Skip to content

Commit

Permalink
Merge branch 'main' into text-input-errors
Browse files Browse the repository at this point in the history
  • Loading branch information
fabOnReact committed May 2, 2022
2 parents 0513007 + 422c224 commit 425056d
Show file tree
Hide file tree
Showing 209 changed files with 2,843 additions and 3,888 deletions.
192 changes: 89 additions & 103 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,11 @@ jobs:
- run:
name: Set USE_HERMES=1
command: echo "export USE_HERMES=1" >> $BASH_ENV

- run:
name: Set BUILD_HERMES_SOURCE=1
command: echo "export BUILD_HERMES_SOURCE=1" >> $BASH_ENV

- with_brew_cache_span:
steps:
- brew_install:
Expand All @@ -427,7 +432,7 @@ jobs:
# -------------------------
# JOBS: iOS Unit Tests
# -------------------------
test_ios_unit:
test_ios:
executor: reactnativeios
parameters:
use_frameworks:
Expand Down Expand Up @@ -487,6 +492,10 @@ jobs:
name: Set USE_HERMES=1
command: echo "export USE_HERMES=1" >> $BASH_ENV

- run:
name: Set BUILD_HERMES_SOURCE=1
command: echo "export BUILD_HERMES_SOURCE=1" >> $BASH_ENV

- run:
name: Setup the CocoaPods environment
command: bundle exec pod setup
Expand Down Expand Up @@ -880,7 +889,7 @@ jobs:
apt-get install -y wget git
- run:
name: Set up Hermes workspace
command: mkdir -p "$HERMES_WS_DIR/hermes" "$HERMES_WS_DIR/download" "$HERMES_WS_DIR/output"
command: mkdir -p "$HERMES_WS_DIR/hermes" "$HERMES_WS_DIR/download"
- run:
name: Download Hermes tarball
command: |
Expand All @@ -900,75 +909,74 @@ jobs:
paths:
- download
- hermes
- hermesc
- output
- hermesversion

