phpv8 / v8js

V8 Javascript Engine for PHP — This PHP extension embeds the Google V8 Javascript Engine
http://pecl.php.net/package/v8js
MIT License
1.84k stars 200 forks source link

PHP7 branch build on Win32 VC14 #194

Closed wagy closed 8 years ago

wagy commented 8 years ago

Hi,

  1. build v8 with using VS 2015, everything looks OK.
  2. copied the libs and headers to deps in PHP build tree V7.0.1
  3. copied the v8js branch PHP7 to ext folder in PHP build tree
  4. configure --disable-all --enable-cli --enable-cli-win32 --with-v8js
  5. nmake result C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\chrono(778): warning C4091: "__forceinline ": Ignoriert auf der linken Seite von "int", wenn keine Variable deklariert wurde (Quelldatei wird kompiliert ext\v8js\v8js.cc) C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\chrono(778): error C2143: Syntaxfehler: Es fehlt ";" vor "namespace" (Quelldatei wird kompiliert ext\v8js\v8js.cc) .... NMAKE : fatal error U1077: ""C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\cl.exe"": Rückgabe-Code "0x2"

looks like a problem with inline name space ? chrono .. 774 return (_Xt); 775 } 776 777 // duration LITERALS 778 inline namespace literals { 779 inline namespace chrono_literals { 780 inline _CONST_FUN chrono::hours operator "" h(unsigned long long _Val) ..

stesie commented 8 years ago

Hi,

could you please try moving the #include <chrono> line in php_v8js_macros.h right above the extern "C" line and then simply try again? I suppose that php defines a macro named inline, which replaces the keyword inline in front of the namespace keyword (to something that isn't valid at that particular position).

I haven't yet tried that out as accessing a Windows box always is a bit of a hazzle; but let me know if that still doesn't work ... then I'll go and organize one :)

cheers ~stesie

wagy commented 8 years ago

Hi

yes this error is fixed bad now there is a other problem. Now they include abs and also extern "C" abs

C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\cmath(17): error C2894: Vorlagen können nicht mit "C"-Bindung deklariert werden (Quelldatei wird kompiliert ext\v8js\v8js_array_access.cc) C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\cmath(35): error C2733: "abs" : Zweite C-Bindung fr berladene Funktion nicht zul„ssig (Quelldatei wird kompiliert ext\v8js\v8js_array_access.cc) C:\Program Files (x86)\Windows Kits\10\include\10.0.10586.0\ucrt\stdlib.h(286): note: Siehe Deklaration von "abs" (Quelldatei wird kompiliert ext\v8js\v8js_array_access.cc) C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\cmath(40): error C2733: "pow" : Zweite C-Bindung fr berladene Funktion nicht zul„ssig (Quelldatei wird kompiliert ext\v8js\v8js_array_access.cc) C:\Program Files (x86)\Windows Kits\10\include\10.0.10586.0\ucrt\math.h(483): note: Siehe Deklaration von "pow" (Quelldatei wird kompiliert ext\v8js\v8js_array_access.cc) .....

cheers walter

stesie commented 8 years ago

hmm, I'll rent a box on Amazon's EC2 and then have a look ...

stesie commented 8 years ago

The php7 branch now compiles fine, but V8Js still has some issues regarding the test suite (opposed to using it under GNU/Linux). What seems especially strange to me: it crashes if you require a three modules in a row :(

... and time/memory limit doesn't work neither.

everything else seems ok

stesie commented 8 years ago

Ok, so the problems mentioned before all relate to V8Js not initializing v8::Platform as needed. This complicates compilation a bit, but makes all tests pass :-)

Actually there were three tests left red, after initializing platform as needed, two of them caused by \r\n vs. \n differences and another one by providing error reporting in a slightly different order.

Besides that

So in order to use V8Js on Windows you can now

... and you're ready to go :-)

wagy commented 8 years ago

Thank you :-)