Skip to content

Commit

Permalink
Merge with upstream (#118)
Browse files Browse the repository at this point in the history
  • Loading branch information
dhil authored Mar 1, 2024
2 parents ae380fd + d097c63 commit a496060
Show file tree
Hide file tree
Showing 67 changed files with 3,164 additions and 413 deletions.
48 changes: 34 additions & 14 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,16 @@ jobs:
GH_TOKEN: ${{ github.token }}

# Check Code style quickly by running `clang-format` over all the C/C++ code
#
# Note that `wasmtime-platform.h` is excluded here as it's auto-generated.
clangformat:
name: Clang format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- run: git ls-files '*.h' '*.c' '*.cpp' | xargs clang-format-15 --dry-run --Werror --verbose
- run: git ls-files '*.h' '*.c' '*.cpp' | grep -v wasmtime-platform.h | xargs clang-format-15 --dry-run --Werror --verbose

# common logic to cancel the entire run if this job fails
- run: gh run cancel ${{ github.run_id }}
Expand Down Expand Up @@ -134,7 +136,7 @@ jobs:
test-matrix: ${{ steps.calculate.outputs.test-matrix }}
build-matrix: ${{ steps.calculate.outputs.build-matrix }}
test-capi: ${{ steps.calculate.outputs.test-capi }}
build-fuzz: ${{ steps.calculate.outputs.build-fuzz }}
test-nightly: ${{ steps.calculate.outputs.test-nightly }}
audit: ${{ steps.calculate.outputs.audit }}
preview1-adapter: ${{ steps.calculate.outputs.preview1-adapter }}
steps:
Expand Down Expand Up @@ -162,7 +164,10 @@ jobs:
echo test-capi=true >> $GITHUB_OUTPUT
fi
if grep -q fuzz names.log; then
echo build-fuzz=true >> $GITHUB_OUTPUT
echo test-nightly=true >> $GITHUB_OUTPUT
fi
if grep -q sys.custom names.log; then
echo test-nightly=true >> $GITHUB_OUTPUT
fi
if grep -q Cargo.lock names.log; then
echo audit=true >> $GITHUB_OUTPUT
Expand All @@ -184,7 +189,7 @@ jobs:
if [ "$run_full" = "true" ]; then
echo run-full=true >> $GITHUB_OUTPUT
echo test-capi=true >> $GITHUB_OUTPUT
echo build-fuzz=true >> $GITHUB_OUTPUT
echo test-nightly=true >> $GITHUB_OUTPUT
echo audit=true >> $GITHUB_OUTPUT
echo preview1-adapter=true >> $GITHUB_OUTPUT
fi
Expand Down Expand Up @@ -380,31 +385,45 @@ jobs:
env:
GH_TOKEN: ${{ github.token }}

# Verify all fuzz targets compile successfully
fuzz_targets:
# Run tests that require a nightly compiler, such as building fuzz targets.
test_nightly:
needs: determine
if: needs.determine.outputs.build-fuzz
name: Fuzz Targets
# TODO(dhil): The min platform is unsupported. Disable for now.
#if: needs.determine.outputs.test-nightly
if: false
name: Nightly tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
# Note that building with fuzzers requires nightly since it uses unstable
# flags to rustc.
# Note that nightly is pinned here to insulate us from breakage that might
# happen upstream. This is periodically updated through a PR.
- uses: ./.github/actions/install-rust
with:
toolchain: nightly-2024-02-22
- run: cargo install cargo-fuzz --vers "^0.11"

# Ensure that fuzzers sitll build.
#
# Install the OCaml packages necessary for fuzz targets that use the
# `wasm-spec-interpreter`.
- run: cargo install cargo-fuzz --vers "^0.11"
- run: sudo apt-get update && sudo apt install -y ocaml-nox ocamlbuild ocaml-findlib libzarith-ocaml-dev
- run: cargo fetch
working-directory: ./fuzz
- run: cargo fuzz build --dev -s none
# Check that the ISLE fuzz targets build too.
- run: cargo fuzz build --dev -s none --fuzz-dir ./cranelift/isle/fuzz

# Verify the "min platform" example still works.
#
# Afterwards make sure the generated header file is up to date by ensuring
# that the regeneration process didn't change anything in-tree.
# - run: cargo install cbindgen --vers "^0.26"
# - run: rustup component add rust-src
# - run: ./build.sh ./embedding/x86_64-unknown-unknown.json
# working-directory: ./examples/min-platform
# - run: git diff --exit-code

# common logic to cancel the entire run if this job fails
- run: gh run cancel ${{ github.run_id }}
if: failure() && github.event_name != 'pull_request'
Expand Down Expand Up @@ -607,7 +626,6 @@ jobs:

build-wasmtime-target-wasm32:
name: Build wasmtime-target-wasm32
needs: determine
# TODO(dhil): This platform is unsupported.
if: false
runs-on: ubuntu-latest
Expand Down Expand Up @@ -812,18 +830,20 @@ jobs:
- test
- build
- rustfmt
- clangformat
- cargo_deny
- cargo_vet
- doc
- checks
- checks_winarm64
- fuzz_targets
- test_nightly
- bench
- meta_deterministic_check
- verify-publish
- determine
- miri
- build-preview1-component-adapter
- build-wasmtime-target-wasm32
if: always()
steps:
- name: Dump needs context
Expand Down
Loading

0 comments on commit a496060

Please sign in to comment.