build_hermesc_linux:
docker:
- image: debian:buster
environment:
- HERMES_WS_DIR: *hermes_workspace_root
- TERM: dumb
- DEBIAN_FRONTEND: noninteractive
- image: debian:bullseye
resource_class: "xlarge"
working_directory: /root
steps:
- *attach_hermes_workspace
- run:
name: Install dependencies
command: |
apt-get update
apt-get install -y \
sudo git openssh-client cmake ninja-build python \
build-essential libreadline-dev libicu-dev
apt update
apt install -y git openssh-client cmake build-essential \
libreadline-dev libicu-dev zip python3
- *attach_hermes_workspace
- run:
name: Set up workspace
command: |
sudo cp /usr/bin/ninja /usr/bin/ninja.real
printf '%s\n' '#!/bin/sh' 'ninja.real -j4 "$@" || ninja.real -j1 "$@"' | sudo tee /usr/bin/ninja
mkdir -p /tmp/hermes/linux64-bin
- run:
name: Build Hermes Compiler for Linux
name: Build HermesC for Linux
command: |
HERMESC_LINUX_DIR="$HERMES_WS_DIR/hermesc/linux"
cd "$HERMES_WS_DIR"
cmake -S hermes -B build_release -G Ninja -DHERMES_STATIC_LINK=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS=-s -DCMAKE_C_FLAGS=-s
cd build_release
ninja github-cli-release
mkdir -p "$HERMESC_LINUX_DIR"
mv $HERMES_WS_DIR/build_release/* "$HERMESC_LINUX_DIR"
cd /tmp/hermes
cmake -S hermes -B build -DHERMES_STATIC_LINK=ON -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=True -DCMAKE_CXX_FLAGS=-s -DCMAKE_C_FLAGS=-s \
-DCMAKE_EXE_LINKER_FLAGS="-Wl,--whole-archive -lpthread -Wl,--no-whole-archive"
cmake --build build --target check-hermes -j 4
- run:
name: Package HermesC for Linux
command: |
cp /tmp/hermes/build/bin/hermesc /tmp/hermes/linux64-bin/.
- store_artifacts:
path: /tmp/hermes/linux64-bin/
- persist_to_workspace:
root: *hermes_workspace_root
root: /tmp/hermes/
paths:
- hermesc/linux
- linux64-bin

build_hermesc_macos:
executor: reactnativeios
working_directory: ~/hermes
environment:
- HERMES_WS_DIR: *hermes_workspace_root
- TERM: dumb
- HOMEBREW_NO_AUTO_UPDATE: 1
steps:
- *attach_hermes_workspace
- restore_cache:
key: v4-repo-{{ .Environment.CIRCLE_SHA1 }}
- run:
name: Set up workspace
command: |
mkdir -p /tmp/hermes/osx-bin
- run:
name: Install dependencies
command: |
brew install cmake ninja
sudo gem install cocoapods
- run:
name: Build Hermes Compiler for macOS
name: Build HermesC for macOS
command: |
HERMESC_MACOS_DIR="$HERMES_WS_DIR/hermesc/macos"
cd "$HERMES_WS_DIR"
cmake -S hermes -B build_host_hermesc -G Ninja -DCMAKE_BUILD_TYPE=Release
cmake --build ./build_host_hermesc --target hermesc
mkdir -p "$HERMESC_MACOS_DIR"
mv $HERMES_WS_DIR/build_host_hermesc/* "$HERMESC_MACOS_DIR"
cd "$HERMES_WS_DIR/hermes"
./utils/build-mac-framework.sh
- run:
name: Package HermesC for macOS
command: |
cd "$HERMES_WS_DIR/hermes"
cp build_macosx/bin/hermesc /tmp/hermes/osx-bin/.
- store_artifacts:
path: /tmp/hermes/osx-bin/
- persist_to_workspace:
root: *hermes_workspace_root
root: /tmp/hermes/
paths:
- hermesc/macos
- osx-bin

build_hermesc_windows:
executor:
Expand All @@ -986,9 +994,8 @@ jobs:
command: |
New-Item -ItemType Directory $Env:HERMES_WS_DIR
New-Item -ItemType Directory $Env:HERMES_WS_DIR\icu
New-Item -ItemType Directory $Env:HERMES_WS_DIR\output
New-Item -ItemType Directory $Env:HERMES_WS_DIR\deps
New-Item -ItemType Directory $Env:HERMES_WS_DIR\windows
New-Item -ItemType Directory $Env:HERMES_WS_DIR\win64-bin
New-Item -ItemType SymbolicLink -Target tmp\hermes\hermes -Path $Env:HERMES_WS_DIR -Name hermes
- run:
name: Download ICU
Expand All @@ -1015,38 +1022,30 @@ jobs:
Copy-Item -Path "c:\windows\system32\msvcp140.dll" -Destination "deps"
Copy-Item -Path "c:\windows\system32\vcruntime140.dll" -Destination "deps"
Copy-Item -Path "c:\windows\system32\vcruntime140_1.dll" -Destination "deps"
- run:
name: Build Hermes Compiler for Windows
name: Build HermesC for Windows
command: |
$HermesCWindowsFolder = "$Env:HERMES_WS_DIR\hermesc\windows"
$Env:PATH += ";$Env:CMAKE_DIR;$Env:MSBUILD_DIR"
$Env:ICU_ROOT = "$Env:HERMES_WS_DIR\icu"
cd $Env:HERMES_WS_DIR
cmake -S hermes -B build_release -G 'Visual Studio 16 2019' -DCMAKE_BUILD_TYPE=Release -DHERMES_ENABLE_WIN10_ICU_FALLBACK=OFF -DHERMES_GITHUB_RESOURCE_DIR="$Env:HERMES_WS_DIR\deps"
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
if (-not $?) { throw "Failed to configure Hermes" }
cd build_release
cmake --build . --target github-cli-release --config Release
cmake --build . --target hermesc --config Release
if (-not $?) { throw "Failed to build Hermes" }
New-Item -ItemType Directory $HermesCWindowsFolder
Copy-Item -Path "C:\tmp\hermes\build_release\*" -Destination $HermesCWindowsFolder -Recurse
- run:
name: Package HermesC for Windows
command: |
cd $Env:HERMES_WS_DIR
Copy-Item -Path "build_release\bin\Release\hermesc.exe" -Destination "win64-bin"
# Include Windows runtime dependencies
Copy-Item -Path "deps\*" -Destination "win64-bin"
- store_artifacts:
path: c:\tmp\hermes\win64-bin\
- persist_to_workspace:
root: 'C:\tmp\hermes'
root: c:\tmp\hermes\
paths:
- hermesc\windows

store_hermesc:
docker:
- image: debian:buster
environment:
- HERMES_WS_DIR: *hermes_workspace_root
steps:
- *attach_hermes_workspace
# Provide a tarball of hermesc binaries as an artifact, for convenience.
- run: tar -czvf $HERMES_WS_DIR/hermesc.tar.gz $HERMES_WS_DIR/hermesc
- store_artifacts:
path: /tmp/hermes/hermesc.tar.gz
destination: hermesc
- win64-bin

# -------------------------
# JOBS: Releases
Expand Down Expand Up @@ -1085,15 +1084,14 @@ jobs:
mkdir -p ~/.ssh
echo '|1|If6MU203eXTaaWL678YEfWkVMrw=|kqLeIAyTy8pzpj8x8Ae4Fr8Mtlc= ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ==' >> ~/.ssh/known_hosts
- checkout
# TODO: (hramos) Filter out unnecessary files before adding Hermes Compiler to package
# - *attach_hermes_workspace
# - run:
# name: Move hermesc binaries to sdks/hermesc
# command: |
# curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
# apt update && apt install -y jq
# mkdir -p ./sdks/hermesc
# cp -R $HERMES_WS_DIR/hermesc/* ./sdks/hermesc
- *attach_hermes_workspace
- run:
name: Copy HermesC binaries
command: |
mkdir -p ./sdks/hermesc ./sdks/hermesc/osx-bin ./sdks/hermesc/win64-bin ./sdks/hermesc/linux64-bin
cp -r $HERMES_WS_DIR/osx-bin/* ./sdks/hermesc/osx-bin/.
cp -r $HERMES_WS_DIR/win64-bin/* ./sdks/hermesc/win64-bin/.
cp -r $HERMES_WS_DIR/linux64-bin/* ./sdks/hermesc/linux64-bin/.
- run_yarn
- install_buck_tooling
Expand Down Expand Up @@ -1219,17 +1217,13 @@ workflows:
- build_hermesc_windows:
requires:
- prepare_hermes_workspace
- store_hermesc:
- build_npm_package:
# Build a release package on every untagged commit, but do not publish to npm.
publish_npm_args: --dry-run
requires:
- build_hermesc_linux
- build_hermesc_macos
- build_hermesc_windows
- build_npm_package:
# Build a release package on every untagged commit, but do not publish to npm.
publish_npm_args: --dry-run
# TODO: (hramos) Slim down Hermes Compiler files before adding to react-native npm
# requires:
# - store_hermesc
- test_js:
run_disabled_tests: false
- test_android:
Expand All @@ -1243,19 +1237,16 @@ workflows:
- build_npm_package
- test_ios_rntester
- build_ios
- test_ios_unit:
# TODO(ncor, neildhar) Integration tests for iOS + Hermes are currently
# disabled due to an ABI incompatibility introduced by D33830544.
# They can be re-enabled as soon as Hermes 0.12.0 is released.
run_unit_tests: false
- test_ios:
run_unit_tests: true
requires:
- build_ios
# DISABLED: USE_FRAMEWORKS=1 not supported by Flipper
# - build_ios:
# name: build_ios_frameworks
# use_frameworks: true
# - test_ios_unit:
# name: test_ios_unit_frameworks
# - test_ios:
# name: test_ios_frameworks
# use_frameworks: true
# run_unit_tests: true
# requires:
Expand All @@ -1282,28 +1273,27 @@ workflows:
- prepare_hermes_workspace:
filters: *only_release_tags
- build_hermesc_linux:
filters: *only_release_tags
requires:
- prepare_hermes_workspace
- build_hermesc_macos:
filters: *only_release_tags
requires:
- prepare_hermes_workspace
- build_hermesc_windows:
filters: *only_release_tags
requires:
- prepare_hermes_workspace
- store_hermesc:
requires:
- build_hermesc_linux
- build_hermesc_macos
- build_hermesc_windows
# This job will trigger when a version tag is pushed (by package_release)
- build_npm_package:
name: build_and_publish_npm_package
context: react-native-bot
publish_npm_args: --release
filters: *only_release_tags
# TODO: (hramos) Slim down Hermes Compiler files before adding to react-native npm
# requires:
# - store_hermesc
requires:
- build_hermesc_linux
- build_hermesc_macos
- build_hermesc_windows

analysis:
unless: << pipeline.parameters.run_package_release_workflow_only >>
Expand Down Expand Up @@ -1342,14 +1332,10 @@ workflows:
- build_hermesc_windows:
requires:
- prepare_hermes_workspace
- store_hermesc:

- build_npm_package:
publish_npm_args: --nightly
requires:
- build_hermesc_linux
- build_hermesc_macos
- build_hermesc_windows

- build_npm_package:
publish_npm_args: --nightly
# TODO: (hramos) Slim down Hermes Compiler files before adding to react-native npm
# requires:
# - store_hermesc
2 changes: 1 addition & 1 deletion .flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,4 @@ untyped-import
untyped-type-import

[version]
^0.176.1
^0.176.3
2 changes: 1 addition & 1 deletion .flowconfig.android
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,4 @@ untyped-import
untyped-type-import

[version]
^0.176.1
^0.176.3
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ package-lock.json
/packages/rn-tester/NativeModuleExample/ScreenshotManagerSpec*

# Additional SDKs
/sdks/.hermesversion
/sdks/hermes
/sdks/download

Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,12 @@
#!/bin/bash

# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.

# Set terminal title
echo -en "\033]0;Web Socket Test Server\a"
clear

THIS_DIR=$(cd -P "$(dirname "$(readlink "${BASH_SOURCE[0]}" || echo "${BASH_SOURCE[0]}")")" && pwd)
pushd "$THIS_DIR"
pushd "$THIS_DIR" || exit
./websocket_integration_test_server.js
popd
popd || exit

echo "Process terminated. Press <enter> to close the window"
read
echo "Process terminated."
Loading

0 comments on commit 425056d

Please sign in to comment.