Skip to content

Commit bc3d0ed

Browse files
Integrate Facebook/Hermes changes up to November 8, 2025 (#260)
* Merge Hermes bbebefe * fix build issues * uwp build fix * Add Changes for Supporting Proxy Array * Add Value override for has/get/setProperty, and deleteProperty API * Raise Expection inside NodeApiJsiRuntime * Align deleteProperty in NodeApiJsi with Hermes JSI * Add missed JSI Version Macro * clang format * Remove the use of auto * Delete Kotlin based files * Add Meta change for napi_get_array_length
1 parent d7ca19b commit bc3d0ed

File tree

243 files changed

+1093861
-1158429
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

243 files changed

+1093861
-1158429
lines changed

.ado/scripts/build.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,7 @@ function cmakeConfigure(buildParams) {
445445
// Use prebuilt Hermes compiler for cross-platform builds
446446
if (isCrossPlatformBuild(buildParams)) {
447447
genArgs.push(
448-
`-DIMPORT_HERMESC="${path.join(toolsPath, "ImportHermesc.cmake")}"`,
448+
`-DIMPORT_HOST_COMPILERS="${path.join(toolsPath, "ImportHostCompilers.cmake")}"`,
449449
);
450450
}
451451

@@ -894,7 +894,9 @@ function setupJSTestEnvPaths() {
894894
const pythonScriptsDir = path.join(pythonDir, "Scripts");
895895
console.log(`Found Python at: ${pythonDir}`);
896896
if (!process.env.PATH.includes(pythonDir)) {
897-
console.log(`Adding python directories to PATH: ${pythonDir}, ${pythonScriptsDir}`);
897+
console.log(
898+
`Adding python directories to PATH: ${pythonDir}, ${pythonScriptsDir}`,
899+
);
898900
process.env.PATH = `${pythonDir};${pythonScriptsDir};${process.env.PATH}`;
899901
}
900902
})();

.clang-tidy

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ Checks: >
44
readability-identifier-naming,
55
readability-inconsistent-declaration-parameter-name,
66
readability-static-accessed-through-instance,
7-
-facebook-hte-MissingBraces,
87
FormatStyle: file
98
InheritParentConfig: true
109
HeaderFilterRegex: include/hermes/.*
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
name: Install CMake
2+
runs:
3+
using: composite
4+
steps:
5+
- name: Install CMake
6+
shell: bash
7+
run: |-
8+
if ! brew list cmake &> /dev/null; then
9+
echo "Installing CMake"
10+
brew install cmake
11+
fi
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: Setup node.js
2+
description: 'Set up your GitHub Actions workflow with a specific version of node.js'
3+
inputs:
4+
node-version:
5+
description: 'The node.js version to use'
6+
required: false
7+
default: '22.14.0'
8+
runs:
9+
using: "composite"
10+
steps:
11+
- name: Setup node.js
12+
uses: actions/setup-node@v4
13+
with:
14+
node-version: ${{ inputs.node-version }}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: Setup xcode
2+
description: 'Set up your GitHub Actions workflow with a specific version of xcode'
3+
inputs:
4+
xcode-version:
5+
description: 'The xcode version to use'
6+
required: false
7+
default: '16.4.0'
8+
runs:
9+
using: "composite"
10+
steps:
11+
- name: Setup xcode
12+
uses: maxim-lobanov/setup-xcode@60606e260d2fc5762a71e64e74b2174e8ea3c8bd
13+
with:
14+
xcode-version: ${{ inputs.xcode-version }}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: yarn-install
2+
runs:
3+
using: composite
4+
steps:
5+
- name: Setup node.js
6+
uses: ./.github/actions/setup-node
7+
- name: Install dependencies
8+
shell: bash
9+
run: |
10+
cd utils/scripts/hermes
11+
MAX_ATTEMPTS=2
12+
ATTEMPT=0
13+
WAIT_TIME=20
14+
while [ $ATTEMPT -lt $MAX_ATTEMPTS ]; do
15+
yarn install --non-interactive --frozen-lockfile && break
16+
echo "yarn install failed. Retrying in $WAIT_TIME seconds..."
17+
sleep $WAIT_TIME
18+
ATTEMPT=$((ATTEMPT + 1))
19+
done
20+
if [ $ATTEMPT -eq $MAX_ATTEMPTS ]; then
21+
echo "All attempts to invoke yarn install failed - Aborting the workflow"
22+
exit 1
23+
fi
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: build-android
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
release-type:
7+
required: true
8+
description: The type of release we are building. It could be commitly, release or dry-run
9+
type: string
10+
hermes-version:
11+
required: true
12+
description: The Hermes version to use for this build
13+
type: string
14+
15+
jobs:
16+
build-android:
17+
runs-on: 8-core-ubuntu
18+
env:
19+
HERMES_WS_DIR: /home/runner/work/hermes/hermes
20+
container:
21+
image: reactnativecommunity/react-native-android:latest
22+
env:
23+
TERM: "dumb"
24+
GRADLE_OPTS: "-Dorg.gradle.daemon=false"
25+
ORG_GRADLE_PROJECT_SIGNING_PWD: ${{ secrets.ORG_GRADLE_PROJECT_SIGNING_PWD }}
26+
ORG_GRADLE_PROJECT_SIGNING_KEY: ${{ secrets.ORG_GRADLE_PROJECT_SIGNING_KEY }}
27+
ORG_GRADLE_PROJECT_SONATYPE_USERNAME: ${{ secrets.ORG_GRADLE_PROJECT_SONATYPE_USERNAME }}
28+
ORG_GRADLE_PROJECT_SONATYPE_PASSWORD: ${{ secrets.ORG_GRADLE_PROJECT_SONATYPE_PASSWORD }}
29+
steps:
30+
- name: Checkout
31+
uses: actions/checkout@v4
32+
- name: Setup git safe folders
33+
shell: bash
34+
run: git config --global --add safe.directory '*'
35+
- name: Setup node.js
36+
uses: ./.github/actions/setup-node
37+
- name: Install node dependencies
38+
uses: ./.github/actions/yarn-install
39+
- name: Set artifacts version
40+
shell: bash
41+
run: node ./utils/scripts/hermes/set-artifacts-version.js --build-type ${{ inputs.release-type }} --hermesVersion "${{ inputs.hermes-version }}"
42+
- name: Build android
43+
shell: bash
44+
run: |
45+
cd android
46+
47+
if [[ "${{ inputs.release-type }}" == "commitly" ]]; then
48+
export ORG_GRADLE_PROJECT_isSnapshot="true"
49+
TASKS="publishAndroidOnlyToMavenTempLocal publishAndroidOnlyToSonatype"
50+
else
51+
TASKS="publishAndroidOnlyToMavenTempLocal"
52+
fi
53+
54+
./gradlew $TASKS -PenableWarningsAsErrors=true
55+
- name: Upload Maven Artifacts
56+
uses: actions/[email protected]
57+
with:
58+
name: maven-local
59+
path: /tmp/maven-local
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
name: build-apple-slices-hermes
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
release-type:
7+
required: true
8+
description: The type of release we are building. It could be commitly, release or dry-run
9+
type: string
10+
hermes-version:
11+
required: true
12+
description: The Hermes version to use for this build
13+
type: string
14+
15+
jobs:
16+
build_apple_slices_hermes:
17+
runs-on: macos-15
18+
env:
19+
IOS_DEPLOYMENT_TARGET: "15.1"
20+
XROS_DEPLOYMENT_TARGET: "1.0"
21+
MAC_DEPLOYMENT_TARGET: "10.15"
22+
strategy:
23+
fail-fast: false
24+
matrix:
25+
flavor: [Debug, Release]
26+
slice: [macosx, iphoneos, iphonesimulator, appletvos, appletvsimulator, catalyst, xros, xrsimulator]
27+
steps:
28+
- name: Checkout
29+
uses: actions/checkout@v4
30+
- name: Setup git safe folders
31+
shell: bash
32+
run: git config --global --add safe.directory '*'
33+
- name: Setup node.js
34+
uses: ./.github/actions/setup-node
35+
- name: Install node dependencies
36+
uses: ./.github/actions/yarn-install
37+
- name: Set artifacts version
38+
shell: bash
39+
run: node ./utils/scripts/hermes/set-artifacts-version.js --build-type ${{ inputs.release-type }} --hermesVersion "${{ inputs.hermes-version }}"
40+
- name: Setup xcode
41+
uses: ./.github/actions/setup-xcode
42+
- name: Restore HermesC Artifact
43+
uses: actions/download-artifact@v4
44+
with:
45+
name: hermesc-apple
46+
path: ./build_host_hermesc
47+
- name: Build the Hermes ${{ matrix.slice }} frameworks
48+
shell: bash
49+
run: |
50+
SLICE=${{ matrix.slice }}
51+
FLAVOR=${{ matrix.flavor }}
52+
FINAL_PATH=build_"$SLICE"_"$FLAVOR"
53+
echo "Final path for this slice is: $FINAL_PATH"
54+
55+
# HermesC is used to build hermes, so it has to be executable
56+
chmod +x ./build_host_hermesc/bin/hermesc
57+
58+
if [[ "$SLICE" == "macosx" ]]; then
59+
echo "[HERMES] Building Hermes for MacOS"
60+
61+
chmod +x ./utils/build-mac-framework.sh
62+
BUILD_TYPE="${{ matrix.flavor }}" ./utils/build-mac-framework.sh
63+
else
64+
echo "[HERMES] Building Hermes for iOS: $SLICE"
65+
66+
chmod +x ./utils/build-ios-framework.sh
67+
BUILD_TYPE="${{ matrix.flavor }}" ./utils/build-ios-framework.sh "$SLICE"
68+
fi
69+
70+
echo "Moving from build_$SLICE to $FINAL_PATH"
71+
mv build_"$SLICE" "$FINAL_PATH"
72+
73+
# check whether everything is there
74+
if [[ -d "$FINAL_PATH/lib/hermesvm.framework" ]]; then
75+
echo "Successfully built hermesvm.framework for $SLICE in $FLAVOR"
76+
else
77+
echo "Failed to built hermesvm.framework for $SLICE in $FLAVOR"
78+
exit 1
79+
fi
80+
81+
if [[ -d "$FINAL_PATH/lib/hermesvm.framework.dSYM" ]]; then
82+
echo "Successfully built hermesvm.framework.dSYM for $SLICE in $FLAVOR"
83+
else
84+
echo "Failed to built hermesvm.framework.dSYM for $SLICE in $FLAVOR"
85+
echo "Please try again"
86+
exit 1
87+
fi
88+
- name: Compress slices to preserve Symlinks
89+
shell: bash
90+
run: |
91+
tar -czv -f build_${{ matrix.slice }}_${{ matrix.flavor }}.tar.gz build_${{ matrix.slice }}_${{ matrix.flavor }}
92+
- name: Upload Artifact for Slice (${{ matrix.slice }}, ${{ matrix.flavor }}}
93+
uses: actions/[email protected]
94+
with:
95+
name: slice-${{ matrix.slice }}-${{ matrix.flavor }}
96+
path: ./build_${{ matrix.slice }}_${{ matrix.flavor }}.tar.gz
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: build-emscripten
2+
3+
on:
4+
workflow_call
5+
6+
jobs:
7+
build-emscripten:
8+
runs-on: ubuntu-22.04
9+
container:
10+
image: emscripten/emsdk:3.1.17
11+
steps:
12+
- name: Install dependencies
13+
run: |-
14+
apt update
15+
apt install -y libicu-dev libreadline-dev
16+
- uses: actions/[email protected]
17+
with:
18+
path: hermes
19+
- name: Build Hermes Compiler
20+
run: |-
21+
cmake -S hermes -B build_host_hermesc
22+
cmake --build ./build_host_hermesc --target hermesc -j 4
23+
- name: Build Hermes with Emscripten for Website Playground
24+
run: |-
25+
echo LINKER_FLAGS: $LINKER_FLAGS
26+
cmake -S hermes -B playground \
27+
-DCMAKE_BUILD_TYPE=Release \
28+
-DCMAKE_EXE_LINKER_FLAGS="$LINKER_FLAGS" \
29+
-DCMAKE_TOOLCHAIN_FILE="$EMSDK/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake" \
30+
-DIMPORT_HOST_COMPILERS="$PWD/build_host_hermesc/ImportHostCompilers.cmake"
31+
cmake --build ./playground --target hermes -j 4
32+
cmake --build ./playground --target hermesc -j 4
33+
cmake --build ./playground --target emhermesc -j 4
34+
EMHERMESC="$PWD/playground/bin/emhermesc.js" node ./hermes/tools/emhermesc/test.js
35+
env:
36+
LINKER_FLAGS: "-s WASM=1 -s ALLOW_MEMORY_GROWTH=0 -s TOTAL_MEMORY=33554432 -s MODULARIZE=1 -s EXPORT_NAME=createHermes -s INVOKE_RUN=0 -s EXIT_RUNTIME=1 -s NODERAWFS=0 -s EXTRA_EXPORTED_RUNTIME_METHODS=[callMain,FS] -s EXPORTED_FUNCTIONS=[_malloc,_free]"
37+
- name: Create Playground tarball
38+
run: |-
39+
mkdir output staging
40+
cp ./playground/bin/hermes.js ./playground/bin/hermes.wasm staging
41+
tar -C staging -czvf output/${TAR_NAME} .
42+
shasum -a 256 output/${TAR_NAME} > output/${TAR_NAME}.sha256
43+
env:
44+
TAR_NAME: hermes-cli-emscripten.tar.gz
45+
- uses: actions/[email protected]
46+
with:
47+
name: emscripten-hermes
48+
path: output

0 commit comments

Comments
 (0)