From cba4eb4cb87891ca4b0252698e6daa7e34f14be5 Mon Sep 17 00:00:00 2001 From: Stefan Siegl Date: Fri, 5 Jan 2018 15:12:41 +0100 Subject: [PATCH 1/6] Remove old-age V8 versions from Vagrantfile, refs #345 --- Vagrantfile | 28 +++------------------------- 1 file changed, 3 insertions(+), 25 deletions(-) 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" From 3af2f16e7628cb6c5ff374c5d34077332ab707c0 Mon Sep 17 00:00:00 2001 From: Stefan Siegl Date: Fri, 5 Jan 2018 15:14:48 +0100 Subject: [PATCH 2/6] Run Travis tests against V8 6.3 & 6.5, refs #345 --- .travis.yml | 4 ++-- Makefile.travis | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 765893d..e351558 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,8 +7,8 @@ php: - 7.1 env: - - V8VER=5.2 - - V8VER=5.1 + - V8VER=6.5 + - V8VER=6.3 before_install: make -f Makefile.travis before_install install: make -f Makefile.travis install diff --git a/Makefile.travis b/Makefile.travis index 18a3c08..25e23d1 100644 --- a/Makefile.travis +++ b/Makefile.travis @@ -1,5 +1,5 @@ # Configure and build scripts for travis CI system -V8VER ?= 5.1 +V8VER ?= 6.3 export NO_INTERACTION=1 export REPORT_EXIT_STATUS=1 From 9a1e76b592f629796c4a95e4178ffdb88fe38f52 Mon Sep 17 00:00:00 2001 From: Stefan Siegl Date: Fri, 5 Jan 2018 15:31:48 +0100 Subject: [PATCH 3/6] update version numbers --- README.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) 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 From ddfb9ec012d044ee020fe7654f6f225d8c373c91 Mon Sep 17 00:00:00 2001 From: Stefan Siegl Date: Fri, 5 Jan 2018 19:05:00 +0100 Subject: [PATCH 4/6] Use Docker w/ ubuntu:xenial base image on Travis --- .gitignore | 1 + .travis.yml | 18 ++++++++++++------ Dockerfile.travis | 22 ++++++++++++++++++++++ Makefile.travis | 16 +++++----------- 4 files changed, 40 insertions(+), 17 deletions(-) create mode 100644 Dockerfile.travis 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 e351558..9f9da4e 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=6.5 + PHPVER=7.0 - V8VER=6.3 + PHPVER=7.0 + - V8VER=6.5 + PHPVER=7.1 + - V8VER=6.3 + PHPVER=7.1 + - V8VER=6.5 + PHPVER=7.2 + - V8VER=6.3 + 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/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 25e23d1..e5de874 100644 --- a/Makefile.travis +++ b/Makefile.travis @@ -1,20 +1,14 @@ # Configure and build scripts for travis CI system 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 From 457dacf7ed7ab872413fcdb295a73b668d1d33e7 Mon Sep 17 00:00:00 2001 From: Stefan Siegl Date: Fri, 5 Jan 2018 19:41:06 +0100 Subject: [PATCH 5/6] Use V8 6.4 to exec tests, as 6.3 fails on timezones.phpt ... and both 6.4 and 6.5 don't show that particular error --- .travis.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 9f9da4e..d5fb6e6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,15 +7,15 @@ services: env: - V8VER=6.5 PHPVER=7.0 - - V8VER=6.3 + - V8VER=6.4 PHPVER=7.0 - V8VER=6.5 PHPVER=7.1 - - V8VER=6.3 + - V8VER=6.4 PHPVER=7.1 - V8VER=6.5 PHPVER=7.2 - - V8VER=6.3 + - V8VER=6.4 PHPVER=7.2 script: make -f Makefile.travis test From c8d5e23d9b0466700f061e5058b95f1e03793650 Mon Sep 17 00:00:00 2001 From: Stefan Siegl Date: Fri, 5 Jan 2018 19:41:21 +0100 Subject: [PATCH 6/6] explicitly link against stdc++ --- Commandfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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}"'