diff --git a/.github/workflows/cpp.yml b/.github/workflows/cpp.yml index c0f8e59c8..eaad2e01d 100644 --- a/.github/workflows/cpp.yml +++ b/.github/workflows/cpp.yml @@ -117,97 +117,12 @@ jobs: fail-fast: false matrix: include: - - name: 'NullVM on Linux/x86_64' - engine: 'null' - os: ubuntu-20.04 - arch: x86_64 - action: test - flags: --config=gcc - - name: 'NullVM on Windows/x86_64' - engine: 'null' - os: windows-2019 - arch: x86_64 - action: test - - name: 'V8 on Linux/x86_64' - engine: 'v8' - repo: 'v8' - os: ubuntu-20.04 - arch: x86_64 - action: test - flags: --config=clang --define=crypto=system - cache: true - - name: 'V8 on Linux/aarch64' + - name: 'V8 on Windows/x86_64' engine: 'v8' repo: 'v8' - os: ubuntu-20.04 - arch: aarch64 - action: test - flags: --config=zig-cc-linux-aarch64 --@v8//bazel/config:v8_target_cpu=arm64 - deps: qemu-user-static libc6-arm64-cross - cache: true - - name: 'V8 on macOS/x86_64' - engine: 'v8' - repo: 'v8' - os: macos-11 - arch: x86_64 - action: test - cache: true - - name: 'WAMR on Linux/x86_64' - engine: 'wamr' - repo: 'com_github_bytecodealliance_wasm_micro_runtime' - os: ubuntu-20.04 - arch: x86_64 - action: test - flags: --config=clang - - name: 'WAMR on macOS/x86_64' - engine: 'wamr' - repo: 'com_github_bytecodealliance_wasm_micro_runtime' - os: macos-11 - arch: x86_64 - action: test - - name: 'Wasmtime on Linux/x86_64' - engine: 'wasmtime' - repo: 'com_github_bytecodealliance_wasmtime' - os: ubuntu-20.04 - arch: x86_64 - action: test - flags: --config=clang - - name: 'Wasmtime on Linux/aarch64' - engine: 'wasmtime' - repo: 'com_github_bytecodealliance_wasmtime' - os: ubuntu-20.04 - arch: aarch64 - action: build - flags: --config=zig-cc-linux-aarch64 - deps: qemu-user-static libc6-arm64-cross - - name: 'Wasmtime on Linux/s390x' - engine: 'wasmtime' - repo: 'com_github_bytecodealliance_wasmtime' - os: ubuntu-20.04 - arch: s390x - action: test - flags: --config=clang - run_under: docker run --rm --env HOME=$HOME --env USER=$(id -un) --volume "$HOME:$HOME" --workdir $(pwd) --user $(id -u):$(id -g) --platform linux/s390x piotrsikora/build-tools:bazel-5.0.0-clang-13-gcc-11 - cache: true - - name: 'Wasmtime on macOS/x86_64' - engine: 'wasmtime' - repo: 'com_github_bytecodealliance_wasmtime' - os: macos-11 - arch: x86_64 - action: test - - name: 'Wasmtime on Windows/x86_64' - engine: 'wasmtime' - repo: 'com_github_bytecodealliance_wasmtime' os: windows-2019 arch: x86_64 action: test - - name: 'WAVM on Linux/x86_64' - engine: 'wavm' - repo: 'com_github_wavm_wavm' - os: ubuntu-20.04 - arch: x86_64 - action: test - flags: --config=clang cache: true steps: @@ -223,6 +138,7 @@ jobs: - name: Set cache key if: ${{ matrix.cache }} + shell: bash run: echo "::set-output name=uniq::$(bazel query --output build //external:${{ matrix.repo }} | grep -E 'sha256|commit' | cut -d\" -f2)" id: cache-key @@ -252,6 +168,28 @@ jobs: echo "filegroup(name = \"$i\", srcs = [\"$i.wasm\"])" >> test/test_data/BUILD; \ done + - name: Generate V8 inspector files + if: ${{ matrix.engine == 'v8' }} + run: > + ${{ matrix.run_under }} + bazel build + --verbose_failures + --test_output=errors + --define engine=${{ matrix.engine }} + ${{ matrix.flags }} + @v8//:generated_inspector_files + + - name: Generate V8 torque files + if: ${{ matrix.engine == 'v8' }} + run: > + ${{ matrix.run_under }} + bazel build + --verbose_failures + --test_output=errors + --define engine=${{ matrix.engine }} + ${{ matrix.flags }} + @v8//:noicu/generated_torque_files + - name: Bazel build/test run: > ${{ matrix.run_under }} diff --git a/bazel/external/v8.patch b/bazel/external/v8.patch index 52af7b6ad..c04baf2b3 100644 --- a/bazel/external/v8.patch +++ b/bazel/external/v8.patch @@ -1,5 +1,6 @@ # 1. Disable pointer compression (limits the maximum number of WasmVMs). # 2. Don't expose Wasm C API (only Wasm C++ API). +# 3. Fix linking on Windows. diff --git a/BUILD.bazel b/BUILD.bazel index 5fb10d3940..a19930d36e 100644 @@ -14,6 +15,18 @@ index 5fb10d3940..a19930d36e 100644 ) # Default setting for v8_enable_pointer_compression. +diff --git a/bazel/defs.bzl b/bazel/defs.bzl +index 0e9559a65f..c289f3e866 100644 +--- a/bazel/defs.bzl ++++ b/bazel/defs.bzl +@@ -137,6 +137,7 @@ def _default_args(): + ], + "@v8//bazel/config:is_windows": [ + "/std:c++17", ++ "/O1", + ], + "//conditions:default": [], + }) + select({ diff --git a/src/wasm/c-api.cc b/src/wasm/c-api.cc index ce3f569fd5..dc8a4c4f6a 100644 --- a/src/wasm/c-api.cc