Skip to content

Commit

Permalink
Add end-to-end CI for sandbox (facebook#1252)
Browse files Browse the repository at this point in the history
Summary:
Add a CI job that recreates the sandbox from source and tests that it
works.

Pull Request resolved: facebook#1252

Reviewed By: avp

Differential Revision: D52823512

Pulled By: neildhar

fbshipit-source-id: 7c9ef620a78a95db4e7b3608372e513ddb134f3c
  • Loading branch information
neildhar authored and facebook-github-bot committed Jan 17, 2024
1 parent 3a5f1de commit 4562643
Showing 1 changed file with 59 additions and 0 deletions.
59 changes: 59 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ workflows:
- windows
- macos
- emscripten
- sandbox
- test-linux
- test-windows
- test-e2e
Expand Down Expand Up @@ -548,6 +549,64 @@ jobs:
paths:
- .

sandbox:
docker:
- image: emscripten/emsdk:3.1.39
environment:
- DEBIAN_FRONTEND: noninteractive
working_directory: /root
steps:
- run:
name: Install dependencies
command: |
apt update
apt install -y libicu-dev tzdata
wget https://github.com/WebAssembly/wabt/releases/download/1.0.33/wabt-1.0.33-ubuntu.tar.gz
tar -xvf ./wabt-1.0.33-ubuntu.tar.gz
- checkout:
path: hermes
- run:
name: Build Hermes with Emscripten
command: |
# Generate the host compiler.
cmake -S hermes -B build_host
cmake --build ./build_host --target hermesc -j 4
# Generate and build the debug artefact.
cmake -S hermes -B build_wasm_dbg \
-DCMAKE_TOOLCHAIN_FILE=$EMSDK/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake \
-DIMPORT_HERMESC=build_host/ImportHermesc.cmake \
-DCMAKE_BUILD_TYPE=Debug -DHERMES_UNICODE_LITE=ON \
-DCMAKE_CXX_FLAGS=-O2 -DCMAKE_C_FLAGS=-O2 \
-DCMAKE_EXE_LINKER_FLAGS="-sALLOW_MEMORY_GROWTH=1 -sSTACK_SIZE=256KB" \
-DHERMES_ENABLE_DEBUGGER=OFF -DHERMES_SLOW_DEBUG=OFF
cmake --build build_wasm_dbg --target hermesSandboxImpl -j 4
./wabt-1.0.33/bin/wasm2c build_wasm_dbg/API/hermes_sandbox/hermesSandboxImpl.wasm -n hermes \
-o hermes/API/hermes_sandbox/external/hermes_sandbox_impl_dbg_compiled.c
# Generate and build the release artefact.
cmake -S hermes -B build_wasm_opt \
-DCMAKE_TOOLCHAIN_FILE=$EMSDK/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake \
-DIMPORT_HERMESC=build_host/ImportHermesc.cmake \
-DCMAKE_BUILD_TYPE=Release -DHERMES_UNICODE_LITE=ON \
-DCMAKE_EXE_LINKER_FLAGS="-sALLOW_MEMORY_GROWTH=1 -sSTACK_SIZE=256KB -g2" \
-DHERMES_ENABLE_DEBUGGER=OFF
cmake --build build_wasm_opt --target hermesSandboxImpl -j 4
./wabt-1.0.33/bin/wasm2c build_wasm_opt/API/hermes_sandbox/hermesSandboxImpl.wasm -n hermes \
-o hermes/API/hermes_sandbox/external/hermes_sandbox_impl_opt_compiled.c
- run:
name: Build and test with the newly generated sandbox
command: |
cmake -S hermes -B build_dbg -DCMAKE_BUILD_TYPE=Debug
cmake --build build_dbg -j 4
cmake --build build_dbg --target check-hermes -j 4
cmake -S hermes -B build_opt -DCMAKE_BUILD_TYPE=Release
cmake --build build_opt -j 4
cmake --build build_opt --target check-hermes -j 4
test-e2e:
executor:
name: android/android-machine
Expand Down

0 comments on commit 4562643

Please sign in to comment.