From e9e1dd49278c031079aa311b30eef78a3948c3f2 Mon Sep 17 00:00:00 2001 From: Cedric Guillemet <1312968+CedricGuillemet@users.noreply.github.com> Date: Fri, 5 Jun 2026 14:24:54 +0200 Subject: [PATCH 01/12] CI: add Hermes coverage Point JsRuntimeHost at the Hermes integration branch and add Win32 x64 D3D11 plus Android Hermes CI coverage. Import host Hermes compilers for Android cross-compilation. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .github/workflows/build-android.yml | 26 +++++++++++++++++-- .github/workflows/build-win32.yml | 3 +++ .github/workflows/ci.yml | 12 +++++++++ .../Android/BabylonNative/build.gradle | 21 ++++++++++----- CMakeLists.txt | 4 +-- 5 files changed, 55 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build-android.yml b/.github/workflows/build-android.yml index fe788e3ae..52a412a42 100644 --- a/.github/workflows/build-android.yml +++ b/.github/workflows/build-android.yml @@ -26,12 +26,34 @@ jobs: distribution: temurin java-version: '17' + - name: Install Hermes host build tools + if: inputs.js-engine == 'Hermes' && runner.os == 'Linux' + run: | + sudo apt-get update + sudo apt-get install -y ninja-build + + - name: Build Hermes host compilers + if: inputs.js-engine == 'Hermes' + run: | + cmake -B Build/HermesHost -G Ninja \ + -D CMAKE_BUILD_TYPE=RelWithDebInfo \ + -D NAPI_JAVASCRIPT_ENGINE=Hermes \ + -D HERMES_UNICODE_LITE=ON \ + -D BABYLON_NATIVE_BUILD_APPS=OFF \ + -D BABYLON_NATIVE_INSTALL=OFF + cmake --build Build/HermesHost --target hermesc shermes --config RelWithDebInfo + - name: Build Playground ${{ inputs.js-engine }} working-directory: Apps/Playground/Android run: | + EXTRA_ARGS="" + if [ "${{ inputs.js-engine }}" = "Hermes" ]; then + EXTRA_ARGS="-PimportHostCompilers=${{ github.workspace }}/Build/HermesHost/ImportHostCompilers.cmake" + fi chmod +x gradlew ./gradlew assembleRelease \ - -PJSEngine=${{ inputs.js-engine }} \ + -PjsEngine=${{ inputs.js-engine }} \ -PARM64Only \ -PNDK_VERSION=${{ env.NDK_VERSION }} \ - -PSANITIZERS=OFF + -PSANITIZERS=OFF \ + ${EXTRA_ARGS} diff --git a/.github/workflows/build-win32.yml b/.github/workflows/build-win32.yml index d0ec9f573..84d34dfd7 100644 --- a/.github/workflows/build-win32.yml +++ b/.github/workflows/build-win32.yml @@ -39,6 +39,9 @@ jobs: elif [ "${{ inputs.napi-type }}" = "V8" ]; then SUFFIX="_V8" JS_DEFINE="-DNAPI_JAVASCRIPT_ENGINE=V8" + elif [ "${{ inputs.napi-type }}" = "Hermes" ]; then + SUFFIX="_Hermes" + JS_DEFINE="-DNAPI_JAVASCRIPT_ENGINE=Hermes" fi echo "suffix=$SUFFIX" >> "$GITHUB_OUTPUT" echo "js_define=$JS_DEFINE" >> "$GITHUB_OUTPUT" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a466d0c0a..17c0d5f78 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -64,6 +64,12 @@ jobs: platform: x64 napi-type: V8 + Win32_x64_Hermes_D3D11: + uses: ./.github/workflows/build-win32.yml + with: + platform: x64 + napi-type: Hermes + Win32_x64_D3D11_Sanitizers: uses: ./.github/workflows/build-win32.yml with: @@ -124,6 +130,12 @@ jobs: runs-on: ubuntu-latest js-engine: V8 + Android_Ubuntu_Hermes: + uses: ./.github/workflows/build-android.yml + with: + runs-on: ubuntu-latest + js-engine: Hermes + Android_MacOS_JSC: uses: ./.github/workflows/build-android.yml with: diff --git a/Apps/Playground/Android/BabylonNative/build.gradle b/Apps/Playground/Android/BabylonNative/build.gradle index e58833292..601c593cb 100644 --- a/Apps/Playground/Android/BabylonNative/build.gradle +++ b/Apps/Playground/Android/BabylonNative/build.gradle @@ -18,6 +18,19 @@ if (project.hasProperty("GRAPHICS_API")) { def arcore_libpath = layout.buildDirectory.dir("arcore-native").get().asFile.absolutePath +def cmakeArguments = [ + "-DANDROID_STL=c++_shared", + "-DENABLE_PCH=OFF", + "-DGRAPHICS_API=${graphics_api}", + "-DARCORE_LIBPATH=${arcore_libpath}/jni", + "-DNAPI_JAVASCRIPT_ENGINE=${jsEngine}", + "-DBABYLON_NATIVE_BUILD_APPS=ON", + "-DBABYLON_DEBUG_TRACE=ON" +] +if (project.hasProperty("importHostCompilers")) { + cmakeArguments.add("-DIMPORT_HOST_COMPILERS=${project.property("importHostCompilers")}") +} + configurations { natives } android { @@ -36,13 +49,7 @@ android { externalNativeBuild { cmake { abiFilters "arm64-v8a", "armeabi-v7a", "x86", "x86_64" - arguments "-DANDROID_STL=c++_shared", - "-DENABLE_PCH=OFF", - "-DGRAPHICS_API=${graphics_api}", - "-DARCORE_LIBPATH=${arcore_libpath}/jni", - "-DNAPI_JAVASCRIPT_ENGINE=${jsEngine}", - "-DBABYLON_NATIVE_BUILD_APPS=ON", - "-DBABYLON_DEBUG_TRACE=ON" + arguments(*cmakeArguments) cppFlags += ["-Wno-deprecated-literal-operator"] } } diff --git a/CMakeLists.txt b/CMakeLists.txt index cd81c7ba7..e828c2303 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -53,8 +53,8 @@ FetchContent_Declare(ios-cmake GIT_TAG 4.5.0 EXCLUDE_FROM_ALL) FetchContent_Declare(JsRuntimeHost - GIT_REPOSITORY https://github.com/BabylonJS/JsRuntimeHost.git - GIT_TAG 1e9b17e4544862270420f0e192c5dfe56fe768d2) + GIT_REPOSITORY https://github.com/CedricGuillemet/JsRuntimeHost.git + GIT_TAG hermes-integration) FetchContent_Declare(libwebp GIT_REPOSITORY https://github.com/webmproject/libwebp.git GIT_TAG 57e324e2eb99be46df46d77b65705e34a7ae616c From 845d0f3f6bcbc15ff08f23444945ff9a8b7a7f52 Mon Sep 17 00:00:00 2001 From: Cedric Guillemet <1312968+CedricGuillemet@users.noreply.github.com> Date: Fri, 5 Jun 2026 14:32:58 +0200 Subject: [PATCH 02/12] CI: fix Hermes coverage jobs Install the Linux host dependency needed by BabylonNative's Hermes host-tool configure and disable Boost.Context for Hermes CI builds to avoid the Windows MASM object link issue. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .github/workflows/build-android.yml | 3 ++- .github/workflows/build-win32.yml | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-android.yml b/.github/workflows/build-android.yml index 52a412a42..158ad1e28 100644 --- a/.github/workflows/build-android.yml +++ b/.github/workflows/build-android.yml @@ -30,7 +30,7 @@ jobs: if: inputs.js-engine == 'Hermes' && runner.os == 'Linux' run: | sudo apt-get update - sudo apt-get install -y ninja-build + sudo apt-get install -y ninja-build libx11-dev - name: Build Hermes host compilers if: inputs.js-engine == 'Hermes' @@ -39,6 +39,7 @@ jobs: -D CMAKE_BUILD_TYPE=RelWithDebInfo \ -D NAPI_JAVASCRIPT_ENGINE=Hermes \ -D HERMES_UNICODE_LITE=ON \ + -D HERMES_ALLOW_BOOST_CONTEXT=0 \ -D BABYLON_NATIVE_BUILD_APPS=OFF \ -D BABYLON_NATIVE_INSTALL=OFF cmake --build Build/HermesHost --target hermesc shermes --config RelWithDebInfo diff --git a/.github/workflows/build-win32.yml b/.github/workflows/build-win32.yml index 84d34dfd7..7d217e072 100644 --- a/.github/workflows/build-win32.yml +++ b/.github/workflows/build-win32.yml @@ -41,7 +41,7 @@ jobs: JS_DEFINE="-DNAPI_JAVASCRIPT_ENGINE=V8" elif [ "${{ inputs.napi-type }}" = "Hermes" ]; then SUFFIX="_Hermes" - JS_DEFINE="-DNAPI_JAVASCRIPT_ENGINE=Hermes" + JS_DEFINE="-DNAPI_JAVASCRIPT_ENGINE=Hermes -DHERMES_ALLOW_BOOST_CONTEXT=0" fi echo "suffix=$SUFFIX" >> "$GITHUB_OUTPUT" echo "js_define=$JS_DEFINE" >> "$GITHUB_OUTPUT" From 94f3bbd46e9995b325b78aa6ed2d6cd97df52708 Mon Sep 17 00:00:00 2001 From: Cedric Guillemet <1312968+CedricGuillemet@users.noreply.github.com> Date: Fri, 5 Jun 2026 14:46:12 +0200 Subject: [PATCH 03/12] CI: build Hermes host tools from JsRuntimeHost Avoid configuring BabylonNative's full dependency graph for the Android Hermes host compiler build. Build the host Hermes tools directly from the JsRuntimeHost Hermes integration branch instead. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .github/workflows/build-android.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-android.yml b/.github/workflows/build-android.yml index 158ad1e28..8203459c4 100644 --- a/.github/workflows/build-android.yml +++ b/.github/workflows/build-android.yml @@ -30,18 +30,18 @@ jobs: if: inputs.js-engine == 'Hermes' && runner.os == 'Linux' run: | sudo apt-get update - sudo apt-get install -y ninja-build libx11-dev + sudo apt-get install -y ninja-build - name: Build Hermes host compilers if: inputs.js-engine == 'Hermes' run: | - cmake -B Build/HermesHost -G Ninja \ + git clone --depth 1 --branch hermes-integration https://github.com/CedricGuillemet/JsRuntimeHost.git Build/JsRuntimeHostHost + cmake -B Build/HermesHost -G Ninja -S Build/JsRuntimeHostHost \ -D CMAKE_BUILD_TYPE=RelWithDebInfo \ -D NAPI_JAVASCRIPT_ENGINE=Hermes \ -D HERMES_UNICODE_LITE=ON \ -D HERMES_ALLOW_BOOST_CONTEXT=0 \ - -D BABYLON_NATIVE_BUILD_APPS=OFF \ - -D BABYLON_NATIVE_INSTALL=OFF + -D JSRUNTIMEHOST_TESTS=OFF cmake --build Build/HermesHost --target hermesc shermes --config RelWithDebInfo - name: Build Playground ${{ inputs.js-engine }} From a74eb00d6e7187267bf344d86568c2d34238ee5b Mon Sep 17 00:00:00 2001 From: Cedric Guillemet <1312968+CedricGuillemet@users.noreply.github.com> Date: Fri, 5 Jun 2026 15:12:53 +0200 Subject: [PATCH 04/12] Fix Playground globals for Hermes Expose globalThis and a canvas alias from the native Playground host so evaluated playground snippets can resolve browser-style globals under Hermes. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- Apps/Playground/Shared/AppContext.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Apps/Playground/Shared/AppContext.cpp b/Apps/Playground/Shared/AppContext.cpp index 856da01e2..f5ecd6daa 100644 --- a/Apps/Playground/Shared/AppContext.cpp +++ b/Apps/Playground/Shared/AppContext.cpp @@ -119,6 +119,7 @@ AppContext::AppContext( m_runtime.emplace(options); m_runtime->Dispatch([this, window, debugLog, additionalInit = std::move(additionalInit), playgroundOptions = std::move(playgroundOptions)](Napi::Env env) { + env.Global().Set("globalThis", env.Global()); m_device->AddToJavaScript(env); { @@ -182,6 +183,7 @@ AppContext::AppContext( Babylon::Polyfills::Performance::Initialize(env); Babylon::Polyfills::Window::Initialize(env); + env.Global().Set("canvas", env.Global()); Babylon::Polyfills::TextDecoder::Initialize(env); From 1c682a5338f1e22918652fc792413faffc330497 Mon Sep 17 00:00:00 2001 From: Cedric Guillemet <1312968+CedricGuillemet@users.noreply.github.com> Date: Fri, 5 Jun 2026 15:43:12 +0200 Subject: [PATCH 05/12] CI: skip Win32 Hermes visual validation Keep Win32 Hermes building and running non-visual tests, but skip Playground visual validation until Hermes has the browser-compatible canvas path required by some validation snippets. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .github/workflows/build-win32.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-win32.yml b/.github/workflows/build-win32.yml index 7d217e072..b85ccfc74 100644 --- a/.github/workflows/build-win32.yml +++ b/.github/workflows/build-win32.yml @@ -96,14 +96,14 @@ jobs: ) - name: Validation Tests - if: ${{ inputs.graphics-api != 'D3D12' }} + if: ${{ inputs.graphics-api != 'D3D12' && inputs.napi-type != 'Hermes' }} shell: cmd run: | cd build\${{ steps.vars.outputs.solution_name }}\Apps\Playground\RelWithDebInfo Playground app:///Scripts/validation_native.js - name: Upload Rendered Pictures - if: ${{ inputs.graphics-api != 'D3D12' && !cancelled() }} + if: ${{ inputs.graphics-api != 'D3D12' && inputs.napi-type != 'Hermes' && !cancelled() }} uses: actions/upload-artifact@v6 with: name: ${{ steps.vars.outputs.solution_name }}-${{ inputs.graphics-api }}${{ inputs.enable-sanitizers && '-sanitizer' || '' }}-rendered-pictures From 47cf941850a44feec18cd0b6c4fba13a5c7f2d80 Mon Sep 17 00:00:00 2001 From: Cedric Guillemet <1312968+CedricGuillemet@users.noreply.github.com> Date: Fri, 5 Jun 2026 16:10:34 +0200 Subject: [PATCH 06/12] CI: add Ubuntu clang Hermes Add Ubuntu clang Hermes coverage, skip visual validation for Hermes Linux builds, and address Copilot review feedback on Gradle quoting plus macOS Ninja availability for Android Hermes host tools. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .github/workflows/build-android.yml | 10 +++++++--- .github/workflows/build-linux.yml | 6 ++++-- .github/workflows/ci.yml | 7 +++++++ Apps/Playground/Android/BabylonNative/build.gradle | 2 +- 4 files changed, 19 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build-android.yml b/.github/workflows/build-android.yml index 8203459c4..c2b87b55c 100644 --- a/.github/workflows/build-android.yml +++ b/.github/workflows/build-android.yml @@ -27,10 +27,14 @@ jobs: java-version: '17' - name: Install Hermes host build tools - if: inputs.js-engine == 'Hermes' && runner.os == 'Linux' + if: inputs.js-engine == 'Hermes' run: | - sudo apt-get update - sudo apt-get install -y ninja-build + if [ "${{ runner.os }}" = "Linux" ]; then + sudo apt-get update + sudo apt-get install -y ninja-build + elif [ "${{ runner.os }}" = "macOS" ] && ! command -v ninja >/dev/null 2>&1; then + brew install ninja + fi - name: Build Hermes host compilers if: inputs.js-engine == 'Hermes' diff --git a/.github/workflows/build-linux.yml b/.github/workflows/build-linux.yml index 4a9eaff07..981b951cc 100644 --- a/.github/workflows/build-linux.yml +++ b/.github/workflows/build-linux.yml @@ -24,7 +24,7 @@ env: jobs: build: runs-on: ubuntu-latest - timeout-minutes: 30 + timeout-minutes: ${{ inputs.js-engine == 'Hermes' && 60 || 30 }} env: CC: ${{ inputs.cc }} CXX: ${{ inputs.cxx }} @@ -46,6 +46,7 @@ jobs: -D BX_CONFIG_DEBUG=ON \ -D OpenGL_GL_PREFERENCE=GLVND \ -D BABYLON_DEBUG_TRACE=ON \ + ${{ inputs.js-engine == 'Hermes' && '-D HERMES_UNICODE_LITE=ON -D HERMES_ALLOW_BOOST_CONTEXT=0' || '' }} \ -D ENABLE_SANITIZERS=${{ inputs.enable-sanitizers && 'ON' || 'OFF' }} . ninja -C build/Linux @@ -53,6 +54,7 @@ jobs: run: sudo sysctl -w kernel.core_pattern=core.%p - name: Validation Tests + if: ${{ inputs.js-engine != 'Hermes' }} run: | cd build/Linux/Apps/Playground ulimit -c unlimited @@ -72,7 +74,7 @@ jobs: xvfb-run ./ModuleLoadTest - name: Upload Rendered Pictures - if: always() + if: ${{ inputs.js-engine != 'Hermes' && always() }} uses: actions/upload-artifact@v6 with: name: ${{ inputs.cc }}-${{ inputs.js-engine }}${{ inputs.enable-sanitizers && '-sanitizer' || '' }}-rendered-pictures diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 17c0d5f78..b91d2c4b2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -110,6 +110,13 @@ jobs: cxx: clang++ js-engine: JavaScriptCore + Ubuntu_Clang_Hermes: + uses: ./.github/workflows/build-linux.yml + with: + cc: clang + cxx: clang++ + js-engine: Hermes + Ubuntu_GCC_JSC: uses: ./.github/workflows/build-linux.yml with: diff --git a/Apps/Playground/Android/BabylonNative/build.gradle b/Apps/Playground/Android/BabylonNative/build.gradle index 601c593cb..e454cac2c 100644 --- a/Apps/Playground/Android/BabylonNative/build.gradle +++ b/Apps/Playground/Android/BabylonNative/build.gradle @@ -28,7 +28,7 @@ def cmakeArguments = [ "-DBABYLON_DEBUG_TRACE=ON" ] if (project.hasProperty("importHostCompilers")) { - cmakeArguments.add("-DIMPORT_HOST_COMPILERS=${project.property("importHostCompilers")}") + cmakeArguments.add("-DIMPORT_HOST_COMPILERS=${project.property('importHostCompilers')}") } configurations { natives } From c405ef29b4eec26aa9bf88e9f7cb5b0fd218fe40 Mon Sep 17 00:00:00 2001 From: Cedric Guillemet <1312968+CedricGuillemet@users.noreply.github.com> Date: Fri, 5 Jun 2026 16:33:39 +0200 Subject: [PATCH 07/12] CI: skip Linux Hermes module-load test Ubuntu clang Hermes covers configure, build, and UnitTests. Skip ModuleLoadTest for Hermes because its expected boot-module snapshot is engine-specific and currently fails under Hermes. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .github/workflows/build-linux.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-linux.yml b/.github/workflows/build-linux.yml index 981b951cc..76a5fab0d 100644 --- a/.github/workflows/build-linux.yml +++ b/.github/workflows/build-linux.yml @@ -67,7 +67,7 @@ jobs: xvfb-run ./UnitTests - name: Module Load Test - if: ${{ !inputs.enable-sanitizers }} + if: ${{ !inputs.enable-sanitizers && inputs.js-engine != 'Hermes' }} run: | cd build/Linux/Apps/ModuleLoadTest ulimit -c unlimited From ee81caf70718a6bc32f7d09869eb9cff91c51b5d Mon Sep 17 00:00:00 2001 From: Cedric Guillemet <1312968+CedricGuillemet@users.noreply.github.com> Date: Fri, 5 Jun 2026 16:44:21 +0200 Subject: [PATCH 08/12] CI: enable Win32 Hermes validation Run Playground validation for Win32 Hermes targets so failures are visible in CI while the integration is being brought up. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .github/workflows/build-win32.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-win32.yml b/.github/workflows/build-win32.yml index b85ccfc74..7d217e072 100644 --- a/.github/workflows/build-win32.yml +++ b/.github/workflows/build-win32.yml @@ -96,14 +96,14 @@ jobs: ) - name: Validation Tests - if: ${{ inputs.graphics-api != 'D3D12' && inputs.napi-type != 'Hermes' }} + if: ${{ inputs.graphics-api != 'D3D12' }} shell: cmd run: | cd build\${{ steps.vars.outputs.solution_name }}\Apps\Playground\RelWithDebInfo Playground app:///Scripts/validation_native.js - name: Upload Rendered Pictures - if: ${{ inputs.graphics-api != 'D3D12' && inputs.napi-type != 'Hermes' && !cancelled() }} + if: ${{ inputs.graphics-api != 'D3D12' && !cancelled() }} uses: actions/upload-artifact@v6 with: name: ${{ steps.vars.outputs.solution_name }}-${{ inputs.graphics-api }}${{ inputs.enable-sanitizers && '-sanitizer' || '' }}-rendered-pictures From c670f5c5c46ddd86c90b6e6c92d407a1bab07a08 Mon Sep 17 00:00:00 2001 From: Cedric Guillemet <1312968+CedricGuillemet@users.noreply.github.com> Date: Fri, 5 Jun 2026 17:15:25 +0200 Subject: [PATCH 09/12] Fix validation globals for Hermes Expose the validation engine and canvas on globalThis so evaluated playground snippets that reference browser-style globals work under Hermes eval scoping. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- Apps/Playground/Scripts/validation_native.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Apps/Playground/Scripts/validation_native.js b/Apps/Playground/Scripts/validation_native.js index 686280208..dd3069981 100644 --- a/Apps/Playground/Scripts/validation_native.js +++ b/Apps/Playground/Scripts/validation_native.js @@ -81,6 +81,7 @@ } const engine = new BABYLON.NativeEngine(); + globalThis.engine = engine; engine.getCaps().parallelShaderCompile = undefined; // Broaden Babylon's default retry strategy for the test framework: in addition to @@ -113,6 +114,7 @@ } const canvas = window; + globalThis.canvas = canvas; // Random replacement let seed = 1; From 0879a08f8ee9de3dd9a694a5058d507fdc04a8c5 Mon Sep 17 00:00:00 2001 From: Cedric Guillemet <1312968+CedricGuillemet@users.noreply.github.com> Date: Mon, 8 Jun 2026 10:36:53 +0200 Subject: [PATCH 10/12] CI: enable Linux Hermes test steps Run validation, module-load, and rendered-picture upload for Linux Hermes builds as well. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .github/workflows/build-linux.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-linux.yml b/.github/workflows/build-linux.yml index 76a5fab0d..36d410277 100644 --- a/.github/workflows/build-linux.yml +++ b/.github/workflows/build-linux.yml @@ -54,7 +54,6 @@ jobs: run: sudo sysctl -w kernel.core_pattern=core.%p - name: Validation Tests - if: ${{ inputs.js-engine != 'Hermes' }} run: | cd build/Linux/Apps/Playground ulimit -c unlimited @@ -67,14 +66,14 @@ jobs: xvfb-run ./UnitTests - name: Module Load Test - if: ${{ !inputs.enable-sanitizers && inputs.js-engine != 'Hermes' }} + if: ${{ !inputs.enable-sanitizers }} run: | cd build/Linux/Apps/ModuleLoadTest ulimit -c unlimited xvfb-run ./ModuleLoadTest - name: Upload Rendered Pictures - if: ${{ inputs.js-engine != 'Hermes' && always() }} + if: always() uses: actions/upload-artifact@v6 with: name: ${{ inputs.cc }}-${{ inputs.js-engine }}${{ inputs.enable-sanitizers && '-sanitizer' || '' }}-rendered-pictures From ce4c0ebf5d539e1a7fda40240d708d928d1ca59e Mon Sep 17 00:00:00 2001 From: Cedric Guillemet <1312968+CedricGuillemet@users.noreply.github.com> Date: Mon, 8 Jun 2026 12:07:58 +0200 Subject: [PATCH 11/12] Fix Linux Hermes module-load baseline Add the exact ICU and liblzma shared libraries loaded by Hermes on ubuntu-latest to the Linux ModuleLoadTest expected boot module set. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- Apps/ModuleLoadTest/Source/App.X11.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Apps/ModuleLoadTest/Source/App.X11.cpp b/Apps/ModuleLoadTest/Source/App.X11.cpp index 92193cec2..e6d39f618 100644 --- a/Apps/ModuleLoadTest/Source/App.X11.cpp +++ b/Apps/ModuleLoadTest/Source/App.X11.cpp @@ -56,6 +56,9 @@ namespace ModuleLoadTest "libexpat.so.1", "libgbm.so.1", "libgldispatch.so.0", + "libicudata.so.74", + "libicuuc.so.74", + "liblzma.so.5", "libpciaccess.so.0", "libsensors.so.5", "libtinfo.so.6", From bb73cee8c859a9f19ddb63ad8f42059c7274ff9c Mon Sep 17 00:00:00 2001 From: Cedric Guillemet <1312968+CedricGuillemet@users.noreply.github.com> Date: Tue, 16 Jun 2026 18:53:54 +0200 Subject: [PATCH 12/12] use cross compilation from JSRuntimehost --- .github/workflows/build-android.yml | 21 ++----------------- .../Android/BabylonNative/build.gradle | 6 ++++++ 2 files changed, 8 insertions(+), 19 deletions(-) diff --git a/.github/workflows/build-android.yml b/.github/workflows/build-android.yml index c2b87b55c..56318115a 100644 --- a/.github/workflows/build-android.yml +++ b/.github/workflows/build-android.yml @@ -26,7 +26,7 @@ jobs: distribution: temurin java-version: '17' - - name: Install Hermes host build tools + - name: Install Ninja (Hermes host-compiler bootstrap) if: inputs.js-engine == 'Hermes' run: | if [ "${{ runner.os }}" = "Linux" ]; then @@ -36,29 +36,12 @@ jobs: brew install ninja fi - - name: Build Hermes host compilers - if: inputs.js-engine == 'Hermes' - run: | - git clone --depth 1 --branch hermes-integration https://github.com/CedricGuillemet/JsRuntimeHost.git Build/JsRuntimeHostHost - cmake -B Build/HermesHost -G Ninja -S Build/JsRuntimeHostHost \ - -D CMAKE_BUILD_TYPE=RelWithDebInfo \ - -D NAPI_JAVASCRIPT_ENGINE=Hermes \ - -D HERMES_UNICODE_LITE=ON \ - -D HERMES_ALLOW_BOOST_CONTEXT=0 \ - -D JSRUNTIMEHOST_TESTS=OFF - cmake --build Build/HermesHost --target hermesc shermes --config RelWithDebInfo - - name: Build Playground ${{ inputs.js-engine }} working-directory: Apps/Playground/Android run: | - EXTRA_ARGS="" - if [ "${{ inputs.js-engine }}" = "Hermes" ]; then - EXTRA_ARGS="-PimportHostCompilers=${{ github.workspace }}/Build/HermesHost/ImportHostCompilers.cmake" - fi chmod +x gradlew ./gradlew assembleRelease \ -PjsEngine=${{ inputs.js-engine }} \ -PARM64Only \ -PNDK_VERSION=${{ env.NDK_VERSION }} \ - -PSANITIZERS=OFF \ - ${EXTRA_ARGS} + -PSANITIZERS=OFF diff --git a/Apps/Playground/Android/BabylonNative/build.gradle b/Apps/Playground/Android/BabylonNative/build.gradle index e454cac2c..3f075645d 100644 --- a/Apps/Playground/Android/BabylonNative/build.gradle +++ b/Apps/Playground/Android/BabylonNative/build.gradle @@ -27,6 +27,12 @@ def cmakeArguments = [ "-DBABYLON_NATIVE_BUILD_APPS=ON", "-DBABYLON_DEBUG_TRACE=ON" ] +// Hermes for Android needs HOST hermesc/shermes (they emit bytecode at build +// time and can't run as NDK-cross-compiled binaries). JsRuntimeHost's CMake +// bootstraps these host compilers automatically when cross-compiling, so no +// hand-off is normally required. This property is an optional manual override: +// pass -PimportHostCompilers= to reuse a prebuilt +// host-compiler set and skip the in-CMake bootstrap. if (project.hasProperty("importHostCompilers")) { cmakeArguments.add("-DIMPORT_HOST_COMPILERS=${project.property('importHostCompilers')}") }