-
Notifications
You must be signed in to change notification settings - Fork 205
[WIP] refresh appveyor #293
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
The failing test is 'Check long integer handling from PHP to JS', which exactly reflects #292 In other words: the AppVeyor setup is correct at the moment. It should fail on this test and it really does. Also note that only the x64 builds produce 'possible loss of data' warnings, like those here: You are on the right track! I was looking into those errors as well and noticed that a lot of them had to do with the V8Js string and integer macro definitions. See for instance the error message for this line:
The relevant parts of the code block:
There is a warning as well on the last line of the quote:
For someone like @weltling it should be easy to tell what is wrong in those two lines, I guess, because he is the author of the 64-bits changes: |
Another observation. If you change this in https://github.com/phpv8/v8js/blob/php7/v8js_convert.cc#L104
the warning for https://github.com/phpv8/v8js/blob/php7/v8js_convert.cc#L140 disappears. Instead a warning is issued on https://github.com/phpv8/v8js/blob/php7/v8js_convert.cc#L148:
Interpretation: v is zend_long, V8JS_INT(v) is defined as 'v8::Integer::New(isolate, v)', jsValue is just a (typeless?) v8::Handlev8::Value. Something tells me that V8JS_INT(v) should have been int64_t and not int32_t. |
I tried to fix the warnings in v8js_array_access.cc with this diff:
Result:
https://github.com/phpv8/v8js/blob/php7/v8js_array_access.cc#L159:
The same warning as in the previous comment. And the same macro V8JS_INT ... |
For the length of an array there seems to be no realistic scenario that the array-length is more than 32-bits, so maybe a explicit cast to int is allowed here:
or shorter:
This also suppresses the warning in v8js_array_access.cc |
I took a closer look at long.phpt and see now that you do not check for 64-bit integers, but for pow(2, 31) Result when I ran this test myself: ---- EXPECTED OUTPUT The first 2 actual results are in line with #292 (comment)
@flexarts even did a check for pow(2,45): #287 (comment) You might consider to add things like pow(2,45) to the long.phpt test or create a new long64bits.phpt. |
Best option: create a new long64bits.phpt with pow(2,45) and skip that test for x86 builds. |
Hey @Jan-E, thanks for your comments. And yes this now all guides to the direction you outlined. ... and I don't yet know whether I'll find enough time in the course of the week, let's see. Yet I'm definitely going to continue working on that :) |
Some interesting read on V8 and 64-bit integers: https://bugs.chromium.org/p/v8/issues/detail?id=973 So If we let V8Js convert 64-bit integers to JS numbers, then there might be some loss in precision. Generally I think this is fine, yet should be pointed out in the README. We might show PHP warnings, yet I think this is more feature creep then helpful. hence a roadmap could be
|
Interesting stuff indeed. Strange thing is that the x86 builds generate the correct output for the tests with pow(2,31). On x64 there must be a mismatch between signed and unsigned ints somewhere. |
Thank you both for you efforts to provide a functioning 64-bit V8 PHP extension also for Windows. I initally made the 64-bit int tests for verification of our main reason to use 64-bit integers namely datetime milliseconds. Our customers are railway infrastructure companies which maintain assets (e.g. bridges/tunnels...) with construction datetime values starting from 1800 :-) We ran into problems using PHP5* 32-bit builds related to datetime functions when using integers to represent unixtime. Cheers to you! |
PHP 7.0.17RC1 nts x64:
Slow machine, because it was busy compiling te other versions. But even more tests passed than in your appveyor setup! Congrats. |
Additional tests passing in my setup with all extensions:
|
@Jan-E yes, those two tests require json and libxml extensions, which aren't built on appveyor. |
Json should be easy as it does not need external dependencies and compiles as static extension by default. Just change the configure line into:
Not tested, but worth the try. |
I'd like to refresh v8js' appveyor to some more recent assets, ... and then try adding x64 build ... and last but not least try to reproduce #292 over there.
Yet work in progress, will rewrite commits here until appveyor says green :-)