V8 on Linux: documented but not wired up in CMake, and V8Platform doesn't build with V8 12+
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- cmake, cpp
- Domain
- backend, build-system
Research direction
Start with the V8 branches in Dependencies/JsRuntimeHost/Core/Node-API/CMakeLists.txt, which exist only for Android and Win32, and with the V8Platform.h and V8Inc.h headers. The issue also names the Xlib include order in the Unix Platform.h and DeviceImpl_Unix.cpp, plus the BUILDING.md section. Done means either a Linux V8 configure that compiles against V8 12+ or a BUILDING.md that no longer documents Linux V8. Maintainers need to choose between those two paths first.
Written by the indexing model from the issue text.
Description
Describe the bug
BUILDING.md describes building on Linux with -D NAPI_JAVASCRIPT_ENGINE=V8 and libv8-dev. However, Dependencies/JsRuntimeHost/Core/Node-API/CMakeLists.txt has V8 branches only for Android and Win32, so Linux stops with "Unsupported JavaScript engine: V8".
With a local Linux branch (headers plus the system libv8/libnode), we hit three more problems building against V8 12.4 (Fedora's Node 22):
V8Platform.h: V8 12 madeCallOnWorkerThread,CallBlockingTaskOnWorkerThread,CallLowPriorityTaskOnWorkerThread,CallDelayedOnWorkerThread,PostJobandCreateJobnon-virtual wrappers. Embedders now overridePostTaskOnWorkerThreadImpl,PostDelayedTaskOnWorkerThreadImplandCreateJobImpl, so theoverrides fail to compile.TaskRunnerlikewise gainedPost*TaskImpl.- X11 macros:
Core/Graphics/Include/Platform/Unix/.../Platform.hincludes<X11/Xlib.h>, whose macros (True,Status, …) break V8's headers when they come later in the same file (DeviceImpl_Unix.cpp). V8Inc.h: the V8 inspector expectsv8-inspector.h, which distribution V8 packages may not ship.
With those worked around (version-guarded Impl overrides, V8 headers included before Xlib, inspector off), the Playground runs on V8 12.4 on Linux. Under a V8 build, Babylon.js scenes and a large physics simulation behave the same as under JavaScriptCore.
Expected behavior
Either Linux V8 is supported (a CMake branch, plus V8Platform guarded for V8 ≥ 12), or BUILDING.md no longer documents it. We can send the V8Platform/V8ForegroundTaskRunner changes as a PR if that's wanted.
Other
- Platform: Linux x64, Fedora 44, GCC 16, V8 12.4.254.21 (from Node 22.23).
- Dominant language
- C++
- Stars
- 931
- Forks
- 169
- Avg merge
- 2d 17h
- Merged PRs (30d)
- 66
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from BabylonJS/BabylonNative
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
BabylonJS/BabylonNative#2138 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
BabylonJS/BabylonNative#2042 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
BabylonJS/BabylonNative#2052 ·
Maintainers usually reply within 1 day
-
testing
Difficulty 4/5 3-5 days Newbie friendliness 45/100
BabylonJS/BabylonNative#2136 ·
Maintainers usually reply within 1 day
-
Support useNDCHalfZRange (half-range NDC depth) so Babylon.js half-range depth visual tests can runOpen
Difficulty 4/5 3-5 days Newbie friendliness 48/100
BabylonJS/BabylonNative#2134 ·
Maintainers usually reply within 1 day
All issues in BabylonJS/BabylonNative
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
gofractally/psibase#2379 ·
Maintainers usually reply within 3 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
simnJS/AnyPS5#735 · 1 comment ·
Maintainers usually reply within 1 day
-
needs-format
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Niko1221/Strata#7719 · 1 comment ·
Maintainers usually reply within 4 days