diff --git a/.gitignore b/.gitignore index 7099cae..2671f03 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ *.o .deps .libs +Dockerfile.tmp Makefile Makefile.fragments Makefile.global diff --git a/.travis.yml b/.travis.yml index 765893d..d5fb6e6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,15 +1,21 @@ language: php sudo: required -dist: trusty -php: - - 7.0 - - 7.1 +services: + - docker env: - - V8VER=5.2 - - V8VER=5.1 + - V8VER=6.5 + PHPVER=7.0 + - V8VER=6.4 + PHPVER=7.0 + - V8VER=6.5 + PHPVER=7.1 + - V8VER=6.4 + PHPVER=7.1 + - V8VER=6.5 + PHPVER=7.2 + - V8VER=6.4 + PHPVER=7.2 -before_install: make -f Makefile.travis before_install -install: make -f Makefile.travis install script: make -f Makefile.travis test diff --git a/Commandfile b/Commandfile index 9000767..35b6fee 100644 --- a/Commandfile +++ b/Commandfile @@ -11,7 +11,7 @@ command 'configure', description: 'executes "configure" to prepare build', parameters: { cxxflags: { default: "-ggdb -Wall -Wno-write-strings" }, - ldflags: { default: "-ggdb" }, + ldflags: { default: "-ggdb -lstdc++" }, }, script: <<-eof bash -c 'cd /data/build; ../v8js/configure `bash -c "if test -d /opt/libv8-*; then echo -n --with-v8js=; echo /opt/libv8-*; fi"` `test -d "/usr/lib64" && echo --with-libdir=lib64` CXXFLAGS="%{cxxflags}" LDFLAGS="%{ldflags}"' diff --git a/Dockerfile.travis b/Dockerfile.travis new file mode 100644 index 0000000..7fbc4a3 --- /dev/null +++ b/Dockerfile.travis @@ -0,0 +1,22 @@ +FROM ubuntu:xenial + +ENV DEBIAN_FRONTEND=noninteractive +ENV LC_ALL=C.UTF-8 +ENV NO_INTERACTION=1 +ENV REPORT_EXIT_STATUS=1 + +RUN apt-get update -q +RUN apt-get install -y software-properties-common + +RUN add-apt-repository ppa:ondrej/php +RUN add-apt-repository ppa:pinepain/libv8-$V8VER -y +RUN apt-get update -q + +RUN apt-get install -y php$PHPVER-dev libv8-$V8VER-dev + +ADD . /app +WORKDIR /app + +RUN phpize +RUN ./configure CXXFLAGS="-Wall -Wno-write-strings -Werror" LDFLAGS="-lstdc++" --with-v8js=/opt/libv8-$V8VER/ +RUN make -j4 diff --git a/Makefile.travis b/Makefile.travis index 18a3c08..e5de874 100644 --- a/Makefile.travis +++ b/Makefile.travis @@ -1,20 +1,14 @@ # Configure and build scripts for travis CI system -V8VER ?= 5.1 +V8VER ?= 6.3 + +IMAGENAME ?= v8js-test export NO_INTERACTION=1 export REPORT_EXIT_STATUS=1 -before_install: - sudo add-apt-repository ppa:pinepain/libv8-$(V8VER) -y - sudo apt-get update -q - -install: - sudo apt-get install -y libv8-$(V8VER)-dev - build: - phpize - ./configure CXXFLAGS="-Wall -Wno-write-strings -Werror" - $(MAKE) -j3 + envsubst < Dockerfile.travis > Dockerfile.tmp + docker build -t $(IMAGENAME) -f Dockerfile.tmp . test: build - $(MAKE) test + docker run --rm -t $(IMAGENAME) make test diff --git a/README.md b/README.md index 821e9d2..b35b867 100644 --- a/README.md +++ b/README.md @@ -42,11 +42,10 @@ For some very first steps, instead of compiling manually you might want to try o image](https://registry.hub.docker.com/u/stesie/v8js/). It has v8, v8js and php-cli pre-installed so you can give it a try with PHP in "interactive mode". There is no Apache, etc. running however. -For Ubuntu @pinepain has PPAs for V8 [5.1](https://launchpad.net/~pinepain/+archive/ubuntu/libv8-5.1) -and [5.2](https://launchpad.net/~pinepain/+archive/ubuntu/libv8-5.2). You might want to install -these (and compile V8Js based on them). +For Ubuntu @pinepain has PPAs for [various versions of V8](https://launchpad.net/~pinepain). +You might want to install these and compile V8Js based on them. -There also is a Heroku extension pack that has recent V8Js versions for both PHP 5.6 and 7.0, see +There also is a Heroku extension pack that has recent V8Js versions for PHP 7.x, see [@stesie's blog post](https://stesie.github.io/2016/03/heroku-custom-platform-repo) for details. Last but not least there are binaries for Windows (PHP7, x86 including V8 4.9.385.29) that you can use diff --git a/Vagrantfile b/Vagrantfile index 1da40b0..d998dad 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -11,6 +11,7 @@ Vagrant.configure("2") do |config| config.vm.box = "ubuntu/xenial64" config.vm.provider "lxc" do |lxc, override| + lxc.backingstore = "none" override.vm.box = "zaikin/xenial64-lxc" end @@ -18,7 +19,7 @@ Vagrant.configure("2") do |config| # # mass-define "generic" Ubuntu boxes # - %w{5.7 5.8 5.9 6.0 6.3}.each { |version| + %w{6.3 6.4 6.5}.each { |version| config.vm.define "v8-#{version}" do |i| i.vm.synced_folder ".", "/data/v8js" @@ -37,7 +38,7 @@ Vagrant.configure("2") do |config| end } - %w{5.9.35 6.0.318}.each { |version| + %w{}.each { |version| config.vm.define "v8-#{version}" do |i| i.vm.synced_folder ".", "/data/v8js" @@ -143,29 +144,6 @@ Vagrant.configure("2") do |config| SHELL end - - # - # ubuntu xenial(16.04) box with PHP 7.1.3, V8 5.2 - # (to reproduce issue #304) - # - config.vm.define "xenial-v8-5.2" do |i| - i.vm.box = "ubuntu/xenial64" - i.vm.synced_folder ".", "/data/v8js" - - i.vm.provision "shell", inline: <<-SHELL - gpg --keyserver keys.gnupg.net --recv 7F438280EF8D349F - gpg --armor --export 7F438280EF8D349F | apt-key add - - - apt-get update - apt-get install -y software-properties-common gdb tmux git tig curl apache2-utils lcov - - add-apt-repository ppa:ondrej/php - add-apt-repository ppa:pinepain/libv8-5.2 - apt-get update - apt-get install -y php7.1-dev libv8-5.2-dbg libv8-5.2-dev - SHELL - end - config.vm.define "macos-sierra" do |i| i.vm.box = "gobadiah/macos-sierra"