Comments (11)
Hi! Thank you for reporting. Sorry for late reply, life was too busy past week.
Can you please post what exactly fails in that tests: I have test-report.sh which I use to show output of failed tests: make test | tee result.txt && test-report.sh
should do the job.
From your Docker file alpine-libv8, it looks like that you don't copy icudtl.dat
, which php-v8 expects to have (and from build flags it looks like that v8 build with icu, which is default behavior), so I guess this is the cause of an issue with failed tests. As tests that doesn't init V8 passes, it also makes me thing that missed ICU data file is the cause of tests failure.
You can give a look how I package libv8 for ubuntu and macOS (homebrew).
In latest changes I make php-v8 be quite demanding to libv8 and it expects vanilla build, which has own ICU. While it's a nice thing, as before I faced with a minor problems as icu versions was different across ubuntu versions and on macOS, it also has a drawback for our case - it has it data as a standalone file rather then built-in. As v8js expects non-icu libv8 and it doesn't initialize it, it should works just fine, but only with non-icu libv8 builds, thought, I'm not quite sure about that, so to validate my assumption, you can run some of Intl.DateTimeFormat examples with v8js.
(RU)
Огромное спасибо! Отписал на указанный в гитхаб профиле почтовый ящик.
from php-v8.
Thanks for the reply.
gcc 6.3.0-r1
icu-dev 58.2-r1
alpine-libv8: Add icudtl.dat in shared libraries + icu_use_data_file=true
(Default)
test-result.log
test-report.log
(RU)
Постараюсь позже ответить подробней на почту. Флаги протестирую.
from php-v8.
Hi, thanks for detailed logs!
002+ # Fatal error in ../../src/snapshot/natives-external.cc, line 122
003+ # Check failed: holder_.
Add v8_use_external_startup_data=0
to build flags
TL;DR
It looks like you have startup data as external file, php-v8 expect libv8 built with v8_use_external_startup_data=0
. At this time I don't detect external snapshot in build script as having built-in startup data offers better performance and I can't easily come up with a generic use case when end-users will alter external startup data, especially from PHP userland. V8js, is more lenient to libv8 options and it try to detect such variations. While the same approach for blobs detection could be added to php-v8, I'm not fond of supporting of libv8 builds variability at this time, you'd better just add v8_use_external_startup_data=0
to build flags and the issue should be resolved for this particular case.
from php-v8.
alpine-libv8: Add "v8_use_external_startup_data=false" to build flags
New report looks better.
test-result.log
test-report.log
=====================================================================
FAILED TEST SUMMARY
---------------------------------------------------------------------
V8\DateObject [tests/V8DateObject.phpt]
V8\Int32Value [tests/V8Int32Value.phpt]
V8\IntegerValue [tests/V8IntegerValue.phpt]
V8\Uint32Value [tests/V8Uint32Value.phpt]
V8DateObject.phpt
date.timezone
is empty in php.ini; this is the only problem? v8js ext. has something similar:
=====================================================================
FAILED TEST SUMMARY
---------------------------------------------------------------------
Test V8::registerExtension() : Register extension with errors [tests/extensions_error.phpt]
Test V8::executeString() : Check timezone handling [tests/timezones.phpt]
from php-v8.
Great! Thanks! Awesome work!
Timezone problem comes from environment timezone, last time i was looking into this specific proble, v8 respect TZ
env variable, so having it preset to some standard value should fix test result inconsistency. I'll give it a look later today (as well as fixing float/int argument issue).
from php-v8.
I fixed Int*Value
tests, they should be fine now.
As to DateObject
test, under the hood it also tests timezone change at runtime. From your test output I can assume that somehow internal date cache is not reset during V8\DateObject::DateTimeConfigurationChangeNotification()
call. But it may be that Alpine handles timezone differently from other distros or it's some issue with it libc++ or in ICU.
from php-v8.
This report from the latest commit b33c148
.
No change. Hm.
test-result.log
test-report.log
from php-v8.
Hm, my fault, "fixed" nonexistent issue then. I reverted that bogus changes.
double: NAN
128+ V8\IntegerValue->Value(): int(0)
128- TypeError: Argument 2 passed to V8\IntegerValue::__construct() must be of the type integer, float given\n
It seems to be that for some reason NAN is integer zero. I'm a bit surprised. What libc++ does Alpine has and which one do you use to build php-v8? Can you check what NAN is in Alpine?
from php-v8.
Can you check what NAN is in Alpine?
float(NAN)
The same output as here: is_nan().
from php-v8.
It seems to be a bug, https://bugs.php.net/bug.php?id=73954.
I guess there is nothing to do in advance with both NAN
and timezone changing issues at this time as they both come from external tools. For now you may locally add --XFAIL--
to known to fail tests or ignore that failures. I'll try to keep you updated about a progress, if any.
from php-v8.
@pinepain
Thank you. I will support your report about this bug.
I think this issue can be closed.
btw, is_nan(NAN)
returns FALSE on Alpine (musl) 😃👍
from php-v8.
Related Issues (20)
- Write docs on how to use caching and snapshots HOT 2
- Add support for BigInt API HOT 1
- Call to undefined method V8\ObjectValue::value() HOT 2
- Reflect changes to libv8 PPA layout
- Add support for near-heap-limit callback HOT 1
- PHP API HOT 2
- Rep 404 HOT 2
- Hello, can you tell me how to compile v8js? HOT 3
- what is the difference HOT 2
- Still maintained? HOT 1
- it is not installing - PHP 7.4 / umbuntu server 18.4 HOT 2
- Create and publish docker image for php-v8 HOT 2
- V8Js::executeString HOT 4
- v8::Proxy API has changed (V8 6.5.164) HOT 6
- Warning: Calling <<-EOS.undent is deprecated HOT 2
- Resolving/rejecting Promise in non-pending state leads to segfault HOT 2
- GetOwnPropertyNames and GetPropertyNames should return Strings
- Implement v8::Object::SetLazyDataProperty.
- Add BigInt64Array, BigUint64Array
- Script cache creating is broken after bumping v8 version to 6.6.313 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from php-v8.