From 31f5871fead3251af301ede317a68eba8d2a26a8 Mon Sep 17 00:00:00 2001 From: Stefan Siegl Date: Sun, 5 Mar 2017 20:29:50 +0100 Subject: [PATCH 1/7] (appveyor) Use PHP 7.0.16 --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 0bd9f65..c906758 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -8,7 +8,7 @@ environment: OUTDIR: Release CONFIGURE_EXTRA: --disable-zts - PHP_VERSION: 7.0.7 + PHP_VERSION: 7.0.16 PHP_SDK: c:\projects\php-sdk os: Windows Server 2012 From e3a5b915cbd29ea0d8c2842668bdf750b0e6780f Mon Sep 17 00:00:00 2001 From: Stefan Siegl Date: Sun, 5 Mar 2017 20:37:22 +0100 Subject: [PATCH 2/7] (appveyor) update build assets to 5.8.301.0 --- appveyor.yml | 8 +++++--- config.w32 | 6 +++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index c906758..3ba94c9 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -25,15 +25,17 @@ install: - call bin\phpsdk_buildtree.bat v8js-ci - cd v8js-ci\vc14\x86 - md deps - - curl -fSL -o v8-4.9.385.29-x86-deps.zip 'https://s3.amazonaws.com/win-phpv8/v8-4.9.385.29-x86-deps.zip' - - 7z.exe x v8-4.9.385.29-x86-deps.zip + - cd deps + - curl -fSL -o win32build.vc14.zip 'https://s3.amazonaws.com/win-phpv8/win32build.vc14.zip' + - 7z.exe x win32build.vc14.zip + - cd .. - curl -fSL -o 'php-%PHP_VERSION%.tar.gz' 'http://us1.php.net/distributions/php-%PHP_VERSION%.tar.gz' - ren php php-%PHP_VERSION% - 7z.exe x php-%PHP_VERSION%.tar.gz -y - 7z.exe x php-%PHP_VERSION%.tar -y | find /v "Extracting" - cd php-%PHP_VERSION% - mkdir %OUTDIR% - - move ..\deps\lib\*.dll %OUTDIR%\ + - move ..\deps\bin\*.dll %OUTDIR%\ build_script: - '"%VS140COMNTOOLS%\VsDevCmd" %BUILD_PLATFORM%' diff --git a/config.w32 b/config.w32 index ffa9065..04ab65f 100644 --- a/config.w32 +++ b/config.w32 @@ -16,9 +16,9 @@ if (PHP_V8JS != "no") { ADD_FLAG("CFLAGS_V8JS", "/D __STDC_LIMIT_MACROS"); // defaults - var v8major = 4; - var v8minor = 7; - var v8build = 75; + var v8major = 5; + var v8minor = 8; + var v8build = 301; var v8patch = 0; var v8pinc = search_paths("v8-version.h", php_usual_include_suspects, null); if (typeof(v8pinc) == "string") { From e631f25f015b243b27906368620e1c317a9a5e91 Mon Sep 17 00:00:00 2001 From: Stefan Siegl Date: Sun, 5 Mar 2017 20:51:11 +0100 Subject: [PATCH 3/7] (appveyor) supply v8 assets .zip name via env --- appveyor.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 3ba94c9..b33ebad 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -3,10 +3,12 @@ environment: - BUILD_PLATFORM: x86 ARTIFACT_NAME: v8js_vc14_php7_ts.zip OUTDIR: Release_TS + V8_ASSETS: win32build.vc14.zip - BUILD_PLATFORM: x86 ARTIFACT_NAME: v8js_vc14_php7_nts.zip OUTDIR: Release CONFIGURE_EXTRA: --disable-zts + V8_ASSETS: win32build.vc14.zip PHP_VERSION: 7.0.16 PHP_SDK: c:\projects\php-sdk @@ -26,8 +28,8 @@ install: - cd v8js-ci\vc14\x86 - md deps - cd deps - - curl -fSL -o win32build.vc14.zip 'https://s3.amazonaws.com/win-phpv8/win32build.vc14.zip' - - 7z.exe x win32build.vc14.zip + - curl -fSL -o %V8_ASSETS% 'https://s3.amazonaws.com/win-phpv8/%V8_ASSETS%' + - 7z.exe x %V8_ASSETS% - cd .. - curl -fSL -o 'php-%PHP_VERSION%.tar.gz' 'http://us1.php.net/distributions/php-%PHP_VERSION%.tar.gz' - ren php php-%PHP_VERSION% From a9bdc321259ded6a0ffb61c76a97019b5b833840 Mon Sep 17 00:00:00 2001 From: Stefan Siegl Date: Sun, 5 Mar 2017 20:52:01 +0100 Subject: [PATCH 4/7] (appveyor) add x64 builds --- appveyor.yml | 35 +++++++++++++++++++++-------------- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index b33ebad..4cebb43 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,23 +1,22 @@ environment: matrix: - - BUILD_PLATFORM: x86 - ARTIFACT_NAME: v8js_vc14_php7_ts.zip + - ARTIFACT_NAME: v8js_vc14_php7_%Platform%_ts.zip OUTDIR: Release_TS - V8_ASSETS: win32build.vc14.zip - - BUILD_PLATFORM: x86 - ARTIFACT_NAME: v8js_vc14_php7_nts.zip + V8_ASSETS: V8-5.8.301.0-%Platform%.zip + - ARTIFACT_NAME: v8js_vc14_php7_%Platform%_nts.zip OUTDIR: Release CONFIGURE_EXTRA: --disable-zts - V8_ASSETS: win32build.vc14.zip + V8_ASSETS: V8-5.8.301.0-%Platform%.zip PHP_VERSION: 7.0.16 PHP_SDK: c:\projects\php-sdk os: Windows Server 2012 -clone_folder: c:\projects\php-sdk\v8js-ci\vc14\x86\php\ext\v8js +clone_folder: c:\projects\php-sdk\v8js-ci\vc14\%Platform%\php\ext\v8js -matrix: - fast_finish: true +platform: + - x64 + - x86 install: - cd %PHP_SDK% @@ -25,7 +24,7 @@ install: - 7z.exe x php-sdk-binary-tools-20110915.zip - call bin\phpsdk_setvars.bat - call bin\phpsdk_buildtree.bat v8js-ci - - cd v8js-ci\vc14\x86 + - cd v8js-ci\vc14\%Platform% - md deps - cd deps - curl -fSL -o %V8_ASSETS% 'https://s3.amazonaws.com/win-phpv8/%V8_ASSETS%' @@ -36,12 +35,20 @@ install: - 7z.exe x php-%PHP_VERSION%.tar.gz -y - 7z.exe x php-%PHP_VERSION%.tar -y | find /v "Extracting" - cd php-%PHP_VERSION% + - IF "%Platform%" == "x64" SET OUTDIR=x64\%OUTDIR% - mkdir %OUTDIR% - move ..\deps\bin\*.dll %OUTDIR%\ build_script: - - '"%VS140COMNTOOLS%\VsDevCmd" %BUILD_PLATFORM%' - - set + - ps: >- + If ($env:Platform -Match "x86") { + $env:VCVARS_PLATFORM="x86" + $env:ENV_PLATFORM="x86" + } Else { + $env:VCVARS_PLATFORM="amd64" + $env:ENV_PLATFORM="x64" + } + - call "%VS140COMNTOOLS%\..\..\VC\vcvarsall.bat" %VCVARS_PLATFORM% - echo Building PHP [%PHP_VERSION%] - '%PHP_SDK%\bin\phpsdk_setvars' - buildconf @@ -54,14 +61,14 @@ after_build: - ps: Push-AppveyorArtifact $env:ARTIFACT_NAME test_script: - - cd c:\projects\php-sdk\v8js-ci\vc14\x86\php-%PHP_VERSION% + - cd c:\projects\php-sdk\v8js-ci\vc14\%Platform%\php-%PHP_VERSION% - set NO_INTERACTION=1 - set TEST_PHP_JUNIT=junit.xml - set REPORT_EXIT_STATUS=1 - "%OUTDIR%\\php.exe run-tests.php -p %OUTDIR%\\php.exe ext/v8js/tests/ -d extension=php_v8js.dll -d extension_dir=%OUTDIR%\\" on_finish: - - cd c:\projects\php-sdk\v8js-ci\vc14\x86\php-%PHP_VERSION% + - cd c:\projects\php-sdk\v8js-ci\vc14\%Platform%\php-%PHP_VERSION% - ps: | # upload results to AppVeyor $wc = New-Object 'System.Net.WebClient' From e86c9578118d2151d75e5cd9636e3e82afe9ef5e Mon Sep 17 00:00:00 2001 From: Stefan Siegl Date: Wed, 8 Mar 2017 07:38:42 +0100 Subject: [PATCH 5/7] fix long vs. zend_long issue on Windows, refs #292 --- v8js_convert.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/v8js_convert.cc b/v8js_convert.cc index ed29b0e..5f6aebd 100644 --- a/v8js_convert.cc +++ b/v8js_convert.cc @@ -101,7 +101,7 @@ static v8::Handle v8js_hash_to_jsarr(zval *value, v8::Isolate *isolat v8::Handle zval_to_v8js(zval *value, v8::Isolate *isolate TSRMLS_DC) /* {{{ */ { v8::Handle jsValue; - long v; + zend_long v; zend_class_entry *ce; switch (Z_TYPE_P(value)) @@ -143,9 +143,9 @@ v8::Handle zval_to_v8js(zval *value, v8::Isolate *isolate TSRMLS_DC) #undef max #undef min if (v < - std::numeric_limits::min() || v > std::numeric_limits::max()) { - jsValue = V8JS_FLOAT((double)v); + jsValue = V8JS_FLOAT(static_cast(v)); } else { - jsValue = V8JS_INT(v); + jsValue = V8JS_INT(static_cast(v)); } break; From b45bef46de5f36bc51ff4ec141a4a1b7e27d37a0 Mon Sep 17 00:00:00 2001 From: Stefan Siegl Date: Wed, 8 Mar 2017 07:54:48 +0100 Subject: [PATCH 6/7] pick up int64 export test from issue #287 --- tests/long_int64.phpt | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 tests/long_int64.phpt diff --git a/tests/long_int64.phpt b/tests/long_int64.phpt new file mode 100644 index 0000000..d508abe --- /dev/null +++ b/tests/long_int64.phpt @@ -0,0 +1,32 @@ +--TEST-- +Test V8::executeString() : Check long 64-bit export from PHP to JS +--SKIPIF-- + +--FILE-- +add = $addInt; +$v8->p1 = 10; +$v8->p2 = pow(2,45); + +var_dump($v8->p2); + +var_dump($v8->executeString(' + var res = PHP.p1 + PHP.p2; + "p1:" + PHP.p1 + + ", p2:" + PHP.p2 + + ", PHP.add(p1,p2)=" + PHP.add(PHP.p1, PHP.p2) + + ", p1+p2=" + res + + " -> " + (new Date(res)).toISOString(); + ')); +?> +===EOF=== +--EXPECT-- +int(35184372088832) +string(105) "p1:10, p2:35184372088832, PHP.add(p1,p2)=35184372088842, p1+p2=35184372088842 -> 3084-12-12T12:41:28.842Z" +===EOF=== From 346c47b657d092bacc03aea1019260ae1d5bb572 Mon Sep 17 00:00:00 2001 From: Stefan Siegl Date: Wed, 8 Mar 2017 07:58:38 +0100 Subject: [PATCH 7/7] skip long_int64 test on 32bit PHP versions --- tests/long_int64.phpt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/long_int64.phpt b/tests/long_int64.phpt index d508abe..78bfb54 100644 --- a/tests/long_int64.phpt +++ b/tests/long_int64.phpt @@ -1,7 +1,11 @@ --TEST-- Test V8::executeString() : Check long 64-bit export from PHP to JS --SKIPIF-- - + --FILE--