Repository navigation
Remove x64 exception handling code and support aarch64 #562
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
5cfba39
98cba7d
4afce70
a7478f6
073b101
e41caf1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| [target.'cfg(target_os = "macos")'] | ||
| runner = "dev/macos-sign-and-run.sh" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -23,6 +23,15 @@ permissions: | |
| jobs: | ||
| build-docker-image: | ||
| if: ${{ inputs.docs_only == 'false' || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }} | ||
| strategy: | ||
| matrix: | ||
| arch: | ||
| - name: X64 | ||
| runner: ubuntu-latest | ||
| docker-platform: linux/amd64 | ||
| - name: arm64 | ||
| runner: ubuntu-24.04-arm | ||
| docker-platform: linux/arm64 | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v5 | ||
|
|
@@ -46,15 +55,18 @@ jobs: | |
| with: | ||
| images: ${{ github.repository_owner }}/wasm-clang-builder | ||
| - name: Calculate ghcr cache destination | ||
| id: ghcr-dest | ||
| env: | ||
| CAN_WRITE: ${{ (github.event_name != 'pull_request' || github.event.pull_request.head.repo.fork == false) && github.actor != 'dependabot[bot]' }} | ||
| run: | | ||
| if [ "$CAN_WRITE" = "true" ]; then | ||
| echo "CACHE_TO=type=registry,ref=ghcr.io/${{ github.repository_owner }}/wasm-clang-builder:buildcache,mode=max" >> $GITHUB_ENV | ||
| echo "DO_PUSH=true" >> $GITHUB_ENV | ||
| echo "DO_PUSH=false" >> $GITHUB_OUTPUT | ||
| else | ||
| echo "CACHE_TO=type=local,dest=/tmp/wasm-clang-builder-cache/" >> $GITHUB_ENV | ||
| echo "DO_PUSH=false" >> $GITHUB_ENV | ||
| echo "DO_PUSH=false" >> $GITHUB_OUTPUT | ||
| fi | ||
| - name: Build and push wasm-clang-builder | ||
| # Only push if not from a fork, not from pull request, and not from dependabot | ||
|
|
@@ -67,28 +79,61 @@ jobs: | |
| build-args: | | ||
| WASI_SDK_VERSION_FULL=25.0 | ||
| GCC_VERSION=12 | ||
| tags: ghcr.io/${{ github.repository_owner }}/wasm-clang-builder:latest | ||
| platforms: ${{ matrix.arch.docker-platform }} | ||
| tags: ghcr.io/${{ github.repository_owner }}/wasm-clang-builder:latest-${{ matrix.arch.name }} | ||
| cache-from: type=registry,ref=ghcr.io/${{ github.repository_owner }}/wasm-clang-builder:buildcache | ||
| cache-to: ${{ env.CACHE_TO }} | ||
| outputs: | ||
| do_push: ${{ steps.ghcr-dest.outputs.DO_PUSH }} | ||
|
|
||
| build-wasm-examples: | ||
| merge-docker-image: | ||
| needs: build-docker-image | ||
| if: ${{ needs.build-docker-image.outputs.do_push }} | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Login to Registry | ||
| uses: docker/login-action@v3 | ||
| with: | ||
| registry: ghcr.io | ||
| username: ${{ github.actor }} | ||
| password: ${{ secrets.GITHUB_TOKEN }} | ||
| - name: Create manifest | ||
| run: | | ||
| docker buildx imagetools create -t ghcr.io/${{ github.repository_owner }}/wasm-clang-builder:latest \ | ||
| ghcr.io/${{ github.repository_owner }}/wasm-clang-builder:latest-X64 \ | ||
| ghcr.io/${{ github.repository_owner }}/wasm-clang-builder:latest-arm64 | ||
|
|
||
| build-wasm-examples: | ||
| needs: merge-docker-image | ||
| # Required because merge-docker-image is skipped on some runs, | ||
| # and a skipped dependency transitively skips all downstream | ||
| # jobs. See: https://github.com/actions/runner/issues/2205 | ||
| if: ${{ !cancelled() && !failure() }} | ||
| strategy: | ||
| matrix: | ||
| wasmtime_version: | ||
| - name: lts | ||
| features: "" | ||
| - name: latest | ||
| features: "wasmtime_latest" | ||
| arch: | ||
| - name: X64 | ||
| runner: ubuntu-latest | ||
| - name: arm64 | ||
| runner: ubuntu-24.04-arm | ||
| runs-on: ${{ matrix.arch.runner }} | ||
| env: | ||
| CI_BUILD_WASM_MODULES: true | ||
| steps: | ||
| - uses: actions/checkout@v5 | ||
| with: | ||
| fetch-depth: 0 | ||
| - name: Remove default clang | ||
| run: sudo rm /usr/bin/clang | ||
| - name: Fake /dev/kvm for ci-setup-workflow action | ||
| run: sudo touch /dev/kvm | ||
| - name: Hyperlight setup workflow | ||
| uses: hyperlight-dev/ci-setup-workflow@v1.8.0 | ||
| uses: hyperlight-dev/ci-setup-workflow@v2.3.1 | ||
| with: | ||
| rust-toolchain: "1.94" | ||
| - name: Set up Docker Buildx | ||
|
|
@@ -110,6 +155,6 @@ jobs: | |
| - name: Upload Wasm Modules (wasmtime ${{ matrix.wasmtime_version.name }}) | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: guest-modules-${{ matrix.wasmtime_version.name }} | ||
| name: guest-modules-${{ matrix.arch.name }}-${{ matrix.wasmtime_version.name }} | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you update the release workflow to download |
||
| path: | | ||
| x64/release/*.aot | ||
| build/release/*.aot | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -39,39 +39,71 @@ jobs: | |
| # failed-job rerun does not need to repeat the entire matrix. | ||
| fail-fast: false | ||
| matrix: | ||
| hypervisor: [hyperv, mshv3, kvm] # hyperv is windows, mshv and kvm are linux | ||
| cpu: [amd, intel] | ||
| hypervisor: [hyperv, mshv3, kvm, hvf] # hyperv is windows, mshv and kvm are linux | ||
| cpu: [amd, intel, apple, microsoft] | ||
| arch: [X64, arm64] | ||
| config: [debug, release] | ||
| wasmtime: [latest, lts] | ||
| exclude: | ||
| # Latest testing: skip debug builds to reduce CI load | ||
| - wasmtime: latest | ||
| config: debug | ||
|
|
||
| runs-on: ${{ fromJson( | ||
| format('["self-hosted", "{0}", "X64", "1ES.Pool=hld-{1}-{2}", "JobId=build-{3}-{4}-{5}-{6}-{7}"]', | ||
| matrix.hypervisor == 'hyperv' && 'Windows' || 'Linux', | ||
| matrix.hypervisor == 'hyperv' && 'win2025' || matrix.hypervisor == 'mshv3' && 'azlinux3-mshv' || matrix.hypervisor, | ||
| matrix.cpu, | ||
| matrix.config, | ||
| matrix.wasmtime, | ||
| github.run_id, | ||
| github.run_number, | ||
| github.run_attempt)) }} | ||
| - cpu: apple | ||
| hypervisor: hyperv | ||
| - cpu: apple | ||
| hypervisor: mshv3 | ||
| - cpu: microsoft | ||
| hypervisor: mshv3 | ||
| - cpu: microsoft | ||
| hypervisor: kvm | ||
| - cpu: microsoft | ||
| hypervisor: hvf | ||
| - arch: X64 | ||
| hypervisor: hvf | ||
| - cpu: amd | ||
| arch: arm64 | ||
| - cpu: intel | ||
| arch: arm64 | ||
| - cpu: apple | ||
| arch: X64 | ||
| - cpu: microsoft | ||
| arch: X64 | ||
| runs-on: ${{ fromJson(matrix.arch == 'X64' | ||
| && format('["self-hosted", "{0}", "X64", "1ES.Pool=hld-{1}-{2}", "JobId=build-{3}-{4}-{5}-{6}-{7}"]', | ||
| matrix.hypervisor == 'hyperv' && 'Windows' || 'Linux', | ||
| matrix.hypervisor == 'hyperv' && 'win2025' || matrix.hypervisor == 'mshv3' && 'azlinux3-mshv' || matrix.hypervisor, | ||
| matrix.cpu, | ||
| matrix.config, | ||
| matrix.wasmtime, | ||
| github.run_id, | ||
| github.run_number, | ||
| github.run_attempt) | ||
| || matrix.hypervisor == 'hyperv' | ||
| && format('["self-hosted", "Windows", "ARM64", "1ES.Pool=hl-windows-arm", "JobId=build-{0}-{1}-{2}-{3}"]', | ||
| matrix.config, | ||
| matrix.run_id, | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you use |
||
| matrix.run_number, | ||
| matrix.run_attempt) | ||
| || format('["self-hosted", "{0}", "arm64", "{1}"]', | ||
| matrix.hypervisor == 'hvf' && 'macos' || 'Linux', | ||
| matrix.hypervisor)) }} | ||
| env: | ||
| # Features to pass to cargo. | ||
| # On Windows LTS builds, do not pass any features. | ||
| # On Windows latest builds, only add wasmtime_latest. | ||
| # On Linux, always pass the hypervisor feature (kvm/mshv3). | ||
| # On Linux latest builds, also add wasmtime_latest. | ||
| FEATURES: ${{ matrix.hypervisor != 'hyperv' && format('{0}{1}', matrix.hypervisor, matrix.wasmtime == 'latest' && ',wasmtime_latest' || '') || (matrix.wasmtime == 'latest' && 'wasmtime_latest' || '') }} | ||
| JUST_OVERRIDE_ARCH: ${{ matrix.arch == 'X64' && 'x86_64' || 'aarch64' }} | ||
| steps: | ||
| - uses: actions/checkout@v5 | ||
|
|
||
| - name: Hyperlight setup | ||
| uses: hyperlight-dev/ci-setup-workflow@v1.8.0 | ||
| uses: hyperlight-dev/ci-setup-workflow@v2.3.1 | ||
| with: | ||
| rust-toolchain: "1.94" | ||
| additional-toolchain-directory: src/tests/rust_guests | ||
| just-version: 1.59.0 | ||
|
|
||
| - name: Add Nightly Rust | ||
| run: | | ||
|
|
@@ -86,11 +118,32 @@ jobs: | |
| if: runner.os == 'Windows' | ||
| run: rustup component add --toolchain nightly-x86_64-pc-windows-msvc rustfmt | ||
|
|
||
| - name: Configure ARM64 libclang | ||
| if: runner.os == 'Windows' && matrix.arch == 'arm64' | ||
| shell: pwsh | ||
| run: | | ||
| if (-not $env:VSINSTALLDIR) { | ||
| throw "Visual Studio developer environment did not set VSINSTALLDIR" | ||
| } | ||
| $libclang = Join-Path $env:VSINSTALLDIR "VC\Tools\Llvm\ARM64\bin\libclang.dll" | ||
| if (-not (Test-Path $libclang)) { | ||
| throw "ARM64 libclang not found at '$libclang'" | ||
| } | ||
| $llvmPath = Split-Path $libclang | ||
| "LIBCLANG_PATH=$llvmPath" >> $env:GITHUB_ENV | ||
| $llvmPath >> $env:GITHUB_PATH | ||
| - name: Install clang tools (macOS) | ||
| if: ${{ runner.os == 'macOS' }} | ||
| run: | | ||
| brew install llvm | ||
| echo "$(brew --prefix llvm)/bin" >> "$GITHUB_PATH" | ||
| - name: Download Wasm Modules | ||
| uses: actions/download-artifact@v5 | ||
| with: | ||
| name: guest-modules-${{ matrix.wasmtime }} | ||
| path: ./x64/${{ matrix.config }} | ||
| name: guest-modules-${{ matrix.arch }}-${{ matrix.wasmtime }} | ||
| path: ./build/${{ matrix.config }} | ||
|
|
||
| - name: Build Rust component model examples | ||
| run: | | ||
|
|
@@ -144,38 +197,76 @@ jobs: | |
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| hypervisor: [hyperv, mshv3, kvm] | ||
| cpu: [amd, intel] | ||
| hypervisor: [hyperv, mshv3, kvm, hvf] | ||
| cpu: [amd, intel, apple, microsoft] | ||
| arch: [X64, arm64] | ||
| wasmtime: [lts] | ||
| exclude: | ||
| # Latest testing: skip debug builds to reduce CI load | ||
| - cpu: apple | ||
| hypervisor: hyperv | ||
| - cpu: apple | ||
| hypervisor: mshv3 | ||
| - cpu: microsoft | ||
| hypervisor: mshv3 | ||
| - cpu: microsoft | ||
| hypervisor: kvm | ||
| - cpu: microsoft | ||
| hypervisor: hvf | ||
| - arch: X64 | ||
| hypervisor: hvf | ||
| - cpu: amd | ||
| arch: arm64 | ||
| - cpu: intel | ||
| arch: arm64 | ||
| - cpu: apple | ||
| arch: X64 | ||
| - cpu: microsoft | ||
| arch: X64 | ||
| include: | ||
| - hypervisor: kvm | ||
| cpu: amd | ||
| arch: X64 | ||
| wasmtime: latest | ||
|
|
||
| runs-on: ${{ fromJson( | ||
| format('["self-hosted", "{0}", "X64", "1ES.Pool=hld-{1}-{2}", "JobId=benchmark-{3}-{4}-{5}-{6}"]', | ||
| matrix.hypervisor == 'hyperv' && 'Windows' || 'Linux', | ||
| matrix.hypervisor == 'hyperv' && 'win2025' || matrix.hypervisor == 'mshv3' && 'azlinux3-mshv' || matrix.hypervisor, | ||
| matrix.cpu, | ||
| matrix.wasmtime, | ||
| github.run_id, | ||
| github.run_number, | ||
| github.run_attempt)) }} | ||
| runs-on: ${{ fromJson(matrix.arch == 'X64' | ||
| && format('["self-hosted", "{0}", "X64", "1ES.Pool=hld-{1}-{2}", "JobId=benchmark-{3}-{4}-{5}-{6}"]', | ||
| matrix.hypervisor == 'hyperv' && 'Windows' || 'Linux', | ||
| matrix.hypervisor == 'hyperv' && 'win2025' || matrix.hypervisor == 'mshv3' && 'azlinux3-mshv' || matrix.hypervisor, | ||
| matrix.cpu, | ||
| matrix.wasmtime, | ||
| github.run_id, | ||
| github.run_number, | ||
| github.run_attempt) | ||
| || matrix.hypervisor == 'hyperv' | ||
| && format('["self-hosted", "Windows", "ARM64", "1ES.Pool=hl-windows-arm", "JobId=build-{0}-{1}-{2}"]', | ||
| matrix.run_id, | ||
| matrix.run_number, | ||
| matrix.run_attempt) | ||
| || format('["self-hosted", "{0}", "arm64", "{1}"]', | ||
| matrix.hypervisor == 'hvf' && 'macos' || 'Linux', | ||
| matrix.hypervisor)) }} | ||
| env: | ||
| FEATURES: ${{ matrix.hypervisor != 'hyperv' && format('{0}{1}', matrix.hypervisor, matrix.wasmtime == 'latest' && ',wasmtime_latest' || '') || (matrix.wasmtime == 'latest' && 'wasmtime_latest' || '') }} | ||
| steps: | ||
| - uses: actions/checkout@v5 | ||
|
|
||
| - name: Hyperlight setup | ||
| uses: hyperlight-dev/ci-setup-workflow@v1.8.0 | ||
| uses: hyperlight-dev/ci-setup-workflow@v2.3.1 | ||
| with: | ||
| rust-toolchain: "1.94" | ||
|
|
||
| - name: Install clang tools (macOS) | ||
| if: ${{ runner.os == 'macOS' }} | ||
| run: | | ||
| brew install llvm | ||
| echo "$(brew --prefix llvm)/bin" >> "$GITHUB_PATH" | ||
| - name: Download Wasm Modules | ||
| uses: actions/download-artifact@v5 | ||
| with: | ||
| name: guest-modules-${{ matrix.wasmtime }} | ||
| path: ./x64/release | ||
| name: guest-modules-${{ matrix.arch }}-${{ matrix.wasmtime }} | ||
| path: ./build/release | ||
|
|
||
| - name: Download benchmarks from "latest" | ||
| run: just bench-download ${{ runner.os }} ${{ matrix.hypervisor }} ${{ matrix.cpu }} dev-latest | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you emit
truein the writable branch and compare this output with'true'? Both branches currently emit the stringfalse, which is truthy here. Fork and Dependabot runs would attempt a registry push.