V8 on Linux: documented but not wired up in CMake, and V8Platform doesn't build with V8 12+

Abierto
#2,088 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
35/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
cmake, cpp

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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 made CallOnWorkerThread, CallBlockingTaskOnWorkerThread, CallLowPriorityTaskOnWorkerThread, CallDelayedOnWorkerThread, PostJob and CreateJob non-virtual wrappers. Embedders now override PostTaskOnWorkerThreadImpl, PostDelayedTaskOnWorkerThreadImpl and CreateJobImpl, so the overrides fail to compile. TaskRunner likewise gained Post*TaskImpl.
  • X11 macros: Core/Graphics/Include/Platform/Unix/.../Platform.h includes <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 expects v8-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).
Lenguaje dominante
C++
Estrellas
931
Forks
169
Merge medio
2 d 17 h
PR fusionados (30 d)
66

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de BabylonJS/BabylonNative

Todos los issues de BabylonJS/BabylonNative

Issues similares

Más issues de C++

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.