Skip to content

Commit 7c23f47

Browse files
committed
Merge commit '23a160ebf66f6aac306f8db90ff79b945fe76ce2' into realize-last-focused
2 parents 093968e + 23a160e commit 7c23f47

File tree

191 files changed

+2032
-3553
lines changed

Some content is hidden

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

191 files changed

+2032
-3553
lines changed

.circleci/config.yml

Lines changed: 129 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,7 @@ jobs:
432432
# -------------------------
433433
# JOBS: iOS Unit Tests
434434
# -------------------------
435-
test_ios_unit:
435+
test_ios:
436436
executor: reactnativeios
437437
parameters:
438438
use_frameworks:
@@ -452,8 +452,12 @@ jobs:
452452
- checkout
453453
- setup_artifacts
454454
- setup_ruby
455+
- run:
456+
name: Run Ruby Tests
457+
command: |
458+
cd scripts/cocoapods
459+
sh run_tests.sh
455460
- run_yarn
456-
457461
- run: |
458462
cd packages/rn-tester
459463
bundle check || bundle install
@@ -877,33 +881,56 @@ jobs:
877881
# -------------------------
878882
prepare_hermes_workspace:
879883
docker:
880-
- image: debian:buster
884+
- image: debian:bullseye
881885
environment:
882886
- HERMES_WS_DIR: *hermes_workspace_root
887+
- HERMES_VERSION_FILE: "sdks/.hermesversion"
883888
steps:
884-
- checkout
885889
- run:
886890
name: Install dependencies
887891
command: |
888-
apt-get update
889-
apt-get install -y wget git
892+
apt update
893+
apt install -y wget git
894+
- checkout
890895
- run:
891-
name: Set up Hermes workspace
892-
command: mkdir -p "$HERMES_WS_DIR/hermes" "$HERMES_WS_DIR/download"
896+
name: Set up Hermes workspace and caching
897+
command: |
898+
mkdir -p "/tmp/hermes" "/tmp/hermes/download" "/tmp/hermes/hermes"
899+
900+
if [ -f "$HERMES_VERSION_FILE" ]; then
901+
cat $HERMES_VERSION_FILE > /tmp/hermes/hermesversion
902+
else
903+
HERMES_TAG_SHA=$(git ls-remote https://github.com/facebook/hermes main | cut -f 1 | tr -d '[:space:]')
904+
echo $HERMES_TAG_SHA > /tmp/hermes/hermesversion
905+
fi
906+
- restore_cache:
907+
key: v1-hermes-{{ .Environment.CIRCLE_JOB }}-{{ checksum "/tmp/hermes/hermesversion" }}
893908
- run:
894909
name: Download Hermes tarball
895910
command: |
896-
HERMES_VERSION_FILE="sdks/.hermesversion"
897911
HERMES_TARBALL_URL="https://github.com/facebook/hermes/archive/refs/heads/main.tar.gz"
912+
HERMES_TARBALL_PATH="$HERMES_WS_DIR/download/hermes.tar.gz"
913+
898914
if [ -f "$HERMES_VERSION_FILE" ]; then
899915
HERMES_TAG=$(cat $HERMES_VERSION_FILE | tr -d '[:space:]')
900916
HERMES_TARBALL_URL="https://github.com/facebook/hermes/archive/refs/tags/$HERMES_TAG.tar.gz"
901917
echo "Using Hermes version tagged $HERMES_TAG"
902918
else
903919
echo "Using Hermes latest version from trunk"
904920
fi
905-
wget --timestamping -O "$HERMES_WS_DIR/download/hermes.tar.gz" "$HERMES_TARBALL_URL"
921+
922+
if [ -f "$HERMES_TARBALL_PATH" ]; then
923+
echo "Skipping download; $HERMES_TARBALL_PATH already present."
924+
else
925+
echo "Downloading Hermes tarball from $HERMES_TARBALL_URL"
926+
wget -O "$HERMES_TARBALL_PATH" "$HERMES_TARBALL_URL"
927+
fi
906928
tar -xzf "$HERMES_WS_DIR/download/hermes.tar.gz" --strip-components=1 -C "$HERMES_WS_DIR/hermes"
929+
- save_cache:
930+
key: v1-hermes-{{ .Environment.CIRCLE_JOB }}-{{ checksum "/tmp/hermes/hermesversion" }}
931+
paths:
932+
- /tmp/hermes/download/
933+
- /tmp/hermes/hermes/
907934
- persist_to_workspace:
908935
root: *hermes_workspace_root
909936
paths:
@@ -924,22 +951,30 @@ jobs:
924951
apt install -y git openssh-client cmake build-essential \
925952
libreadline-dev libicu-dev zip python3
926953
- *attach_hermes_workspace
954+
- restore_cache:
955+
key: v1-hermes-{{ .Environment.CIRCLE_JOB }}-{{ checksum "/tmp/hermes/hermesversion" }}
927956
- run:
928957
name: Set up workspace
929958
command: |
930959
mkdir -p /tmp/hermes/linux64-bin
931960
- run:
932961
name: Build HermesC for Linux
933962
command: |
934-
cd /tmp/hermes
935-
cmake -S hermes -B build -DHERMES_STATIC_LINK=ON -DCMAKE_BUILD_TYPE=Release \
936-
-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=True -DCMAKE_CXX_FLAGS=-s -DCMAKE_C_FLAGS=-s \
937-
-DCMAKE_EXE_LINKER_FLAGS="-Wl,--whole-archive -lpthread -Wl,--no-whole-archive"
938-
cmake --build build --target check-hermes -j 4
939-
- run:
940-
name: Package HermesC for Linux
941-
command: |
942-
cp /tmp/hermes/build/bin/hermesc /tmp/hermes/linux64-bin/.
963+
if [ -f /tmp/hermes/linux64-bin/hermesc ]; then
964+
echo 'Skipping; Clean "/tmp/hermes/linux64-bin" to rebuild.'
965+
else
966+
cd /tmp/hermes
967+
cmake -S hermes -B build -DHERMES_STATIC_LINK=ON -DCMAKE_BUILD_TYPE=Release \
968+
-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=True -DCMAKE_CXX_FLAGS=-s -DCMAKE_C_FLAGS=-s \
969+
-DCMAKE_EXE_LINKER_FLAGS="-Wl,--whole-archive -lpthread -Wl,--no-whole-archive"
970+
cmake --build build --target check-hermes -j 4
971+
cp /tmp/hermes/build/bin/hermesc /tmp/hermes/linux64-bin/.
972+
fi
973+
- save_cache:
974+
key: v1-hermes-{{ .Environment.CIRCLE_JOB }}-{{ checksum "/tmp/hermes/hermesversion" }}
975+
paths:
976+
- /tmp/hermes/linux64-bin/
977+
- /tmp/hermes/hermes/destroot/
943978
- store_artifacts:
944979
path: /tmp/hermes/linux64-bin/
945980
- persist_to_workspace:
@@ -953,6 +988,8 @@ jobs:
953988
- HERMES_WS_DIR: *hermes_workspace_root
954989
steps:
955990
- *attach_hermes_workspace
991+
- restore_cache:
992+
key: v1-hermes-{{ .Environment.CIRCLE_JOB }}-{{ checksum "/tmp/hermes/hermesversion" }}
956993
- run:
957994
name: Set up workspace
958995
command: |
@@ -964,13 +1001,20 @@ jobs:
9641001
- run:
9651002
name: Build HermesC for macOS
9661003
command: |
967-
cd "$HERMES_WS_DIR/hermes"
968-
./utils/build-mac-framework.sh
969-
- run:
970-
name: Package HermesC for macOS
971-
command: |
972-
cd "$HERMES_WS_DIR/hermes"
973-
cp build_macosx/bin/hermesc /tmp/hermes/osx-bin/.
1004+
if [ -f /tmp/hermes/osx-bin/hermesc ]; then
1005+
echo 'Skipping; Clean "/tmp/hermes/osx-bin" to rebuild.'
1006+
else
1007+
cd "$HERMES_WS_DIR/hermes"
1008+
./utils/build-mac-framework.sh
1009+
cp build_macosx/bin/hermesc /tmp/hermes/osx-bin/.
1010+
fi
1011+
- save_cache:
1012+
key: v1-hermes-{{ .Environment.CIRCLE_JOB }}-{{ checksum "/tmp/hermes/hermesversion" }}
1013+
paths:
1014+
- /tmp/hermes/osx-bin/
1015+
- /tmp/hermes/hermes/destroot/
1016+
- /tmp/hermes/hermes/build_host_hermesc/
1017+
- /tmp/hermes/hermes/build_macosx/
9741018
- store_artifacts:
9751019
path: /tmp/hermes/osx-bin/
9761020
- persist_to_workspace:
@@ -989,6 +1033,8 @@ jobs:
9891033
- CMAKE_DIR: 'C:\Program Files\CMake\bin'
9901034
steps:
9911035
- *attach_hermes_workspace
1036+
- restore_cache:
1037+
key: v1-hermes-{{ .Environment.CIRCLE_JOB }}-{{ checksum "tmp/hermes/hermesversion" }}
9921038
- run:
9931039
name: Set up workspace
9941040
command: |
@@ -997,53 +1043,57 @@ jobs:
9971043
New-Item -ItemType Directory $Env:HERMES_WS_DIR\deps
9981044
New-Item -ItemType Directory $Env:HERMES_WS_DIR\win64-bin
9991045
New-Item -ItemType SymbolicLink -Target tmp\hermes\hermes -Path $Env:HERMES_WS_DIR -Name hermes
1000-
- run:
1001-
name: Download ICU
1002-
command: |
1003-
cd $Env:HERMES_WS_DIR\icu
1004-
# If Invoke-WebRequest shows a progress bar, it will fail with
1005-
# Win32 internal error "Access is denied" 0x5 occurred [...]
1006-
$progressPreference = 'silentlyContinue'
1007-
Invoke-WebRequest -Uri "$Env:ICU_URL" -OutFile "icu.zip"
1008-
Expand-Archive -Path "icu.zip" -DestinationPath "."
1009-
- run:
1010-
name: Install dependencies
1011-
command: |
1012-
choco install --no-progress cmake --version 3.14.7
1013-
if (-not $?) { throw "Failed to install CMake" }
1014-
choco install --no-progress python3
1015-
if (-not $?) { throw "Failed to install Python" }
1016-
- run:
1017-
name: Assemble Windows runtime dependencies
1018-
command: |
1019-
cd $Env:HERMES_WS_DIR
1020-
Copy-Item -Path "icu\bin64\icu*.dll" -Destination "deps"
1021-
# Include MSVC++ 2015 redistributables
1022-
Copy-Item -Path "c:\windows\system32\msvcp140.dll" -Destination "deps"
1023-
Copy-Item -Path "c:\windows\system32\vcruntime140.dll" -Destination "deps"
1024-
Copy-Item -Path "c:\windows\system32\vcruntime140_1.dll" -Destination "deps"
10251046
- run:
10261047
name: Build HermesC for Windows
10271048
command: |
1028-
$Env:PATH += ";$Env:CMAKE_DIR;$Env:MSBUILD_DIR"
1029-
$Env:ICU_ROOT = "$Env:HERMES_WS_DIR\icu"
1030-
cd $Env:HERMES_WS_DIR
1031-
cmake -S hermes -B build_release -G 'Visual Studio 16 2019' -Ax64 -DCMAKE_BUILD_TYPE=Release -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=True -DHERMES_ENABLE_WIN10_ICU_FALLBACK=OFF
1032-
if (-not $?) { throw "Failed to configure Hermes" }
1033-
cd build_release
1034-
cmake --build . --target hermesc --config Release
1035-
if (-not $?) { throw "Failed to build Hermes" }
1036-
- run:
1037-
name: Package HermesC for Windows
1038-
command: |
1039-
cd $Env:HERMES_WS_DIR
1040-
Copy-Item -Path "build_release\bin\Release\hermesc.exe" -Destination "win64-bin"
1041-
# Include Windows runtime dependencies
1042-
Copy-Item -Path "deps\*" -Destination "win64-bin"
1049+
if (-not(Test-Path -Path $Env:HERMES_WS_DIR\win64-bin\hermesc.exe)) {
1050+
choco install --no-progress cmake --version 3.14.7
1051+
if (-not $?) { throw "Failed to install CMake" }
1052+
choco install --no-progress python3
1053+
if (-not $?) { throw "Failed to install Python" }
1054+
1055+
cd $Env:HERMES_WS_DIR\icu
1056+
# If Invoke-WebRequest shows a progress bar, it will fail with
1057+
# Win32 internal error "Access is denied" 0x5 occurred [...]
1058+
$progressPreference = 'silentlyContinue'
1059+
Invoke-WebRequest -Uri "$Env:ICU_URL" -OutFile "icu.zip"
1060+
Expand-Archive -Path "icu.zip" -DestinationPath "."
1061+
1062+
cd $Env:HERMES_WS_DIR
1063+
Copy-Item -Path "icu\bin64\icu*.dll" -Destination "deps"
1064+
# Include MSVC++ 2015 redistributables
1065+
Copy-Item -Path "c:\windows\system32\msvcp140.dll" -Destination "deps"
1066+
Copy-Item -Path "c:\windows\system32\vcruntime140.dll" -Destination "deps"
1067+
Copy-Item -Path "c:\windows\system32\vcruntime140_1.dll" -Destination "deps"
1068+
1069+
$Env:PATH += ";$Env:CMAKE_DIR;$Env:MSBUILD_DIR"
1070+
$Env:ICU_ROOT = "$Env:HERMES_WS_DIR\icu"
1071+
1072+
cmake -S hermes -B build_release -G 'Visual Studio 16 2019' -Ax64 -DCMAKE_BUILD_TYPE=Release -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=True -DHERMES_ENABLE_WIN10_ICU_FALLBACK=OFF
1073+
if (-not $?) { throw "Failed to configure Hermes" }
1074+
cd build_release
1075+
cmake --build . --target hermesc --config Release
1076+
if (-not $?) { throw "Failed to build Hermes" }
1077+
1078+
cd $Env:HERMES_WS_DIR
1079+
Copy-Item -Path "build_release\bin\Release\hermesc.exe" -Destination "win64-bin"
1080+
# Include Windows runtime dependencies
1081+
Copy-Item -Path "deps\*" -Destination "win64-bin"
1082+
}
1083+
else {
1084+
Write-Host "Skipping; Clean c:\tmp\hermes\win64-bin to rebuild."
1085+
}
1086+
- save_cache:
1087+
key: v1-hermes-{{ .Environment.CIRCLE_JOB }}-{{ checksum "tmp/hermes/hermesversion" }}
1088+
paths:
1089+
- C:\tmp\hermes\win64-bin\
1090+
- C:\tmp\hermes\hermes\icu\
1091+
- C:\tmp\hermes\hermes\deps\
1092+
- C:\tmp\hermes\hermes\build_release\
10431093
- store_artifacts:
1044-
path: c:\tmp\hermes\win64-bin\
1094+
path: C:\tmp\hermes\win64-bin\
10451095
- persist_to_workspace:
1046-
root: c:\tmp\hermes\
1096+
root: C:\tmp\hermes\
10471097
paths:
10481098
- win64-bin
10491099

@@ -1116,6 +1166,11 @@ jobs:
11161166
# END: Stables and nightlies
11171167

11181168
- run: node ./scripts/publish-npm.js << parameters.publish_npm_args >>
1169+
- run:
1170+
name: Zip Hermes Native Symbols
1171+
command: zip -r /tmp/hermes-native-symbols.zip ~/react-native/ReactAndroid/hermes-engine/build/intermediates/cmake/
1172+
- store_artifacts:
1173+
path: /tmp/hermes-native-symbols.zip
11191174

11201175
# START: Commitlies
11211176
# Provide a react-native package for this commit as a Circle CI release artifact.
@@ -1237,16 +1292,16 @@ workflows:
12371292
- build_npm_package
12381293
- test_ios_rntester
12391294
- build_ios
1240-
- test_ios_unit:
1295+
- test_ios:
12411296
run_unit_tests: true
12421297
requires:
12431298
- build_ios
12441299
# DISABLED: USE_FRAMEWORKS=1 not supported by Flipper
12451300
# - build_ios:
12461301
# name: build_ios_frameworks
12471302
# use_frameworks: true
1248-
# - test_ios_unit:
1249-
# name: test_ios_unit_frameworks
1303+
# - test_ios:
1304+
# name: test_ios_frameworks
12501305
# use_frameworks: true
12511306
# run_unit_tests: true
12521307
# requires:
@@ -1273,12 +1328,15 @@ workflows:
12731328
- prepare_hermes_workspace:
12741329
filters: *only_release_tags
12751330
- build_hermesc_linux:
1331+
filters: *only_release_tags
12761332
requires:
12771333
- prepare_hermes_workspace
12781334
- build_hermesc_macos:
1335+
filters: *only_release_tags
12791336
requires:
12801337
- prepare_hermes_workspace
12811338
- build_hermesc_windows:
1339+
filters: *only_release_tags
12821340
requires:
12831341
- prepare_hermes_workspace
12841342
# This job will trigger when a version tag is pushed (by package_release)

.flowconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,4 +71,4 @@ untyped-import
7171
untyped-type-import
7272

7373
[version]
74-
^0.176.3
74+
^0.177.0

.flowconfig.android

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,4 +71,4 @@ untyped-import
7171
untyped-type-import
7272

7373
[version]
74-
^0.176.3
74+
^0.177.0

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,6 @@ package-lock.json
115115
/packages/rn-tester/NativeModuleExample/ScreenshotManagerSpec*
116116

117117
# Additional SDKs
118-
/sdks/.hermesversion
119118
/sdks/hermes
120119
/sdks/download
121120

BUCK

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -759,7 +759,7 @@ rn_library(
759759
"//xplat/js:node_modules__react_19shallow_19renderer",
760760
"//xplat/js:node_modules__regenerator_19runtime",
761761
"//xplat/js:node_modules__stacktrace_19parser",
762-
"//xplat/js:node_modules__use_19subscription",
762+
"//xplat/js:node_modules__use_19sync_19external_19store",
763763
"//xplat/js:node_modules__whatwg_19fetch",
764764
"//xplat/js/RKJSModules/Libraries/Polyfills:Polyfills",
765765
"//xplat/js/RKJSModules/Libraries/React:React",

IntegrationTests/AsyncStorageTest.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ class AsyncStorageTest extends React.Component<{...}, $FlowFixMeState> {
207207
this.setState({done: true}, () => {
208208
TestModule.markTestCompleted();
209209
});
210-
updateMessage = msg => {
210+
updateMessage = (msg: string) => {
211211
this.setState({messages: this.state.messages.concat('\n' + msg)});
212212
DEBUG && console.log(msg);
213213
};
Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,12 @@
11
#!/bin/bash
2-
32
# Copyright (c) Meta Platforms, Inc. and affiliates.
43
#
54
# This source code is licensed under the MIT license found in the
65
# LICENSE file in the root directory of this source tree.
76

8-
# Set terminal title
9-
echo -en "\033]0;Web Socket Test Server\a"
10-
clear
11-
127
THIS_DIR=$(cd -P "$(dirname "$(readlink "${BASH_SOURCE[0]}" || echo "${BASH_SOURCE[0]}")")" && pwd)
13-
pushd "$THIS_DIR"
8+
pushd "$THIS_DIR" || exit
149
./websocket_integration_test_server.js
15-
popd
10+
popd || exit
1611

17-
echo "Process terminated. Press <enter> to close the window"
18-
read
12+
echo "Process terminated."

0 commit comments

Comments
 (0)