From e88f5f1ae15c34229fe2d4cc31dccdb845e2c423 Mon Sep 17 00:00:00 2001 From: "M.Amin Rayej" Date: Fri, 18 Oct 2024 12:15:07 +0330 Subject: [PATCH 01/45] add build steps for interpreter backends --- .github/workflows/build.yml | 97 +- .github/workflows/test.yaml | 2176 ++++++++--------- .github/workflows/wasmer-config.yaml | 98 +- .../workflows/wasmer-integration-tests.yaml | 98 +- 4 files changed, 1258 insertions(+), 1211 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 08fe9a06f13..8f16f8d6f81 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -12,6 +12,9 @@ on: tags: # this is _not_ a regex, see: https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#filter-pattern-cheat-sheet - '[0-9]+.[0-9]+.[0-9]+*' + pull_request: # TODO: MUST BE REMOVED! ONLY FOR TESTING + branches: + - 'main' # Run jobs on PRs targeting the 'main' branch workflow_dispatch: inputs: release: @@ -51,6 +54,30 @@ jobs: use_sccache: false use_llvm: true build_wasm: true + - build: linux-x64-v8 + os: ubuntu-20.04 + artifact_name: 'wasmer-v8-linux-amd64' + llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-amd64.tar.xz' + cross_compilation_artifact_name: 'cross_compiled_from_linux' + use_sccache: false + use_llvm: true + build_wasm: true + - build: linux-x64-wamr + os: ubuntu-20.04 + artifact_name: 'wasmer-wamr-linux-amd64' + llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-amd64.tar.xz' + cross_compilation_artifact_name: 'cross_compiled_from_linux' + use_sccache: false + use_llvm: true + build_wasm: true + - build: linux-x64-wasmi + os: ubuntu-20.04 + artifact_name: 'wasmer-wasmi-linux-amd64' + llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-amd64.tar.xz' + cross_compilation_artifact_name: 'cross_compiled_from_linux' + use_sccache: false + use_llvm: true + build_wasm: true - build: macos-x64 os: macos-12 llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-amd64.tar.xz' @@ -93,6 +120,10 @@ jobs: - name: Set up base deps on musl if: matrix.build == 'linux-musl-x64' run: ./scripts/alpine-linux-install-deps.sh + - name: Install mold + if: startsWith(matrix.build, 'linux') + run: | + apt update && apt install mold - name: Install Rust uses: dtolnay/rust-toolchain@stable with: @@ -203,6 +234,22 @@ jobs: make build-wasmer env: ENABLE_LLVM: 1 + - name: Build Wasmer with v8 backend + if: endsWith(matrix.build, 'v8') + run: | + if [ "${{ matrix.build }}" == "linux-x64-v8" ] || [ "${{ matrix.build }}" == "linux-musl-x64-v8" ]; then + RUSTFLAGS="-C linker=clang -C link-arg=-fuse-ld=mold" make build-wasmer-v8 + else + make build-wasmer-v8 + fi + - name: Build Wasmer with wamr backend + if: endsWith(matrix.build, 'wamr') + run: | + make build-wasmer-wamr + - name: Build Wasmer with wasmi backend + if: endsWith(matrix.build, 'wasmi') + run: | + make build-wasmer-wasmi - name: Build Wasmer binary without LLVM if: matrix.use_llvm != true shell: bash @@ -213,31 +260,31 @@ jobs: # shell: bash # run: | # make build-wasmer-wasm - - name: Install Nightly Rust for Headless - if: matrix.build != 'linux-musl-x64' - uses: dtolnay/rust-toolchain@master - with: - toolchain: "nightly-2023-10-05" - target: ${{ matrix.target }} - components: "rust-src" - - name: Build Minimal Wasmer Headless - if: matrix.build != 'linux-musl-x64' - run: | - cargo install xargo - echo "" >> Cargo.toml - echo "[profile.release]" >> Cargo.toml - echo "opt-level = 'z'" >> Cargo.toml - echo "debug = false" >> Cargo.toml - echo "debug-assertions = false" >> Cargo.toml - echo "overflow-checks = false" >> Cargo.toml - echo "lto = true" >> Cargo.toml - echo "panic = 'abort'" >> Cargo.toml - echo "incremental = false" >> Cargo.toml - echo "codegen-units = 1" >> Cargo.toml - echo "rpath = false" >> Cargo.toml - rustup override set nightly-2023-10-05 - make build-wasmer-headless-minimal - rustup override unset + # - name: Install Nightly Rust for Headless + # if: matrix.build != 'linux-musl-x64' + # uses: dtolnay/rust-toolchain@master + # with: + # toolchain: "nightly-2023-10-05" + # target: ${{ matrix.target }} + # components: "rust-src" + # - name: Build Minimal Wasmer Headless + # if: matrix.build != 'linux-musl-x64' + # run: | + # cargo install xargo + # echo "" >> Cargo.toml + # echo "[profile.release]" >> Cargo.toml + # echo "opt-level = 'z'" >> Cargo.toml + # echo "debug = false" >> Cargo.toml + # echo "debug-assertions = false" >> Cargo.toml + # echo "overflow-checks = false" >> Cargo.toml + # echo "lto = true" >> Cargo.toml + # echo "panic = 'abort'" >> Cargo.toml + # echo "incremental = false" >> Cargo.toml + # echo "codegen-units = 1" >> Cargo.toml + # echo "rpath = false" >> Cargo.toml + # rustup override set nightly-2023-10-05 + # make build-wasmer-headless-minimal + # rustup override unset - name: Dist run: | make distribution diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index ddffe58f499..7ea3b591c00 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -1,1135 +1,1135 @@ -name: test-sys +# name: test-sys -on: - push: - branches: - - main - - 'with-ci-.*' - - 'v3.0.x' - - 'v3.1.x' - pull_request: - workflow_dispatch: - inputs: - release: - description: 'Make release' +# on: +# push: +# branches: +# - main +# - 'with-ci-.*' +# - 'v3.0.x' +# - 'v3.1.x' +# pull_request: +# workflow_dispatch: +# inputs: +# release: +# description: 'Make release' -# Automatically cancel previous workflow runs when a new commit is pushed. -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true +# # Automatically cancel previous workflow runs when a new commit is pushed. +# concurrency: +# group: ${{ github.workflow }}-${{ github.ref }} +# cancel-in-progress: true -env: - RUST_BACKTRACE: 1 - # Sparse will be enabled by dtolnay/rust-toolchain when installing nightly - # Rust, but it's not stable on 1.69 yet. By explicitly setting the protocol we - # can override that behaviour - CARGO_REGISTRIES_CRATES_IO_PROTOCOL: git - MSRV: "1.81" - NEXTEST_PROFILE: "ci" - RUSTUP_WINDOWS_PATH_ADD_BIN: 1 - WASI_SDK_VERSION: "22" +# env: +# RUST_BACKTRACE: 1 +# # Sparse will be enabled by dtolnay/rust-toolchain when installing nightly +# # Rust, but it's not stable on 1.69 yet. By explicitly setting the protocol we +# # can override that behaviour +# CARGO_REGISTRIES_CRATES_IO_PROTOCOL: git +# MSRV: "1.81" +# NEXTEST_PROFILE: "ci" +# RUSTUP_WINDOWS_PATH_ADD_BIN: 1 +# WASI_SDK_VERSION: "22" -jobs: - setup: - name: Set up - runs-on: ubuntu-22.04 - outputs: - VERSION: ${{ steps.setup.outputs.VERSION }} - DOING_RELEASE: ${{ steps.setup.outputs.DOING_RELEASE }} - steps: - - name: Set up env vars - id: setup - shell: bash - run: | - VERSION=${GITHUB_REF/refs\/tags\//} - echo "VERSION=${VERSION}" >> $GITHUB_OUTPUT - DOING_RELEASE=$(echo $VERSION | grep -c '^[0-9]\+\.[0-9]\+\.[0-9]\+\(-\([a-zA-Z]\+\)\?[0-9]*\)\?$' || true) - echo "DOING_RELEASE=${DOING_RELEASE}" >> $GITHUB_OUTPUT - echo $VERSION - echo $DOING_RELEASE +# jobs: +# setup: +# name: Set up +# runs-on: ubuntu-22.04 +# outputs: +# VERSION: ${{ steps.setup.outputs.VERSION }} +# DOING_RELEASE: ${{ steps.setup.outputs.DOING_RELEASE }} +# steps: +# - name: Set up env vars +# id: setup +# shell: bash +# run: | +# VERSION=${GITHUB_REF/refs\/tags\//} +# echo "VERSION=${VERSION}" >> $GITHUB_OUTPUT +# DOING_RELEASE=$(echo $VERSION | grep -c '^[0-9]\+\.[0-9]\+\.[0-9]\+\(-\([a-zA-Z]\+\)\?[0-9]*\)\?$' || true) +# echo "DOING_RELEASE=${DOING_RELEASE}" >> $GITHUB_OUTPUT +# echo $VERSION +# echo $DOING_RELEASE - lint: - name: Code lint - runs-on: ubuntu-22.04 - steps: - - uses: actions/checkout@v3 - - name: Install Rust - uses: dtolnay/rust-toolchain@stable - with: - toolchain: ${{ env.MSRV }} - components: rustfmt, clippy - - name: Install libtinfo - shell: bash - run: | - sudo apt install -y libtinfo5 - - name: Install LLVM (Linux) - run: | - curl --proto '=https' --tlsv1.2 -sSf https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-amd64.tar.xz -L -o /opt/llvm.tar.xz - mkdir -p /opt/llvm-18 - tar xf /opt/llvm.tar.xz --strip-components=1 -C /opt/llvm-18 - echo '/opt/llvm-18/bin' >> $GITHUB_PATH - echo 'LLVM_SYS_180_PREFIX=/opt/llvm-18' >> $GITHUB_ENV - - name: Cache - uses: whywaita/actions-cache-s3@v2 - with: - path: | - ~/.cargo/* - ./target/* - key: r22-${{ github.repository }}-${{ runner.os }}-${{ hashFiles('Cargo.lock') }}-wasmer-make-lint-linux-x64 - aws-s3-bucket: wasmer-rust-artifacts-cache - aws-access-key-id: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_TOKEN }} - aws-secret-access-key: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_KEY }} - aws-region: auto - aws-endpoint: https://1541b1e8a3fc6ad155ce67ef38899700.r2.cloudflarestorage.com - aws-s3-bucket-endpoint: false - aws-s3-force-path-style: true - - run: make lint - env: - ENABLE_CRANELIFT: "1" - ENABLE_LLVM: "1" - ENABLE_SINGLEPASS: "1" - - name: Assert no files have changed - run: | - git status - ! [[ $(git status -s) ]] +# lint: +# name: Code lint +# runs-on: ubuntu-22.04 +# steps: +# - uses: actions/checkout@v3 +# - name: Install Rust +# uses: dtolnay/rust-toolchain@stable +# with: +# toolchain: ${{ env.MSRV }} +# components: rustfmt, clippy +# - name: Install libtinfo +# shell: bash +# run: | +# sudo apt install -y libtinfo5 +# - name: Install LLVM (Linux) +# run: | +# curl --proto '=https' --tlsv1.2 -sSf https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-amd64.tar.xz -L -o /opt/llvm.tar.xz +# mkdir -p /opt/llvm-18 +# tar xf /opt/llvm.tar.xz --strip-components=1 -C /opt/llvm-18 +# echo '/opt/llvm-18/bin' >> $GITHUB_PATH +# echo 'LLVM_SYS_180_PREFIX=/opt/llvm-18' >> $GITHUB_ENV +# - name: Cache +# uses: whywaita/actions-cache-s3@v2 +# with: +# path: | +# ~/.cargo/* +# ./target/* +# key: r22-${{ github.repository }}-${{ runner.os }}-${{ hashFiles('Cargo.lock') }}-wasmer-make-lint-linux-x64 +# aws-s3-bucket: wasmer-rust-artifacts-cache +# aws-access-key-id: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_TOKEN }} +# aws-secret-access-key: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_KEY }} +# aws-region: auto +# aws-endpoint: https://1541b1e8a3fc6ad155ce67ef38899700.r2.cloudflarestorage.com +# aws-s3-bucket-endpoint: false +# aws-s3-force-path-style: true +# - run: make lint +# env: +# ENABLE_CRANELIFT: "1" +# ENABLE_LLVM: "1" +# ENABLE_SINGLEPASS: "1" +# - name: Assert no files have changed +# run: | +# git status +# ! [[ $(git status -s) ]] - cargo_deny: - name: cargo-deny - runs-on: ubuntu-22.04 - steps: - - uses: actions/checkout@v3 - - uses: EmbarkStudios/cargo-deny-action@v1 - with: - log-level: error +# cargo_deny: +# name: cargo-deny +# runs-on: ubuntu-22.04 +# steps: +# - uses: actions/checkout@v3 +# - uses: EmbarkStudios/cargo-deny-action@v1 +# with: +# log-level: error - test_nodejs: - name: Test on NodeJS - runs-on: ubuntu-22.04 - steps: - - uses: actions/checkout@v3 - - name: Install Rust - uses: dtolnay/rust-toolchain@stable - with: - toolchain: ${{ env.MSRV }} - - name: Install NodeJS - uses: actions/setup-node@v2 - with: - node-version: 16 - - name: Install wasm-pack - run: | - curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh - - name: make test-js - run: | - make test-js +# test_nodejs: +# name: Test on NodeJS +# runs-on: ubuntu-22.04 +# steps: +# - uses: actions/checkout@v3 +# - name: Install Rust +# uses: dtolnay/rust-toolchain@stable +# with: +# toolchain: ${{ env.MSRV }} +# - name: Install NodeJS +# uses: actions/setup-node@v2 +# with: +# node-version: 16 +# - name: Install wasm-pack +# run: | +# curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh +# - name: make test-js +# run: | +# make test-js - test_wasi_fyi: - name: Test wasi-fyi - runs-on: ubuntu-22.04 - steps: - - uses: actions/checkout@v3 - - name: Install Rust - uses: dtolnay/rust-toolchain@stable - with: - toolchain: nightly - targets: "wasm32-wasi" - - name: Install wasm-pack - run: | - curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh - - name: Install LLVM 18 - run: | - curl --proto '=https' --tlsv1.2 -sSf https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-amd64.tar.xz -L -o llvm.tar.xz - LLVM_DIR=$(pwd)/${{ env.LLVM_DIR }} - mkdir ${LLVM_DIR} - tar xf llvm.tar.xz --strip-components=1 -C ${LLVM_DIR} - echo "ENABLE_LLVM=1" >> $GITHUB_ENV - echo "${LLVM_DIR}/bin" >> $GITHUB_PATH - echo "${LLVM_DIR}/usr/bin" >> $GITHUB_PATH - echo "LLVM_SYS_180_PREFIX=${LLVM_DIR}" >> $GITHUB_ENV - env: - LLVM_DIR: .llvm - - name: make test-wasi-fyi - run: | - make test-wasi-fyi +# test_wasi_fyi: +# name: Test wasi-fyi +# runs-on: ubuntu-22.04 +# steps: +# - uses: actions/checkout@v3 +# - name: Install Rust +# uses: dtolnay/rust-toolchain@stable +# with: +# toolchain: nightly +# targets: "wasm32-wasi" +# - name: Install wasm-pack +# run: | +# curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh +# - name: Install LLVM 18 +# run: | +# curl --proto '=https' --tlsv1.2 -sSf https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-amd64.tar.xz -L -o llvm.tar.xz +# LLVM_DIR=$(pwd)/${{ env.LLVM_DIR }} +# mkdir ${LLVM_DIR} +# tar xf llvm.tar.xz --strip-components=1 -C ${LLVM_DIR} +# echo "ENABLE_LLVM=1" >> $GITHUB_ENV +# echo "${LLVM_DIR}/bin" >> $GITHUB_PATH +# echo "${LLVM_DIR}/usr/bin" >> $GITHUB_PATH +# echo "LLVM_SYS_180_PREFIX=${LLVM_DIR}" >> $GITHUB_ENV +# env: +# LLVM_DIR: .llvm +# - name: make test-wasi-fyi +# run: | +# make test-wasi-fyi - # The no_std functionality doesn't work at the moment - no point in testing it. - # - name: make test-js-core - # run: | - # make test-js-core +# # The no_std functionality doesn't work at the moment - no point in testing it. +# # - name: make test-js-core +# # run: | +# # make test-js-core - test_wasix: - name: Test WASIX - runs-on: ubuntu-22.04 - steps: - - uses: actions/checkout@v3 - - name: Install Rust - uses: dtolnay/rust-toolchain@stable - with: - toolchain: ${{ env.MSRV }} - - name: Install Tools - run: | - sudo apt-get update - sudo apt-get install -y git llvm clang make lld curl - - name: Build wasix sysroot - run: | - cd ~ - git clone --recurse-submodules https://github.com/wasix-org/wasix-libc - cd wasix-libc - ./build32.sh - rm -rf /opt/wasix-sysroot - cp -r sysroot32 ~/wasix-sysroot - - name: Install wasi-sdk Tools - run: | - cd ~ - curl -L "https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-${{ env.WASI_SDK_VERSION }}/wasi-sdk-${{ env.WASI_SDK_VERSION }}.0-linux.tar.gz" -o wasi-sdk.tar.gz - tar -xzf wasi-sdk.tar.gz - cp -r wasi-sdk-${{ env.WASI_SDK_VERSION }}.0 ~/wasi-sdk - - name: Install LLVM 18 - run: | - curl --proto '=https' --tlsv1.2 -sSf https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-amd64.tar.xz -L -o llvm.tar.xz - LLVM_DIR=$(pwd)/${{ env.LLVM_DIR }} - mkdir ${LLVM_DIR} - tar xf llvm.tar.xz --strip-components=1 -C ${LLVM_DIR} - echo "ENABLE_LLVM=1" >> $GITHUB_ENV - echo "${LLVM_DIR}/bin" >> $GITHUB_PATH - echo "${LLVM_DIR}/usr/bin" >> $GITHUB_PATH - echo "LLVM_SYS_180_PREFIX=${LLVM_DIR}" >> $GITHUB_ENV - env: - LLVM_DIR: .llvm - - name: Install wasm-opt - run: | - sudo apt-get install -y binaryen - - name: make test-wasix - run: | - WASI_SDK=~/wasi-sdk WASIX_SYSROOT=~/wasix-sysroot make test-wasix +# test_wasix: +# name: Test WASIX +# runs-on: ubuntu-22.04 +# steps: +# - uses: actions/checkout@v3 +# - name: Install Rust +# uses: dtolnay/rust-toolchain@stable +# with: +# toolchain: ${{ env.MSRV }} +# - name: Install Tools +# run: | +# sudo apt-get update +# sudo apt-get install -y git llvm clang make lld curl +# - name: Build wasix sysroot +# run: | +# cd ~ +# git clone --recurse-submodules https://github.com/wasix-org/wasix-libc +# cd wasix-libc +# ./build32.sh +# rm -rf /opt/wasix-sysroot +# cp -r sysroot32 ~/wasix-sysroot +# - name: Install wasi-sdk Tools +# run: | +# cd ~ +# curl -L "https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-${{ env.WASI_SDK_VERSION }}/wasi-sdk-${{ env.WASI_SDK_VERSION }}.0-linux.tar.gz" -o wasi-sdk.tar.gz +# tar -xzf wasi-sdk.tar.gz +# cp -r wasi-sdk-${{ env.WASI_SDK_VERSION }}.0 ~/wasi-sdk +# - name: Install LLVM 18 +# run: | +# curl --proto '=https' --tlsv1.2 -sSf https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-amd64.tar.xz -L -o llvm.tar.xz +# LLVM_DIR=$(pwd)/${{ env.LLVM_DIR }} +# mkdir ${LLVM_DIR} +# tar xf llvm.tar.xz --strip-components=1 -C ${LLVM_DIR} +# echo "ENABLE_LLVM=1" >> $GITHUB_ENV +# echo "${LLVM_DIR}/bin" >> $GITHUB_PATH +# echo "${LLVM_DIR}/usr/bin" >> $GITHUB_PATH +# echo "LLVM_SYS_180_PREFIX=${LLVM_DIR}" >> $GITHUB_ENV +# env: +# LLVM_DIR: .llvm +# - name: Install wasm-opt +# run: | +# sudo apt-get install -y binaryen +# - name: make test-wasix +# run: | +# WASI_SDK=~/wasi-sdk WASIX_SYSROOT=~/wasix-sysroot make test-wasix - test_wasm_build: - name: Test wasm build - runs-on: ubuntu-22.04 - steps: - - uses: actions/checkout@v3 - - name: rustup target add wasm32-wasi - run: rustup target add wasm32-wasi - - name: make build-wasmer-wasm - run: make build-wasmer-wasm +# test_wasm_build: +# name: Test wasm build +# runs-on: ubuntu-22.04 +# steps: +# - uses: actions/checkout@v3 +# - name: rustup target add wasm32-wasi +# run: rustup target add wasm32-wasi +# - name: make build-wasmer-wasm +# run: make build-wasmer-wasm - test_build_jsc: - name: Test JSC build - runs-on: ubuntu-22.04 - steps: - - uses: actions/checkout@v3 - - uses: dtolnay/rust-toolchain@stable - with: - toolchain: ${{ env.MSRV }} - target: x86_64-unknown-linux-gnu - - name: Install NodeJS - uses: actions/setup-node@v2 - with: - node-version: 16 - - name: Install libjavascriptcoregtk-4.0-dev - run: sudo apt update && sudo apt install -y libjavascriptcoregtk-4.0-dev - - name: make build-wasmer-jsc - run: make build-wasmer-jsc +# test_build_jsc: +# name: Test JSC build +# runs-on: ubuntu-22.04 +# steps: +# - uses: actions/checkout@v3 +# - uses: dtolnay/rust-toolchain@stable +# with: +# toolchain: ${{ env.MSRV }} +# target: x86_64-unknown-linux-gnu +# - name: Install NodeJS +# uses: actions/setup-node@v2 +# with: +# node-version: 16 +# - name: Install libjavascriptcoregtk-4.0-dev +# run: sudo apt update && sudo apt install -y libjavascriptcoregtk-4.0-dev +# - name: make build-wasmer-jsc +# run: make build-wasmer-jsc - test_interpreter_api: - name: ${{ matrix.build-what.name }} on ${{ matrix.metadata.build }} - runs-on: ${{ matrix.metadata.os }} - strategy: - fail-fast: false - matrix: - build-what: [ - { - key: wamr, - build-cmd: 'make test-wamr-api', - name: 'Test API for wamr feature' - }, - { - key: wasmi, - build-cmd: 'make test-wasmi-api', - name: 'Test API for wasmi feature' - }, - { - key: v8, - build-cmd: 'make test-v8-api', - name: 'Test API for v8 feature' - } +# test_interpreter_api: +# name: ${{ matrix.build-what.name }} on ${{ matrix.metadata.build }} +# runs-on: ${{ matrix.metadata.os }} +# strategy: +# fail-fast: false +# matrix: +# build-what: [ +# { +# key: wamr, +# build-cmd: 'make test-wamr-api', +# name: 'Test API for wamr feature' +# }, +# { +# key: wasmi, +# build-cmd: 'make test-wasmi-api', +# name: 'Test API for wasmi feature' +# }, +# { +# key: v8, +# build-cmd: 'make test-v8-api', +# name: 'Test API for v8 feature' +# } - ] - metadata: [ - { - build: linux-x64, - os: ubuntu-22.04, - }, - { - build: macos-arm, - os: macos-14, - }, - { - build: windows-x64, - os: windows-2022, - } - ] - container: ${{ matrix.metadata.container }} - steps: - - uses: actions/checkout@v3 +# ] +# metadata: [ +# { +# build: linux-x64, +# os: ubuntu-22.04, +# }, +# { +# build: macos-arm, +# os: macos-14, +# }, +# { +# build: windows-x64, +# os: windows-2022, +# } +# ] +# container: ${{ matrix.metadata.container }} +# steps: +# - uses: actions/checkout@v3 - - name: Setup MSVC (Windows) - uses: ilammy/msvc-dev-cmd@v1 - if: matrix.metadata.build == 'windows-x64' +# - name: Setup MSVC (Windows) +# uses: ilammy/msvc-dev-cmd@v1 +# if: matrix.metadata.build == 'windows-x64' - - uses: dtolnay/rust-toolchain@stable - with: - toolchain: ${{ env.MSRV }} +# - uses: dtolnay/rust-toolchain@stable +# with: +# toolchain: ${{ env.MSRV }} - - name: Install Nextest - uses: taiki-e/install-action@nextest +# - name: Install Nextest +# uses: taiki-e/install-action@nextest - - name: Install `ninja`, clang` and `mold` on Ubuntu - if: startsWith(matrix.metadata.build, 'linux-') - shell: bash - run: | - sudo apt-get update -y && sudo apt-get install ninja-build clang mold -y +# - name: Install `ninja`, clang` and `mold` on Ubuntu +# if: startsWith(matrix.metadata.build, 'linux-') +# shell: bash +# run: | +# sudo apt-get update -y && sudo apt-get install ninja-build clang mold -y - - name: Install `ninja` on macOS - if: startsWith(matrix.metadata.build, 'macos-') - shell: bash - run: | - brew install ninja +# - name: Install `ninja` on macOS +# if: startsWith(matrix.metadata.build, 'macos-') +# shell: bash +# run: | +# brew install ninja - - name: Install `ninja` on Windows - if: startsWith(matrix.metadata.build, 'windows-') - shell: bash - run: | - choco install ninja +# - name: Install `ninja` on Windows +# if: startsWith(matrix.metadata.build, 'windows-') +# shell: bash +# run: | +# choco install ninja - - name: Delete unwanted link to stop it from interfering (Windows) - shell: bash - run: rm /usr/bin/link.exe - if: startsWith(matrix.metadata.build, 'windows-') +# - name: Delete unwanted link to stop it from interfering (Windows) +# shell: bash +# run: rm /usr/bin/link.exe +# if: startsWith(matrix.metadata.build, 'windows-') - - name: Test WAMR API - if: ${{ matrix.build-what.key == 'wamr' }} - run: ${{ matrix.build-what.build-cmd }} +# - name: Test WAMR API +# if: ${{ matrix.build-what.key == 'wamr' }} +# run: ${{ matrix.build-what.build-cmd }} - - name: Test wasmi API - if: ${{ matrix.build-what.key == 'wasmi' }} - run: ${{ matrix.build-what.build-cmd }} +# - name: Test wasmi API +# if: ${{ matrix.build-what.key == 'wasmi' }} +# run: ${{ matrix.build-what.build-cmd }} - - name: Test v8 API (Linux + mold) - if: ${{ matrix.build-what.key == 'v8' && startsWith(matrix.metadata.build, 'linux-')}} - run: RUSTFLAGS="-C linker=clang -C link-arg=-fuse-ld=mold" CARGO_TERM_VERBOSE=true cargo nextest run --package=wasmer --release --features=v8 --no-default-features +# - name: Test v8 API (Linux + mold) +# if: ${{ matrix.build-what.key == 'v8' && startsWith(matrix.metadata.build, 'linux-')}} +# run: RUSTFLAGS="-C linker=clang -C link-arg=-fuse-ld=mold" CARGO_TERM_VERBOSE=true cargo nextest run --package=wasmer --release --features=v8 --no-default-features - - name: Test v8 API - if: ${{ matrix.build-what.key == 'v8' && !startsWith(matrix.metadata.build, 'linux-')}} - run: ${{ matrix.build-what.build-cmd }} +# - name: Test v8 API +# if: ${{ matrix.build-what.key == 'v8' && !startsWith(matrix.metadata.build, 'linux-')}} +# run: ${{ matrix.build-what.build-cmd }} - test_build_docs_rs: - name: Test build docs rs - runs-on: ubuntu-22.04 - steps: - - uses: actions/checkout@v3 - - uses: dtolnay/rust-toolchain@master - with: - toolchain: "nightly-2024-08-21" - target: x86_64-unknown-linux-gnu - - run: cargo install toml-cli # toml-cli is required to run `make test-build-docs-rs` +# test_build_docs_rs: +# name: Test build docs rs +# runs-on: ubuntu-22.04 +# steps: +# - uses: actions/checkout@v3 +# - uses: dtolnay/rust-toolchain@master +# with: +# toolchain: "nightly-2024-08-21" +# target: x86_64-unknown-linux-gnu +# - run: cargo install toml-cli # toml-cli is required to run `make test-build-docs-rs` - - name: Install `ninja` on Ubuntu - shell: bash - run: | - sudo apt-get install ninja-build -y +# - name: Install `ninja` on Ubuntu +# shell: bash +# run: | +# sudo apt-get install ninja-build -y - - name: Install LLVM 18 - run: | - curl --proto '=https' --tlsv1.2 -sSf https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-amd64.tar.xz -L -o llvm.tar.xz - LLVM_DIR=$(pwd)/${{ env.LLVM_DIR }} - mkdir ${LLVM_DIR} - tar xf llvm.tar.xz --strip-components=1 -C ${LLVM_DIR} - echo "ENABLE_LLVM=1" >> $GITHUB_ENV - echo "${LLVM_DIR}/bin" >> $GITHUB_PATH - echo "${LLVM_DIR}/usr/bin" >> $GITHUB_PATH - echo "LLVM_SYS_180_PREFIX=${LLVM_DIR}" >> $GITHUB_ENV - env: - LLVM_DIR: .llvm - - name: make test-build-docs-rs-ci - run: make test-build-docs-rs-ci +# - name: Install LLVM 18 +# run: | +# curl --proto '=https' --tlsv1.2 -sSf https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-amd64.tar.xz -L -o llvm.tar.xz +# LLVM_DIR=$(pwd)/${{ env.LLVM_DIR }} +# mkdir ${LLVM_DIR} +# tar xf llvm.tar.xz --strip-components=1 -C ${LLVM_DIR} +# echo "ENABLE_LLVM=1" >> $GITHUB_ENV +# echo "${LLVM_DIR}/bin" >> $GITHUB_PATH +# echo "${LLVM_DIR}/usr/bin" >> $GITHUB_PATH +# echo "LLVM_SYS_180_PREFIX=${LLVM_DIR}" >> $GITHUB_ENV +# env: +# LLVM_DIR: .llvm +# - name: make test-build-docs-rs-ci +# run: make test-build-docs-rs-ci - build_linux_aarch64: - name: ${{ matrix.build-what.name }} on linux-aarch64 - runs-on: ubuntu-22.04 - strategy: - fail-fast: false - matrix: - build-what: [ - { - key: capi, - build-cmd: 'make build-capi && make package-capi', - name: 'Build C-API' - }, - { - key: wasmer, - build-cmd: 'make build-wasmer && make package-wasmer && make tar-wasmer', - name: 'Build wasmer-cli' - } - ] - steps: - - uses: actions/checkout@v3 - - uses: dtolnay/rust-toolchain@stable - with: - toolchain: ${{ env.MSRV }} - target: aarch64-unknown-linux-gnu - - name: Build cross image - run: | - docker build -t wasmer/aarch64 ${GITHUB_WORKSPACE}/.github/cross-linux-aarch64/ - env: - CROSS_DOCKER_IN_DOCKER: true - - name: Build ${{ matrix.build-what.key }} - run: | - ${{ matrix.build-what.build-cmd }} - env: - CARGO_BINARY: docker run -v /var/run/docker.sock:/var/run/docker.sock -v ${GITHUB_WORKSPACE}:/project -w /project wasmer/aarch64 cross - CROSS_DOCKER_IN_DOCKER: true - CARGO_TARGET: aarch64-unknown-linux-gnu - PKG_CONFIG_PATH: /usr/lib/aarch64-linux-gnu/pkgconfig - PKG_CONFIG_ALLOW_CROSS: true - ENABLE_LLVM: 0 - - name: Dist - if: ${{ matrix.build-what.key == 'capi' }} - run: | - make distribution - env: - CARGO_BINARY: docker run -v /var/run/docker.sock:/var/run/docker.sock -v ${GITHUB_WORKSPACE}:/project -w /project wasmer/aarch64 cross - CROSS_DOCKER_IN_DOCKER: true - CARGO_TARGET: aarch64-unknown-linux-gnu - PKG_CONFIG_PATH: /usr/lib/aarch64-linux-gnu/pkgconfig - PKG_CONFIG_ALLOW_CROSS: true - TARGET: aarch64-unknown-linux-gnu - TARGET_DIR: target/aarch64-unknown-linux-gnu/release - - name: Upload Artifacts - if: ${{ matrix.build-what.key == 'capi' }} - uses: actions/upload-artifact@v4 - with: - name: capi-linux-aarch64 - path: dist - if-no-files-found: error - retention-days: 2 +# build_linux_aarch64: +# name: ${{ matrix.build-what.name }} on linux-aarch64 +# runs-on: ubuntu-22.04 +# strategy: +# fail-fast: false +# matrix: +# build-what: [ +# { +# key: capi, +# build-cmd: 'make build-capi && make package-capi', +# name: 'Build C-API' +# }, +# { +# key: wasmer, +# build-cmd: 'make build-wasmer && make package-wasmer && make tar-wasmer', +# name: 'Build wasmer-cli' +# } +# ] +# steps: +# - uses: actions/checkout@v3 +# - uses: dtolnay/rust-toolchain@stable +# with: +# toolchain: ${{ env.MSRV }} +# target: aarch64-unknown-linux-gnu +# - name: Build cross image +# run: | +# docker build -t wasmer/aarch64 ${GITHUB_WORKSPACE}/.github/cross-linux-aarch64/ +# env: +# CROSS_DOCKER_IN_DOCKER: true +# - name: Build ${{ matrix.build-what.key }} +# run: | +# ${{ matrix.build-what.build-cmd }} +# env: +# CARGO_BINARY: docker run -v /var/run/docker.sock:/var/run/docker.sock -v ${GITHUB_WORKSPACE}:/project -w /project wasmer/aarch64 cross +# CROSS_DOCKER_IN_DOCKER: true +# CARGO_TARGET: aarch64-unknown-linux-gnu +# PKG_CONFIG_PATH: /usr/lib/aarch64-linux-gnu/pkgconfig +# PKG_CONFIG_ALLOW_CROSS: true +# ENABLE_LLVM: 0 +# - name: Dist +# if: ${{ matrix.build-what.key == 'capi' }} +# run: | +# make distribution +# env: +# CARGO_BINARY: docker run -v /var/run/docker.sock:/var/run/docker.sock -v ${GITHUB_WORKSPACE}:/project -w /project wasmer/aarch64 cross +# CROSS_DOCKER_IN_DOCKER: true +# CARGO_TARGET: aarch64-unknown-linux-gnu +# PKG_CONFIG_PATH: /usr/lib/aarch64-linux-gnu/pkgconfig +# PKG_CONFIG_ALLOW_CROSS: true +# TARGET: aarch64-unknown-linux-gnu +# TARGET_DIR: target/aarch64-unknown-linux-gnu/release +# - name: Upload Artifacts +# if: ${{ matrix.build-what.key == 'capi' }} +# uses: actions/upload-artifact@v4 +# with: +# name: capi-linux-aarch64 +# path: dist +# if-no-files-found: error +# retention-days: 2 - build_linux_riscv64: - name: ${{ matrix.build-what.name }} on linux-riscv64 - runs-on: ubuntu-22.04 - strategy: - fail-fast: false - matrix: - build-what: [ - { - key: capi, - build-cmd: 'make build-capi && make package-capi', - name: 'Build C-API' - }, - { - key: wasmer, - build-cmd: 'make build-wasmer && make package-wasmer && make tar-wasmer', - name: 'Build wasmer-cli' - } - ] - steps: - - uses: actions/checkout@v3 - #- uses: dtolnay/rust-toolchain@stable - # with: - # toolchain: ${{ env.MSRV }} - # target: riscv64gc-unknown-linux-gnu - - name: Build cross image - run: | - docker build -t wasmer/riscv64 ${GITHUB_WORKSPACE}/.github/cross-linux-riscv64/ - env: - CROSS_DOCKER_IN_DOCKER: true - - name: Build ${{ matrix.build-what.key }} - run: | - ${{ matrix.build-what.build-cmd }} - env: - CARGO_BINARY: docker run -v /var/run/docker.sock:/var/run/docker.sock -v ${GITHUB_WORKSPACE}:/project -w /project wasmer/riscv64 cargo - CROSS_DOCKER_IN_DOCKER: true - CARGO_TARGET: riscv64gc-unknown-linux-gnu - ENABLE_LLVM: 0 - - name: Dist - if: ${{ matrix.build-what.key == 'capi' }} - run: | - make distribution - env: - CARGO_BINARY: docker run -v /var/run/docker.sock:/var/run/docker.sock -v ${GITHUB_WORKSPACE}:/project -w /project wasmer/riscv64 cargo - CROSS_DOCKER_IN_DOCKER: true - CARGO_TARGET: riscv64gc-unknown-linux-gnu - PKG_CONFIG_PATH: /usr/lib/riscv64-linux-gnu/pkgconfig - PKG_CONFIG_ALLOW_CROSS: true - TARGET: riscv64gc-unknown-linux-gnu - TARGET_DIR: target/riscv64gc-unknown-linux-gnu/release - - name: Upload Artifacts - if: ${{ matrix.build-what.key == 'capi' }} - uses: actions/upload-artifact@v4 - with: - name: capi-linux-riscv64 - path: dist - if-no-files-found: error - retention-days: 2 +# build_linux_riscv64: +# name: ${{ matrix.build-what.name }} on linux-riscv64 +# runs-on: ubuntu-22.04 +# strategy: +# fail-fast: false +# matrix: +# build-what: [ +# { +# key: capi, +# build-cmd: 'make build-capi && make package-capi', +# name: 'Build C-API' +# }, +# { +# key: wasmer, +# build-cmd: 'make build-wasmer && make package-wasmer && make tar-wasmer', +# name: 'Build wasmer-cli' +# } +# ] +# steps: +# - uses: actions/checkout@v3 +# #- uses: dtolnay/rust-toolchain@stable +# # with: +# # toolchain: ${{ env.MSRV }} +# # target: riscv64gc-unknown-linux-gnu +# - name: Build cross image +# run: | +# docker build -t wasmer/riscv64 ${GITHUB_WORKSPACE}/.github/cross-linux-riscv64/ +# env: +# CROSS_DOCKER_IN_DOCKER: true +# - name: Build ${{ matrix.build-what.key }} +# run: | +# ${{ matrix.build-what.build-cmd }} +# env: +# CARGO_BINARY: docker run -v /var/run/docker.sock:/var/run/docker.sock -v ${GITHUB_WORKSPACE}:/project -w /project wasmer/riscv64 cargo +# CROSS_DOCKER_IN_DOCKER: true +# CARGO_TARGET: riscv64gc-unknown-linux-gnu +# ENABLE_LLVM: 0 +# - name: Dist +# if: ${{ matrix.build-what.key == 'capi' }} +# run: | +# make distribution +# env: +# CARGO_BINARY: docker run -v /var/run/docker.sock:/var/run/docker.sock -v ${GITHUB_WORKSPACE}:/project -w /project wasmer/riscv64 cargo +# CROSS_DOCKER_IN_DOCKER: true +# CARGO_TARGET: riscv64gc-unknown-linux-gnu +# PKG_CONFIG_PATH: /usr/lib/riscv64-linux-gnu/pkgconfig +# PKG_CONFIG_ALLOW_CROSS: true +# TARGET: riscv64gc-unknown-linux-gnu +# TARGET_DIR: target/riscv64gc-unknown-linux-gnu/release +# - name: Upload Artifacts +# if: ${{ matrix.build-what.key == 'capi' }} +# uses: actions/upload-artifact@v4 +# with: +# name: capi-linux-riscv64 +# path: dist +# if-no-files-found: error +# retention-days: 2 - build: - name: ${{ matrix.build-what.name }} on ${{ matrix.metadata.build }} - runs-on: ${{ matrix.metadata.os }} - needs: setup - strategy: - fail-fast: false - matrix: - build-what: [ - { - key: capi, - build-cmd: 'make build-capi && make build-capi-headless && make package-capi && make tar-capi', - name: 'Build and test C-API' - }, - { - key: wasmer, - build-cmd: 'make build-wasmer && make package-wasmer && make tar-wasmer', - name: 'Build wasmer-cli' - } - ] - metadata: [ - { - build: linux-x64, - os: ubuntu-22.04, - target: x86_64-unknown-linux-gnu, - exe: '', - llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-amd64.tar.xz' - }, - { - build: macos-x64, - os: macos-12, - target: x86_64-apple-darwin, - exe: '', - llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-amd64.tar.xz' +# build: +# name: ${{ matrix.build-what.name }} on ${{ matrix.metadata.build }} +# runs-on: ${{ matrix.metadata.os }} +# needs: setup +# strategy: +# fail-fast: false +# matrix: +# build-what: [ +# { +# key: capi, +# build-cmd: 'make build-capi && make build-capi-headless && make package-capi && make tar-capi', +# name: 'Build and test C-API' +# }, +# { +# key: wasmer, +# build-cmd: 'make build-wasmer && make package-wasmer && make tar-wasmer', +# name: 'Build wasmer-cli' +# } +# ] +# metadata: [ +# { +# build: linux-x64, +# os: ubuntu-22.04, +# target: x86_64-unknown-linux-gnu, +# exe: '', +# llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-amd64.tar.xz' +# }, +# { +# build: macos-x64, +# os: macos-12, +# target: x86_64-apple-darwin, +# exe: '', +# llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-amd64.tar.xz' - }, - { - build: macos-arm, - os: macos-14, - target: aarch64-apple-darwin, - exe: '', - # [todo] xdoardo: Reinstate when the code we generate for aarch64 is working correctly. - # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-aarch64.tar.xz' - }, - { - build: windows-x64, - os: windows-2022, - target: x86_64-pc-windows-msvc, - exe: '.exe', - # For now, disable LLVM in `windows-x64.` - # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-windows-amd64.tar.xz' - }, - { - build: windows-gnu, - target: x86_64-pc-windows-gnu, - os: ubuntu-22.04, - }, - { - build: linux-musl, - target: x86_64-unknown-linux-musl, - os: ubuntu-22.04, - exe: '', - container: 'alpine:latest' - } +# }, +# { +# build: macos-arm, +# os: macos-14, +# target: aarch64-apple-darwin, +# exe: '', +# # [todo] xdoardo: Reinstate when the code we generate for aarch64 is working correctly. +# # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-aarch64.tar.xz' +# }, +# { +# build: windows-x64, +# os: windows-2022, +# target: x86_64-pc-windows-msvc, +# exe: '.exe', +# # For now, disable LLVM in `windows-x64.` +# # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-windows-amd64.tar.xz' +# }, +# { +# build: windows-gnu, +# target: x86_64-pc-windows-gnu, +# os: ubuntu-22.04, +# }, +# { +# build: linux-musl, +# target: x86_64-unknown-linux-musl, +# os: ubuntu-22.04, +# exe: '', +# container: 'alpine:latest' +# } - ] - container: ${{ matrix.metadata.container }} - env: - SCCACHE_AZURE_BLOB_CONTAINER: wasmerstoragesccacheblob - SCCACHE_AZURE_CONNECTION_STRING: ${{ secrets.SCCACHE_AZURE_CONNECTION_STRING }} - steps: - - uses: actions/checkout@v3 - - name: Set up libstdc++ on Linux - if: matrix.metadata.build == 'linux-x64' - run: | - sudo apt-get update -y - sudo apt-get install -y --allow-downgrades libstdc++6 libtinfo5 - sudo apt-get install --reinstall g++ - - name: Set up base deps on musl - if: matrix.metadata.build == 'linux-musl' - run: ./scripts/alpine-linux-install-deps.sh - - name: Set up dependencies for Mac OS - run: | - brew install automake - # using gnu-tar is a workaround for https://github.com/actions/cache/issues/403 - brew install gnu-tar - echo PATH="/usr/local/opt/gnu-tar/libexec/gnubin:$PATH" >> $GITHUB_ENV - if: matrix.metadata.os == 'macos-12' - - name: Install Rust - uses: dtolnay/rust-toolchain@stable - with: - toolchain: ${{ env.MSRV }} - target: ${{ matrix.metadata.target }} - - name: Install Nextest - uses: taiki-e/install-action@nextest - - name: Install MSVC dev-cmd (Windows) - uses: ilammy/msvc-dev-cmd@v1 - if: ${{ matrix.metadata.build == 'windows-x64' }} - - name: Delete unwanted link to stop it from interfering (Windows) - shell: bash - run: rm /usr/bin/link.exe - if: ${{ matrix.metadata.build == 'windows-x64' }} - - name: Install Windows-GNU linker - if: ${{ matrix.metadata.build == 'windows-gnu' }} - shell: bash - run: | - sudo apt install -y mingw-w64 - - name: Install Windows-GNU target - if: ${{ matrix.metadata.build == 'windows-gnu' }} - shell: bash - run: | - rustup target add x86_64-pc-windows-gnu - - name: Install Windows 10 SDK with xwin - if: ${{ matrix.metadata.build == 'windows-gnu' }} - shell: bash - run: | - mkdir -p /tmp/xwin - mkdir -p /tmp/xwindownload - mkdir -p /tmp/xwincache - git clone https://github.com/wasmerio/xwin --depth=1 /tmp/xwin - cargo build --release --manifest-path=/tmp/xwin/Cargo.toml - /tmp/xwin/target/release/xwin --accept-license --cache-dir /tmp/xwincache splat --output /tmp/xwindownload - mkdir -p /tmp/winsdk - cp /tmp/xwindownload/sdk/lib/10.0.20348/um/x86_64/WS2_32.lib /tmp/winsdk/ - cp /tmp/xwindownload/sdk/lib/10.0.20348/um/x86_64/KERNEL32.lib /tmp/winsdk/ - cp /tmp/xwindownload/sdk/lib/10.0.20348/um/x86_64/BCRYPT.lib /tmp/winsdk/ - cp /tmp/xwindownload/sdk/lib/10.0.20348/um/x86_64/ADVAPI32.lib /tmp/winsdk/ - cp /tmp/xwindownload/sdk/lib/10.0.20348/um/x86_64/USERENV.lib /tmp/winsdk/ - echo "WinSDK files:" - ls -laH /tmp/winsdk - echo "" - mkdir -p package - mkdir -p package/winsdk - cp -r /tmp/winsdk/* package/winsdk - - name: Install LLVM (macOS Apple Silicon) - if: matrix.metadata.os == 'macos-12' && !matrix.metadata.llvm_url - run: | - brew install llvm - - name: Install LLVM - shell: bash - if: matrix.metadata.llvm_url - run: | - curl --proto '=https' --tlsv1.2 -sSf ${{ matrix.metadata.llvm_url }} -L -o llvm.tar.xz - LLVM_DIR=$(pwd)/${{ env.LLVM_DIR }} - mkdir ${LLVM_DIR} - tar xf llvm.tar.xz --strip-components=1 -C ${LLVM_DIR} - echo "ENABLE_LLVM=1" >> $GITHUB_ENV - echo "${LLVM_DIR}/bin" >> $GITHUB_PATH - echo "${LLVM_DIR}/usr/bin" >> $GITHUB_PATH - echo "LLVM_SYS_180_PREFIX=${LLVM_DIR}" >> $GITHUB_ENV - env: - LLVM_DIR: .llvm - - name: Add `brew` libs to `RUSTFLAGS` - if: matrix.metadata.os == 'macos-14' - shell: bash - run: | - echo "RUSTFLAGS=-L/opt/homebrew/lib" >> $GITHUB_ENV - - name: Setup Rust target - shell: bash - run: | - mkdir -p .cargo - cat << EOF > .cargo/config.toml - [build] - target = "${{ matrix.metadata.target }}" - EOF - if: matrix.metadata.target - - name: which cargo - if: ${{ matrix.build-what.key == 'capi' && matrix.metadata.build == 'windows-x64' }} - run: which cargo - - name: Set cargo env - run: echo "CARGO_ROOT_DIR=$(dirname $(dirname $( which cargo )))" >> $GITHUB_ENV - - name: List root dir - shell: bash - if: ${{ matrix.build-what.key == 'capi' && matrix.metadata.build == 'windows-x64' }} - run: ls -R $CARGO_ROOT_DIR - - name: Cache - uses: whywaita/actions-cache-s3@v2 - with: - path: | - ~/.cargo/* - ./target/* - $CARGO_ROOT_DIR/* - key: r22-${{ github.repository }}-${{ runner.os }}-${{ hashFiles('Cargo.lock') }}-wasmer-make-build-wasmer-${{ matrix.build-what.key }}-${{ matrix.metadata.build }} - aws-s3-bucket: wasmer-rust-artifacts-cache - aws-access-key-id: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_TOKEN }} - aws-secret-access-key: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_KEY }} - aws-region: auto - aws-endpoint: https://1541b1e8a3fc6ad155ce67ef38899700.r2.cloudflarestorage.com - aws-s3-bucket-endpoint: false - aws-s3-force-path-style: true - - name: Build C-API - shell: bash - run: ${{ matrix.build-what.build-cmd }} - if: ${{ matrix.build-what.key == 'capi' }} - env: - TARGET: ${{ matrix.metadata.target }} - TARGET_DIR: target/${{ matrix.metadata.target }}/release - CARGO_TARGET: ${{ matrix.metadata.target }} - - name: Build Wasmer - shell: bash - if: ${{ matrix.build-what.key == 'wasmer' && matrix.metadata.build != 'windows-gnu' }} - run: ${{ matrix.build-what.build-cmd }} - env: - TARGET: ${{ matrix.metadata.target }} - TARGET_DIR: target/${{ matrix.metadata.target }}/release - CARGO_TARGET: ${{ matrix.metadata.target }} - - name: Test C-API - shell: bash - if: ${{ matrix.build-what.key == 'capi' && !(matrix.metadata.build == 'linux-musl' || matrix.metadata.build == 'windows-gnu') }} - run: make test-capi-ci - env: - TARGET: ${{ matrix.metadata.target }} - TARGET_DIR: target/${{ matrix.metadata.target }}/release - CARGO_TARGET: ${{ matrix.metadata.target }} - # C-API tests were disabled for linux-musl and macos-arm (we can't run them) - - name: Test C-API integration - shell: bash - if: ${{ matrix.build-what.key == 'capi' && !(matrix.metadata.build == 'linux-musl' || matrix.metadata.build == 'windows-gnu') }} - run: export WASMER_DIR=`pwd`/package && make test-stage-7-capi-integration-tests - env: - TARGET: ${{ matrix.metadata.target }} - TARGET_DIR: target/${{ matrix.metadata.target }}/release - CARGO_TARGET: ${{ matrix.metadata.target }} - - name: Archive production artifacts - uses: actions/upload-artifact@v4 - with: - name: wasmer-cli-${{ matrix.metadata.build }} - path: build-wasmer.tar.gz - if-no-files-found: ignore - retention-days: 2 - - name: Archive production artifacts - uses: actions/upload-artifact@v4 - with: - name: capi-${{ matrix.metadata.build }} - path: build-capi.tar.gz - if-no-files-found: ignore - retention-days: 2 +# ] +# container: ${{ matrix.metadata.container }} +# env: +# SCCACHE_AZURE_BLOB_CONTAINER: wasmerstoragesccacheblob +# SCCACHE_AZURE_CONNECTION_STRING: ${{ secrets.SCCACHE_AZURE_CONNECTION_STRING }} +# steps: +# - uses: actions/checkout@v3 +# - name: Set up libstdc++ on Linux +# if: matrix.metadata.build == 'linux-x64' +# run: | +# sudo apt-get update -y +# sudo apt-get install -y --allow-downgrades libstdc++6 libtinfo5 +# sudo apt-get install --reinstall g++ +# - name: Set up base deps on musl +# if: matrix.metadata.build == 'linux-musl' +# run: ./scripts/alpine-linux-install-deps.sh +# - name: Set up dependencies for Mac OS +# run: | +# brew install automake +# # using gnu-tar is a workaround for https://github.com/actions/cache/issues/403 +# brew install gnu-tar +# echo PATH="/usr/local/opt/gnu-tar/libexec/gnubin:$PATH" >> $GITHUB_ENV +# if: matrix.metadata.os == 'macos-12' +# - name: Install Rust +# uses: dtolnay/rust-toolchain@stable +# with: +# toolchain: ${{ env.MSRV }} +# target: ${{ matrix.metadata.target }} +# - name: Install Nextest +# uses: taiki-e/install-action@nextest +# - name: Install MSVC dev-cmd (Windows) +# uses: ilammy/msvc-dev-cmd@v1 +# if: ${{ matrix.metadata.build == 'windows-x64' }} +# - name: Delete unwanted link to stop it from interfering (Windows) +# shell: bash +# run: rm /usr/bin/link.exe +# if: ${{ matrix.metadata.build == 'windows-x64' }} +# - name: Install Windows-GNU linker +# if: ${{ matrix.metadata.build == 'windows-gnu' }} +# shell: bash +# run: | +# sudo apt install -y mingw-w64 +# - name: Install Windows-GNU target +# if: ${{ matrix.metadata.build == 'windows-gnu' }} +# shell: bash +# run: | +# rustup target add x86_64-pc-windows-gnu +# - name: Install Windows 10 SDK with xwin +# if: ${{ matrix.metadata.build == 'windows-gnu' }} +# shell: bash +# run: | +# mkdir -p /tmp/xwin +# mkdir -p /tmp/xwindownload +# mkdir -p /tmp/xwincache +# git clone https://github.com/wasmerio/xwin --depth=1 /tmp/xwin +# cargo build --release --manifest-path=/tmp/xwin/Cargo.toml +# /tmp/xwin/target/release/xwin --accept-license --cache-dir /tmp/xwincache splat --output /tmp/xwindownload +# mkdir -p /tmp/winsdk +# cp /tmp/xwindownload/sdk/lib/10.0.20348/um/x86_64/WS2_32.lib /tmp/winsdk/ +# cp /tmp/xwindownload/sdk/lib/10.0.20348/um/x86_64/KERNEL32.lib /tmp/winsdk/ +# cp /tmp/xwindownload/sdk/lib/10.0.20348/um/x86_64/BCRYPT.lib /tmp/winsdk/ +# cp /tmp/xwindownload/sdk/lib/10.0.20348/um/x86_64/ADVAPI32.lib /tmp/winsdk/ +# cp /tmp/xwindownload/sdk/lib/10.0.20348/um/x86_64/USERENV.lib /tmp/winsdk/ +# echo "WinSDK files:" +# ls -laH /tmp/winsdk +# echo "" +# mkdir -p package +# mkdir -p package/winsdk +# cp -r /tmp/winsdk/* package/winsdk +# - name: Install LLVM (macOS Apple Silicon) +# if: matrix.metadata.os == 'macos-12' && !matrix.metadata.llvm_url +# run: | +# brew install llvm +# - name: Install LLVM +# shell: bash +# if: matrix.metadata.llvm_url +# run: | +# curl --proto '=https' --tlsv1.2 -sSf ${{ matrix.metadata.llvm_url }} -L -o llvm.tar.xz +# LLVM_DIR=$(pwd)/${{ env.LLVM_DIR }} +# mkdir ${LLVM_DIR} +# tar xf llvm.tar.xz --strip-components=1 -C ${LLVM_DIR} +# echo "ENABLE_LLVM=1" >> $GITHUB_ENV +# echo "${LLVM_DIR}/bin" >> $GITHUB_PATH +# echo "${LLVM_DIR}/usr/bin" >> $GITHUB_PATH +# echo "LLVM_SYS_180_PREFIX=${LLVM_DIR}" >> $GITHUB_ENV +# env: +# LLVM_DIR: .llvm +# - name: Add `brew` libs to `RUSTFLAGS` +# if: matrix.metadata.os == 'macos-14' +# shell: bash +# run: | +# echo "RUSTFLAGS=-L/opt/homebrew/lib" >> $GITHUB_ENV +# - name: Setup Rust target +# shell: bash +# run: | +# mkdir -p .cargo +# cat << EOF > .cargo/config.toml +# [build] +# target = "${{ matrix.metadata.target }}" +# EOF +# if: matrix.metadata.target +# - name: which cargo +# if: ${{ matrix.build-what.key == 'capi' && matrix.metadata.build == 'windows-x64' }} +# run: which cargo +# - name: Set cargo env +# run: echo "CARGO_ROOT_DIR=$(dirname $(dirname $( which cargo )))" >> $GITHUB_ENV +# - name: List root dir +# shell: bash +# if: ${{ matrix.build-what.key == 'capi' && matrix.metadata.build == 'windows-x64' }} +# run: ls -R $CARGO_ROOT_DIR +# - name: Cache +# uses: whywaita/actions-cache-s3@v2 +# with: +# path: | +# ~/.cargo/* +# ./target/* +# $CARGO_ROOT_DIR/* +# key: r22-${{ github.repository }}-${{ runner.os }}-${{ hashFiles('Cargo.lock') }}-wasmer-make-build-wasmer-${{ matrix.build-what.key }}-${{ matrix.metadata.build }} +# aws-s3-bucket: wasmer-rust-artifacts-cache +# aws-access-key-id: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_TOKEN }} +# aws-secret-access-key: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_KEY }} +# aws-region: auto +# aws-endpoint: https://1541b1e8a3fc6ad155ce67ef38899700.r2.cloudflarestorage.com +# aws-s3-bucket-endpoint: false +# aws-s3-force-path-style: true +# - name: Build C-API +# shell: bash +# run: ${{ matrix.build-what.build-cmd }} +# if: ${{ matrix.build-what.key == 'capi' }} +# env: +# TARGET: ${{ matrix.metadata.target }} +# TARGET_DIR: target/${{ matrix.metadata.target }}/release +# CARGO_TARGET: ${{ matrix.metadata.target }} +# - name: Build Wasmer +# shell: bash +# if: ${{ matrix.build-what.key == 'wasmer' && matrix.metadata.build != 'windows-gnu' }} +# run: ${{ matrix.build-what.build-cmd }} +# env: +# TARGET: ${{ matrix.metadata.target }} +# TARGET_DIR: target/${{ matrix.metadata.target }}/release +# CARGO_TARGET: ${{ matrix.metadata.target }} +# - name: Test C-API +# shell: bash +# if: ${{ matrix.build-what.key == 'capi' && !(matrix.metadata.build == 'linux-musl' || matrix.metadata.build == 'windows-gnu') }} +# run: make test-capi-ci +# env: +# TARGET: ${{ matrix.metadata.target }} +# TARGET_DIR: target/${{ matrix.metadata.target }}/release +# CARGO_TARGET: ${{ matrix.metadata.target }} +# # C-API tests were disabled for linux-musl and macos-arm (we can't run them) +# - name: Test C-API integration +# shell: bash +# if: ${{ matrix.build-what.key == 'capi' && !(matrix.metadata.build == 'linux-musl' || matrix.metadata.build == 'windows-gnu') }} +# run: export WASMER_DIR=`pwd`/package && make test-stage-7-capi-integration-tests +# env: +# TARGET: ${{ matrix.metadata.target }} +# TARGET_DIR: target/${{ matrix.metadata.target }}/release +# CARGO_TARGET: ${{ matrix.metadata.target }} +# - name: Archive production artifacts +# uses: actions/upload-artifact@v4 +# with: +# name: wasmer-cli-${{ matrix.metadata.build }} +# path: build-wasmer.tar.gz +# if-no-files-found: ignore +# retention-days: 2 +# - name: Archive production artifacts +# uses: actions/upload-artifact@v4 +# with: +# name: capi-${{ matrix.metadata.build }} +# path: build-capi.tar.gz +# if-no-files-found: ignore +# retention-days: 2 - test: - name: ${{ matrix.stage.description }} on ${{ matrix.metadata.build }} - runs-on: ${{ matrix.metadata.os }} - needs: setup - strategy: - fail-fast: false - matrix: - stage: [ - { - description: 'Run wast test suite for all compilers', - make: 'test-stage-0-wast', - }, - { - description: 'Unit-test packages on std', - make: 'test-stage-1-test-all', - }, - { - description: 'Unit-test cranelift on no-std', - make: 'test-stage-2-test-compiler-cranelift-nostd', - }, - { - description: 'Unit-test singlepass on no-std', - make: 'test-stage-3-test-compiler-singlepass-nostd', - }, - { - description: 'Unit-test wasmer-cli', - make: 'test-stage-4-wasmer-cli', - }, - { - description: 'Unit-test examples', - make: 'test-stage-5-test-examples', - } - ] - metadata: [ - # We cannot test on macos-arm since we don't have ARM runners - { - build: linux-x64, - os: ubuntu-22.04, - target: x86_64-unknown-linux-gnu, - exe: '', - llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-amd64.tar.xz' - }, - { - build: macos-x64, - os: macos-12, - target: x86_64-apple-darwin, - exe: '', - llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-amd64.tar.xz' +# test: +# name: ${{ matrix.stage.description }} on ${{ matrix.metadata.build }} +# runs-on: ${{ matrix.metadata.os }} +# needs: setup +# strategy: +# fail-fast: false +# matrix: +# stage: [ +# { +# description: 'Run wast test suite for all compilers', +# make: 'test-stage-0-wast', +# }, +# { +# description: 'Unit-test packages on std', +# make: 'test-stage-1-test-all', +# }, +# { +# description: 'Unit-test cranelift on no-std', +# make: 'test-stage-2-test-compiler-cranelift-nostd', +# }, +# { +# description: 'Unit-test singlepass on no-std', +# make: 'test-stage-3-test-compiler-singlepass-nostd', +# }, +# { +# description: 'Unit-test wasmer-cli', +# make: 'test-stage-4-wasmer-cli', +# }, +# { +# description: 'Unit-test examples', +# make: 'test-stage-5-test-examples', +# } +# ] +# metadata: [ +# # We cannot test on macos-arm since we don't have ARM runners +# { +# build: linux-x64, +# os: ubuntu-22.04, +# target: x86_64-unknown-linux-gnu, +# exe: '', +# llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-amd64.tar.xz' +# }, +# { +# build: macos-x64, +# os: macos-12, +# target: x86_64-apple-darwin, +# exe: '', +# llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-amd64.tar.xz' - }, - { - build: macos-arm64, - os: macos-14, - target: aarch64-apple-darwin, - exe: '', - # [todo] xdoardo: Reinstate when the code we generate for aarch64 is working correctly. - # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-aarch64.tar.xz' - }, - { - build: windows-x64, - os: windows-2022, - target: x86_64-pc-windows-msvc, - exe: '.exe', - # For now, disable LLVM in `windows-x64.` - # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-windows-amd64.tar.xz' - }, - { - build: linux-musl, - target: x86_64-unknown-linux-musl, - os: ubuntu-22.04, - exe: '', - container: 'alpine:latest' - } - ] - container: ${{ matrix.metadata.container }} - env: - SCCACHE_AZURE_BLOB_CONTAINER: wasmerstoragesccacheblob - SCCACHE_AZURE_CONNECTION_STRING: ${{ secrets.SCCACHE_AZURE_CONNECTION_STRING }} - steps: - - uses: actions/checkout@v3 - - name: Set up libstdc++ on Linux - if: matrix.metadata.build == 'linux-x64' - run: | - sudo apt-get update -y - sudo apt-get install -y --allow-downgrades libstdc++6 - sudo apt-get install --reinstall g++ - - name: Set up base deps on musl - if: matrix.metadata.build == 'linux-musl' - run: ./scripts/alpine-linux-install-deps.sh - - name: Install MSVC dev-cmd (Windows) - uses: ilammy/msvc-dev-cmd@v1 - if: ${{ matrix.metadata.build == 'windows-x64' }} - - name: Delete unwanted link to stop it from interfering (Windows) - shell: bash - run: rm /usr/bin/link.exe - if: ${{ matrix.metadata.build == 'windows-x64' }} +# }, +# { +# build: macos-arm64, +# os: macos-14, +# target: aarch64-apple-darwin, +# exe: '', +# # [todo] xdoardo: Reinstate when the code we generate for aarch64 is working correctly. +# # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-aarch64.tar.xz' +# }, +# { +# build: windows-x64, +# os: windows-2022, +# target: x86_64-pc-windows-msvc, +# exe: '.exe', +# # For now, disable LLVM in `windows-x64.` +# # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-windows-amd64.tar.xz' +# }, +# { +# build: linux-musl, +# target: x86_64-unknown-linux-musl, +# os: ubuntu-22.04, +# exe: '', +# container: 'alpine:latest' +# } +# ] +# container: ${{ matrix.metadata.container }} +# env: +# SCCACHE_AZURE_BLOB_CONTAINER: wasmerstoragesccacheblob +# SCCACHE_AZURE_CONNECTION_STRING: ${{ secrets.SCCACHE_AZURE_CONNECTION_STRING }} +# steps: +# - uses: actions/checkout@v3 +# - name: Set up libstdc++ on Linux +# if: matrix.metadata.build == 'linux-x64' +# run: | +# sudo apt-get update -y +# sudo apt-get install -y --allow-downgrades libstdc++6 +# sudo apt-get install --reinstall g++ +# - name: Set up base deps on musl +# if: matrix.metadata.build == 'linux-musl' +# run: ./scripts/alpine-linux-install-deps.sh +# - name: Install MSVC dev-cmd (Windows) +# uses: ilammy/msvc-dev-cmd@v1 +# if: ${{ matrix.metadata.build == 'windows-x64' }} +# - name: Delete unwanted link to stop it from interfering (Windows) +# shell: bash +# run: rm /usr/bin/link.exe +# if: ${{ matrix.metadata.build == 'windows-x64' }} - - name: Set up dependencies for Mac OS - run: | - brew install automake - # using gnu-tar is a workaround for https://github.com/actions/cache/issues/403 - brew install gnu-tar - echo PATH="/usr/local/opt/gnu-tar/libexec/gnubin:$PATH" >> $GITHUB_ENV - if: matrix.metadata.os == 'macos-12' - - name: Install Rust - uses: dtolnay/rust-toolchain@stable - with: - toolchain: ${{ env.MSRV }} - target: ${{ matrix.metadata.target }} - - name: Install Nextest - uses: taiki-e/install-action@nextest - - name: Install LLVM (macOS Apple Silicon) - if: matrix.metadata.os == 'macos-12' && !matrix.metadata.llvm_url - run: | - brew install llvm - - name: Install LLVM - shell: bash - if: matrix.metadata.llvm_url - run: | - curl --proto '=https' --tlsv1.2 -sSf ${{ matrix.metadata.llvm_url }} -L -o llvm.tar.xz - LLVM_DIR=$(pwd)/${{ env.LLVM_DIR }} - mkdir ${LLVM_DIR} - tar xf llvm.tar.xz --strip-components=1 -C ${LLVM_DIR} - echo "${LLVM_DIR}/bin" >> $GITHUB_PATH - echo "${LLVM_DIR}/usr/bin" >> $GITHUB_PATH - echo "LLVM_SYS_180_PREFIX=${LLVM_DIR}" >> $GITHUB_ENV - echo "ENABLE_LLVM=1" >> $GITHUB_ENV - env: - LLVM_DIR: .llvm - - name: Add `brew` libs to `RUSTFLAGS` - if: matrix.metadata.os == 'macos-14' - shell: bash - run: | - echo "RUSTFLAGS=-L/opt/homebrew/lib" >> $GITHUB_ENV - - name: Setup Rust target - shell: bash - run: | - mkdir -p .cargo - cat << EOF > .cargo/config.toml - [build] - target = "${{ matrix.metadata.target }}" - EOF - if: matrix.metadata.target - - name: Cache - uses: whywaita/actions-cache-s3@v2 - with: - path: | - ~/.cargo/* - ./target/* - key: r22-${{ github.repository }}-${{ runner.os }}-${{ hashFiles('Cargo.lock') }}-wasmer-make-test-stage-${{ matrix.stage.make }}-${{ matrix.metadata.build }} - aws-s3-bucket: wasmer-rust-artifacts-cache - aws-access-key-id: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_TOKEN }} - aws-secret-access-key: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_KEY }} - aws-region: auto - aws-endpoint: https://1541b1e8a3fc6ad155ce67ef38899700.r2.cloudflarestorage.com - aws-s3-bucket-endpoint: false - aws-s3-force-path-style: true - - name: ${{ matrix.stage.description }} - shell: bash - run: make ${{ matrix.stage.make }} - env: - TARGET: ${{ matrix.metadata.target }} - TARGET_DIR: target/${{ matrix.metadata.target }}/release - CARGO_TARGET: ${{ matrix.metadata.target }} +# - name: Set up dependencies for Mac OS +# run: | +# brew install automake +# # using gnu-tar is a workaround for https://github.com/actions/cache/issues/403 +# brew install gnu-tar +# echo PATH="/usr/local/opt/gnu-tar/libexec/gnubin:$PATH" >> $GITHUB_ENV +# if: matrix.metadata.os == 'macos-12' +# - name: Install Rust +# uses: dtolnay/rust-toolchain@stable +# with: +# toolchain: ${{ env.MSRV }} +# target: ${{ matrix.metadata.target }} +# - name: Install Nextest +# uses: taiki-e/install-action@nextest +# - name: Install LLVM (macOS Apple Silicon) +# if: matrix.metadata.os == 'macos-12' && !matrix.metadata.llvm_url +# run: | +# brew install llvm +# - name: Install LLVM +# shell: bash +# if: matrix.metadata.llvm_url +# run: | +# curl --proto '=https' --tlsv1.2 -sSf ${{ matrix.metadata.llvm_url }} -L -o llvm.tar.xz +# LLVM_DIR=$(pwd)/${{ env.LLVM_DIR }} +# mkdir ${LLVM_DIR} +# tar xf llvm.tar.xz --strip-components=1 -C ${LLVM_DIR} +# echo "${LLVM_DIR}/bin" >> $GITHUB_PATH +# echo "${LLVM_DIR}/usr/bin" >> $GITHUB_PATH +# echo "LLVM_SYS_180_PREFIX=${LLVM_DIR}" >> $GITHUB_ENV +# echo "ENABLE_LLVM=1" >> $GITHUB_ENV +# env: +# LLVM_DIR: .llvm +# - name: Add `brew` libs to `RUSTFLAGS` +# if: matrix.metadata.os == 'macos-14' +# shell: bash +# run: | +# echo "RUSTFLAGS=-L/opt/homebrew/lib" >> $GITHUB_ENV +# - name: Setup Rust target +# shell: bash +# run: | +# mkdir -p .cargo +# cat << EOF > .cargo/config.toml +# [build] +# target = "${{ matrix.metadata.target }}" +# EOF +# if: matrix.metadata.target +# - name: Cache +# uses: whywaita/actions-cache-s3@v2 +# with: +# path: | +# ~/.cargo/* +# ./target/* +# key: r22-${{ github.repository }}-${{ runner.os }}-${{ hashFiles('Cargo.lock') }}-wasmer-make-test-stage-${{ matrix.stage.make }}-${{ matrix.metadata.build }} +# aws-s3-bucket: wasmer-rust-artifacts-cache +# aws-access-key-id: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_TOKEN }} +# aws-secret-access-key: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_KEY }} +# aws-region: auto +# aws-endpoint: https://1541b1e8a3fc6ad155ce67ef38899700.r2.cloudflarestorage.com +# aws-s3-bucket-endpoint: false +# aws-s3-force-path-style: true +# - name: ${{ matrix.stage.description }} +# shell: bash +# run: make ${{ matrix.stage.make }} +# env: +# TARGET: ${{ matrix.metadata.target }} +# TARGET_DIR: target/${{ matrix.metadata.target }}/release +# CARGO_TARGET: ${{ matrix.metadata.target }} - test_integration_cli: - name: CLI integration tests on ${{ matrix.build }} - runs-on: ${{ matrix.os }} - needs: [build, build_linux_aarch64, build_linux_riscv64] - strategy: - fail-fast: false - matrix: - include: - - build: linux-x64 - os: ubuntu-22.04 - target: x86_64-unknown-linux-gnu - llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-amd64.tar.xz' - - build: macos-x64 - os: macos-12 - target: x86_64-apple-darwin - # we only build the integration-test CLI, we don't run tests - - build: macos-arm64 - os: macos-12 - target: aarch64-apple-darwin, - - build: linux-musl - target: x86_64-unknown-linux-musl - os: ubuntu-22.04 - container: alpine:latest - - build: windows-x64 - os: windows-2019 - target: x86_64-pc-windows-msvc - # For now, disable LLVM in `windows-x64.` - # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-windows-amd64.tar.xz' +# test_integration_cli: +# name: CLI integration tests on ${{ matrix.build }} +# runs-on: ${{ matrix.os }} +# needs: [build, build_linux_aarch64, build_linux_riscv64] +# strategy: +# fail-fast: false +# matrix: +# include: +# - build: linux-x64 +# os: ubuntu-22.04 +# target: x86_64-unknown-linux-gnu +# llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-amd64.tar.xz' +# - build: macos-x64 +# os: macos-12 +# target: x86_64-apple-darwin +# # we only build the integration-test CLI, we don't run tests +# - build: macos-arm64 +# os: macos-12 +# target: aarch64-apple-darwin, +# - build: linux-musl +# target: x86_64-unknown-linux-musl +# os: ubuntu-22.04 +# container: alpine:latest +# - build: windows-x64 +# os: windows-2019 +# target: x86_64-pc-windows-msvc +# # For now, disable LLVM in `windows-x64.` +# # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-windows-amd64.tar.xz' - container: ${{ matrix.container }} - env: - SCCACHE_AZURE_BLOB_CONTAINER: wasmerstoragesccacheblob - SCCACHE_AZURE_CONNECTION_STRING: ${{ secrets.SCCACHE_AZURE_CONNECTION_STRING }} - steps: - - uses: actions/checkout@v3 - - uses: goto-bus-stop/setup-zig@v2 - with: - version: 0.10.0 - - name: Set up base deps on musl - if: matrix.build == 'linux-musl' - run: ./scripts/alpine-linux-install-deps.sh - - uses: actions/download-artifact@v4 - id: download - with: - name: capi-${{ matrix.build }} - - uses: actions/download-artifact@v4 - with: - name: wasmer-cli-${{ matrix.build }} - - name: 'Echo download path' - run: echo ${{steps.download.outputs.download-path}} - - name: Install Rust - uses: dtolnay/rust-toolchain@stable - with: - toolchain: ${{ env.MSRV }} - target: ${{ matrix.metadata.target }} - - name: Install Nextest - uses: taiki-e/install-action@nextest - - name: Cache - uses: whywaita/actions-cache-s3@v2 - with: - path: | - ~/.cargo/* - ./target/* - key: r22-${{ github.repository }}-${{ runner.os }}-${{ hashFiles('Cargo.lock') }}-wasmer-make-test-integration-cli-${{ matrix.build }} - aws-s3-bucket: wasmer-rust-artifacts-cache - aws-access-key-id: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_TOKEN }} - aws-secret-access-key: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_KEY }} - aws-region: auto - aws-endpoint: https://1541b1e8a3fc6ad155ce67ef38899700.r2.cloudflarestorage.com - aws-s3-bucket-endpoint: false - aws-s3-force-path-style: true - - name: Prepare package directory - shell: bash - run: | - mkdir -p package - mkdir -p package/cache - - uses: actions/download-artifact@v4 - with: - name: capi-linux-aarch64 - path: package/cache/wasmercache1 - - uses: actions/download-artifact@v4 - with: - name: capi-windows-x64 - path: package/cache/wasmercache2 - - uses: actions/download-artifact@v4 - with: - name: capi-macos-arm - path: package/cache/wasmercache3 - - uses: actions/download-artifact@v4 - with: - name: capi-macos-x64 - path: package/cache/wasmercache4 - - uses: actions/download-artifact@v4 - with: - name: capi-linux-x64 - path: package/cache/wasmercache5 - - uses: actions/download-artifact@v4 - with: - name: capi-linux-riscv64 - path: package/cache/wasmercache6 - - name: Copy .tar.gz files to proper location - shell: bash - run: | - ls package/cache/wasmercache1 - ls package/cache/wasmercache2 - ls package/cache/wasmercache3 - ls package/cache/wasmercache4 - ls package/cache/wasmercache5 - cp package/cache/wasmercache1/wasmer.tar.gz package/cache/wasmer-linux-aarch64.tar.gz - cp package/cache/wasmercache2/build-capi.tar.gz package/cache/wasmer-windows-gnu64.tar.gz - cp package/cache/wasmercache3/build-capi.tar.gz package/cache/wasmer-darwin-arm64.tar.gz - cp package/cache/wasmercache4/build-capi.tar.gz package/cache/wasmer-darwin-amd64.tar.gz - cp package/cache/wasmercache5/build-capi.tar.gz package/cache/wasmer-linux-amd64.tar.gz - cp package/cache/wasmercache6/wasmer.tar.gz package/cache/wasmer-linux-riscv64.tar.gz - - uses: actions/download-artifact@v4 - if: ${{ matrix.build == 'windows-x64' }} - with: - name: capi-windows-x64 - path: download_link - - uses: actions/download-artifact@v4 - if: ${{ matrix.build == 'linux-musl' }} - with: - name: capi-linux-musl - path: download_link - - uses: actions/download-artifact@v4 - if: ${{ matrix.build == 'macos-arm64' }} - with: - name: capi-macos-arm - path: download_link - - uses: actions/download-artifact@v4 - if: ${{ matrix.build == 'macos-x64' }} - with: - name: capi-macos-x64 - path: download_link - - uses: actions/download-artifact@v4 - if: ${{ matrix.build == 'linux-x64' }} - with: - name: capi-linux-x64 - path: download_link - - name: Copy build-capi.tar.gz to link.tar.gz - shell: bash - run: | - cp download_link/build-capi.tar.gz link.tar.gz - - name: Unzip Artifacts - shell: bash - run: | - make untar-capi - - name: Unzip Artifacts - shell: bash - run: | - make untar-wasmer +# container: ${{ matrix.container }} +# env: +# SCCACHE_AZURE_BLOB_CONTAINER: wasmerstoragesccacheblob +# SCCACHE_AZURE_CONNECTION_STRING: ${{ secrets.SCCACHE_AZURE_CONNECTION_STRING }} +# steps: +# - uses: actions/checkout@v3 +# - uses: goto-bus-stop/setup-zig@v2 +# with: +# version: 0.10.0 +# - name: Set up base deps on musl +# if: matrix.build == 'linux-musl' +# run: ./scripts/alpine-linux-install-deps.sh +# - uses: actions/download-artifact@v4 +# id: download +# with: +# name: capi-${{ matrix.build }} +# - uses: actions/download-artifact@v4 +# with: +# name: wasmer-cli-${{ matrix.build }} +# - name: 'Echo download path' +# run: echo ${{steps.download.outputs.download-path}} +# - name: Install Rust +# uses: dtolnay/rust-toolchain@stable +# with: +# toolchain: ${{ env.MSRV }} +# target: ${{ matrix.metadata.target }} +# - name: Install Nextest +# uses: taiki-e/install-action@nextest +# - name: Cache +# uses: whywaita/actions-cache-s3@v2 +# with: +# path: | +# ~/.cargo/* +# ./target/* +# key: r22-${{ github.repository }}-${{ runner.os }}-${{ hashFiles('Cargo.lock') }}-wasmer-make-test-integration-cli-${{ matrix.build }} +# aws-s3-bucket: wasmer-rust-artifacts-cache +# aws-access-key-id: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_TOKEN }} +# aws-secret-access-key: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_KEY }} +# aws-region: auto +# aws-endpoint: https://1541b1e8a3fc6ad155ce67ef38899700.r2.cloudflarestorage.com +# aws-s3-bucket-endpoint: false +# aws-s3-force-path-style: true +# - name: Prepare package directory +# shell: bash +# run: | +# mkdir -p package +# mkdir -p package/cache +# - uses: actions/download-artifact@v4 +# with: +# name: capi-linux-aarch64 +# path: package/cache/wasmercache1 +# - uses: actions/download-artifact@v4 +# with: +# name: capi-windows-x64 +# path: package/cache/wasmercache2 +# - uses: actions/download-artifact@v4 +# with: +# name: capi-macos-arm +# path: package/cache/wasmercache3 +# - uses: actions/download-artifact@v4 +# with: +# name: capi-macos-x64 +# path: package/cache/wasmercache4 +# - uses: actions/download-artifact@v4 +# with: +# name: capi-linux-x64 +# path: package/cache/wasmercache5 +# - uses: actions/download-artifact@v4 +# with: +# name: capi-linux-riscv64 +# path: package/cache/wasmercache6 +# - name: Copy .tar.gz files to proper location +# shell: bash +# run: | +# ls package/cache/wasmercache1 +# ls package/cache/wasmercache2 +# ls package/cache/wasmercache3 +# ls package/cache/wasmercache4 +# ls package/cache/wasmercache5 +# cp package/cache/wasmercache1/wasmer.tar.gz package/cache/wasmer-linux-aarch64.tar.gz +# cp package/cache/wasmercache2/build-capi.tar.gz package/cache/wasmer-windows-gnu64.tar.gz +# cp package/cache/wasmercache3/build-capi.tar.gz package/cache/wasmer-darwin-arm64.tar.gz +# cp package/cache/wasmercache4/build-capi.tar.gz package/cache/wasmer-darwin-amd64.tar.gz +# cp package/cache/wasmercache5/build-capi.tar.gz package/cache/wasmer-linux-amd64.tar.gz +# cp package/cache/wasmercache6/wasmer.tar.gz package/cache/wasmer-linux-riscv64.tar.gz +# - uses: actions/download-artifact@v4 +# if: ${{ matrix.build == 'windows-x64' }} +# with: +# name: capi-windows-x64 +# path: download_link +# - uses: actions/download-artifact@v4 +# if: ${{ matrix.build == 'linux-musl' }} +# with: +# name: capi-linux-musl +# path: download_link +# - uses: actions/download-artifact@v4 +# if: ${{ matrix.build == 'macos-arm64' }} +# with: +# name: capi-macos-arm +# path: download_link +# - uses: actions/download-artifact@v4 +# if: ${{ matrix.build == 'macos-x64' }} +# with: +# name: capi-macos-x64 +# path: download_link +# - uses: actions/download-artifact@v4 +# if: ${{ matrix.build == 'linux-x64' }} +# with: +# name: capi-linux-x64 +# path: download_link +# - name: Copy build-capi.tar.gz to link.tar.gz +# shell: bash +# run: | +# cp download_link/build-capi.tar.gz link.tar.gz +# - name: Unzip Artifacts +# shell: bash +# run: | +# make untar-capi +# - name: Unzip Artifacts +# shell: bash +# run: | +# make untar-wasmer - # Removed in favour of freestanding integration tests - # - # - name: Test integration CLI - # if: false # matrix.build != 'macos-arm' - # shell: bash - # run: | - # export WASMER_PATH=`pwd`/target/${{ matrix.target }}/release/wasmer${{ matrix.exe }} - # export WASMER_DIR=`pwd`/package && make test-integration-cli-ci - # env: - # TARGET: ${{ matrix.target }} - # TARGET_DIR: target/${{ matrix.target }}/release - # CARGO_TARGET: ${{ matrix.target }} - # WAPM_DEV_TOKEN: ${{ secrets.WAPM_DEV_TOKEN }} - # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} +# # Removed in favour of freestanding integration tests +# # +# # - name: Test integration CLI +# # if: false # matrix.build != 'macos-arm' +# # shell: bash +# # run: | +# # export WASMER_PATH=`pwd`/target/${{ matrix.target }}/release/wasmer${{ matrix.exe }} +# # export WASMER_DIR=`pwd`/package && make test-integration-cli-ci +# # env: +# # TARGET: ${{ matrix.target }} +# # TARGET_DIR: target/${{ matrix.target }}/release +# # CARGO_TARGET: ${{ matrix.target }} +# # WAPM_DEV_TOKEN: ${{ secrets.WAPM_DEV_TOKEN }} +# # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # ---- - # Note (xdoardo on 2024/10/07): - # --- - # As of now the WAMR, WASMI (and V8) backends are not that mature enough. We will re-enable these tests - # when they've been used and matured. - # ---- - # - # - name: Test CLI integration (WAMR) - # shell: bash - # run: | - # export WASMER_PATH=`pwd`/target/${{ matrix.target }}/release/wasmer${{ matrix.exe }} - # export WASMER_DIR=`pwd`/package && make test-integration-cli-wamr-ci - # env: - # TARGET: ${{ matrix.target }} - # TARGET_DIR: target/${{ matrix.target }}/release - # CARGO_TARGET: ${{ matrix.target }} - # WAPM_DEV_TOKEN: ${{ secrets.WAPM_DEV_TOKEN }} - # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} +# # ---- +# # Note (xdoardo on 2024/10/07): +# # --- +# # As of now the WAMR, WASMI (and V8) backends are not that mature enough. We will re-enable these tests +# # when they've been used and matured. +# # ---- +# # +# # - name: Test CLI integration (WAMR) +# # shell: bash +# # run: | +# # export WASMER_PATH=`pwd`/target/${{ matrix.target }}/release/wasmer${{ matrix.exe }} +# # export WASMER_DIR=`pwd`/package && make test-integration-cli-wamr-ci +# # env: +# # TARGET: ${{ matrix.target }} +# # TARGET_DIR: target/${{ matrix.target }}/release +# # CARGO_TARGET: ${{ matrix.target }} +# # WAPM_DEV_TOKEN: ${{ secrets.WAPM_DEV_TOKEN }} +# # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # - name: Test CLI integration (WASMI) - # shell: bash - # run: | - # export WASMER_PATH=`pwd`/target/${{ matrix.target }}/release/wasmer${{ matrix.exe }} - # export WASMER_DIR=`pwd`/package && make test-integration-cli-wasmi-ci - # env: - # TARGET: ${{ matrix.target }} - # TARGET_DIR: target/${{ matrix.target }}/release - # CARGO_TARGET: ${{ matrix.target }} - # WAPM_DEV_TOKEN: ${{ secrets.WAPM_DEV_TOKEN }} - # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} +# # - name: Test CLI integration (WASMI) +# # shell: bash +# # run: | +# # export WASMER_PATH=`pwd`/target/${{ matrix.target }}/release/wasmer${{ matrix.exe }} +# # export WASMER_DIR=`pwd`/package && make test-integration-cli-wasmi-ci +# # env: +# # TARGET: ${{ matrix.target }} +# # TARGET_DIR: target/${{ matrix.target }}/release +# # CARGO_TARGET: ${{ matrix.target }} +# # WAPM_DEV_TOKEN: ${{ secrets.WAPM_DEV_TOKEN }} +# # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # there is another set of integration tests in 'wasmer-integration-tests' repo. Run those - test-wasmer-integration-tests: - needs: [build] - runs-on: ubuntu-22.04 - steps: - - name: Checkout wasmer-integration-tests repository - uses: actions/checkout@v3 - with: - repository: wasmerio/wasmer-integration-tests - submodules: true - token: ${{ secrets.CLONE_WASMER_INTEGRATION_TESTS }} - - uses: actions/download-artifact@v4 - with: - name: wasmer-cli-linux-x64 - - name: Cargo Registry Cache - uses: actions/cache@v3 - with: - path: | - ~/.cargo/advisory-db - ~/.cargo/git - ~/.cargo/registry - key: cargo-registry-${{ hashFiles('**/Cargo.lock') }} - - name: Cargo target cache - uses: actions/cache@v3 - with: - path: | - target/ - key: cargo-release-${{ hashFiles('**/Cargo.lock') }} - - run: | - # install rust toolchain - curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y - . "$HOME/.cargo/env" +# # there is another set of integration tests in 'wasmer-integration-tests' repo. Run those +# test-wasmer-integration-tests: +# needs: [build] +# runs-on: ubuntu-22.04 +# steps: +# - name: Checkout wasmer-integration-tests repository +# uses: actions/checkout@v3 +# with: +# repository: wasmerio/wasmer-integration-tests +# submodules: true +# token: ${{ secrets.CLONE_WASMER_INTEGRATION_TESTS }} +# - uses: actions/download-artifact@v4 +# with: +# name: wasmer-cli-linux-x64 +# - name: Cargo Registry Cache +# uses: actions/cache@v3 +# with: +# path: | +# ~/.cargo/advisory-db +# ~/.cargo/git +# ~/.cargo/registry +# key: cargo-registry-${{ hashFiles('**/Cargo.lock') }} +# - name: Cargo target cache +# uses: actions/cache@v3 +# with: +# path: | +# target/ +# key: cargo-release-${{ hashFiles('**/Cargo.lock') }} +# - run: | +# # install rust toolchain +# curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y +# . "$HOME/.cargo/env" - # add wasmer cli to PATH - tar -xzf build-wasmer.tar.gz +# # add wasmer cli to PATH +# tar -xzf build-wasmer.tar.gz - docker build -t tmp . - docker run -v $PWD:/app -w /app tmp bash -c " \ - cp ./bin/wasmer /root/.wasmer/bin/wasmer &&\ - export MYSQL_HOST='${{ vars.INTEGRATION_TEST_MYSQL_HOST }}' &&\ - export MYSQL_DBNAME='${{ vars.INTEGRATION_TEST_MYSQL_DBNAME }}' &&\ - export MYSQL_USERNAME='${{ secrets.INTEGRATION_TEST_MYSQL_USERNAME }}' &&\ - export MYSQL_PASSWORD='${{ secrets.INTEGRATION_TEST_MYSQL_PASSWORD }}' &&\ - export MYSQL_PORT='${{ vars.INTEGRATION_TEST_MYSQL_PORT }}' &&\ - export MYSQL_CERT='${{ secrets.INTEGRATION_TEST_MYSQL_CERT }}' &&\ - export PG_HOST='${{ vars.INTEGRATION_TEST_PG_HOST }}' &&\ - export PG_DBNAME='${{ vars.INTEGRATION_TEST_PG_DBNAME }}' &&\ - export PG_USERNAME='${{ secrets.INTEGRATION_TEST_PG_USERNAME }}' &&\ - export PG_PASSWORD='${{ secrets.INTEGRATION_TEST_PG_PASSWORD }}' &&\ - export PG_PORT='${{ vars.INTEGRATION_TEST_PG_PORT }}' &&\ - wasmer config set registry.url https://registry.wasmer.io/graphql &&\ - wasmer login '${{ secrets.WAPM_PROD_TOKEN }}' &&\ - wasmer config set registry.url https://registry.wasmer.wtf/graphql &&\ - wasmer login '${{ secrets.WAPM_DEV_TOKEN }}' &&\ - cargo test --no-fail-fast" - - name: notify failure in slack - if: failure() - run: | - curl -X POST -H 'Content-type: application/json' --data '{"text":"Integration tests failed ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"}' ${{ secrets.INTEGRATION_TEST_SLACK_WEBHOOK }} +# docker build -t tmp . +# docker run -v $PWD:/app -w /app tmp bash -c " \ +# cp ./bin/wasmer /root/.wasmer/bin/wasmer &&\ +# export MYSQL_HOST='${{ vars.INTEGRATION_TEST_MYSQL_HOST }}' &&\ +# export MYSQL_DBNAME='${{ vars.INTEGRATION_TEST_MYSQL_DBNAME }}' &&\ +# export MYSQL_USERNAME='${{ secrets.INTEGRATION_TEST_MYSQL_USERNAME }}' &&\ +# export MYSQL_PASSWORD='${{ secrets.INTEGRATION_TEST_MYSQL_PASSWORD }}' &&\ +# export MYSQL_PORT='${{ vars.INTEGRATION_TEST_MYSQL_PORT }}' &&\ +# export MYSQL_CERT='${{ secrets.INTEGRATION_TEST_MYSQL_CERT }}' &&\ +# export PG_HOST='${{ vars.INTEGRATION_TEST_PG_HOST }}' &&\ +# export PG_DBNAME='${{ vars.INTEGRATION_TEST_PG_DBNAME }}' &&\ +# export PG_USERNAME='${{ secrets.INTEGRATION_TEST_PG_USERNAME }}' &&\ +# export PG_PASSWORD='${{ secrets.INTEGRATION_TEST_PG_PASSWORD }}' &&\ +# export PG_PORT='${{ vars.INTEGRATION_TEST_PG_PORT }}' &&\ +# wasmer config set registry.url https://registry.wasmer.io/graphql &&\ +# wasmer login '${{ secrets.WAPM_PROD_TOKEN }}' &&\ +# wasmer config set registry.url https://registry.wasmer.wtf/graphql &&\ +# wasmer login '${{ secrets.WAPM_DEV_TOKEN }}' &&\ +# cargo test --no-fail-fast" +# - name: notify failure in slack +# if: failure() +# run: | +# curl -X POST -H 'Content-type: application/json' --data '{"text":"Integration tests failed ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"}' ${{ secrets.INTEGRATION_TEST_SLACK_WEBHOOK }} diff --git a/.github/workflows/wasmer-config.yaml b/.github/workflows/wasmer-config.yaml index 9091574b1e3..90a36b31efd 100644 --- a/.github/workflows/wasmer-config.yaml +++ b/.github/workflows/wasmer-config.yaml @@ -1,54 +1,54 @@ -# Dedicated workflow just for the wasmer-config crate -name: wasmer-config +# # Dedicated workflow just for the wasmer-config crate +# name: wasmer-config -on: - push: - branches: - - main - pull_request: +# on: +# push: +# branches: +# - main +# pull_request: -# Automatically cancel previous workflow runs when a new commit is pushed. -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true +# # Automatically cancel previous workflow runs when a new commit is pushed. +# concurrency: +# group: ${{ github.workflow }}-${{ github.ref }} +# cancel-in-progress: true -env: - DEFAULT_CRATE_NAME: wasmer_toml +# env: +# DEFAULT_CRATE_NAME: wasmer_toml -jobs: - check: - name: Compile and Test - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Rust Cache - uses: Swatinem/rust-cache@v2 - - name: Setup Rust - uses: dsherret/rust-toolchain-file@v1 - - name: Install Nextest - uses: taiki-e/install-action@nextest - - name: Type Checking - run: | - cd lib/config && cargo check --verbose --locked - - name: Build - run: | - cd lib/config && cargo build --verbose --locked - - name: Test - run: | - cd lib/config && cargo nextest run --verbose --locked +# jobs: +# check: +# name: Compile and Test +# runs-on: ubuntu-latest +# steps: +# - uses: actions/checkout@v2 +# - name: Rust Cache +# uses: Swatinem/rust-cache@v2 +# - name: Setup Rust +# uses: dsherret/rust-toolchain-file@v1 +# - name: Install Nextest +# uses: taiki-e/install-action@nextest +# - name: Type Checking +# run: | +# cd lib/config && cargo check --verbose --locked +# - name: Build +# run: | +# cd lib/config && cargo build --verbose --locked +# - name: Test +# run: | +# cd lib/config && cargo nextest run --verbose --locked - lints: - name: Linting and Formatting - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Rust Cache - uses: Swatinem/rust-cache@v2 - - name: Setup Rust - uses: dsherret/rust-toolchain-file@v1 - - name: Check Formatting - run: | - cd lib/config && cargo fmt --verbose --check - - name: Clippy - run: | - cd lib/config && cargo clippy --verbose +# lints: +# name: Linting and Formatting +# runs-on: ubuntu-latest +# steps: +# - uses: actions/checkout@v2 +# - name: Rust Cache +# uses: Swatinem/rust-cache@v2 +# - name: Setup Rust +# uses: dsherret/rust-toolchain-file@v1 +# - name: Check Formatting +# run: | +# cd lib/config && cargo fmt --verbose --check +# - name: Clippy +# run: | +# cd lib/config && cargo clippy --verbose diff --git a/.github/workflows/wasmer-integration-tests.yaml b/.github/workflows/wasmer-integration-tests.yaml index 8a079aed71d..f06a96fd5c8 100644 --- a/.github/workflows/wasmer-integration-tests.yaml +++ b/.github/workflows/wasmer-integration-tests.yaml @@ -1,51 +1,51 @@ -name: test-sys +# name: test-sys -on: - push: - branches: - - sre-383-re-enable-ignored-integration-test-test_php_extensions +# on: +# push: +# branches: +# - sre-383-re-enable-ignored-integration-test-test_php_extensions -jobs: - # there is another set of integration tests in 'wasmer-integration-tests' repo. Run those - test-wasmer-integration-tests: - runs-on: ubuntu-22.04 - steps: - - name: Checkout wasmer-integration-tests repository - uses: actions/checkout@v3 - with: - repository: wasmerio/wasmer-integration-tests - submodules: true - token: ${{ secrets.CLONE_WASMER_INTEGRATION_TESTS }} - - name: Cargo Registry Cache - uses: actions/cache@v3 - with: - path: | - ~/.cargo/advisory-db - ~/.cargo/git - ~/.cargo/registry - key: cargo-registry-${{ hashFiles('**/Cargo.lock') }} - - name: Cargo target cache - uses: actions/cache@v3 - with: - path: | - target/ - key: cargo-release-${{ hashFiles('**/Cargo.lock') }} - - run: | - docker build -t tmp . - docker run -v $PWD:/app -w /app tmp bash -c " \ - export MYSQL_HOST='${{ vars.INTEGRATION_TEST_MYSQL_HOST }}' &&\ - export MYSQL_DBNAME='${{ vars.INTEGRATION_TEST_MYSQL_DBNAME }}' &&\ - export MYSQL_USERNAME='${{ secrets.INTEGRATION_TEST_MYSQL_USERNAME }}' &&\ - export MYSQL_PASSWORD='${{ secrets.INTEGRATION_TEST_MYSQL_PASSWORD }}' &&\ - export MYSQL_PORT='${{ vars.INTEGRATION_TEST_MYSQL_PORT }}' &&\ - export MYSQL_CERT='${{ secrets.INTEGRATION_TEST_MYSQL_CERT }}' &&\ - export PG_HOST='${{ vars.INTEGRATION_TEST_PG_HOST }}' &&\ - export PG_DBNAME='${{ vars.INTEGRATION_TEST_PG_DBNAME }}' &&\ - export PG_USERNAME='${{ secrets.INTEGRATION_TEST_PG_USERNAME }}' &&\ - export PG_PASSWORD='${{ secrets.INTEGRATION_TEST_PG_PASSWORD }}' &&\ - export PG_PORT='${{ vars.INTEGRATION_TEST_PG_PORT }}' &&\ - wasmer config set registry.url https://registry.wasmer.io/graphql &&\ - wasmer login ${{ secrets.WAPM_PROD_TOKEN }} &&\ - wasmer config set registry.url https://registry.wasmer.wtf/graphql &&\ - wasmer login ${{ secrets.WAPM_DEV_TOKEN }} &&\ - cargo test --no-fail-fast" \ No newline at end of file +# jobs: +# # there is another set of integration tests in 'wasmer-integration-tests' repo. Run those +# test-wasmer-integration-tests: +# runs-on: ubuntu-22.04 +# steps: +# - name: Checkout wasmer-integration-tests repository +# uses: actions/checkout@v3 +# with: +# repository: wasmerio/wasmer-integration-tests +# submodules: true +# token: ${{ secrets.CLONE_WASMER_INTEGRATION_TESTS }} +# - name: Cargo Registry Cache +# uses: actions/cache@v3 +# with: +# path: | +# ~/.cargo/advisory-db +# ~/.cargo/git +# ~/.cargo/registry +# key: cargo-registry-${{ hashFiles('**/Cargo.lock') }} +# - name: Cargo target cache +# uses: actions/cache@v3 +# with: +# path: | +# target/ +# key: cargo-release-${{ hashFiles('**/Cargo.lock') }} +# - run: | +# docker build -t tmp . +# docker run -v $PWD:/app -w /app tmp bash -c " \ +# export MYSQL_HOST='${{ vars.INTEGRATION_TEST_MYSQL_HOST }}' &&\ +# export MYSQL_DBNAME='${{ vars.INTEGRATION_TEST_MYSQL_DBNAME }}' &&\ +# export MYSQL_USERNAME='${{ secrets.INTEGRATION_TEST_MYSQL_USERNAME }}' &&\ +# export MYSQL_PASSWORD='${{ secrets.INTEGRATION_TEST_MYSQL_PASSWORD }}' &&\ +# export MYSQL_PORT='${{ vars.INTEGRATION_TEST_MYSQL_PORT }}' &&\ +# export MYSQL_CERT='${{ secrets.INTEGRATION_TEST_MYSQL_CERT }}' &&\ +# export PG_HOST='${{ vars.INTEGRATION_TEST_PG_HOST }}' &&\ +# export PG_DBNAME='${{ vars.INTEGRATION_TEST_PG_DBNAME }}' &&\ +# export PG_USERNAME='${{ secrets.INTEGRATION_TEST_PG_USERNAME }}' &&\ +# export PG_PASSWORD='${{ secrets.INTEGRATION_TEST_PG_PASSWORD }}' &&\ +# export PG_PORT='${{ vars.INTEGRATION_TEST_PG_PORT }}' &&\ +# wasmer config set registry.url https://registry.wasmer.io/graphql &&\ +# wasmer login ${{ secrets.WAPM_PROD_TOKEN }} &&\ +# wasmer config set registry.url https://registry.wasmer.wtf/graphql &&\ +# wasmer login ${{ secrets.WAPM_DEV_TOKEN }} &&\ +# cargo test --no-fail-fast" \ No newline at end of file From 2f4f892922db31402808e4d07d281289ee441bf8 Mon Sep 17 00:00:00 2001 From: "M.Amin Rayej" Date: Fri, 18 Oct 2024 12:18:02 +0330 Subject: [PATCH 02/45] disable more steps for now --- .github/workflows/build.yml | 40 ++++++++++++++++++------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8f16f8d6f81..9ea64170d14 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -219,21 +219,21 @@ jobs: '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' -s echo 'RUSTC_WRAPPER=${{ runner.tool_cache }}/cargo-sccache/bin/sccache' >> $GITHUB_ENV shell: bash - - name: Build C API headless - shell: bash - run: | - make package-capi-headless - - name: Build C API - shell: bash - run: | - make build-capi - - name: Build Wasmer binary with LLVM - if: matrix.use_llvm - shell: bash - run: | - make build-wasmer - env: - ENABLE_LLVM: 1 + # - name: Build C API headless + # shell: bash + # run: | + # make package-capi-headless + # - name: Build C API + # shell: bash + # run: | + # make build-capi + # - name: Build Wasmer binary with LLVM + # if: matrix.use_llvm + # shell: bash + # run: | + # make build-wasmer + # env: + # ENABLE_LLVM: 1 - name: Build Wasmer with v8 backend if: endsWith(matrix.build, 'v8') run: | @@ -250,11 +250,11 @@ jobs: if: endsWith(matrix.build, 'wasmi') run: | make build-wasmer-wasmi - - name: Build Wasmer binary without LLVM - if: matrix.use_llvm != true - shell: bash - run: | - make build-wasmer + # - name: Build Wasmer binary without LLVM + # if: matrix.use_llvm != true + # shell: bash + # run: | + # make build-wasmer #- name: Build Wasmer binary on Wasm32-WASI without LLVM # if: matrix.build_wasm # shell: bash From dcb1cb282f64cca144c6e384fd407b3302d48823 Mon Sep 17 00:00:00 2001 From: "M.Amin Rayej" Date: Fri, 18 Oct 2024 12:19:46 +0330 Subject: [PATCH 03/45] use sudo for package installation --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9ea64170d14..f5692d8c418 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -123,7 +123,7 @@ jobs: - name: Install mold if: startsWith(matrix.build, 'linux') run: | - apt update && apt install mold + sudo apt update && sudo apt install mold - name: Install Rust uses: dtolnay/rust-toolchain@stable with: From 9733ce83efc710ae392c41525bef6704aa8b42fc Mon Sep 17 00:00:00 2001 From: "M.Amin Rayej" Date: Fri, 18 Oct 2024 12:23:59 +0330 Subject: [PATCH 04/45] use newer version of ubuntu --- .github/workflows/build.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f5692d8c418..89cb006c6f9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -47,7 +47,7 @@ jobs: matrix: include: - build: linux-x64 - os: ubuntu-20.04 + os: ubuntu-22.04 artifact_name: 'wasmer-linux-amd64' llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-amd64.tar.xz' cross_compilation_artifact_name: 'cross_compiled_from_linux' @@ -55,7 +55,7 @@ jobs: use_llvm: true build_wasm: true - build: linux-x64-v8 - os: ubuntu-20.04 + os: ubuntu-22.04 artifact_name: 'wasmer-v8-linux-amd64' llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-amd64.tar.xz' cross_compilation_artifact_name: 'cross_compiled_from_linux' @@ -63,7 +63,7 @@ jobs: use_llvm: true build_wasm: true - build: linux-x64-wamr - os: ubuntu-20.04 + os: ubuntu-22.04 artifact_name: 'wasmer-wamr-linux-amd64' llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-amd64.tar.xz' cross_compilation_artifact_name: 'cross_compiled_from_linux' @@ -71,7 +71,7 @@ jobs: use_llvm: true build_wasm: true - build: linux-x64-wasmi - os: ubuntu-20.04 + os: ubuntu-22.04 artifact_name: 'wasmer-wasmi-linux-amd64' llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-amd64.tar.xz' cross_compilation_artifact_name: 'cross_compiled_from_linux' From 8613741824399096001840db88ed0b1841bffd82 Mon Sep 17 00:00:00 2001 From: "M.Amin Rayej" Date: Fri, 18 Oct 2024 12:46:56 +0330 Subject: [PATCH 05/45] fix linux issues and enable macos --- .github/workflows/build.yml | 60 ++++++++++++++++++++++++++++++------- 1 file changed, 49 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 89cb006c6f9..a4a96dd48d5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -86,6 +86,30 @@ jobs: use_sccache: false use_llvm: true build_wasm: false + - build: macos-x64-v8 + os: macos-12 + llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-amd64.tar.xz' + artifact_name: 'wasmer-v8-darwin-amd64' + cross_compilation_artifact_name: 'cross_compiled_from_mac' + use_sccache: false + use_llvm: true + build_wasm: false + - build: macos-x64-wamr + os: macos-12 + llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-amd64.tar.xz' + artifact_name: 'wasmer-wamr-darwin-amd64' + cross_compilation_artifact_name: 'cross_compiled_from_mac' + use_sccache: false + use_llvm: true + build_wasm: false + - build: macos-x64-wasmi + os: macos-12 + llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-amd64.tar.xz' + artifact_name: 'wasmer-wasmi-darwin-amd64' + cross_compilation_artifact_name: 'cross_compiled_from_mac' + use_sccache: false + use_llvm: true + build_wasm: false - build: macos-arm64 os: macos-14 target: aarch64-apple-darwin @@ -120,10 +144,24 @@ jobs: - name: Set up base deps on musl if: matrix.build == 'linux-musl-x64' run: ./scripts/alpine-linux-install-deps.sh - - name: Install mold - if: startsWith(matrix.build, 'linux') + - name: Install Linux tools + if: startsWith(matrix.build, 'linux-x64') run: | - sudo apt update && sudo apt install mold + sudo apt install mold ninja-build + - name: Install Linux musl tools + if: startsWith(matrix.build, 'linux-musl') + run: | + apk add mold ninja + - name: Install `ninja` on macOS + if: startsWith(matrix.build, 'macos-') + shell: bash + run: | + brew install ninja + - name: Install `ninja` on Windows + if: startsWith(matrix.build, 'windows-') + shell: bash + run: | + choco install ninja - name: Install Rust uses: dtolnay/rust-toolchain@stable with: @@ -219,14 +257,14 @@ jobs: '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' -s echo 'RUSTC_WRAPPER=${{ runner.tool_cache }}/cargo-sccache/bin/sccache' >> $GITHUB_ENV shell: bash - # - name: Build C API headless - # shell: bash - # run: | - # make package-capi-headless - # - name: Build C API - # shell: bash - # run: | - # make build-capi + - name: Build C API headless + shell: bash + run: | + make package-capi-headless + - name: Build C API + shell: bash + run: | + make build-capi # - name: Build Wasmer binary with LLVM # if: matrix.use_llvm # shell: bash From f69f60d7ab07ca53dece951a6d1184ecc2320c13 Mon Sep 17 00:00:00 2001 From: "M.Amin Rayej" Date: Fri, 18 Oct 2024 13:23:16 +0330 Subject: [PATCH 06/45] only enable macos, bump to macos 13, and install missing header files --- .github/workflows/build.yml | 121 +++++++++++++++++++----------------- 1 file changed, 63 insertions(+), 58 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a4a96dd48d5..05c013b393a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -46,40 +46,40 @@ jobs: fail-fast: false matrix: include: - - build: linux-x64 - os: ubuntu-22.04 - artifact_name: 'wasmer-linux-amd64' - llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-amd64.tar.xz' - cross_compilation_artifact_name: 'cross_compiled_from_linux' - use_sccache: false - use_llvm: true - build_wasm: true - - build: linux-x64-v8 - os: ubuntu-22.04 - artifact_name: 'wasmer-v8-linux-amd64' - llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-amd64.tar.xz' - cross_compilation_artifact_name: 'cross_compiled_from_linux' - use_sccache: false - use_llvm: true - build_wasm: true - - build: linux-x64-wamr - os: ubuntu-22.04 - artifact_name: 'wasmer-wamr-linux-amd64' - llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-amd64.tar.xz' - cross_compilation_artifact_name: 'cross_compiled_from_linux' - use_sccache: false - use_llvm: true - build_wasm: true - - build: linux-x64-wasmi - os: ubuntu-22.04 - artifact_name: 'wasmer-wasmi-linux-amd64' - llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-amd64.tar.xz' - cross_compilation_artifact_name: 'cross_compiled_from_linux' - use_sccache: false - use_llvm: true - build_wasm: true + # - build: linux-x64 + # os: ubuntu-22.04 + # artifact_name: 'wasmer-linux-amd64' + # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-amd64.tar.xz' + # cross_compilation_artifact_name: 'cross_compiled_from_linux' + # use_sccache: false + # use_llvm: true + # build_wasm: true + # - build: linux-x64-v8 + # os: ubuntu-22.04 + # artifact_name: 'wasmer-v8-linux-amd64' + # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-amd64.tar.xz' + # cross_compilation_artifact_name: 'cross_compiled_from_linux' + # use_sccache: false + # use_llvm: true + # build_wasm: true + # - build: linux-x64-wamr + # os: ubuntu-22.04 + # artifact_name: 'wasmer-wamr-linux-amd64' + # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-amd64.tar.xz' + # cross_compilation_artifact_name: 'cross_compiled_from_linux' + # use_sccache: false + # use_llvm: true + # build_wasm: true + # - build: linux-x64-wasmi + # os: ubuntu-22.04 + # artifact_name: 'wasmer-wasmi-linux-amd64' + # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-amd64.tar.xz' + # cross_compilation_artifact_name: 'cross_compiled_from_linux' + # use_sccache: false + # use_llvm: true + # build_wasm: true - build: macos-x64 - os: macos-12 + os: macos-13 llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-amd64.tar.xz' artifact_name: 'wasmer-darwin-amd64' cross_compilation_artifact_name: 'cross_compiled_from_mac' @@ -87,7 +87,7 @@ jobs: use_llvm: true build_wasm: false - build: macos-x64-v8 - os: macos-12 + os: macos-13 llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-amd64.tar.xz' artifact_name: 'wasmer-v8-darwin-amd64' cross_compilation_artifact_name: 'cross_compiled_from_mac' @@ -95,7 +95,7 @@ jobs: use_llvm: true build_wasm: false - build: macos-x64-wamr - os: macos-12 + os: macos-13 llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-amd64.tar.xz' artifact_name: 'wasmer-wamr-darwin-amd64' cross_compilation_artifact_name: 'cross_compiled_from_mac' @@ -103,37 +103,37 @@ jobs: use_llvm: true build_wasm: false - build: macos-x64-wasmi - os: macos-12 + os: macos-13 llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-amd64.tar.xz' artifact_name: 'wasmer-wasmi-darwin-amd64' cross_compilation_artifact_name: 'cross_compiled_from_mac' use_sccache: false use_llvm: true build_wasm: false - - build: macos-arm64 - os: macos-14 - target: aarch64-apple-darwin - artifact_name: 'wasmer-darwin-arm64' - use_sccache: false - use_llvm: false - build_wasm: false + # - build: macos-arm64 + # os: macos-14 + # target: aarch64-apple-darwin + # artifact_name: 'wasmer-darwin-arm64' + # use_sccache: false + # use_llvm: false + # build_wasm: false # [todo] xdoardo: Reinstate when the code we generate for aarch64 is working correctly. # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-aarch64.tar.xz' - - build: windows-x64 - os: windows-2019 - artifact_name: 'wasmer-windows-amd64' - llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-windows-amd64.tar.xz' - cross_compilation_artifact_name: 'cross_compiled_from_win' - use_sccache: false - use_llvm: true - build_wasm: false - - build: linux-musl-x64 - os: ubuntu-latest - artifact_name: 'wasmer-linux-musl-amd64' - container: alpine:latest - use_sccache: false - use_llvm: false - build_wasm: true + # - build: windows-x64 + # os: windows-2019 + # artifact_name: 'wasmer-windows-amd64' + # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-windows-amd64.tar.xz' + # cross_compilation_artifact_name: 'cross_compiled_from_win' + # use_sccache: false + # use_llvm: true + # build_wasm: false + # - build: linux-musl-x64 + # os: ubuntu-latest + # artifact_name: 'wasmer-linux-musl-amd64' + # container: alpine:latest + # use_sccache: false + # use_llvm: false + # build_wasm: true container: ${{ matrix.container }} env: SCCACHE_AZURE_BLOB_CONTAINER: wasmerstoragesccacheblob @@ -162,6 +162,11 @@ jobs: shell: bash run: | choco install ninja + - name: Install standard header files on macOS + if: startsWith(matrix.build, 'macos-') + shell: bash + run: | + xcode-select -s /Library/Developer/CommandLineTools - name: Install Rust uses: dtolnay/rust-toolchain@stable with: From ae9b94bf7cf215b4a30586bd1a86c76b62352e74 Mon Sep 17 00:00:00 2001 From: "M.Amin Rayej" Date: Fri, 18 Oct 2024 13:24:34 +0330 Subject: [PATCH 07/45] use sudo --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 05c013b393a..a554236238b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -166,7 +166,7 @@ jobs: if: startsWith(matrix.build, 'macos-') shell: bash run: | - xcode-select -s /Library/Developer/CommandLineTools + sudo xcode-select -s /Library/Developer/CommandLineTools - name: Install Rust uses: dtolnay/rust-toolchain@stable with: From 92ec5b172c94c493dfd34152008cb6bd9bc05b99 Mon Sep 17 00:00:00 2001 From: "M.Amin Rayej" Date: Fri, 18 Oct 2024 13:45:14 +0330 Subject: [PATCH 08/45] just enable v8 on macos --- .github/workflows/build.yml | 49 +++++++++++++++++++------------------ 1 file changed, 25 insertions(+), 24 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a554236238b..dfa68fad895 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -78,14 +78,14 @@ jobs: # use_sccache: false # use_llvm: true # build_wasm: true - - build: macos-x64 - os: macos-13 - llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-amd64.tar.xz' - artifact_name: 'wasmer-darwin-amd64' - cross_compilation_artifact_name: 'cross_compiled_from_mac' - use_sccache: false - use_llvm: true - build_wasm: false + # - build: macos-x64 + # os: macos-13 + # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-amd64.tar.xz' + # artifact_name: 'wasmer-darwin-amd64' + # cross_compilation_artifact_name: 'cross_compiled_from_mac' + # use_sccache: false + # use_llvm: true + # build_wasm: false - build: macos-x64-v8 os: macos-13 llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-amd64.tar.xz' @@ -94,22 +94,22 @@ jobs: use_sccache: false use_llvm: true build_wasm: false - - build: macos-x64-wamr - os: macos-13 - llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-amd64.tar.xz' - artifact_name: 'wasmer-wamr-darwin-amd64' - cross_compilation_artifact_name: 'cross_compiled_from_mac' - use_sccache: false - use_llvm: true - build_wasm: false - - build: macos-x64-wasmi - os: macos-13 - llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-amd64.tar.xz' - artifact_name: 'wasmer-wasmi-darwin-amd64' - cross_compilation_artifact_name: 'cross_compiled_from_mac' - use_sccache: false - use_llvm: true - build_wasm: false + # - build: macos-x64-wamr + # os: macos-13 + # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-amd64.tar.xz' + # artifact_name: 'wasmer-wamr-darwin-amd64' + # cross_compilation_artifact_name: 'cross_compiled_from_mac' + # use_sccache: false + # use_llvm: true + # build_wasm: false + # - build: macos-x64-wasmi + # os: macos-13 + # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-amd64.tar.xz' + # artifact_name: 'wasmer-wasmi-darwin-amd64' + # cross_compilation_artifact_name: 'cross_compiled_from_mac' + # use_sccache: false + # use_llvm: true + # build_wasm: false # - build: macos-arm64 # os: macos-14 # target: aarch64-apple-darwin @@ -166,6 +166,7 @@ jobs: if: startsWith(matrix.build, 'macos-') shell: bash run: | + sudo xcode-select --install sudo xcode-select -s /Library/Developer/CommandLineTools - name: Install Rust uses: dtolnay/rust-toolchain@stable From e8631a05894cef41437982d15ece56b231701663 Mon Sep 17 00:00:00 2001 From: "M.Amin Rayej" Date: Fri, 18 Oct 2024 13:46:44 +0330 Subject: [PATCH 09/45] disable more jobs --- .github/workflows/build.yml | 508 ++++++++++++++++++------------------ 1 file changed, 254 insertions(+), 254 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index dfa68fad895..696b3432f7c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -340,264 +340,264 @@ jobs: if-no-files-found: error retention-days: 2 - windows_gnu: - name: Windows GNU - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: Install Windows-GNU linker - shell: bash - run: | - sudo apt install -y mingw-w64 - - uses: dtolnay/rust-toolchain@stable - with: - target: x86_64-pc-windows-gnu - - name: Install Windows-GNU target - shell: bash - run: | - rustup target add x86_64-pc-windows-gnu - - name: Install Windows 10 SDK with xwin - shell: bash - run: | - mkdir -p /tmp/xwin - mkdir -p /tmp/xwindownload - mkdir -p /tmp/xwincache - git clone https://github.com/wasmerio/xwin --depth=1 /tmp/xwin - cargo build --release --manifest-path=/tmp/xwin/Cargo.toml - /tmp/xwin/target/release/xwin --accept-license --cache-dir /tmp/xwincache splat --output /tmp/xwindownload - mkdir -p /tmp/winsdk - cp /tmp/xwindownload/sdk/lib/10.0.20348/um/x86_64/WS2_32.lib /tmp/winsdk/ - cp /tmp/xwindownload/sdk/lib/10.0.20348/um/x86_64/KERNEL32.lib /tmp/winsdk/ - cp /tmp/xwindownload/sdk/lib/10.0.20348/um/x86_64/BCRYPT.lib /tmp/winsdk/ - cp /tmp/xwindownload/sdk/lib/10.0.20348/um/x86_64/ADVAPI32.lib /tmp/winsdk/ - cp /tmp/xwindownload/sdk/lib/10.0.20348/um/x86_64/USERENV.lib /tmp/winsdk/ - echo "WinSDK files:" - ls -laH /tmp/winsdk - echo "" - mkdir -p package - mkdir -p package/winsdk - cp -r /tmp/winsdk/* package/winsdk - - name: Build Wasmer C-API without LLVM - shell: bash - run: | - make build-capi - env: - RUSTFLAGS: -Cpanic=abort - CARGO_TARGET: x86_64-pc-windows-gnu - ENABLE_LLVM: 0 - - name: Build Wasmer C-API headless without LLVM - shell: bash - run: | - make build-capi-headless - env: - RUSTFLAGS: -Cpanic=abort - CARGO_TARGET: x86_64-pc-windows-gnu - ENABLE_LLVM: 0 - - name: Dist - run: | - make distribution-gnu - env: - CARGO_TARGET: x86_64-pc-windows-gnu - TARGET_DIR: target/x86_64-pc-windows-gnu/release - - name: Upload Artifacts - uses: actions/upload-artifact@v4 - with: - name: 'wasmer-windows-gnu64' - path: dist - if-no-files-found: error - retention-days: 2 + # windows_gnu: + # name: Windows GNU + # runs-on: ubuntu-latest + # steps: + # - uses: actions/checkout@v3 + # - name: Install Windows-GNU linker + # shell: bash + # run: | + # sudo apt install -y mingw-w64 + # - uses: dtolnay/rust-toolchain@stable + # with: + # target: x86_64-pc-windows-gnu + # - name: Install Windows-GNU target + # shell: bash + # run: | + # rustup target add x86_64-pc-windows-gnu + # - name: Install Windows 10 SDK with xwin + # shell: bash + # run: | + # mkdir -p /tmp/xwin + # mkdir -p /tmp/xwindownload + # mkdir -p /tmp/xwincache + # git clone https://github.com/wasmerio/xwin --depth=1 /tmp/xwin + # cargo build --release --manifest-path=/tmp/xwin/Cargo.toml + # /tmp/xwin/target/release/xwin --accept-license --cache-dir /tmp/xwincache splat --output /tmp/xwindownload + # mkdir -p /tmp/winsdk + # cp /tmp/xwindownload/sdk/lib/10.0.20348/um/x86_64/WS2_32.lib /tmp/winsdk/ + # cp /tmp/xwindownload/sdk/lib/10.0.20348/um/x86_64/KERNEL32.lib /tmp/winsdk/ + # cp /tmp/xwindownload/sdk/lib/10.0.20348/um/x86_64/BCRYPT.lib /tmp/winsdk/ + # cp /tmp/xwindownload/sdk/lib/10.0.20348/um/x86_64/ADVAPI32.lib /tmp/winsdk/ + # cp /tmp/xwindownload/sdk/lib/10.0.20348/um/x86_64/USERENV.lib /tmp/winsdk/ + # echo "WinSDK files:" + # ls -laH /tmp/winsdk + # echo "" + # mkdir -p package + # mkdir -p package/winsdk + # cp -r /tmp/winsdk/* package/winsdk + # - name: Build Wasmer C-API without LLVM + # shell: bash + # run: | + # make build-capi + # env: + # RUSTFLAGS: -Cpanic=abort + # CARGO_TARGET: x86_64-pc-windows-gnu + # ENABLE_LLVM: 0 + # - name: Build Wasmer C-API headless without LLVM + # shell: bash + # run: | + # make build-capi-headless + # env: + # RUSTFLAGS: -Cpanic=abort + # CARGO_TARGET: x86_64-pc-windows-gnu + # ENABLE_LLVM: 0 + # - name: Dist + # run: | + # make distribution-gnu + # env: + # CARGO_TARGET: x86_64-pc-windows-gnu + # TARGET_DIR: target/x86_64-pc-windows-gnu/release + # - name: Upload Artifacts + # uses: actions/upload-artifact@v4 + # with: + # name: 'wasmer-windows-gnu64' + # path: dist + # if-no-files-found: error + # retention-days: 2 - darwin_aarch64_jsc: - name: macOS aarch64 (JSC) - runs-on: macos-12 - steps: - - uses: actions/checkout@v3 - - uses: dtolnay/rust-toolchain@stable - with: - target: aarch64-apple-darwin - - name: Install Darwin-aarch64 target - shell: bash - run: | - rustup target add aarch64-apple-darwin - - name: Build Wasmer C-API (JSC) - shell: bash - run: | - make build-capi-jsc - env: - RUSTFLAGS: -Cpanic=abort - CARGO_TARGET: aarch64-apple-darwin - - name: Dist - run: | - make distribution - env: - CARGO_TARGET: aarch64-apple-darwin - TARGET_DIR: target/aarch64-apple-darwin/release - - name: Upload Artifacts - uses: actions/upload-artifact@v4 - with: - name: 'aarch64-apple-darwin-jsc' - path: dist - if-no-files-found: error - retention-days: 2 + # darwin_aarch64_jsc: + # name: macOS aarch64 (JSC) + # runs-on: macos-12 + # steps: + # - uses: actions/checkout@v3 + # - uses: dtolnay/rust-toolchain@stable + # with: + # target: aarch64-apple-darwin + # - name: Install Darwin-aarch64 target + # shell: bash + # run: | + # rustup target add aarch64-apple-darwin + # - name: Build Wasmer C-API (JSC) + # shell: bash + # run: | + # make build-capi-jsc + # env: + # RUSTFLAGS: -Cpanic=abort + # CARGO_TARGET: aarch64-apple-darwin + # - name: Dist + # run: | + # make distribution + # env: + # CARGO_TARGET: aarch64-apple-darwin + # TARGET_DIR: target/aarch64-apple-darwin/release + # - name: Upload Artifacts + # uses: actions/upload-artifact@v4 + # with: + # name: 'aarch64-apple-darwin-jsc' + # path: dist + # if-no-files-found: error + # retention-days: 2 - darwin_x86_64_jsc: - name: macOS x86_64 (JSC) - runs-on: macos-12 - steps: - - uses: actions/checkout@v3 - - uses: dtolnay/rust-toolchain@stable - with: - target: x86_64-apple-darwin - - name: Build Wasmer C-API (JSC) - shell: bash - run: | - make build-capi-jsc - env: - RUSTFLAGS: -Cpanic=abort - CARGO_TARGET: x86_64-apple-darwin - - name: Dist - run: | - make distribution - env: - CARGO_TARGET: x86_64-apple-darwin - TARGET_DIR: target/x86_64-apple-darwin/release - - name: Upload Artifacts - uses: actions/upload-artifact@v4 - with: - name: 'x86_64-apple-darwin-jsc' - path: dist - if-no-files-found: error - retention-days: 2 + # darwin_x86_64_jsc: + # name: macOS x86_64 (JSC) + # runs-on: macos-12 + # steps: + # - uses: actions/checkout@v3 + # - uses: dtolnay/rust-toolchain@stable + # with: + # target: x86_64-apple-darwin + # - name: Build Wasmer C-API (JSC) + # shell: bash + # run: | + # make build-capi-jsc + # env: + # RUSTFLAGS: -Cpanic=abort + # CARGO_TARGET: x86_64-apple-darwin + # - name: Dist + # run: | + # make distribution + # env: + # CARGO_TARGET: x86_64-apple-darwin + # TARGET_DIR: target/x86_64-apple-darwin/release + # - name: Upload Artifacts + # uses: actions/upload-artifact@v4 + # with: + # name: 'x86_64-apple-darwin-jsc' + # path: dist + # if-no-files-found: error + # retention-days: 2 - linux_aarch64: - name: Linux aarch64 - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: dtolnay/rust-toolchain@stable - with: - target: aarch64-unknown-linux-gnu - - name: Build cross image - run: | - docker build -t wasmer/aarch64 ${GITHUB_WORKSPACE}/.github/cross-linux-aarch64/ - env: - CROSS_DOCKER_IN_DOCKER: true - - name: Build Wasmer binary - run: | - make build-wasmer - env: - CARGO_BINARY: docker run -v /var/run/docker.sock:/var/run/docker.sock -v ${GITHUB_WORKSPACE}:/project -w /project wasmer/aarch64 cross - CROSS_DOCKER_IN_DOCKER: true - CARGO_TARGET: aarch64-unknown-linux-gnu - PKG_CONFIG_PATH: /usr/lib/aarch64-linux-gnu/pkgconfig - PKG_CONFIG_ALLOW_CROSS: true - ENABLE_LLVM: 0 - - name: Build C API headless - shell: bash - run: | - make package-capi-headless - env: - CARGO_BINARY: docker run -v /var/run/docker.sock:/var/run/docker.sock -v ${GITHUB_WORKSPACE}:/project -w /project wasmer/aarch64 cross - CROSS_DOCKER_IN_DOCKER: true - CARGO_TARGET: aarch64-unknown-linux-gnu - PKG_CONFIG_PATH: /usr/lib/aarch64-linux-gnu/pkgconfig - PKG_CONFIG_ALLOW_CROSS: true - ENABLE_LLVM: 0 - TARGET: aarch64-unknown-linux-gnu - TARGET_DIR: target/aarch64-unknown-linux-gnu/release - - name: Build C API - run: | - make build-capi - env: - CARGO_BINARY: docker run -v /var/run/docker.sock:/var/run/docker.sock -v ${GITHUB_WORKSPACE}:/project -w /project wasmer/aarch64 cross - CROSS_DOCKER_IN_DOCKER: true - CARGO_TARGET: aarch64-unknown-linux-gnu - PKG_CONFIG_PATH: /usr/lib/aarch64-linux-gnu/pkgconfig - PKG_CONFIG_ALLOW_CROSS: true - ENABLE_LLVM: 0 - - name: Dist - run: | - make distribution - env: - CARGO_BINARY: docker run -v /var/run/docker.sock:/var/run/docker.sock -v ${GITHUB_WORKSPACE}:/project -w /project wasmer/aarch64 cross - CROSS_DOCKER_IN_DOCKER: true - CARGO_TARGET: aarch64-unknown-linux-gnu - PKG_CONFIG_PATH: /usr/lib/aarch64-linux-gnu/pkgconfig - PKG_CONFIG_ALLOW_CROSS: true - TARGET: aarch64-unknown-linux-gnu - TARGET_DIR: target/aarch64-unknown-linux-gnu/release - - name: Upload Artifacts - uses: actions/upload-artifact@v4 - with: - name: wasmer-linux-aarch64 - path: dist - if-no-files-found: error - retention-days: 2 + # linux_aarch64: + # name: Linux aarch64 + # runs-on: ubuntu-latest + # steps: + # - uses: actions/checkout@v3 + # - uses: dtolnay/rust-toolchain@stable + # with: + # target: aarch64-unknown-linux-gnu + # - name: Build cross image + # run: | + # docker build -t wasmer/aarch64 ${GITHUB_WORKSPACE}/.github/cross-linux-aarch64/ + # env: + # CROSS_DOCKER_IN_DOCKER: true + # - name: Build Wasmer binary + # run: | + # make build-wasmer + # env: + # CARGO_BINARY: docker run -v /var/run/docker.sock:/var/run/docker.sock -v ${GITHUB_WORKSPACE}:/project -w /project wasmer/aarch64 cross + # CROSS_DOCKER_IN_DOCKER: true + # CARGO_TARGET: aarch64-unknown-linux-gnu + # PKG_CONFIG_PATH: /usr/lib/aarch64-linux-gnu/pkgconfig + # PKG_CONFIG_ALLOW_CROSS: true + # ENABLE_LLVM: 0 + # - name: Build C API headless + # shell: bash + # run: | + # make package-capi-headless + # env: + # CARGO_BINARY: docker run -v /var/run/docker.sock:/var/run/docker.sock -v ${GITHUB_WORKSPACE}:/project -w /project wasmer/aarch64 cross + # CROSS_DOCKER_IN_DOCKER: true + # CARGO_TARGET: aarch64-unknown-linux-gnu + # PKG_CONFIG_PATH: /usr/lib/aarch64-linux-gnu/pkgconfig + # PKG_CONFIG_ALLOW_CROSS: true + # ENABLE_LLVM: 0 + # TARGET: aarch64-unknown-linux-gnu + # TARGET_DIR: target/aarch64-unknown-linux-gnu/release + # - name: Build C API + # run: | + # make build-capi + # env: + # CARGO_BINARY: docker run -v /var/run/docker.sock:/var/run/docker.sock -v ${GITHUB_WORKSPACE}:/project -w /project wasmer/aarch64 cross + # CROSS_DOCKER_IN_DOCKER: true + # CARGO_TARGET: aarch64-unknown-linux-gnu + # PKG_CONFIG_PATH: /usr/lib/aarch64-linux-gnu/pkgconfig + # PKG_CONFIG_ALLOW_CROSS: true + # ENABLE_LLVM: 0 + # - name: Dist + # run: | + # make distribution + # env: + # CARGO_BINARY: docker run -v /var/run/docker.sock:/var/run/docker.sock -v ${GITHUB_WORKSPACE}:/project -w /project wasmer/aarch64 cross + # CROSS_DOCKER_IN_DOCKER: true + # CARGO_TARGET: aarch64-unknown-linux-gnu + # PKG_CONFIG_PATH: /usr/lib/aarch64-linux-gnu/pkgconfig + # PKG_CONFIG_ALLOW_CROSS: true + # TARGET: aarch64-unknown-linux-gnu + # TARGET_DIR: target/aarch64-unknown-linux-gnu/release + # - name: Upload Artifacts + # uses: actions/upload-artifact@v4 + # with: + # name: wasmer-linux-aarch64 + # path: dist + # if-no-files-found: error + # retention-days: 2 - linux_riscv64: - name: Linux riscv64 - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: dtolnay/rust-toolchain@stable - with: - target: riscv64gc-unknown-linux-gnu - - name: Build cross image - run: | - docker build -t wasmer/riscv64 ${GITHUB_WORKSPACE}/.github/cross-linux-riscv64/ - env: - CROSS_DOCKER_IN_DOCKER: true - - name: Build Wasmer binary - run: | - make build-wasmer - env: - CARGO_BINARY: docker run -v /var/run/docker.sock:/var/run/docker.sock -v ${GITHUB_WORKSPACE}:/project -w /project wasmer/riscv64:latest cargo - CROSS_DOCKER_IN_DOCKER: true - CARGO_TARGET: riscv64gc-unknown-linux-gnu - PKG_CONFIG_PATH: /usr/lib/riscv64-linux-gnu/pkgconfig - PKG_CONFIG_ALLOW_CROSS: true - ENABLE_LLVM: 0 - - name: Build C API headless - shell: bash - run: | - make package-capi-headless - env: - CARGO_BINARY: docker run -v /var/run/docker.sock:/var/run/docker.sock -v ${GITHUB_WORKSPACE}:/project -w /project wasmer/riscv64:latest cargo - CROSS_DOCKER_IN_DOCKER: true - CARGO_TARGET: riscv64gc-unknown-linux-gnu - PKG_CONFIG_PATH: /usr/lib/riscv64-linux-gnu/pkgconfig - PKG_CONFIG_ALLOW_CROSS: true - ENABLE_LLVM: 0 - TARGET: riscv64gc-unknown-linux-gnu - TARGET_DIR: target/riscv64gc-unknown-linux-gnu/release - - name: Build C API - run: | - make build-capi - env: - CARGO_BINARY: docker run -v /var/run/docker.sock:/var/run/docker.sock -v ${GITHUB_WORKSPACE}:/project -w /project wasmer/riscv64:latest cargo - CROSS_DOCKER_IN_DOCKER: true - CARGO_TARGET: riscv64gc-unknown-linux-gnu - PKG_CONFIG_PATH: /usr/lib/riscv64-linux-gnu/pkgconfig - PKG_CONFIG_ALLOW_CROSS: true - ENABLE_LLVM: 0 - - name: Dist - run: | - make distribution - env: - CARGO_BINARY: docker run -v /var/run/docker.sock:/var/run/docker.sock -v ${GITHUB_WORKSPACE}:/project -w /project wasmer/riscv64:latest cargo - CROSS_DOCKER_IN_DOCKER: true - CARGO_TARGET: riscv64gc-unknown-linux-gnu - PKG_CONFIG_PATH: /usr/lib/riscv64-linux-gnu/pkgconfig - PKG_CONFIG_ALLOW_CROSS: true - TARGET: riscv64gc-unknown-linux-gnu - TARGET_DIR: target/riscv64gc-unknown-linux-gnu/release - - name: Upload Artifacts - uses: actions/upload-artifact@v4 - with: - name: wasmer-linux-riscv64 - path: dist - if-no-files-found: error - retention-days: 2 + # linux_riscv64: + # name: Linux riscv64 + # runs-on: ubuntu-latest + # steps: + # - uses: actions/checkout@v3 + # - uses: dtolnay/rust-toolchain@stable + # with: + # target: riscv64gc-unknown-linux-gnu + # - name: Build cross image + # run: | + # docker build -t wasmer/riscv64 ${GITHUB_WORKSPACE}/.github/cross-linux-riscv64/ + # env: + # CROSS_DOCKER_IN_DOCKER: true + # - name: Build Wasmer binary + # run: | + # make build-wasmer + # env: + # CARGO_BINARY: docker run -v /var/run/docker.sock:/var/run/docker.sock -v ${GITHUB_WORKSPACE}:/project -w /project wasmer/riscv64:latest cargo + # CROSS_DOCKER_IN_DOCKER: true + # CARGO_TARGET: riscv64gc-unknown-linux-gnu + # PKG_CONFIG_PATH: /usr/lib/riscv64-linux-gnu/pkgconfig + # PKG_CONFIG_ALLOW_CROSS: true + # ENABLE_LLVM: 0 + # - name: Build C API headless + # shell: bash + # run: | + # make package-capi-headless + # env: + # CARGO_BINARY: docker run -v /var/run/docker.sock:/var/run/docker.sock -v ${GITHUB_WORKSPACE}:/project -w /project wasmer/riscv64:latest cargo + # CROSS_DOCKER_IN_DOCKER: true + # CARGO_TARGET: riscv64gc-unknown-linux-gnu + # PKG_CONFIG_PATH: /usr/lib/riscv64-linux-gnu/pkgconfig + # PKG_CONFIG_ALLOW_CROSS: true + # ENABLE_LLVM: 0 + # TARGET: riscv64gc-unknown-linux-gnu + # TARGET_DIR: target/riscv64gc-unknown-linux-gnu/release + # - name: Build C API + # run: | + # make build-capi + # env: + # CARGO_BINARY: docker run -v /var/run/docker.sock:/var/run/docker.sock -v ${GITHUB_WORKSPACE}:/project -w /project wasmer/riscv64:latest cargo + # CROSS_DOCKER_IN_DOCKER: true + # CARGO_TARGET: riscv64gc-unknown-linux-gnu + # PKG_CONFIG_PATH: /usr/lib/riscv64-linux-gnu/pkgconfig + # PKG_CONFIG_ALLOW_CROSS: true + # ENABLE_LLVM: 0 + # - name: Dist + # run: | + # make distribution + # env: + # CARGO_BINARY: docker run -v /var/run/docker.sock:/var/run/docker.sock -v ${GITHUB_WORKSPACE}:/project -w /project wasmer/riscv64:latest cargo + # CROSS_DOCKER_IN_DOCKER: true + # CARGO_TARGET: riscv64gc-unknown-linux-gnu + # PKG_CONFIG_PATH: /usr/lib/riscv64-linux-gnu/pkgconfig + # PKG_CONFIG_ALLOW_CROSS: true + # TARGET: riscv64gc-unknown-linux-gnu + # TARGET_DIR: target/riscv64gc-unknown-linux-gnu/release + # - name: Upload Artifacts + # uses: actions/upload-artifact@v4 + # with: + # name: wasmer-linux-riscv64 + # path: dist + # if-no-files-found: error + # retention-days: 2 release: needs: [setup, build, linux_aarch64, windows_gnu, linux_riscv64] From a433615a3dd9cfc047528e98ede3e91ed0ed0700 Mon Sep 17 00:00:00 2001 From: "M.Amin Rayej" Date: Fri, 18 Oct 2024 13:49:43 +0330 Subject: [PATCH 10/45] also install gcc --- .github/workflows/build.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 696b3432f7c..e3f85dc61ba 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -156,7 +156,7 @@ jobs: if: startsWith(matrix.build, 'macos-') shell: bash run: | - brew install ninja + brew install ninja gcc - name: Install `ninja` on Windows if: startsWith(matrix.build, 'windows-') shell: bash @@ -166,7 +166,6 @@ jobs: if: startsWith(matrix.build, 'macos-') shell: bash run: | - sudo xcode-select --install sudo xcode-select -s /Library/Developer/CommandLineTools - name: Install Rust uses: dtolnay/rust-toolchain@stable From 4505e997cc8ee00f40731fa7fc688bc0f397346b Mon Sep 17 00:00:00 2001 From: "M.Amin Rayej" Date: Fri, 18 Oct 2024 13:51:28 +0330 Subject: [PATCH 11/45] try to fix macos --- .github/workflows/build.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e3f85dc61ba..ba608bf97a6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -167,6 +167,7 @@ jobs: shell: bash run: | sudo xcode-select -s /Library/Developer/CommandLineTools + export CPATH=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include - name: Install Rust uses: dtolnay/rust-toolchain@stable with: @@ -280,6 +281,7 @@ jobs: - name: Build Wasmer with v8 backend if: endsWith(matrix.build, 'v8') run: | + echo $CPATH if [ "${{ matrix.build }}" == "linux-x64-v8" ] || [ "${{ matrix.build }}" == "linux-musl-x64-v8" ]; then RUSTFLAGS="-C linker=clang -C link-arg=-fuse-ld=mold" make build-wasmer-v8 else From 53bb16c9d061555bd2eef2a3abe3096ecbca1755 Mon Sep 17 00:00:00 2001 From: "M.Amin Rayej" Date: Fri, 18 Oct 2024 13:52:57 +0330 Subject: [PATCH 12/45] trigger --- .github/workflows/build.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ba608bf97a6..096fd13abd6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -601,7 +601,8 @@ jobs: # retention-days: 2 release: - needs: [setup, build, linux_aarch64, windows_gnu, linux_riscv64] + # needs: [setup, build, linux_aarch64, windows_gnu, linux_riscv64] + needs: [setup, build] runs-on: ubuntu-latest if: needs.setup.outputs.DOING_RELEASE == '1' || github.event.inputs.release != '' steps: From 43ecbc1cb8d0e5a217de3d0c3eba6c0d78acee87 Mon Sep 17 00:00:00 2001 From: "M.Amin Rayej" Date: Fri, 18 Oct 2024 14:13:10 +0330 Subject: [PATCH 13/45] enable v8 on windows --- .github/workflows/build.yml | 50 +++++++++++++++++++++++++++++-------- 1 file changed, 39 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 096fd13abd6..9ff8c9a314d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -86,14 +86,14 @@ jobs: # use_sccache: false # use_llvm: true # build_wasm: false - - build: macos-x64-v8 - os: macos-13 - llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-amd64.tar.xz' - artifact_name: 'wasmer-v8-darwin-amd64' - cross_compilation_artifact_name: 'cross_compiled_from_mac' - use_sccache: false - use_llvm: true - build_wasm: false + # - build: macos-x64-v8 + # os: macos-13 + # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-amd64.tar.xz' + # artifact_name: 'wasmer-v8-darwin-amd64' + # cross_compilation_artifact_name: 'cross_compiled_from_mac' + # use_sccache: false + # use_llvm: true + # build_wasm: false # - build: macos-x64-wamr # os: macos-13 # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-amd64.tar.xz' @@ -127,6 +127,30 @@ jobs: # use_sccache: false # use_llvm: true # build_wasm: false + - build: windows-x64-v8 + os: windows-2019 + artifact_name: 'wasmer-v8-windows-amd64' + llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-windows-amd64.tar.xz' + cross_compilation_artifact_name: 'cross_compiled_from_win' + use_sccache: false + use_llvm: true + build_wasm: false + - build: windows-x64-wamr + os: windows-2019 + artifact_name: 'wasmer-wamr-windows-amd64' + llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-windows-amd64.tar.xz' + cross_compilation_artifact_name: 'cross_compiled_from_win' + use_sccache: false + use_llvm: true + build_wasm: false + - build: windows-x64-wasmi + os: windows-2019 + artifact_name: 'wasmer-wasmi-windows-amd64' + llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-windows-amd64.tar.xz' + cross_compilation_artifact_name: 'cross_compiled_from_win' + use_sccache: false + use_llvm: true + build_wasm: false # - build: linux-musl-x64 # os: ubuntu-latest # artifact_name: 'wasmer-linux-musl-amd64' @@ -162,12 +186,19 @@ jobs: shell: bash run: | choco install ninja + - name: Delete unwanted link to stop it from interfering (Windows) + if: startsWith(matrix.build, 'windows-') + shell: bash + run: rm /usr/bin/link.exe - name: Install standard header files on macOS if: startsWith(matrix.build, 'macos-') shell: bash run: | sudo xcode-select -s /Library/Developer/CommandLineTools export CPATH=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include + - name: Install MSVC dev-cmd (Windows) + uses: ilammy/msvc-dev-cmd@v1 + if: ${{ matrix.build == 'windows-x64' }} - name: Install Rust uses: dtolnay/rust-toolchain@stable with: @@ -189,9 +220,6 @@ jobs: echo "${LLVM_DIR}/bin" >> $GITHUB_PATH env: LLVM_DIR: .llvm - - name: Install MSVC dev-cmd (Windows) - uses: ilammy/msvc-dev-cmd@v1 - if: ${{ matrix.metadata.build == 'windows-x64' }} - name: Configure LLVM (Windows) # The Custom Windows build does not contains llvm-config.exe, so need to setup manualy here if: matrix.build == 'windows-x64' && matrix.llvm_url From 948891fbb7009b04a995d190c3abed2e7819aee2 Mon Sep 17 00:00:00 2001 From: "M.Amin Rayej" Date: Fri, 18 Oct 2024 14:17:01 +0330 Subject: [PATCH 14/45] fix windows step --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9ff8c9a314d..dfd9174e9a8 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -198,7 +198,7 @@ jobs: export CPATH=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include - name: Install MSVC dev-cmd (Windows) uses: ilammy/msvc-dev-cmd@v1 - if: ${{ matrix.build == 'windows-x64' }} + if: startsWith(matrix.build, 'windows-') - name: Install Rust uses: dtolnay/rust-toolchain@stable with: From a4d5a72497e3cf2f097d1d4cbda1c2dfd2c8c8f0 Mon Sep 17 00:00:00 2001 From: "M.Amin Rayej" Date: Fri, 18 Oct 2024 14:53:08 +0330 Subject: [PATCH 15/45] fix v8 on windows --- .github/workflows/build.yml | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index dfd9174e9a8..b01e941419e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -291,14 +291,14 @@ jobs: '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' -s echo 'RUSTC_WRAPPER=${{ runner.tool_cache }}/cargo-sccache/bin/sccache' >> $GITHUB_ENV shell: bash - - name: Build C API headless - shell: bash - run: | - make package-capi-headless - - name: Build C API - shell: bash - run: | - make build-capi + # - name: Build C API headless + # shell: bash + # run: | + # make package-capi-headless + # - name: Build C API + # shell: bash + # run: | + # make build-capi # - name: Build Wasmer binary with LLVM # if: matrix.use_llvm # shell: bash @@ -308,6 +308,7 @@ jobs: # ENABLE_LLVM: 1 - name: Build Wasmer with v8 backend if: endsWith(matrix.build, 'v8') + shell: bash run: | echo $CPATH if [ "${{ matrix.build }}" == "linux-x64-v8" ] || [ "${{ matrix.build }}" == "linux-musl-x64-v8" ]; then @@ -315,14 +316,14 @@ jobs: else make build-wasmer-v8 fi - - name: Build Wasmer with wamr backend - if: endsWith(matrix.build, 'wamr') - run: | - make build-wasmer-wamr - - name: Build Wasmer with wasmi backend - if: endsWith(matrix.build, 'wasmi') - run: | - make build-wasmer-wasmi + # - name: Build Wasmer with wamr backend + # if: endsWith(matrix.build, 'wamr') + # run: | + # make build-wasmer-wamr + # - name: Build Wasmer with wasmi backend + # if: endsWith(matrix.build, 'wasmi') + # run: | + # make build-wasmer-wasmi # - name: Build Wasmer binary without LLVM # if: matrix.use_llvm != true # shell: bash From 149f6b46cd1e690e6deab36fd88dfa504d65e80f Mon Sep 17 00:00:00 2001 From: "M.Amin Rayej" Date: Fri, 18 Oct 2024 15:11:16 +0330 Subject: [PATCH 16/45] fix v8 on windows --- .github/workflows/build.yml | 46 ++++++++++++++++++------------------- 1 file changed, 22 insertions(+), 24 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b01e941419e..9f8f06b2697 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -135,22 +135,22 @@ jobs: use_sccache: false use_llvm: true build_wasm: false - - build: windows-x64-wamr - os: windows-2019 - artifact_name: 'wasmer-wamr-windows-amd64' - llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-windows-amd64.tar.xz' - cross_compilation_artifact_name: 'cross_compiled_from_win' - use_sccache: false - use_llvm: true - build_wasm: false - - build: windows-x64-wasmi - os: windows-2019 - artifact_name: 'wasmer-wasmi-windows-amd64' - llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-windows-amd64.tar.xz' - cross_compilation_artifact_name: 'cross_compiled_from_win' - use_sccache: false - use_llvm: true - build_wasm: false + # - build: windows-x64-wamr + # os: windows-2019 + # artifact_name: 'wasmer-wamr-windows-amd64' + # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-windows-amd64.tar.xz' + # cross_compilation_artifact_name: 'cross_compiled_from_win' + # use_sccache: false + # use_llvm: true + # build_wasm: false + # - build: windows-x64-wasmi + # os: windows-2019 + # artifact_name: 'wasmer-wasmi-windows-amd64' + # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-windows-amd64.tar.xz' + # cross_compilation_artifact_name: 'cross_compiled_from_win' + # use_sccache: false + # use_llvm: true + # build_wasm: false # - build: linux-musl-x64 # os: ubuntu-latest # artifact_name: 'wasmer-linux-musl-amd64' @@ -306,16 +306,14 @@ jobs: # make build-wasmer # env: # ENABLE_LLVM: 1 - - name: Build Wasmer with v8 backend - if: endsWith(matrix.build, 'v8') - shell: bash - run: | - echo $CPATH - if [ "${{ matrix.build }}" == "linux-x64-v8" ] || [ "${{ matrix.build }}" == "linux-musl-x64-v8" ]; then + - name: Build Wasmer with v8 backend with mold + if: ${{ endsWith(matrix.build, 'v8') && startsWith(matrix.build, 'linux') }} + run: | RUSTFLAGS="-C linker=clang -C link-arg=-fuse-ld=mold" make build-wasmer-v8 - else + - name: Build Wasmer with v8 backend + if: ${{ endsWith(matrix.build, 'v8') && !startsWith(matrix.build, 'linux') }} + run: | make build-wasmer-v8 - fi # - name: Build Wasmer with wamr backend # if: endsWith(matrix.build, 'wamr') # run: | From 04c8bd1ed11aad824b4c9440bd15ca68a7fdd559 Mon Sep 17 00:00:00 2001 From: "M.Amin Rayej" Date: Fri, 18 Oct 2024 15:29:10 +0330 Subject: [PATCH 17/45] use windows 2022 --- .github/workflows/build.yml | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9f8f06b2697..dbb757c64eb 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -128,29 +128,29 @@ jobs: # use_llvm: true # build_wasm: false - build: windows-x64-v8 - os: windows-2019 + os: windows-2022 artifact_name: 'wasmer-v8-windows-amd64' llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-windows-amd64.tar.xz' cross_compilation_artifact_name: 'cross_compiled_from_win' use_sccache: false use_llvm: true build_wasm: false - # - build: windows-x64-wamr - # os: windows-2019 - # artifact_name: 'wasmer-wamr-windows-amd64' - # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-windows-amd64.tar.xz' - # cross_compilation_artifact_name: 'cross_compiled_from_win' - # use_sccache: false - # use_llvm: true - # build_wasm: false - # - build: windows-x64-wasmi - # os: windows-2019 - # artifact_name: 'wasmer-wasmi-windows-amd64' - # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-windows-amd64.tar.xz' - # cross_compilation_artifact_name: 'cross_compiled_from_win' - # use_sccache: false - # use_llvm: true - # build_wasm: false + - build: windows-x64-wamr + os: windows-2022 + artifact_name: 'wasmer-wamr-windows-amd64' + llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-windows-amd64.tar.xz' + cross_compilation_artifact_name: 'cross_compiled_from_win' + use_sccache: false + use_llvm: true + build_wasm: false + - build: windows-x64-wasmi + os: windows-2022 + artifact_name: 'wasmer-wasmi-windows-amd64' + llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-windows-amd64.tar.xz' + cross_compilation_artifact_name: 'cross_compiled_from_win' + use_sccache: false + use_llvm: true + build_wasm: false # - build: linux-musl-x64 # os: ubuntu-latest # artifact_name: 'wasmer-linux-musl-amd64' From c32c00551fca4aa6c3641a14626b1c3ce1e6d736 Mon Sep 17 00:00:00 2001 From: "M.Amin Rayej" Date: Fri, 18 Oct 2024 15:35:41 +0330 Subject: [PATCH 18/45] re-enable wamr and wasmi for windows --- .github/workflows/build.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index dbb757c64eb..66ec0b8cad3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -314,14 +314,14 @@ jobs: if: ${{ endsWith(matrix.build, 'v8') && !startsWith(matrix.build, 'linux') }} run: | make build-wasmer-v8 - # - name: Build Wasmer with wamr backend - # if: endsWith(matrix.build, 'wamr') - # run: | - # make build-wasmer-wamr - # - name: Build Wasmer with wasmi backend - # if: endsWith(matrix.build, 'wasmi') - # run: | - # make build-wasmer-wasmi + - name: Build Wasmer with wamr backend + if: endsWith(matrix.build, 'wamr') + run: | + make build-wasmer-wamr + - name: Build Wasmer with wasmi backend + if: endsWith(matrix.build, 'wasmi') + run: | + make build-wasmer-wasmi # - name: Build Wasmer binary without LLVM # if: matrix.use_llvm != true # shell: bash From 4936e713613fd557477260ea7ea3bb9fae579756 Mon Sep 17 00:00:00 2001 From: "M.Amin Rayej" Date: Fri, 18 Oct 2024 15:54:02 +0330 Subject: [PATCH 19/45] enable backends on macos x64 --- .github/workflows/build.yml | 100 ++++++++++++++++++------------------ 1 file changed, 50 insertions(+), 50 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 66ec0b8cad3..e8e20b44126 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -86,30 +86,30 @@ jobs: # use_sccache: false # use_llvm: true # build_wasm: false - # - build: macos-x64-v8 - # os: macos-13 - # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-amd64.tar.xz' - # artifact_name: 'wasmer-v8-darwin-amd64' - # cross_compilation_artifact_name: 'cross_compiled_from_mac' - # use_sccache: false - # use_llvm: true - # build_wasm: false - # - build: macos-x64-wamr - # os: macos-13 - # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-amd64.tar.xz' - # artifact_name: 'wasmer-wamr-darwin-amd64' - # cross_compilation_artifact_name: 'cross_compiled_from_mac' - # use_sccache: false - # use_llvm: true - # build_wasm: false - # - build: macos-x64-wasmi - # os: macos-13 - # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-amd64.tar.xz' - # artifact_name: 'wasmer-wasmi-darwin-amd64' - # cross_compilation_artifact_name: 'cross_compiled_from_mac' - # use_sccache: false - # use_llvm: true - # build_wasm: false + - build: macos-x64-v8 + os: macos-13 + llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-amd64.tar.xz' + artifact_name: 'wasmer-v8-darwin-amd64' + cross_compilation_artifact_name: 'cross_compiled_from_mac' + use_sccache: false + use_llvm: true + build_wasm: false + - build: macos-x64-wamr + os: macos-13 + llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-amd64.tar.xz' + artifact_name: 'wasmer-wamr-darwin-amd64' + cross_compilation_artifact_name: 'cross_compiled_from_mac' + use_sccache: false + use_llvm: true + build_wasm: false + - build: macos-x64-wasmi + os: macos-13 + llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-amd64.tar.xz' + artifact_name: 'wasmer-wasmi-darwin-amd64' + cross_compilation_artifact_name: 'cross_compiled_from_mac' + use_sccache: false + use_llvm: true + build_wasm: false # - build: macos-arm64 # os: macos-14 # target: aarch64-apple-darwin @@ -127,30 +127,30 @@ jobs: # use_sccache: false # use_llvm: true # build_wasm: false - - build: windows-x64-v8 - os: windows-2022 - artifact_name: 'wasmer-v8-windows-amd64' - llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-windows-amd64.tar.xz' - cross_compilation_artifact_name: 'cross_compiled_from_win' - use_sccache: false - use_llvm: true - build_wasm: false - - build: windows-x64-wamr - os: windows-2022 - artifact_name: 'wasmer-wamr-windows-amd64' - llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-windows-amd64.tar.xz' - cross_compilation_artifact_name: 'cross_compiled_from_win' - use_sccache: false - use_llvm: true - build_wasm: false - - build: windows-x64-wasmi - os: windows-2022 - artifact_name: 'wasmer-wasmi-windows-amd64' - llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-windows-amd64.tar.xz' - cross_compilation_artifact_name: 'cross_compiled_from_win' - use_sccache: false - use_llvm: true - build_wasm: false + # - build: windows-x64-v8 + # os: windows-2022 + # artifact_name: 'wasmer-v8-windows-amd64' + # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-windows-amd64.tar.xz' + # cross_compilation_artifact_name: 'cross_compiled_from_win' + # use_sccache: false + # use_llvm: true + # build_wasm: false + # - build: windows-x64-wamr + # os: windows-2022 + # artifact_name: 'wasmer-wamr-windows-amd64' + # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-windows-amd64.tar.xz' + # cross_compilation_artifact_name: 'cross_compiled_from_win' + # use_sccache: false + # use_llvm: true + # build_wasm: false + # - build: windows-x64-wasmi + # os: windows-2022 + # artifact_name: 'wasmer-wasmi-windows-amd64' + # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-windows-amd64.tar.xz' + # cross_compilation_artifact_name: 'cross_compiled_from_win' + # use_sccache: false + # use_llvm: true + # build_wasm: false # - build: linux-musl-x64 # os: ubuntu-latest # artifact_name: 'wasmer-linux-musl-amd64' @@ -195,7 +195,7 @@ jobs: shell: bash run: | sudo xcode-select -s /Library/Developer/CommandLineTools - export CPATH=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include + echo "CPATH=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include" >> $GITHUB_ENV - name: Install MSVC dev-cmd (Windows) uses: ilammy/msvc-dev-cmd@v1 if: startsWith(matrix.build, 'windows-') @@ -236,7 +236,7 @@ jobs: # using gnu-tar is a workaround for https://github.com/actions/cache/issues/403 brew install gnu-tar echo PATH="/usr/local/opt/gnu-tar/libexec/gnubin:$PATH" >> $GITHUB_ENV - if: matrix.os == 'macos-12' + if: matrix.os == 'macos-13' - uses: actions/cache@v2 with: path: | From d2ded18f44c7b759d3abffd46217aada076eaa30 Mon Sep 17 00:00:00 2001 From: "M.Amin Rayej" Date: Fri, 18 Oct 2024 16:12:54 +0330 Subject: [PATCH 20/45] enable backends for macos-arm --- .github/workflows/build.yml | 77 +++++++++++++++++++++++++------------ 1 file changed, 52 insertions(+), 25 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e8e20b44126..4831f4fca88 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -86,30 +86,30 @@ jobs: # use_sccache: false # use_llvm: true # build_wasm: false - - build: macos-x64-v8 - os: macos-13 - llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-amd64.tar.xz' - artifact_name: 'wasmer-v8-darwin-amd64' - cross_compilation_artifact_name: 'cross_compiled_from_mac' - use_sccache: false - use_llvm: true - build_wasm: false - - build: macos-x64-wamr - os: macos-13 - llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-amd64.tar.xz' - artifact_name: 'wasmer-wamr-darwin-amd64' - cross_compilation_artifact_name: 'cross_compiled_from_mac' - use_sccache: false - use_llvm: true - build_wasm: false - - build: macos-x64-wasmi - os: macos-13 - llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-amd64.tar.xz' - artifact_name: 'wasmer-wasmi-darwin-amd64' - cross_compilation_artifact_name: 'cross_compiled_from_mac' - use_sccache: false - use_llvm: true - build_wasm: false + # - build: macos-x64-v8 + # os: macos-13 + # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-amd64.tar.xz' + # artifact_name: 'wasmer-v8-darwin-amd64' + # cross_compilation_artifact_name: 'cross_compiled_from_mac' + # use_sccache: false + # use_llvm: true + # build_wasm: false + # - build: macos-x64-wamr + # os: macos-13 + # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-amd64.tar.xz' + # artifact_name: 'wasmer-wamr-darwin-amd64' + # cross_compilation_artifact_name: 'cross_compiled_from_mac' + # use_sccache: false + # use_llvm: true + # build_wasm: false + # - build: macos-x64-wasmi + # os: macos-13 + # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-amd64.tar.xz' + # artifact_name: 'wasmer-wasmi-darwin-amd64' + # cross_compilation_artifact_name: 'cross_compiled_from_mac' + # use_sccache: false + # use_llvm: true + # build_wasm: false # - build: macos-arm64 # os: macos-14 # target: aarch64-apple-darwin @@ -117,8 +117,35 @@ jobs: # use_sccache: false # use_llvm: false # build_wasm: false + # # [todo] xdoardo: Reinstate when the code we generate for aarch64 is working correctly. + # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-aarch64.tar.xz' + - build: macos-arm64-v8 + os: macos-14 + target: aarch64-apple-darwin + artifact_name: 'wasmer-v8-darwin-arm64' + use_sccache: false + use_llvm: false + build_wasm: false + # [todo] xdoardo: Reinstate when the code we generate for aarch64 is working correctly. + llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-aarch64.tar.xz' + - build: macos-arm64-wamr + os: macos-14 + target: aarch64-apple-darwin + artifact_name: 'wasmer-wamr-darwin-arm64' + use_sccache: false + use_llvm: false + build_wasm: false + # [todo] xdoardo: Reinstate when the code we generate for aarch64 is working correctly. + llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-aarch64.tar.xz' + - build: macos-arm64-wasmi + os: macos-14 + target: aarch64-apple-darwin + artifact_name: 'wasmer-wasmi-darwin-arm64' + use_sccache: false + use_llvm: false + build_wasm: false # [todo] xdoardo: Reinstate when the code we generate for aarch64 is working correctly. - # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-aarch64.tar.xz' + llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-aarch64.tar.xz' # - build: windows-x64 # os: windows-2019 # artifact_name: 'wasmer-windows-amd64' From 92fd41ed9c13893b8f92507221a4224f2efe0162 Mon Sep 17 00:00:00 2001 From: "M.Amin Rayej" Date: Fri, 18 Oct 2024 16:14:18 +0330 Subject: [PATCH 21/45] install things on arm as well --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4831f4fca88..abf444a7862 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -263,7 +263,7 @@ jobs: # using gnu-tar is a workaround for https://github.com/actions/cache/issues/403 brew install gnu-tar echo PATH="/usr/local/opt/gnu-tar/libexec/gnubin:$PATH" >> $GITHUB_ENV - if: matrix.os == 'macos-13' + if: startsWith(matrix.os == 'macos') - uses: actions/cache@v2 with: path: | From 66415a7554051b9a4c5508b1b95479a57aee7e8d Mon Sep 17 00:00:00 2001 From: "M.Amin Rayej" Date: Fri, 18 Oct 2024 16:16:47 +0330 Subject: [PATCH 22/45] cancel in progress ci --- .github/workflows/build.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index abf444a7862..05969caeaa0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -42,6 +42,9 @@ jobs: name: Build on ${{ matrix.build }} runs-on: ${{ matrix.os }} needs: setup + concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true strategy: fail-fast: false matrix: From 18e90ab8a663151877d6883ef49ca4bdb17158e5 Mon Sep 17 00:00:00 2001 From: "M.Amin Rayej" Date: Fri, 18 Oct 2024 16:17:33 +0330 Subject: [PATCH 23/45] fix syntax --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 05969caeaa0..1dca916e721 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -266,7 +266,7 @@ jobs: # using gnu-tar is a workaround for https://github.com/actions/cache/issues/403 brew install gnu-tar echo PATH="/usr/local/opt/gnu-tar/libexec/gnubin:$PATH" >> $GITHUB_ENV - if: startsWith(matrix.os == 'macos') + if: startsWith(matrix.os, 'macos') - uses: actions/cache@v2 with: path: | From 4cd71a9765067ab55b5096db72513c1492f28878 Mon Sep 17 00:00:00 2001 From: "M.Amin Rayej" Date: Fri, 18 Oct 2024 16:18:32 +0330 Subject: [PATCH 24/45] revert concurrency --- .github/workflows/build.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1dca916e721..2f3bd63e3d1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -42,9 +42,6 @@ jobs: name: Build on ${{ matrix.build }} runs-on: ${{ matrix.os }} needs: setup - concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true strategy: fail-fast: false matrix: From 0f7bc63d092d668dc8d108def75e134e2e46170d Mon Sep 17 00:00:00 2001 From: "M.Amin Rayej" Date: Fri, 18 Oct 2024 16:26:13 +0330 Subject: [PATCH 25/45] enable linux-musl --- .github/workflows/build.yml | 75 ++++++++++++++++++++++++------------- 1 file changed, 48 insertions(+), 27 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2f3bd63e3d1..47612ee60ed 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -119,33 +119,33 @@ jobs: # build_wasm: false # # [todo] xdoardo: Reinstate when the code we generate for aarch64 is working correctly. # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-aarch64.tar.xz' - - build: macos-arm64-v8 - os: macos-14 - target: aarch64-apple-darwin - artifact_name: 'wasmer-v8-darwin-arm64' - use_sccache: false - use_llvm: false - build_wasm: false - # [todo] xdoardo: Reinstate when the code we generate for aarch64 is working correctly. - llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-aarch64.tar.xz' - - build: macos-arm64-wamr - os: macos-14 - target: aarch64-apple-darwin - artifact_name: 'wasmer-wamr-darwin-arm64' - use_sccache: false - use_llvm: false - build_wasm: false - # [todo] xdoardo: Reinstate when the code we generate for aarch64 is working correctly. - llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-aarch64.tar.xz' - - build: macos-arm64-wasmi - os: macos-14 - target: aarch64-apple-darwin - artifact_name: 'wasmer-wasmi-darwin-arm64' - use_sccache: false - use_llvm: false - build_wasm: false - # [todo] xdoardo: Reinstate when the code we generate for aarch64 is working correctly. - llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-aarch64.tar.xz' + # - build: macos-arm64-v8 + # os: macos-14 + # target: aarch64-apple-darwin + # artifact_name: 'wasmer-v8-darwin-arm64' + # use_sccache: false + # use_llvm: false + # build_wasm: false + # # [todo] xdoardo: Reinstate when the code we generate for aarch64 is working correctly. + # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-aarch64.tar.xz' + # - build: macos-arm64-wamr + # os: macos-14 + # target: aarch64-apple-darwin + # artifact_name: 'wasmer-wamr-darwin-arm64' + # use_sccache: false + # use_llvm: false + # build_wasm: false + # # [todo] xdoardo: Reinstate when the code we generate for aarch64 is working correctly. + # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-aarch64.tar.xz' + # - build: macos-arm64-wasmi + # os: macos-14 + # target: aarch64-apple-darwin + # artifact_name: 'wasmer-wasmi-darwin-arm64' + # use_sccache: false + # use_llvm: false + # build_wasm: false + # # [todo] xdoardo: Reinstate when the code we generate for aarch64 is working correctly. + # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-aarch64.tar.xz' # - build: windows-x64 # os: windows-2019 # artifact_name: 'wasmer-windows-amd64' @@ -185,6 +185,27 @@ jobs: # use_sccache: false # use_llvm: false # build_wasm: true + - build: linux-musl-x64-v8 + os: ubuntu-latest + artifact_name: 'wasmer-v8-linux-musl-amd64' + container: alpine:latest + use_sccache: false + use_llvm: false + build_wasm: true + - build: linux-musl-x64-wamr + os: ubuntu-latest + artifact_name: 'wasmer-wamr-linux-musl-amd64' + container: alpine:latest + use_sccache: false + use_llvm: false + build_wasm: true + - build: linux-musl-x64-wasmi + os: ubuntu-latest + artifact_name: 'wasmer-wasmi-linux-musl-amd64' + container: alpine:latest + use_sccache: false + use_llvm: false + build_wasm: true container: ${{ matrix.container }} env: SCCACHE_AZURE_BLOB_CONTAINER: wasmerstoragesccacheblob From 2c8dc8caa4acd413d284cf2bbab27c500029a714 Mon Sep 17 00:00:00 2001 From: "M.Amin Rayej" Date: Fri, 18 Oct 2024 16:28:41 +0330 Subject: [PATCH 26/45] install bash on alpine --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 47612ee60ed..596c0ff5361 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -223,7 +223,7 @@ jobs: - name: Install Linux musl tools if: startsWith(matrix.build, 'linux-musl') run: | - apk add mold ninja + apk add mold ninja bash - name: Install `ninja` on macOS if: startsWith(matrix.build, 'macos-') shell: bash From 895f5f4f7aad3ebf982298a719143710d676546b Mon Sep 17 00:00:00 2001 From: "M.Amin Rayej" Date: Fri, 18 Oct 2024 16:30:56 +0330 Subject: [PATCH 27/45] install curl on alpine --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 596c0ff5361..3cbc45cd9c6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -223,7 +223,7 @@ jobs: - name: Install Linux musl tools if: startsWith(matrix.build, 'linux-musl') run: | - apk add mold ninja bash + apk add mold ninja bash curl - name: Install `ninja` on macOS if: startsWith(matrix.build, 'macos-') shell: bash From bf6a8599f7f06a61515d65e60791518b64915275 Mon Sep 17 00:00:00 2001 From: "M.Amin Rayej" Date: Fri, 18 Oct 2024 16:36:56 +0330 Subject: [PATCH 28/45] install more packages --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3cbc45cd9c6..d6ed44dbcad 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -223,7 +223,7 @@ jobs: - name: Install Linux musl tools if: startsWith(matrix.build, 'linux-musl') run: | - apk add mold ninja bash curl + apk add mold cmake ninja bash curl make - name: Install `ninja` on macOS if: startsWith(matrix.build, 'macos-') shell: bash From a924c380f43bde7b1777eeb705cdba7f11f07229 Mon Sep 17 00:00:00 2001 From: "M.Amin Rayej" Date: Fri, 18 Oct 2024 16:41:31 +0330 Subject: [PATCH 29/45] install llvm18 on alpine --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d6ed44dbcad..91c967e3137 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -223,7 +223,7 @@ jobs: - name: Install Linux musl tools if: startsWith(matrix.build, 'linux-musl') run: | - apk add mold cmake ninja bash curl make + apk add mold cmake ninja bash curl make llvm18 - name: Install `ninja` on macOS if: startsWith(matrix.build, 'macos-') shell: bash From 67d2e4bb5fbd27d4079a9bd64ce61c7c7223a0ec Mon Sep 17 00:00:00 2001 From: "M.Amin Rayej" Date: Fri, 18 Oct 2024 16:48:02 +0330 Subject: [PATCH 30/45] install clang --- .github/workflows/build.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 91c967e3137..c63e308208c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -223,7 +223,7 @@ jobs: - name: Install Linux musl tools if: startsWith(matrix.build, 'linux-musl') run: | - apk add mold cmake ninja bash curl make llvm18 + apk add mold cmake ninja bash curl make llvm18 clang18 - name: Install `ninja` on macOS if: startsWith(matrix.build, 'macos-') shell: bash @@ -384,7 +384,7 @@ jobs: # if: matrix.build != 'linux-musl-x64' # uses: dtolnay/rust-toolchain@master # with: - # toolchain: "nightly-2023-10-05" + # toolchain: "nightly-2024-07-05" # target: ${{ matrix.target }} # components: "rust-src" # - name: Build Minimal Wasmer Headless @@ -402,7 +402,7 @@ jobs: # echo "incremental = false" >> Cargo.toml # echo "codegen-units = 1" >> Cargo.toml # echo "rpath = false" >> Cargo.toml - # rustup override set nightly-2023-10-05 + # rustup override set nightly-2024-07-05 # make build-wasmer-headless-minimal # rustup override unset - name: Dist From 624fdc27144c53a0dc206c63fe8355c5df0a4020 Mon Sep 17 00:00:00 2001 From: "M.Amin Rayej" Date: Fri, 18 Oct 2024 16:55:02 +0330 Subject: [PATCH 31/45] install lld --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c63e308208c..3a327d7e690 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -223,7 +223,7 @@ jobs: - name: Install Linux musl tools if: startsWith(matrix.build, 'linux-musl') run: | - apk add mold cmake ninja bash curl make llvm18 clang18 + apk add mold cmake ninja bash curl make llvm18 clang18 lld - name: Install `ninja` on macOS if: startsWith(matrix.build, 'macos-') shell: bash From c23d6593a5e177f21cd6d797643ec3663c991ccc Mon Sep 17 00:00:00 2001 From: "M.Amin Rayej" Date: Fri, 18 Oct 2024 17:00:03 +0330 Subject: [PATCH 32/45] do not use mold when building with musl --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3a327d7e690..16153bbc81d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -355,11 +355,11 @@ jobs: # env: # ENABLE_LLVM: 1 - name: Build Wasmer with v8 backend with mold - if: ${{ endsWith(matrix.build, 'v8') && startsWith(matrix.build, 'linux') }} + if: ${{ endsWith(matrix.build, 'v8') && startsWith(matrix.build, 'linux-x64') }} run: | RUSTFLAGS="-C linker=clang -C link-arg=-fuse-ld=mold" make build-wasmer-v8 - name: Build Wasmer with v8 backend - if: ${{ endsWith(matrix.build, 'v8') && !startsWith(matrix.build, 'linux') }} + if: ${{ endsWith(matrix.build, 'v8') && !startsWith(matrix.build, 'linux-x64') }} run: | make build-wasmer-v8 - name: Build Wasmer with wamr backend From f96bb21dc2ac64ef0da55929094fd76ff0d0bc44 Mon Sep 17 00:00:00 2001 From: "M.Amin Rayej" Date: Fri, 18 Oct 2024 17:14:14 +0330 Subject: [PATCH 33/45] fix clang and add release steps for backends --- .github/workflows/build.yml | 140 +++++++++++++++++++++++++++++++++++- 1 file changed, 139 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 16153bbc81d..3284a901562 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -223,7 +223,7 @@ jobs: - name: Install Linux musl tools if: startsWith(matrix.build, 'linux-musl') run: | - apk add mold cmake ninja bash curl make llvm18 clang18 lld + apk add mold cmake ninja bash curl make llvm18 clang18 lld clang18-libclang - name: Install `ninja` on macOS if: startsWith(matrix.build, 'macos-') shell: bash @@ -713,6 +713,33 @@ jobs: asset_path: artifacts/wasmer-windows-amd64/wasmer.tar.gz asset_name: wasmer-windows-amd64.tar.gz asset_content_type: application/gzip + - name: Upload Release Asset Windows v8 + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: artifacts/wasmer-v8-windows-amd64/wasmer.tar.gz + asset_name: wasmer-v8-windows-amd64.tar.gz + asset_content_type: application/gzip + - name: Upload Release Asset Windows wamr + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: artifacts/wasmer-wamr-windows-amd64/wasmer.tar.gz + asset_name: wasmer-wamr-windows-amd64.tar.gz + asset_content_type: application/gzip + - name: Upload Release Asset Windows wasmi + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: artifacts/wasmer-wasmi-windows-amd64/wasmer.tar.gz + asset_name: wasmer-wasmi-windows-amd64.tar.gz + asset_content_type: application/gzip - name: Upload Release Asset Linux amd64 uses: actions/upload-release-asset@v1 env: @@ -722,6 +749,33 @@ jobs: asset_path: artifacts/wasmer-linux-amd64/wasmer.tar.gz asset_name: wasmer-linux-amd64.tar.gz asset_content_type: application/gzip + - name: Upload Release Asset v8 Linux amd64 + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: artifacts/wasmer-v8-linux-amd64/wasmer.tar.gz + asset_name: wasmer-v8-linux-amd64.tar.gz + asset_content_type: application/gzip + - name: Upload Release Asset wamr Linux amd64 + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: artifacts/wasmer-wamr-linux-amd64/wasmer.tar.gz + asset_name: wasmer-wamr-linux-amd64.tar.gz + asset_content_type: application/gzip + - name: Upload Release Asset wasmi Linux amd64 + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: artifacts/wasmer-wasmi-linux-amd64/wasmer.tar.gz + asset_name: wasmer-wasmi-linux-amd64.tar.gz + asset_content_type: application/gzip - name: Upload Release Asset Linux aarch64 uses: actions/upload-release-asset@v1 env: @@ -759,6 +813,36 @@ jobs: asset_path: artifacts/wasmer-linux-musl-amd64/wasmer.tar.gz asset_name: wasmer-linux-musl-amd64.tar.gz asset_content_type: application/gzip + - name: Upload Release Asset Linux amd64 (musl) v8 + id: upload-release-asset-linux-musl-amd64-v8 + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: artifacts/wasmer-v8-linux-musl-amd64/wasmer.tar.gz + asset_name: wasmer-v8-linux-musl-amd64.tar.gz + asset_content_type: application/gzip + - name: Upload Release Asset Linux amd64 (musl) wamr + id: upload-release-asset-linux-musl-amd64-wamr + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: artifacts/wasmer-wamr-linux-musl-amd64/wasmer.tar.gz + asset_name: wasmer-wamr-linux-musl-amd64.tar.gz + asset_content_type: application/gzip + - name: Upload Release Asset Linux amd64 (musl) wasmi + id: upload-release-asset-linux-musl-amd64-wasmi + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: artifacts/wasmer-wasmi-linux-musl-amd64/wasmer.tar.gz + asset_name: wasmer-wasmi-linux-musl-amd64.tar.gz + asset_content_type: application/gzip - name: Upload Release Asset Mac amd64 uses: actions/upload-release-asset@v1 env: @@ -768,6 +852,33 @@ jobs: asset_path: artifacts/wasmer-darwin-amd64/wasmer.tar.gz asset_name: wasmer-darwin-amd64.tar.gz asset_content_type: application/gzip + - name: Upload Release Asset Mac amd64 v8 + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: artifacts/wasmer-v8-darwin-amd64/wasmer.tar.gz + asset_name: wasmer-v8-darwin-amd64.tar.gz + asset_content_type: application/gzip + - name: Upload Release Asset Mac amd64 wamr + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: artifacts/wasmer-wamr-darwin-amd64/wasmer.tar.gz + asset_name: wasmer-wamr-darwin-amd64.tar.gz + asset_content_type: application/gzip + - name: Upload Release Asset Mac amd64 wasmi + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: artifacts/wasmer-wasmi-darwin-amd64/wasmer.tar.gz + asset_name: wasmer-wasmi-darwin-amd64.tar.gz + asset_content_type: application/gzip - name: Upload Release Asset Mac arm64 uses: actions/upload-release-asset@v1 env: @@ -777,3 +888,30 @@ jobs: asset_path: artifacts/wasmer-darwin-arm64/wasmer.tar.gz asset_name: wasmer-darwin-arm64.tar.gz asset_content_type: application/gzip + - name: Upload Release Asset Mac arm64 v8 + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: artifacts/wasmer-v8-darwin-arm64/wasmer.tar.gz + asset_name: wasmer-v8-darwin-arm64.tar.gz + asset_content_type: application/gzip + - name: Upload Release Asset Mac arm64 wamr + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: artifacts/wasmer-wamr-darwin-arm64/wasmer.tar.gz + asset_name: wasmer-wamr-darwin-arm64.tar.gz + asset_content_type: application/gzip + - name: Upload Release Asset Mac arm64 wasmi + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: artifacts/wasmer-wasmi-darwin-arm64/wasmer.tar.gz + asset_name: wasmer-wasmi-darwin-arm64.tar.gz + asset_content_type: application/gzip From 883fa9dd9ad1c99285b5c0b76bd5ce45710dbdcd Mon Sep 17 00:00:00 2001 From: "M.Amin Rayej" Date: Fri, 18 Oct 2024 17:29:46 +0330 Subject: [PATCH 34/45] install clang static --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3284a901562..d34c71e44bc 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -223,7 +223,7 @@ jobs: - name: Install Linux musl tools if: startsWith(matrix.build, 'linux-musl') run: | - apk add mold cmake ninja bash curl make llvm18 clang18 lld clang18-libclang + apk add mold cmake ninja bash curl make llvm18 clang18 lld clang18-static - name: Install `ninja` on macOS if: startsWith(matrix.build, 'macos-') shell: bash From 1089cf5228c8a4a23b22bcbeec1fd5a3c187b822 Mon Sep 17 00:00:00 2001 From: "M.Amin Rayej" Date: Fri, 18 Oct 2024 17:40:23 +0330 Subject: [PATCH 35/45] also install shared libs I guess --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d34c71e44bc..1ed35d446ef 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -223,7 +223,7 @@ jobs: - name: Install Linux musl tools if: startsWith(matrix.build, 'linux-musl') run: | - apk add mold cmake ninja bash curl make llvm18 clang18 lld clang18-static + apk add mold cmake ninja bash curl make llvm18 clang18 lld clang18-static clang18-libclang - name: Install `ninja` on macOS if: startsWith(matrix.build, 'macos-') shell: bash From 7c9be634a85084dbcee9aa8406b035912fb513a2 Mon Sep 17 00:00:00 2001 From: "M.Amin Rayej" Date: Fri, 18 Oct 2024 17:51:22 +0330 Subject: [PATCH 36/45] add path for static clang --- .github/workflows/build.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1ed35d446ef..452ef76a97d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -224,6 +224,7 @@ jobs: if: startsWith(matrix.build, 'linux-musl') run: | apk add mold cmake ninja bash curl make llvm18 clang18 lld clang18-static clang18-libclang + echo "LIBCLANG_STATIC_PATH=/usr/lib/llvm18/lib" >> $GITHUB_ENV - name: Install `ninja` on macOS if: startsWith(matrix.build, 'macos-') shell: bash @@ -357,11 +358,12 @@ jobs: - name: Build Wasmer with v8 backend with mold if: ${{ endsWith(matrix.build, 'v8') && startsWith(matrix.build, 'linux-x64') }} run: | - RUSTFLAGS="-C linker=clang -C link-arg=-fuse-ld=mold" make build-wasmer-v8 + RUSTFLAGS="-C linker=clang -C link-arg=-fuse-ld=mold" make build-wasmer-v8 - name: Build Wasmer with v8 backend if: ${{ endsWith(matrix.build, 'v8') && !startsWith(matrix.build, 'linux-x64') }} run: | - make build-wasmer-v8 + echo $LIBCLANG_STATIC_PATH + make build-wasmer-v8 - name: Build Wasmer with wamr backend if: endsWith(matrix.build, 'wamr') run: | From bb2d2ff010fa22af9a86fa92244e3a0e3d7ea06b Mon Sep 17 00:00:00 2001 From: "M.Amin Rayej" Date: Fri, 18 Oct 2024 17:52:30 +0330 Subject: [PATCH 37/45] also install llvm-dev --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 452ef76a97d..1dbd3a33ec9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -223,7 +223,7 @@ jobs: - name: Install Linux musl tools if: startsWith(matrix.build, 'linux-musl') run: | - apk add mold cmake ninja bash curl make llvm18 clang18 lld clang18-static clang18-libclang + apk add mold cmake ninja bash curl make llvm18 llvm18-dev clang18 lld clang18-static clang18-libclang echo "LIBCLANG_STATIC_PATH=/usr/lib/llvm18/lib" >> $GITHUB_ENV - name: Install `ninja` on macOS if: startsWith(matrix.build, 'macos-') From 17fca958cd9c1e8db750f5efe38282f1c4710107 Mon Sep 17 00:00:00 2001 From: "M.Amin Rayej" Date: Fri, 18 Oct 2024 18:01:41 +0330 Subject: [PATCH 38/45] remove shared lib --- .github/workflows/build.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1dbd3a33ec9..f3f6d3c67f2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -223,8 +223,9 @@ jobs: - name: Install Linux musl tools if: startsWith(matrix.build, 'linux-musl') run: | - apk add mold cmake ninja bash curl make llvm18 llvm18-dev clang18 lld clang18-static clang18-libclang + apk add mold cmake ninja bash curl make llvm18 llvm18-dev clang18 lld clang18-static echo "LIBCLANG_STATIC_PATH=/usr/lib/llvm18/lib" >> $GITHUB_ENV + ls /usr/lib/llvm18/lib - name: Install `ninja` on macOS if: startsWith(matrix.build, 'macos-') shell: bash From ba6d39270b05fe2f07fb5c70a5d8f35e1e976f1e Mon Sep 17 00:00:00 2001 From: "M.Amin Rayej" Date: Fri, 18 Oct 2024 18:17:04 +0330 Subject: [PATCH 39/45] test all builds except musl --- .github/workflows/build.yml | 938 +++++++++++++++++------------------- 1 file changed, 442 insertions(+), 496 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f3f6d3c67f2..2047f964de0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -46,162 +46,141 @@ jobs: fail-fast: false matrix: include: - # - build: linux-x64 - # os: ubuntu-22.04 - # artifact_name: 'wasmer-linux-amd64' - # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-amd64.tar.xz' - # cross_compilation_artifact_name: 'cross_compiled_from_linux' - # use_sccache: false - # use_llvm: true - # build_wasm: true - # - build: linux-x64-v8 - # os: ubuntu-22.04 - # artifact_name: 'wasmer-v8-linux-amd64' - # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-amd64.tar.xz' - # cross_compilation_artifact_name: 'cross_compiled_from_linux' - # use_sccache: false - # use_llvm: true - # build_wasm: true - # - build: linux-x64-wamr - # os: ubuntu-22.04 - # artifact_name: 'wasmer-wamr-linux-amd64' - # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-amd64.tar.xz' - # cross_compilation_artifact_name: 'cross_compiled_from_linux' - # use_sccache: false - # use_llvm: true - # build_wasm: true - # - build: linux-x64-wasmi - # os: ubuntu-22.04 - # artifact_name: 'wasmer-wasmi-linux-amd64' - # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-amd64.tar.xz' - # cross_compilation_artifact_name: 'cross_compiled_from_linux' - # use_sccache: false - # use_llvm: true - # build_wasm: true - # - build: macos-x64 - # os: macos-13 - # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-amd64.tar.xz' - # artifact_name: 'wasmer-darwin-amd64' - # cross_compilation_artifact_name: 'cross_compiled_from_mac' - # use_sccache: false - # use_llvm: true - # build_wasm: false - # - build: macos-x64-v8 - # os: macos-13 - # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-amd64.tar.xz' - # artifact_name: 'wasmer-v8-darwin-amd64' - # cross_compilation_artifact_name: 'cross_compiled_from_mac' - # use_sccache: false - # use_llvm: true - # build_wasm: false - # - build: macos-x64-wamr - # os: macos-13 - # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-amd64.tar.xz' - # artifact_name: 'wasmer-wamr-darwin-amd64' - # cross_compilation_artifact_name: 'cross_compiled_from_mac' - # use_sccache: false - # use_llvm: true - # build_wasm: false - # - build: macos-x64-wasmi - # os: macos-13 - # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-amd64.tar.xz' - # artifact_name: 'wasmer-wasmi-darwin-amd64' - # cross_compilation_artifact_name: 'cross_compiled_from_mac' - # use_sccache: false - # use_llvm: true - # build_wasm: false - # - build: macos-arm64 - # os: macos-14 - # target: aarch64-apple-darwin - # artifact_name: 'wasmer-darwin-arm64' - # use_sccache: false - # use_llvm: false - # build_wasm: false - # # [todo] xdoardo: Reinstate when the code we generate for aarch64 is working correctly. - # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-aarch64.tar.xz' - # - build: macos-arm64-v8 - # os: macos-14 - # target: aarch64-apple-darwin - # artifact_name: 'wasmer-v8-darwin-arm64' - # use_sccache: false - # use_llvm: false - # build_wasm: false - # # [todo] xdoardo: Reinstate when the code we generate for aarch64 is working correctly. - # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-aarch64.tar.xz' - # - build: macos-arm64-wamr - # os: macos-14 - # target: aarch64-apple-darwin - # artifact_name: 'wasmer-wamr-darwin-arm64' - # use_sccache: false - # use_llvm: false - # build_wasm: false - # # [todo] xdoardo: Reinstate when the code we generate for aarch64 is working correctly. - # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-aarch64.tar.xz' - # - build: macos-arm64-wasmi - # os: macos-14 - # target: aarch64-apple-darwin - # artifact_name: 'wasmer-wasmi-darwin-arm64' - # use_sccache: false - # use_llvm: false - # build_wasm: false - # # [todo] xdoardo: Reinstate when the code we generate for aarch64 is working correctly. - # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-aarch64.tar.xz' - # - build: windows-x64 - # os: windows-2019 - # artifact_name: 'wasmer-windows-amd64' - # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-windows-amd64.tar.xz' - # cross_compilation_artifact_name: 'cross_compiled_from_win' - # use_sccache: false - # use_llvm: true - # build_wasm: false - # - build: windows-x64-v8 - # os: windows-2022 - # artifact_name: 'wasmer-v8-windows-amd64' - # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-windows-amd64.tar.xz' - # cross_compilation_artifact_name: 'cross_compiled_from_win' - # use_sccache: false - # use_llvm: true - # build_wasm: false - # - build: windows-x64-wamr - # os: windows-2022 - # artifact_name: 'wasmer-wamr-windows-amd64' - # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-windows-amd64.tar.xz' - # cross_compilation_artifact_name: 'cross_compiled_from_win' - # use_sccache: false - # use_llvm: true - # build_wasm: false - # - build: windows-x64-wasmi - # os: windows-2022 - # artifact_name: 'wasmer-wasmi-windows-amd64' - # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-windows-amd64.tar.xz' - # cross_compilation_artifact_name: 'cross_compiled_from_win' - # use_sccache: false - # use_llvm: true - # build_wasm: false - # - build: linux-musl-x64 - # os: ubuntu-latest - # artifact_name: 'wasmer-linux-musl-amd64' - # container: alpine:latest - # use_sccache: false - # use_llvm: false - # build_wasm: true - - build: linux-musl-x64-v8 - os: ubuntu-latest - artifact_name: 'wasmer-v8-linux-musl-amd64' - container: alpine:latest + - build: linux-x64 + os: ubuntu-22.04 + artifact_name: 'wasmer-linux-amd64' + llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-amd64.tar.xz' + cross_compilation_artifact_name: 'cross_compiled_from_linux' use_sccache: false - use_llvm: false + use_llvm: true build_wasm: true - - build: linux-musl-x64-wamr - os: ubuntu-latest - artifact_name: 'wasmer-wamr-linux-musl-amd64' - container: alpine:latest + - build: linux-x64-v8 + os: ubuntu-22.04 + artifact_name: 'wasmer-v8-linux-amd64' + llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-amd64.tar.xz' + cross_compilation_artifact_name: 'cross_compiled_from_linux' use_sccache: false - use_llvm: false + use_llvm: true build_wasm: true - - build: linux-musl-x64-wasmi + - build: linux-x64-wamr + os: ubuntu-22.04 + artifact_name: 'wasmer-wamr-linux-amd64' + llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-amd64.tar.xz' + cross_compilation_artifact_name: 'cross_compiled_from_linux' + use_sccache: false + use_llvm: true + build_wasm: true + - build: linux-x64-wasmi + os: ubuntu-22.04 + artifact_name: 'wasmer-wasmi-linux-amd64' + llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-amd64.tar.xz' + cross_compilation_artifact_name: 'cross_compiled_from_linux' + use_sccache: false + use_llvm: true + build_wasm: true + - build: macos-x64 + os: macos-13 + llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-amd64.tar.xz' + artifact_name: 'wasmer-darwin-amd64' + cross_compilation_artifact_name: 'cross_compiled_from_mac' + use_sccache: false + use_llvm: true + build_wasm: false + - build: macos-x64-v8 + os: macos-13 + llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-amd64.tar.xz' + artifact_name: 'wasmer-v8-darwin-amd64' + cross_compilation_artifact_name: 'cross_compiled_from_mac' + use_sccache: false + use_llvm: true + build_wasm: false + - build: macos-x64-wamr + os: macos-13 + llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-amd64.tar.xz' + artifact_name: 'wasmer-wamr-darwin-amd64' + cross_compilation_artifact_name: 'cross_compiled_from_mac' + use_sccache: false + use_llvm: true + build_wasm: false + - build: macos-x64-wasmi + os: macos-13 + llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-amd64.tar.xz' + artifact_name: 'wasmer-wasmi-darwin-amd64' + cross_compilation_artifact_name: 'cross_compiled_from_mac' + use_sccache: false + use_llvm: true + build_wasm: false + - build: macos-arm64 + os: macos-14 + target: aarch64-apple-darwin + artifact_name: 'wasmer-darwin-arm64' + use_sccache: false + use_llvm: false + build_wasm: false + # [todo] xdoardo: Reinstate when the code we generate for aarch64 is working correctly. + llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-aarch64.tar.xz' + - build: macos-arm64-v8 + os: macos-14 + target: aarch64-apple-darwin + artifact_name: 'wasmer-v8-darwin-arm64' + use_sccache: false + use_llvm: false + build_wasm: false + # [todo] xdoardo: Reinstate when the code we generate for aarch64 is working correctly. + llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-aarch64.tar.xz' + - build: macos-arm64-wamr + os: macos-14 + target: aarch64-apple-darwin + artifact_name: 'wasmer-wamr-darwin-arm64' + use_sccache: false + use_llvm: false + build_wasm: false + # [todo] xdoardo: Reinstate when the code we generate for aarch64 is working correctly. + llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-aarch64.tar.xz' + - build: macos-arm64-wasmi + os: macos-14 + target: aarch64-apple-darwin + artifact_name: 'wasmer-wasmi-darwin-arm64' + use_sccache: false + use_llvm: false + build_wasm: false + # [todo] xdoardo: Reinstate when the code we generate for aarch64 is working correctly. + llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-aarch64.tar.xz' + - build: windows-x64 + os: windows-2019 + artifact_name: 'wasmer-windows-amd64' + llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-windows-amd64.tar.xz' + cross_compilation_artifact_name: 'cross_compiled_from_win' + use_sccache: false + use_llvm: true + build_wasm: false + - build: windows-x64-v8 + os: windows-2022 + artifact_name: 'wasmer-v8-windows-amd64' + llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-windows-amd64.tar.xz' + cross_compilation_artifact_name: 'cross_compiled_from_win' + use_sccache: false + use_llvm: true + build_wasm: false + - build: windows-x64-wamr + os: windows-2022 + artifact_name: 'wasmer-wamr-windows-amd64' + llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-windows-amd64.tar.xz' + cross_compilation_artifact_name: 'cross_compiled_from_win' + use_sccache: false + use_llvm: true + build_wasm: false + - build: windows-x64-wasmi + os: windows-2022 + artifact_name: 'wasmer-wasmi-windows-amd64' + llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-windows-amd64.tar.xz' + cross_compilation_artifact_name: 'cross_compiled_from_win' + use_sccache: false + use_llvm: true + build_wasm: false + - build: linux-musl-x64 os: ubuntu-latest - artifact_name: 'wasmer-wasmi-linux-musl-amd64' + artifact_name: 'wasmer-linux-musl-amd64' container: alpine:latest use_sccache: false use_llvm: false @@ -224,8 +203,6 @@ jobs: if: startsWith(matrix.build, 'linux-musl') run: | apk add mold cmake ninja bash curl make llvm18 llvm18-dev clang18 lld clang18-static - echo "LIBCLANG_STATIC_PATH=/usr/lib/llvm18/lib" >> $GITHUB_ENV - ls /usr/lib/llvm18/lib - name: Install `ninja` on macOS if: startsWith(matrix.build, 'macos-') shell: bash @@ -341,21 +318,21 @@ jobs: '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' -s echo 'RUSTC_WRAPPER=${{ runner.tool_cache }}/cargo-sccache/bin/sccache' >> $GITHUB_ENV shell: bash - # - name: Build C API headless - # shell: bash - # run: | - # make package-capi-headless - # - name: Build C API - # shell: bash - # run: | - # make build-capi - # - name: Build Wasmer binary with LLVM - # if: matrix.use_llvm - # shell: bash - # run: | - # make build-wasmer - # env: - # ENABLE_LLVM: 1 + - name: Build C API headless + shell: bash + run: | + make package-capi-headless + - name: Build C API + shell: bash + run: | + make build-capi + - name: Build Wasmer binary with LLVM + if: matrix.use_llvm + shell: bash + run: | + make build-wasmer + env: + ENABLE_LLVM: 1 - name: Build Wasmer with v8 backend with mold if: ${{ endsWith(matrix.build, 'v8') && startsWith(matrix.build, 'linux-x64') }} run: | @@ -373,41 +350,41 @@ jobs: if: endsWith(matrix.build, 'wasmi') run: | make build-wasmer-wasmi - # - name: Build Wasmer binary without LLVM - # if: matrix.use_llvm != true - # shell: bash - # run: | - # make build-wasmer + - name: Build Wasmer binary without LLVM + if: matrix.use_llvm != true + shell: bash + run: | + make build-wasmer #- name: Build Wasmer binary on Wasm32-WASI without LLVM # if: matrix.build_wasm # shell: bash # run: | # make build-wasmer-wasm - # - name: Install Nightly Rust for Headless - # if: matrix.build != 'linux-musl-x64' - # uses: dtolnay/rust-toolchain@master - # with: - # toolchain: "nightly-2024-07-05" - # target: ${{ matrix.target }} - # components: "rust-src" - # - name: Build Minimal Wasmer Headless - # if: matrix.build != 'linux-musl-x64' - # run: | - # cargo install xargo - # echo "" >> Cargo.toml - # echo "[profile.release]" >> Cargo.toml - # echo "opt-level = 'z'" >> Cargo.toml - # echo "debug = false" >> Cargo.toml - # echo "debug-assertions = false" >> Cargo.toml - # echo "overflow-checks = false" >> Cargo.toml - # echo "lto = true" >> Cargo.toml - # echo "panic = 'abort'" >> Cargo.toml - # echo "incremental = false" >> Cargo.toml - # echo "codegen-units = 1" >> Cargo.toml - # echo "rpath = false" >> Cargo.toml - # rustup override set nightly-2024-07-05 - # make build-wasmer-headless-minimal - # rustup override unset + - name: Install Nightly Rust for Headless + if: matrix.build != 'linux-musl-x64' + uses: dtolnay/rust-toolchain@master + with: + toolchain: "nightly-2024-07-05" + target: ${{ matrix.target }} + components: "rust-src" + - name: Build Minimal Wasmer Headless + if: matrix.build != 'linux-musl-x64' + run: | + cargo install xargo + echo "" >> Cargo.toml + echo "[profile.release]" >> Cargo.toml + echo "opt-level = 'z'" >> Cargo.toml + echo "debug = false" >> Cargo.toml + echo "debug-assertions = false" >> Cargo.toml + echo "overflow-checks = false" >> Cargo.toml + echo "lto = true" >> Cargo.toml + echo "panic = 'abort'" >> Cargo.toml + echo "incremental = false" >> Cargo.toml + echo "codegen-units = 1" >> Cargo.toml + echo "rpath = false" >> Cargo.toml + rustup override set nightly-2024-07-05 + make build-wasmer-headless-minimal + rustup override unset - name: Dist run: | make distribution @@ -419,268 +396,267 @@ jobs: if-no-files-found: error retention-days: 2 - # windows_gnu: - # name: Windows GNU - # runs-on: ubuntu-latest - # steps: - # - uses: actions/checkout@v3 - # - name: Install Windows-GNU linker - # shell: bash - # run: | - # sudo apt install -y mingw-w64 - # - uses: dtolnay/rust-toolchain@stable - # with: - # target: x86_64-pc-windows-gnu - # - name: Install Windows-GNU target - # shell: bash - # run: | - # rustup target add x86_64-pc-windows-gnu - # - name: Install Windows 10 SDK with xwin - # shell: bash - # run: | - # mkdir -p /tmp/xwin - # mkdir -p /tmp/xwindownload - # mkdir -p /tmp/xwincache - # git clone https://github.com/wasmerio/xwin --depth=1 /tmp/xwin - # cargo build --release --manifest-path=/tmp/xwin/Cargo.toml - # /tmp/xwin/target/release/xwin --accept-license --cache-dir /tmp/xwincache splat --output /tmp/xwindownload - # mkdir -p /tmp/winsdk - # cp /tmp/xwindownload/sdk/lib/10.0.20348/um/x86_64/WS2_32.lib /tmp/winsdk/ - # cp /tmp/xwindownload/sdk/lib/10.0.20348/um/x86_64/KERNEL32.lib /tmp/winsdk/ - # cp /tmp/xwindownload/sdk/lib/10.0.20348/um/x86_64/BCRYPT.lib /tmp/winsdk/ - # cp /tmp/xwindownload/sdk/lib/10.0.20348/um/x86_64/ADVAPI32.lib /tmp/winsdk/ - # cp /tmp/xwindownload/sdk/lib/10.0.20348/um/x86_64/USERENV.lib /tmp/winsdk/ - # echo "WinSDK files:" - # ls -laH /tmp/winsdk - # echo "" - # mkdir -p package - # mkdir -p package/winsdk - # cp -r /tmp/winsdk/* package/winsdk - # - name: Build Wasmer C-API without LLVM - # shell: bash - # run: | - # make build-capi - # env: - # RUSTFLAGS: -Cpanic=abort - # CARGO_TARGET: x86_64-pc-windows-gnu - # ENABLE_LLVM: 0 - # - name: Build Wasmer C-API headless without LLVM - # shell: bash - # run: | - # make build-capi-headless - # env: - # RUSTFLAGS: -Cpanic=abort - # CARGO_TARGET: x86_64-pc-windows-gnu - # ENABLE_LLVM: 0 - # - name: Dist - # run: | - # make distribution-gnu - # env: - # CARGO_TARGET: x86_64-pc-windows-gnu - # TARGET_DIR: target/x86_64-pc-windows-gnu/release - # - name: Upload Artifacts - # uses: actions/upload-artifact@v4 - # with: - # name: 'wasmer-windows-gnu64' - # path: dist - # if-no-files-found: error - # retention-days: 2 + windows_gnu: + name: Windows GNU + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Install Windows-GNU linker + shell: bash + run: | + sudo apt install -y mingw-w64 + - uses: dtolnay/rust-toolchain@stable + with: + target: x86_64-pc-windows-gnu + - name: Install Windows-GNU target + shell: bash + run: | + rustup target add x86_64-pc-windows-gnu + - name: Install Windows 10 SDK with xwin + shell: bash + run: | + mkdir -p /tmp/xwin + mkdir -p /tmp/xwindownload + mkdir -p /tmp/xwincache + git clone https://github.com/wasmerio/xwin --depth=1 /tmp/xwin + cargo build --release --manifest-path=/tmp/xwin/Cargo.toml + /tmp/xwin/target/release/xwin --accept-license --cache-dir /tmp/xwincache splat --output /tmp/xwindownload + mkdir -p /tmp/winsdk + cp /tmp/xwindownload/sdk/lib/10.0.20348/um/x86_64/WS2_32.lib /tmp/winsdk/ + cp /tmp/xwindownload/sdk/lib/10.0.20348/um/x86_64/KERNEL32.lib /tmp/winsdk/ + cp /tmp/xwindownload/sdk/lib/10.0.20348/um/x86_64/BCRYPT.lib /tmp/winsdk/ + cp /tmp/xwindownload/sdk/lib/10.0.20348/um/x86_64/ADVAPI32.lib /tmp/winsdk/ + cp /tmp/xwindownload/sdk/lib/10.0.20348/um/x86_64/USERENV.lib /tmp/winsdk/ + echo "WinSDK files:" + ls -laH /tmp/winsdk + echo "" + mkdir -p package + mkdir -p package/winsdk + cp -r /tmp/winsdk/* package/winsdk + - name: Build Wasmer C-API without LLVM + shell: bash + run: | + make build-capi + env: + RUSTFLAGS: -Cpanic=abort + CARGO_TARGET: x86_64-pc-windows-gnu + ENABLE_LLVM: 0 + - name: Build Wasmer C-API headless without LLVM + shell: bash + run: | + make build-capi-headless + env: + RUSTFLAGS: -Cpanic=abort + CARGO_TARGET: x86_64-pc-windows-gnu + ENABLE_LLVM: 0 + - name: Dist + run: | + make distribution-gnu + env: + CARGO_TARGET: x86_64-pc-windows-gnu + TARGET_DIR: target/x86_64-pc-windows-gnu/release + - name: Upload Artifacts + uses: actions/upload-artifact@v4 + with: + name: 'wasmer-windows-gnu64' + path: dist + if-no-files-found: error + retention-days: 2 - # darwin_aarch64_jsc: - # name: macOS aarch64 (JSC) - # runs-on: macos-12 - # steps: - # - uses: actions/checkout@v3 - # - uses: dtolnay/rust-toolchain@stable - # with: - # target: aarch64-apple-darwin - # - name: Install Darwin-aarch64 target - # shell: bash - # run: | - # rustup target add aarch64-apple-darwin - # - name: Build Wasmer C-API (JSC) - # shell: bash - # run: | - # make build-capi-jsc - # env: - # RUSTFLAGS: -Cpanic=abort - # CARGO_TARGET: aarch64-apple-darwin - # - name: Dist - # run: | - # make distribution - # env: - # CARGO_TARGET: aarch64-apple-darwin - # TARGET_DIR: target/aarch64-apple-darwin/release - # - name: Upload Artifacts - # uses: actions/upload-artifact@v4 - # with: - # name: 'aarch64-apple-darwin-jsc' - # path: dist - # if-no-files-found: error - # retention-days: 2 + darwin_aarch64_jsc: + name: macOS aarch64 (JSC) + runs-on: macos-12 + steps: + - uses: actions/checkout@v3 + - uses: dtolnay/rust-toolchain@stable + with: + target: aarch64-apple-darwin + - name: Install Darwin-aarch64 target + shell: bash + run: | + rustup target add aarch64-apple-darwin + - name: Build Wasmer C-API (JSC) + shell: bash + run: | + make build-capi-jsc + env: + RUSTFLAGS: -Cpanic=abort + CARGO_TARGET: aarch64-apple-darwin + - name: Dist + run: | + make distribution + env: + CARGO_TARGET: aarch64-apple-darwin + TARGET_DIR: target/aarch64-apple-darwin/release + - name: Upload Artifacts + uses: actions/upload-artifact@v4 + with: + name: 'aarch64-apple-darwin-jsc' + path: dist + if-no-files-found: error + retention-days: 2 - # darwin_x86_64_jsc: - # name: macOS x86_64 (JSC) - # runs-on: macos-12 - # steps: - # - uses: actions/checkout@v3 - # - uses: dtolnay/rust-toolchain@stable - # with: - # target: x86_64-apple-darwin - # - name: Build Wasmer C-API (JSC) - # shell: bash - # run: | - # make build-capi-jsc - # env: - # RUSTFLAGS: -Cpanic=abort - # CARGO_TARGET: x86_64-apple-darwin - # - name: Dist - # run: | - # make distribution - # env: - # CARGO_TARGET: x86_64-apple-darwin - # TARGET_DIR: target/x86_64-apple-darwin/release - # - name: Upload Artifacts - # uses: actions/upload-artifact@v4 - # with: - # name: 'x86_64-apple-darwin-jsc' - # path: dist - # if-no-files-found: error - # retention-days: 2 + darwin_x86_64_jsc: + name: macOS x86_64 (JSC) + runs-on: macos-12 + steps: + - uses: actions/checkout@v3 + - uses: dtolnay/rust-toolchain@stable + with: + target: x86_64-apple-darwin + - name: Build Wasmer C-API (JSC) + shell: bash + run: | + make build-capi-jsc + env: + RUSTFLAGS: -Cpanic=abort + CARGO_TARGET: x86_64-apple-darwin + - name: Dist + run: | + make distribution + env: + CARGO_TARGET: x86_64-apple-darwin + TARGET_DIR: target/x86_64-apple-darwin/release + - name: Upload Artifacts + uses: actions/upload-artifact@v4 + with: + name: 'x86_64-apple-darwin-jsc' + path: dist + if-no-files-found: error + retention-days: 2 - # linux_aarch64: - # name: Linux aarch64 - # runs-on: ubuntu-latest - # steps: - # - uses: actions/checkout@v3 - # - uses: dtolnay/rust-toolchain@stable - # with: - # target: aarch64-unknown-linux-gnu - # - name: Build cross image - # run: | - # docker build -t wasmer/aarch64 ${GITHUB_WORKSPACE}/.github/cross-linux-aarch64/ - # env: - # CROSS_DOCKER_IN_DOCKER: true - # - name: Build Wasmer binary - # run: | - # make build-wasmer - # env: - # CARGO_BINARY: docker run -v /var/run/docker.sock:/var/run/docker.sock -v ${GITHUB_WORKSPACE}:/project -w /project wasmer/aarch64 cross - # CROSS_DOCKER_IN_DOCKER: true - # CARGO_TARGET: aarch64-unknown-linux-gnu - # PKG_CONFIG_PATH: /usr/lib/aarch64-linux-gnu/pkgconfig - # PKG_CONFIG_ALLOW_CROSS: true - # ENABLE_LLVM: 0 - # - name: Build C API headless - # shell: bash - # run: | - # make package-capi-headless - # env: - # CARGO_BINARY: docker run -v /var/run/docker.sock:/var/run/docker.sock -v ${GITHUB_WORKSPACE}:/project -w /project wasmer/aarch64 cross - # CROSS_DOCKER_IN_DOCKER: true - # CARGO_TARGET: aarch64-unknown-linux-gnu - # PKG_CONFIG_PATH: /usr/lib/aarch64-linux-gnu/pkgconfig - # PKG_CONFIG_ALLOW_CROSS: true - # ENABLE_LLVM: 0 - # TARGET: aarch64-unknown-linux-gnu - # TARGET_DIR: target/aarch64-unknown-linux-gnu/release - # - name: Build C API - # run: | - # make build-capi - # env: - # CARGO_BINARY: docker run -v /var/run/docker.sock:/var/run/docker.sock -v ${GITHUB_WORKSPACE}:/project -w /project wasmer/aarch64 cross - # CROSS_DOCKER_IN_DOCKER: true - # CARGO_TARGET: aarch64-unknown-linux-gnu - # PKG_CONFIG_PATH: /usr/lib/aarch64-linux-gnu/pkgconfig - # PKG_CONFIG_ALLOW_CROSS: true - # ENABLE_LLVM: 0 - # - name: Dist - # run: | - # make distribution - # env: - # CARGO_BINARY: docker run -v /var/run/docker.sock:/var/run/docker.sock -v ${GITHUB_WORKSPACE}:/project -w /project wasmer/aarch64 cross - # CROSS_DOCKER_IN_DOCKER: true - # CARGO_TARGET: aarch64-unknown-linux-gnu - # PKG_CONFIG_PATH: /usr/lib/aarch64-linux-gnu/pkgconfig - # PKG_CONFIG_ALLOW_CROSS: true - # TARGET: aarch64-unknown-linux-gnu - # TARGET_DIR: target/aarch64-unknown-linux-gnu/release - # - name: Upload Artifacts - # uses: actions/upload-artifact@v4 - # with: - # name: wasmer-linux-aarch64 - # path: dist - # if-no-files-found: error - # retention-days: 2 + linux_aarch64: + name: Linux aarch64 + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: dtolnay/rust-toolchain@stable + with: + target: aarch64-unknown-linux-gnu + - name: Build cross image + run: | + docker build -t wasmer/aarch64 ${GITHUB_WORKSPACE}/.github/cross-linux-aarch64/ + env: + CROSS_DOCKER_IN_DOCKER: true + - name: Build Wasmer binary + run: | + make build-wasmer + env: + CARGO_BINARY: docker run -v /var/run/docker.sock:/var/run/docker.sock -v ${GITHUB_WORKSPACE}:/project -w /project wasmer/aarch64 cross + CROSS_DOCKER_IN_DOCKER: true + CARGO_TARGET: aarch64-unknown-linux-gnu + PKG_CONFIG_PATH: /usr/lib/aarch64-linux-gnu/pkgconfig + PKG_CONFIG_ALLOW_CROSS: true + ENABLE_LLVM: 0 + - name: Build C API headless + shell: bash + run: | + make package-capi-headless + env: + CARGO_BINARY: docker run -v /var/run/docker.sock:/var/run/docker.sock -v ${GITHUB_WORKSPACE}:/project -w /project wasmer/aarch64 cross + CROSS_DOCKER_IN_DOCKER: true + CARGO_TARGET: aarch64-unknown-linux-gnu + PKG_CONFIG_PATH: /usr/lib/aarch64-linux-gnu/pkgconfig + PKG_CONFIG_ALLOW_CROSS: true + ENABLE_LLVM: 0 + TARGET: aarch64-unknown-linux-gnu + TARGET_DIR: target/aarch64-unknown-linux-gnu/release + - name: Build C API + run: | + make build-capi + env: + CARGO_BINARY: docker run -v /var/run/docker.sock:/var/run/docker.sock -v ${GITHUB_WORKSPACE}:/project -w /project wasmer/aarch64 cross + CROSS_DOCKER_IN_DOCKER: true + CARGO_TARGET: aarch64-unknown-linux-gnu + PKG_CONFIG_PATH: /usr/lib/aarch64-linux-gnu/pkgconfig + PKG_CONFIG_ALLOW_CROSS: true + ENABLE_LLVM: 0 + - name: Dist + run: | + make distribution + env: + CARGO_BINARY: docker run -v /var/run/docker.sock:/var/run/docker.sock -v ${GITHUB_WORKSPACE}:/project -w /project wasmer/aarch64 cross + CROSS_DOCKER_IN_DOCKER: true + CARGO_TARGET: aarch64-unknown-linux-gnu + PKG_CONFIG_PATH: /usr/lib/aarch64-linux-gnu/pkgconfig + PKG_CONFIG_ALLOW_CROSS: true + TARGET: aarch64-unknown-linux-gnu + TARGET_DIR: target/aarch64-unknown-linux-gnu/release + - name: Upload Artifacts + uses: actions/upload-artifact@v4 + with: + name: wasmer-linux-aarch64 + path: dist + if-no-files-found: error + retention-days: 2 - # linux_riscv64: - # name: Linux riscv64 - # runs-on: ubuntu-latest - # steps: - # - uses: actions/checkout@v3 - # - uses: dtolnay/rust-toolchain@stable - # with: - # target: riscv64gc-unknown-linux-gnu - # - name: Build cross image - # run: | - # docker build -t wasmer/riscv64 ${GITHUB_WORKSPACE}/.github/cross-linux-riscv64/ - # env: - # CROSS_DOCKER_IN_DOCKER: true - # - name: Build Wasmer binary - # run: | - # make build-wasmer - # env: - # CARGO_BINARY: docker run -v /var/run/docker.sock:/var/run/docker.sock -v ${GITHUB_WORKSPACE}:/project -w /project wasmer/riscv64:latest cargo - # CROSS_DOCKER_IN_DOCKER: true - # CARGO_TARGET: riscv64gc-unknown-linux-gnu - # PKG_CONFIG_PATH: /usr/lib/riscv64-linux-gnu/pkgconfig - # PKG_CONFIG_ALLOW_CROSS: true - # ENABLE_LLVM: 0 - # - name: Build C API headless - # shell: bash - # run: | - # make package-capi-headless - # env: - # CARGO_BINARY: docker run -v /var/run/docker.sock:/var/run/docker.sock -v ${GITHUB_WORKSPACE}:/project -w /project wasmer/riscv64:latest cargo - # CROSS_DOCKER_IN_DOCKER: true - # CARGO_TARGET: riscv64gc-unknown-linux-gnu - # PKG_CONFIG_PATH: /usr/lib/riscv64-linux-gnu/pkgconfig - # PKG_CONFIG_ALLOW_CROSS: true - # ENABLE_LLVM: 0 - # TARGET: riscv64gc-unknown-linux-gnu - # TARGET_DIR: target/riscv64gc-unknown-linux-gnu/release - # - name: Build C API - # run: | - # make build-capi - # env: - # CARGO_BINARY: docker run -v /var/run/docker.sock:/var/run/docker.sock -v ${GITHUB_WORKSPACE}:/project -w /project wasmer/riscv64:latest cargo - # CROSS_DOCKER_IN_DOCKER: true - # CARGO_TARGET: riscv64gc-unknown-linux-gnu - # PKG_CONFIG_PATH: /usr/lib/riscv64-linux-gnu/pkgconfig - # PKG_CONFIG_ALLOW_CROSS: true - # ENABLE_LLVM: 0 - # - name: Dist - # run: | - # make distribution - # env: - # CARGO_BINARY: docker run -v /var/run/docker.sock:/var/run/docker.sock -v ${GITHUB_WORKSPACE}:/project -w /project wasmer/riscv64:latest cargo - # CROSS_DOCKER_IN_DOCKER: true - # CARGO_TARGET: riscv64gc-unknown-linux-gnu - # PKG_CONFIG_PATH: /usr/lib/riscv64-linux-gnu/pkgconfig - # PKG_CONFIG_ALLOW_CROSS: true - # TARGET: riscv64gc-unknown-linux-gnu - # TARGET_DIR: target/riscv64gc-unknown-linux-gnu/release - # - name: Upload Artifacts - # uses: actions/upload-artifact@v4 - # with: - # name: wasmer-linux-riscv64 - # path: dist - # if-no-files-found: error - # retention-days: 2 + linux_riscv64: + name: Linux riscv64 + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: dtolnay/rust-toolchain@stable + with: + target: riscv64gc-unknown-linux-gnu + - name: Build cross image + run: | + docker build -t wasmer/riscv64 ${GITHUB_WORKSPACE}/.github/cross-linux-riscv64/ + env: + CROSS_DOCKER_IN_DOCKER: true + - name: Build Wasmer binary + run: | + make build-wasmer + env: + CARGO_BINARY: docker run -v /var/run/docker.sock:/var/run/docker.sock -v ${GITHUB_WORKSPACE}:/project -w /project wasmer/riscv64:latest cargo + CROSS_DOCKER_IN_DOCKER: true + CARGO_TARGET: riscv64gc-unknown-linux-gnu + PKG_CONFIG_PATH: /usr/lib/riscv64-linux-gnu/pkgconfig + PKG_CONFIG_ALLOW_CROSS: true + ENABLE_LLVM: 0 + - name: Build C API headless + shell: bash + run: | + make package-capi-headless + env: + CARGO_BINARY: docker run -v /var/run/docker.sock:/var/run/docker.sock -v ${GITHUB_WORKSPACE}:/project -w /project wasmer/riscv64:latest cargo + CROSS_DOCKER_IN_DOCKER: true + CARGO_TARGET: riscv64gc-unknown-linux-gnu + PKG_CONFIG_PATH: /usr/lib/riscv64-linux-gnu/pkgconfig + PKG_CONFIG_ALLOW_CROSS: true + ENABLE_LLVM: 0 + TARGET: riscv64gc-unknown-linux-gnu + TARGET_DIR: target/riscv64gc-unknown-linux-gnu/release + - name: Build C API + run: | + make build-capi + env: + CARGO_BINARY: docker run -v /var/run/docker.sock:/var/run/docker.sock -v ${GITHUB_WORKSPACE}:/project -w /project wasmer/riscv64:latest cargo + CROSS_DOCKER_IN_DOCKER: true + CARGO_TARGET: riscv64gc-unknown-linux-gnu + PKG_CONFIG_PATH: /usr/lib/riscv64-linux-gnu/pkgconfig + PKG_CONFIG_ALLOW_CROSS: true + ENABLE_LLVM: 0 + - name: Dist + run: | + make distribution + env: + CARGO_BINARY: docker run -v /var/run/docker.sock:/var/run/docker.sock -v ${GITHUB_WORKSPACE}:/project -w /project wasmer/riscv64:latest cargo + CROSS_DOCKER_IN_DOCKER: true + CARGO_TARGET: riscv64gc-unknown-linux-gnu + PKG_CONFIG_PATH: /usr/lib/riscv64-linux-gnu/pkgconfig + PKG_CONFIG_ALLOW_CROSS: true + TARGET: riscv64gc-unknown-linux-gnu + TARGET_DIR: target/riscv64gc-unknown-linux-gnu/release + - name: Upload Artifacts + uses: actions/upload-artifact@v4 + with: + name: wasmer-linux-riscv64 + path: dist + if-no-files-found: error + retention-days: 2 release: - # needs: [setup, build, linux_aarch64, windows_gnu, linux_riscv64] - needs: [setup, build] + needs: [setup, build, linux_aarch64, windows_gnu, linux_riscv64] runs-on: ubuntu-latest if: needs.setup.outputs.DOING_RELEASE == '1' || github.event.inputs.release != '' steps: @@ -716,7 +692,7 @@ jobs: asset_path: artifacts/wasmer-windows-amd64/wasmer.tar.gz asset_name: wasmer-windows-amd64.tar.gz asset_content_type: application/gzip - - name: Upload Release Asset Windows v8 + - name: Upload Release Asset Windows With v8 uses: actions/upload-release-asset@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -725,7 +701,7 @@ jobs: asset_path: artifacts/wasmer-v8-windows-amd64/wasmer.tar.gz asset_name: wasmer-v8-windows-amd64.tar.gz asset_content_type: application/gzip - - name: Upload Release Asset Windows wamr + - name: Upload Release Asset Windows With wamr uses: actions/upload-release-asset@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -734,7 +710,7 @@ jobs: asset_path: artifacts/wasmer-wamr-windows-amd64/wasmer.tar.gz asset_name: wasmer-wamr-windows-amd64.tar.gz asset_content_type: application/gzip - - name: Upload Release Asset Windows wasmi + - name: Upload Release Asset Windows With wasmi uses: actions/upload-release-asset@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -752,7 +728,7 @@ jobs: asset_path: artifacts/wasmer-linux-amd64/wasmer.tar.gz asset_name: wasmer-linux-amd64.tar.gz asset_content_type: application/gzip - - name: Upload Release Asset v8 Linux amd64 + - name: Upload Release Asset Linux amd64 With v8 uses: actions/upload-release-asset@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -761,7 +737,7 @@ jobs: asset_path: artifacts/wasmer-v8-linux-amd64/wasmer.tar.gz asset_name: wasmer-v8-linux-amd64.tar.gz asset_content_type: application/gzip - - name: Upload Release Asset wamr Linux amd64 + - name: Upload Release Asset Linux amd64 With wamr uses: actions/upload-release-asset@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -770,7 +746,7 @@ jobs: asset_path: artifacts/wasmer-wamr-linux-amd64/wasmer.tar.gz asset_name: wasmer-wamr-linux-amd64.tar.gz asset_content_type: application/gzip - - name: Upload Release Asset wasmi Linux amd64 + - name: Upload Release Asset Linux amd64 with wasmi uses: actions/upload-release-asset@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -816,36 +792,6 @@ jobs: asset_path: artifacts/wasmer-linux-musl-amd64/wasmer.tar.gz asset_name: wasmer-linux-musl-amd64.tar.gz asset_content_type: application/gzip - - name: Upload Release Asset Linux amd64 (musl) v8 - id: upload-release-asset-linux-musl-amd64-v8 - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: artifacts/wasmer-v8-linux-musl-amd64/wasmer.tar.gz - asset_name: wasmer-v8-linux-musl-amd64.tar.gz - asset_content_type: application/gzip - - name: Upload Release Asset Linux amd64 (musl) wamr - id: upload-release-asset-linux-musl-amd64-wamr - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: artifacts/wasmer-wamr-linux-musl-amd64/wasmer.tar.gz - asset_name: wasmer-wamr-linux-musl-amd64.tar.gz - asset_content_type: application/gzip - - name: Upload Release Asset Linux amd64 (musl) wasmi - id: upload-release-asset-linux-musl-amd64-wasmi - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: artifacts/wasmer-wasmi-linux-musl-amd64/wasmer.tar.gz - asset_name: wasmer-wasmi-linux-musl-amd64.tar.gz - asset_content_type: application/gzip - name: Upload Release Asset Mac amd64 uses: actions/upload-release-asset@v1 env: @@ -855,7 +801,7 @@ jobs: asset_path: artifacts/wasmer-darwin-amd64/wasmer.tar.gz asset_name: wasmer-darwin-amd64.tar.gz asset_content_type: application/gzip - - name: Upload Release Asset Mac amd64 v8 + - name: Upload Release Asset Mac amd64 With v8 uses: actions/upload-release-asset@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -864,7 +810,7 @@ jobs: asset_path: artifacts/wasmer-v8-darwin-amd64/wasmer.tar.gz asset_name: wasmer-v8-darwin-amd64.tar.gz asset_content_type: application/gzip - - name: Upload Release Asset Mac amd64 wamr + - name: Upload Release Asset Mac amd64 With wamr uses: actions/upload-release-asset@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -873,7 +819,7 @@ jobs: asset_path: artifacts/wasmer-wamr-darwin-amd64/wasmer.tar.gz asset_name: wasmer-wamr-darwin-amd64.tar.gz asset_content_type: application/gzip - - name: Upload Release Asset Mac amd64 wasmi + - name: Upload Release Asset Mac amd64 With wasmi uses: actions/upload-release-asset@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -891,7 +837,7 @@ jobs: asset_path: artifacts/wasmer-darwin-arm64/wasmer.tar.gz asset_name: wasmer-darwin-arm64.tar.gz asset_content_type: application/gzip - - name: Upload Release Asset Mac arm64 v8 + - name: Upload Release Asset Mac arm64 With v8 uses: actions/upload-release-asset@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -900,7 +846,7 @@ jobs: asset_path: artifacts/wasmer-v8-darwin-arm64/wasmer.tar.gz asset_name: wasmer-v8-darwin-arm64.tar.gz asset_content_type: application/gzip - - name: Upload Release Asset Mac arm64 wamr + - name: Upload Release Asset Mac arm64 With wamr uses: actions/upload-release-asset@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -909,7 +855,7 @@ jobs: asset_path: artifacts/wasmer-wamr-darwin-arm64/wasmer.tar.gz asset_name: wasmer-wamr-darwin-arm64.tar.gz asset_content_type: application/gzip - - name: Upload Release Asset Mac arm64 wasmi + - name: Upload Release Asset Mac arm64 With wasmi uses: actions/upload-release-asset@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From d29ae0f8d6466359559e1e4f3acc26042204236c Mon Sep 17 00:00:00 2001 From: "M.Amin Rayej" Date: Fri, 18 Oct 2024 19:02:26 +0330 Subject: [PATCH 40/45] fix for windows --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2047f964de0..fa78c27d018 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -249,7 +249,7 @@ jobs: LLVM_DIR: .llvm - name: Configure LLVM (Windows) # The Custom Windows build does not contains llvm-config.exe, so need to setup manualy here - if: matrix.build == 'windows-x64' && matrix.llvm_url + if: startsWith(matrix.build, 'windows-x64') && matrix.llvm_url shell: bash run: | LLVM_DIR=$(pwd)/${{ env.LLVM_DIR }} From e5e0e109c63bc741a0e02ab90ce176cfc5f2b4bb Mon Sep 17 00:00:00 2001 From: "M.Amin Rayej" Date: Fri, 18 Oct 2024 19:40:41 +0330 Subject: [PATCH 41/45] fix windows version --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index fa78c27d018..9e2edfd7ab0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -147,7 +147,7 @@ jobs: # [todo] xdoardo: Reinstate when the code we generate for aarch64 is working correctly. llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-aarch64.tar.xz' - build: windows-x64 - os: windows-2019 + os: windows-2022 artifact_name: 'wasmer-windows-amd64' llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-windows-amd64.tar.xz' cross_compilation_artifact_name: 'cross_compiled_from_win' From 5115ce04551c35da9f6dd25d82bfc3772ebf3ce3 Mon Sep 17 00:00:00 2001 From: "M.Amin Rayej" Date: Mon, 21 Oct 2024 12:31:26 +0330 Subject: [PATCH 42/45] re-enable other workflows --- .github/workflows/build.yml | 3 - .github/workflows/test.yaml | 2176 ++++++++--------- .github/workflows/wasmer-config.yaml | 98 +- .../workflows/wasmer-integration-tests.yaml | 98 +- 4 files changed, 1186 insertions(+), 1189 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9e2edfd7ab0..523846c70d4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -12,9 +12,6 @@ on: tags: # this is _not_ a regex, see: https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#filter-pattern-cheat-sheet - '[0-9]+.[0-9]+.[0-9]+*' - pull_request: # TODO: MUST BE REMOVED! ONLY FOR TESTING - branches: - - 'main' # Run jobs on PRs targeting the 'main' branch workflow_dispatch: inputs: release: diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 7ea3b591c00..ddffe58f499 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -1,1135 +1,1135 @@ -# name: test-sys +name: test-sys -# on: -# push: -# branches: -# - main -# - 'with-ci-.*' -# - 'v3.0.x' -# - 'v3.1.x' -# pull_request: -# workflow_dispatch: -# inputs: -# release: -# description: 'Make release' +on: + push: + branches: + - main + - 'with-ci-.*' + - 'v3.0.x' + - 'v3.1.x' + pull_request: + workflow_dispatch: + inputs: + release: + description: 'Make release' -# # Automatically cancel previous workflow runs when a new commit is pushed. -# concurrency: -# group: ${{ github.workflow }}-${{ github.ref }} -# cancel-in-progress: true +# Automatically cancel previous workflow runs when a new commit is pushed. +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true -# env: -# RUST_BACKTRACE: 1 -# # Sparse will be enabled by dtolnay/rust-toolchain when installing nightly -# # Rust, but it's not stable on 1.69 yet. By explicitly setting the protocol we -# # can override that behaviour -# CARGO_REGISTRIES_CRATES_IO_PROTOCOL: git -# MSRV: "1.81" -# NEXTEST_PROFILE: "ci" -# RUSTUP_WINDOWS_PATH_ADD_BIN: 1 -# WASI_SDK_VERSION: "22" +env: + RUST_BACKTRACE: 1 + # Sparse will be enabled by dtolnay/rust-toolchain when installing nightly + # Rust, but it's not stable on 1.69 yet. By explicitly setting the protocol we + # can override that behaviour + CARGO_REGISTRIES_CRATES_IO_PROTOCOL: git + MSRV: "1.81" + NEXTEST_PROFILE: "ci" + RUSTUP_WINDOWS_PATH_ADD_BIN: 1 + WASI_SDK_VERSION: "22" -# jobs: -# setup: -# name: Set up -# runs-on: ubuntu-22.04 -# outputs: -# VERSION: ${{ steps.setup.outputs.VERSION }} -# DOING_RELEASE: ${{ steps.setup.outputs.DOING_RELEASE }} -# steps: -# - name: Set up env vars -# id: setup -# shell: bash -# run: | -# VERSION=${GITHUB_REF/refs\/tags\//} -# echo "VERSION=${VERSION}" >> $GITHUB_OUTPUT -# DOING_RELEASE=$(echo $VERSION | grep -c '^[0-9]\+\.[0-9]\+\.[0-9]\+\(-\([a-zA-Z]\+\)\?[0-9]*\)\?$' || true) -# echo "DOING_RELEASE=${DOING_RELEASE}" >> $GITHUB_OUTPUT -# echo $VERSION -# echo $DOING_RELEASE +jobs: + setup: + name: Set up + runs-on: ubuntu-22.04 + outputs: + VERSION: ${{ steps.setup.outputs.VERSION }} + DOING_RELEASE: ${{ steps.setup.outputs.DOING_RELEASE }} + steps: + - name: Set up env vars + id: setup + shell: bash + run: | + VERSION=${GITHUB_REF/refs\/tags\//} + echo "VERSION=${VERSION}" >> $GITHUB_OUTPUT + DOING_RELEASE=$(echo $VERSION | grep -c '^[0-9]\+\.[0-9]\+\.[0-9]\+\(-\([a-zA-Z]\+\)\?[0-9]*\)\?$' || true) + echo "DOING_RELEASE=${DOING_RELEASE}" >> $GITHUB_OUTPUT + echo $VERSION + echo $DOING_RELEASE -# lint: -# name: Code lint -# runs-on: ubuntu-22.04 -# steps: -# - uses: actions/checkout@v3 -# - name: Install Rust -# uses: dtolnay/rust-toolchain@stable -# with: -# toolchain: ${{ env.MSRV }} -# components: rustfmt, clippy -# - name: Install libtinfo -# shell: bash -# run: | -# sudo apt install -y libtinfo5 -# - name: Install LLVM (Linux) -# run: | -# curl --proto '=https' --tlsv1.2 -sSf https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-amd64.tar.xz -L -o /opt/llvm.tar.xz -# mkdir -p /opt/llvm-18 -# tar xf /opt/llvm.tar.xz --strip-components=1 -C /opt/llvm-18 -# echo '/opt/llvm-18/bin' >> $GITHUB_PATH -# echo 'LLVM_SYS_180_PREFIX=/opt/llvm-18' >> $GITHUB_ENV -# - name: Cache -# uses: whywaita/actions-cache-s3@v2 -# with: -# path: | -# ~/.cargo/* -# ./target/* -# key: r22-${{ github.repository }}-${{ runner.os }}-${{ hashFiles('Cargo.lock') }}-wasmer-make-lint-linux-x64 -# aws-s3-bucket: wasmer-rust-artifacts-cache -# aws-access-key-id: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_TOKEN }} -# aws-secret-access-key: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_KEY }} -# aws-region: auto -# aws-endpoint: https://1541b1e8a3fc6ad155ce67ef38899700.r2.cloudflarestorage.com -# aws-s3-bucket-endpoint: false -# aws-s3-force-path-style: true -# - run: make lint -# env: -# ENABLE_CRANELIFT: "1" -# ENABLE_LLVM: "1" -# ENABLE_SINGLEPASS: "1" -# - name: Assert no files have changed -# run: | -# git status -# ! [[ $(git status -s) ]] + lint: + name: Code lint + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v3 + - name: Install Rust + uses: dtolnay/rust-toolchain@stable + with: + toolchain: ${{ env.MSRV }} + components: rustfmt, clippy + - name: Install libtinfo + shell: bash + run: | + sudo apt install -y libtinfo5 + - name: Install LLVM (Linux) + run: | + curl --proto '=https' --tlsv1.2 -sSf https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-amd64.tar.xz -L -o /opt/llvm.tar.xz + mkdir -p /opt/llvm-18 + tar xf /opt/llvm.tar.xz --strip-components=1 -C /opt/llvm-18 + echo '/opt/llvm-18/bin' >> $GITHUB_PATH + echo 'LLVM_SYS_180_PREFIX=/opt/llvm-18' >> $GITHUB_ENV + - name: Cache + uses: whywaita/actions-cache-s3@v2 + with: + path: | + ~/.cargo/* + ./target/* + key: r22-${{ github.repository }}-${{ runner.os }}-${{ hashFiles('Cargo.lock') }}-wasmer-make-lint-linux-x64 + aws-s3-bucket: wasmer-rust-artifacts-cache + aws-access-key-id: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_TOKEN }} + aws-secret-access-key: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_KEY }} + aws-region: auto + aws-endpoint: https://1541b1e8a3fc6ad155ce67ef38899700.r2.cloudflarestorage.com + aws-s3-bucket-endpoint: false + aws-s3-force-path-style: true + - run: make lint + env: + ENABLE_CRANELIFT: "1" + ENABLE_LLVM: "1" + ENABLE_SINGLEPASS: "1" + - name: Assert no files have changed + run: | + git status + ! [[ $(git status -s) ]] -# cargo_deny: -# name: cargo-deny -# runs-on: ubuntu-22.04 -# steps: -# - uses: actions/checkout@v3 -# - uses: EmbarkStudios/cargo-deny-action@v1 -# with: -# log-level: error + cargo_deny: + name: cargo-deny + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v3 + - uses: EmbarkStudios/cargo-deny-action@v1 + with: + log-level: error -# test_nodejs: -# name: Test on NodeJS -# runs-on: ubuntu-22.04 -# steps: -# - uses: actions/checkout@v3 -# - name: Install Rust -# uses: dtolnay/rust-toolchain@stable -# with: -# toolchain: ${{ env.MSRV }} -# - name: Install NodeJS -# uses: actions/setup-node@v2 -# with: -# node-version: 16 -# - name: Install wasm-pack -# run: | -# curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh -# - name: make test-js -# run: | -# make test-js + test_nodejs: + name: Test on NodeJS + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v3 + - name: Install Rust + uses: dtolnay/rust-toolchain@stable + with: + toolchain: ${{ env.MSRV }} + - name: Install NodeJS + uses: actions/setup-node@v2 + with: + node-version: 16 + - name: Install wasm-pack + run: | + curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh + - name: make test-js + run: | + make test-js -# test_wasi_fyi: -# name: Test wasi-fyi -# runs-on: ubuntu-22.04 -# steps: -# - uses: actions/checkout@v3 -# - name: Install Rust -# uses: dtolnay/rust-toolchain@stable -# with: -# toolchain: nightly -# targets: "wasm32-wasi" -# - name: Install wasm-pack -# run: | -# curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh -# - name: Install LLVM 18 -# run: | -# curl --proto '=https' --tlsv1.2 -sSf https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-amd64.tar.xz -L -o llvm.tar.xz -# LLVM_DIR=$(pwd)/${{ env.LLVM_DIR }} -# mkdir ${LLVM_DIR} -# tar xf llvm.tar.xz --strip-components=1 -C ${LLVM_DIR} -# echo "ENABLE_LLVM=1" >> $GITHUB_ENV -# echo "${LLVM_DIR}/bin" >> $GITHUB_PATH -# echo "${LLVM_DIR}/usr/bin" >> $GITHUB_PATH -# echo "LLVM_SYS_180_PREFIX=${LLVM_DIR}" >> $GITHUB_ENV -# env: -# LLVM_DIR: .llvm -# - name: make test-wasi-fyi -# run: | -# make test-wasi-fyi + test_wasi_fyi: + name: Test wasi-fyi + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v3 + - name: Install Rust + uses: dtolnay/rust-toolchain@stable + with: + toolchain: nightly + targets: "wasm32-wasi" + - name: Install wasm-pack + run: | + curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh + - name: Install LLVM 18 + run: | + curl --proto '=https' --tlsv1.2 -sSf https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-amd64.tar.xz -L -o llvm.tar.xz + LLVM_DIR=$(pwd)/${{ env.LLVM_DIR }} + mkdir ${LLVM_DIR} + tar xf llvm.tar.xz --strip-components=1 -C ${LLVM_DIR} + echo "ENABLE_LLVM=1" >> $GITHUB_ENV + echo "${LLVM_DIR}/bin" >> $GITHUB_PATH + echo "${LLVM_DIR}/usr/bin" >> $GITHUB_PATH + echo "LLVM_SYS_180_PREFIX=${LLVM_DIR}" >> $GITHUB_ENV + env: + LLVM_DIR: .llvm + - name: make test-wasi-fyi + run: | + make test-wasi-fyi -# # The no_std functionality doesn't work at the moment - no point in testing it. -# # - name: make test-js-core -# # run: | -# # make test-js-core + # The no_std functionality doesn't work at the moment - no point in testing it. + # - name: make test-js-core + # run: | + # make test-js-core -# test_wasix: -# name: Test WASIX -# runs-on: ubuntu-22.04 -# steps: -# - uses: actions/checkout@v3 -# - name: Install Rust -# uses: dtolnay/rust-toolchain@stable -# with: -# toolchain: ${{ env.MSRV }} -# - name: Install Tools -# run: | -# sudo apt-get update -# sudo apt-get install -y git llvm clang make lld curl -# - name: Build wasix sysroot -# run: | -# cd ~ -# git clone --recurse-submodules https://github.com/wasix-org/wasix-libc -# cd wasix-libc -# ./build32.sh -# rm -rf /opt/wasix-sysroot -# cp -r sysroot32 ~/wasix-sysroot -# - name: Install wasi-sdk Tools -# run: | -# cd ~ -# curl -L "https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-${{ env.WASI_SDK_VERSION }}/wasi-sdk-${{ env.WASI_SDK_VERSION }}.0-linux.tar.gz" -o wasi-sdk.tar.gz -# tar -xzf wasi-sdk.tar.gz -# cp -r wasi-sdk-${{ env.WASI_SDK_VERSION }}.0 ~/wasi-sdk -# - name: Install LLVM 18 -# run: | -# curl --proto '=https' --tlsv1.2 -sSf https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-amd64.tar.xz -L -o llvm.tar.xz -# LLVM_DIR=$(pwd)/${{ env.LLVM_DIR }} -# mkdir ${LLVM_DIR} -# tar xf llvm.tar.xz --strip-components=1 -C ${LLVM_DIR} -# echo "ENABLE_LLVM=1" >> $GITHUB_ENV -# echo "${LLVM_DIR}/bin" >> $GITHUB_PATH -# echo "${LLVM_DIR}/usr/bin" >> $GITHUB_PATH -# echo "LLVM_SYS_180_PREFIX=${LLVM_DIR}" >> $GITHUB_ENV -# env: -# LLVM_DIR: .llvm -# - name: Install wasm-opt -# run: | -# sudo apt-get install -y binaryen -# - name: make test-wasix -# run: | -# WASI_SDK=~/wasi-sdk WASIX_SYSROOT=~/wasix-sysroot make test-wasix + test_wasix: + name: Test WASIX + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v3 + - name: Install Rust + uses: dtolnay/rust-toolchain@stable + with: + toolchain: ${{ env.MSRV }} + - name: Install Tools + run: | + sudo apt-get update + sudo apt-get install -y git llvm clang make lld curl + - name: Build wasix sysroot + run: | + cd ~ + git clone --recurse-submodules https://github.com/wasix-org/wasix-libc + cd wasix-libc + ./build32.sh + rm -rf /opt/wasix-sysroot + cp -r sysroot32 ~/wasix-sysroot + - name: Install wasi-sdk Tools + run: | + cd ~ + curl -L "https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-${{ env.WASI_SDK_VERSION }}/wasi-sdk-${{ env.WASI_SDK_VERSION }}.0-linux.tar.gz" -o wasi-sdk.tar.gz + tar -xzf wasi-sdk.tar.gz + cp -r wasi-sdk-${{ env.WASI_SDK_VERSION }}.0 ~/wasi-sdk + - name: Install LLVM 18 + run: | + curl --proto '=https' --tlsv1.2 -sSf https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-amd64.tar.xz -L -o llvm.tar.xz + LLVM_DIR=$(pwd)/${{ env.LLVM_DIR }} + mkdir ${LLVM_DIR} + tar xf llvm.tar.xz --strip-components=1 -C ${LLVM_DIR} + echo "ENABLE_LLVM=1" >> $GITHUB_ENV + echo "${LLVM_DIR}/bin" >> $GITHUB_PATH + echo "${LLVM_DIR}/usr/bin" >> $GITHUB_PATH + echo "LLVM_SYS_180_PREFIX=${LLVM_DIR}" >> $GITHUB_ENV + env: + LLVM_DIR: .llvm + - name: Install wasm-opt + run: | + sudo apt-get install -y binaryen + - name: make test-wasix + run: | + WASI_SDK=~/wasi-sdk WASIX_SYSROOT=~/wasix-sysroot make test-wasix -# test_wasm_build: -# name: Test wasm build -# runs-on: ubuntu-22.04 -# steps: -# - uses: actions/checkout@v3 -# - name: rustup target add wasm32-wasi -# run: rustup target add wasm32-wasi -# - name: make build-wasmer-wasm -# run: make build-wasmer-wasm + test_wasm_build: + name: Test wasm build + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v3 + - name: rustup target add wasm32-wasi + run: rustup target add wasm32-wasi + - name: make build-wasmer-wasm + run: make build-wasmer-wasm -# test_build_jsc: -# name: Test JSC build -# runs-on: ubuntu-22.04 -# steps: -# - uses: actions/checkout@v3 -# - uses: dtolnay/rust-toolchain@stable -# with: -# toolchain: ${{ env.MSRV }} -# target: x86_64-unknown-linux-gnu -# - name: Install NodeJS -# uses: actions/setup-node@v2 -# with: -# node-version: 16 -# - name: Install libjavascriptcoregtk-4.0-dev -# run: sudo apt update && sudo apt install -y libjavascriptcoregtk-4.0-dev -# - name: make build-wasmer-jsc -# run: make build-wasmer-jsc + test_build_jsc: + name: Test JSC build + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v3 + - uses: dtolnay/rust-toolchain@stable + with: + toolchain: ${{ env.MSRV }} + target: x86_64-unknown-linux-gnu + - name: Install NodeJS + uses: actions/setup-node@v2 + with: + node-version: 16 + - name: Install libjavascriptcoregtk-4.0-dev + run: sudo apt update && sudo apt install -y libjavascriptcoregtk-4.0-dev + - name: make build-wasmer-jsc + run: make build-wasmer-jsc -# test_interpreter_api: -# name: ${{ matrix.build-what.name }} on ${{ matrix.metadata.build }} -# runs-on: ${{ matrix.metadata.os }} -# strategy: -# fail-fast: false -# matrix: -# build-what: [ -# { -# key: wamr, -# build-cmd: 'make test-wamr-api', -# name: 'Test API for wamr feature' -# }, -# { -# key: wasmi, -# build-cmd: 'make test-wasmi-api', -# name: 'Test API for wasmi feature' -# }, -# { -# key: v8, -# build-cmd: 'make test-v8-api', -# name: 'Test API for v8 feature' -# } + test_interpreter_api: + name: ${{ matrix.build-what.name }} on ${{ matrix.metadata.build }} + runs-on: ${{ matrix.metadata.os }} + strategy: + fail-fast: false + matrix: + build-what: [ + { + key: wamr, + build-cmd: 'make test-wamr-api', + name: 'Test API for wamr feature' + }, + { + key: wasmi, + build-cmd: 'make test-wasmi-api', + name: 'Test API for wasmi feature' + }, + { + key: v8, + build-cmd: 'make test-v8-api', + name: 'Test API for v8 feature' + } -# ] -# metadata: [ -# { -# build: linux-x64, -# os: ubuntu-22.04, -# }, -# { -# build: macos-arm, -# os: macos-14, -# }, -# { -# build: windows-x64, -# os: windows-2022, -# } -# ] -# container: ${{ matrix.metadata.container }} -# steps: -# - uses: actions/checkout@v3 + ] + metadata: [ + { + build: linux-x64, + os: ubuntu-22.04, + }, + { + build: macos-arm, + os: macos-14, + }, + { + build: windows-x64, + os: windows-2022, + } + ] + container: ${{ matrix.metadata.container }} + steps: + - uses: actions/checkout@v3 -# - name: Setup MSVC (Windows) -# uses: ilammy/msvc-dev-cmd@v1 -# if: matrix.metadata.build == 'windows-x64' + - name: Setup MSVC (Windows) + uses: ilammy/msvc-dev-cmd@v1 + if: matrix.metadata.build == 'windows-x64' -# - uses: dtolnay/rust-toolchain@stable -# with: -# toolchain: ${{ env.MSRV }} + - uses: dtolnay/rust-toolchain@stable + with: + toolchain: ${{ env.MSRV }} -# - name: Install Nextest -# uses: taiki-e/install-action@nextest + - name: Install Nextest + uses: taiki-e/install-action@nextest -# - name: Install `ninja`, clang` and `mold` on Ubuntu -# if: startsWith(matrix.metadata.build, 'linux-') -# shell: bash -# run: | -# sudo apt-get update -y && sudo apt-get install ninja-build clang mold -y + - name: Install `ninja`, clang` and `mold` on Ubuntu + if: startsWith(matrix.metadata.build, 'linux-') + shell: bash + run: | + sudo apt-get update -y && sudo apt-get install ninja-build clang mold -y -# - name: Install `ninja` on macOS -# if: startsWith(matrix.metadata.build, 'macos-') -# shell: bash -# run: | -# brew install ninja + - name: Install `ninja` on macOS + if: startsWith(matrix.metadata.build, 'macos-') + shell: bash + run: | + brew install ninja -# - name: Install `ninja` on Windows -# if: startsWith(matrix.metadata.build, 'windows-') -# shell: bash -# run: | -# choco install ninja + - name: Install `ninja` on Windows + if: startsWith(matrix.metadata.build, 'windows-') + shell: bash + run: | + choco install ninja -# - name: Delete unwanted link to stop it from interfering (Windows) -# shell: bash -# run: rm /usr/bin/link.exe -# if: startsWith(matrix.metadata.build, 'windows-') + - name: Delete unwanted link to stop it from interfering (Windows) + shell: bash + run: rm /usr/bin/link.exe + if: startsWith(matrix.metadata.build, 'windows-') -# - name: Test WAMR API -# if: ${{ matrix.build-what.key == 'wamr' }} -# run: ${{ matrix.build-what.build-cmd }} + - name: Test WAMR API + if: ${{ matrix.build-what.key == 'wamr' }} + run: ${{ matrix.build-what.build-cmd }} -# - name: Test wasmi API -# if: ${{ matrix.build-what.key == 'wasmi' }} -# run: ${{ matrix.build-what.build-cmd }} + - name: Test wasmi API + if: ${{ matrix.build-what.key == 'wasmi' }} + run: ${{ matrix.build-what.build-cmd }} -# - name: Test v8 API (Linux + mold) -# if: ${{ matrix.build-what.key == 'v8' && startsWith(matrix.metadata.build, 'linux-')}} -# run: RUSTFLAGS="-C linker=clang -C link-arg=-fuse-ld=mold" CARGO_TERM_VERBOSE=true cargo nextest run --package=wasmer --release --features=v8 --no-default-features + - name: Test v8 API (Linux + mold) + if: ${{ matrix.build-what.key == 'v8' && startsWith(matrix.metadata.build, 'linux-')}} + run: RUSTFLAGS="-C linker=clang -C link-arg=-fuse-ld=mold" CARGO_TERM_VERBOSE=true cargo nextest run --package=wasmer --release --features=v8 --no-default-features -# - name: Test v8 API -# if: ${{ matrix.build-what.key == 'v8' && !startsWith(matrix.metadata.build, 'linux-')}} -# run: ${{ matrix.build-what.build-cmd }} + - name: Test v8 API + if: ${{ matrix.build-what.key == 'v8' && !startsWith(matrix.metadata.build, 'linux-')}} + run: ${{ matrix.build-what.build-cmd }} -# test_build_docs_rs: -# name: Test build docs rs -# runs-on: ubuntu-22.04 -# steps: -# - uses: actions/checkout@v3 -# - uses: dtolnay/rust-toolchain@master -# with: -# toolchain: "nightly-2024-08-21" -# target: x86_64-unknown-linux-gnu -# - run: cargo install toml-cli # toml-cli is required to run `make test-build-docs-rs` + test_build_docs_rs: + name: Test build docs rs + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v3 + - uses: dtolnay/rust-toolchain@master + with: + toolchain: "nightly-2024-08-21" + target: x86_64-unknown-linux-gnu + - run: cargo install toml-cli # toml-cli is required to run `make test-build-docs-rs` -# - name: Install `ninja` on Ubuntu -# shell: bash -# run: | -# sudo apt-get install ninja-build -y + - name: Install `ninja` on Ubuntu + shell: bash + run: | + sudo apt-get install ninja-build -y -# - name: Install LLVM 18 -# run: | -# curl --proto '=https' --tlsv1.2 -sSf https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-amd64.tar.xz -L -o llvm.tar.xz -# LLVM_DIR=$(pwd)/${{ env.LLVM_DIR }} -# mkdir ${LLVM_DIR} -# tar xf llvm.tar.xz --strip-components=1 -C ${LLVM_DIR} -# echo "ENABLE_LLVM=1" >> $GITHUB_ENV -# echo "${LLVM_DIR}/bin" >> $GITHUB_PATH -# echo "${LLVM_DIR}/usr/bin" >> $GITHUB_PATH -# echo "LLVM_SYS_180_PREFIX=${LLVM_DIR}" >> $GITHUB_ENV -# env: -# LLVM_DIR: .llvm -# - name: make test-build-docs-rs-ci -# run: make test-build-docs-rs-ci + - name: Install LLVM 18 + run: | + curl --proto '=https' --tlsv1.2 -sSf https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-amd64.tar.xz -L -o llvm.tar.xz + LLVM_DIR=$(pwd)/${{ env.LLVM_DIR }} + mkdir ${LLVM_DIR} + tar xf llvm.tar.xz --strip-components=1 -C ${LLVM_DIR} + echo "ENABLE_LLVM=1" >> $GITHUB_ENV + echo "${LLVM_DIR}/bin" >> $GITHUB_PATH + echo "${LLVM_DIR}/usr/bin" >> $GITHUB_PATH + echo "LLVM_SYS_180_PREFIX=${LLVM_DIR}" >> $GITHUB_ENV + env: + LLVM_DIR: .llvm + - name: make test-build-docs-rs-ci + run: make test-build-docs-rs-ci -# build_linux_aarch64: -# name: ${{ matrix.build-what.name }} on linux-aarch64 -# runs-on: ubuntu-22.04 -# strategy: -# fail-fast: false -# matrix: -# build-what: [ -# { -# key: capi, -# build-cmd: 'make build-capi && make package-capi', -# name: 'Build C-API' -# }, -# { -# key: wasmer, -# build-cmd: 'make build-wasmer && make package-wasmer && make tar-wasmer', -# name: 'Build wasmer-cli' -# } -# ] -# steps: -# - uses: actions/checkout@v3 -# - uses: dtolnay/rust-toolchain@stable -# with: -# toolchain: ${{ env.MSRV }} -# target: aarch64-unknown-linux-gnu -# - name: Build cross image -# run: | -# docker build -t wasmer/aarch64 ${GITHUB_WORKSPACE}/.github/cross-linux-aarch64/ -# env: -# CROSS_DOCKER_IN_DOCKER: true -# - name: Build ${{ matrix.build-what.key }} -# run: | -# ${{ matrix.build-what.build-cmd }} -# env: -# CARGO_BINARY: docker run -v /var/run/docker.sock:/var/run/docker.sock -v ${GITHUB_WORKSPACE}:/project -w /project wasmer/aarch64 cross -# CROSS_DOCKER_IN_DOCKER: true -# CARGO_TARGET: aarch64-unknown-linux-gnu -# PKG_CONFIG_PATH: /usr/lib/aarch64-linux-gnu/pkgconfig -# PKG_CONFIG_ALLOW_CROSS: true -# ENABLE_LLVM: 0 -# - name: Dist -# if: ${{ matrix.build-what.key == 'capi' }} -# run: | -# make distribution -# env: -# CARGO_BINARY: docker run -v /var/run/docker.sock:/var/run/docker.sock -v ${GITHUB_WORKSPACE}:/project -w /project wasmer/aarch64 cross -# CROSS_DOCKER_IN_DOCKER: true -# CARGO_TARGET: aarch64-unknown-linux-gnu -# PKG_CONFIG_PATH: /usr/lib/aarch64-linux-gnu/pkgconfig -# PKG_CONFIG_ALLOW_CROSS: true -# TARGET: aarch64-unknown-linux-gnu -# TARGET_DIR: target/aarch64-unknown-linux-gnu/release -# - name: Upload Artifacts -# if: ${{ matrix.build-what.key == 'capi' }} -# uses: actions/upload-artifact@v4 -# with: -# name: capi-linux-aarch64 -# path: dist -# if-no-files-found: error -# retention-days: 2 + build_linux_aarch64: + name: ${{ matrix.build-what.name }} on linux-aarch64 + runs-on: ubuntu-22.04 + strategy: + fail-fast: false + matrix: + build-what: [ + { + key: capi, + build-cmd: 'make build-capi && make package-capi', + name: 'Build C-API' + }, + { + key: wasmer, + build-cmd: 'make build-wasmer && make package-wasmer && make tar-wasmer', + name: 'Build wasmer-cli' + } + ] + steps: + - uses: actions/checkout@v3 + - uses: dtolnay/rust-toolchain@stable + with: + toolchain: ${{ env.MSRV }} + target: aarch64-unknown-linux-gnu + - name: Build cross image + run: | + docker build -t wasmer/aarch64 ${GITHUB_WORKSPACE}/.github/cross-linux-aarch64/ + env: + CROSS_DOCKER_IN_DOCKER: true + - name: Build ${{ matrix.build-what.key }} + run: | + ${{ matrix.build-what.build-cmd }} + env: + CARGO_BINARY: docker run -v /var/run/docker.sock:/var/run/docker.sock -v ${GITHUB_WORKSPACE}:/project -w /project wasmer/aarch64 cross + CROSS_DOCKER_IN_DOCKER: true + CARGO_TARGET: aarch64-unknown-linux-gnu + PKG_CONFIG_PATH: /usr/lib/aarch64-linux-gnu/pkgconfig + PKG_CONFIG_ALLOW_CROSS: true + ENABLE_LLVM: 0 + - name: Dist + if: ${{ matrix.build-what.key == 'capi' }} + run: | + make distribution + env: + CARGO_BINARY: docker run -v /var/run/docker.sock:/var/run/docker.sock -v ${GITHUB_WORKSPACE}:/project -w /project wasmer/aarch64 cross + CROSS_DOCKER_IN_DOCKER: true + CARGO_TARGET: aarch64-unknown-linux-gnu + PKG_CONFIG_PATH: /usr/lib/aarch64-linux-gnu/pkgconfig + PKG_CONFIG_ALLOW_CROSS: true + TARGET: aarch64-unknown-linux-gnu + TARGET_DIR: target/aarch64-unknown-linux-gnu/release + - name: Upload Artifacts + if: ${{ matrix.build-what.key == 'capi' }} + uses: actions/upload-artifact@v4 + with: + name: capi-linux-aarch64 + path: dist + if-no-files-found: error + retention-days: 2 -# build_linux_riscv64: -# name: ${{ matrix.build-what.name }} on linux-riscv64 -# runs-on: ubuntu-22.04 -# strategy: -# fail-fast: false -# matrix: -# build-what: [ -# { -# key: capi, -# build-cmd: 'make build-capi && make package-capi', -# name: 'Build C-API' -# }, -# { -# key: wasmer, -# build-cmd: 'make build-wasmer && make package-wasmer && make tar-wasmer', -# name: 'Build wasmer-cli' -# } -# ] -# steps: -# - uses: actions/checkout@v3 -# #- uses: dtolnay/rust-toolchain@stable -# # with: -# # toolchain: ${{ env.MSRV }} -# # target: riscv64gc-unknown-linux-gnu -# - name: Build cross image -# run: | -# docker build -t wasmer/riscv64 ${GITHUB_WORKSPACE}/.github/cross-linux-riscv64/ -# env: -# CROSS_DOCKER_IN_DOCKER: true -# - name: Build ${{ matrix.build-what.key }} -# run: | -# ${{ matrix.build-what.build-cmd }} -# env: -# CARGO_BINARY: docker run -v /var/run/docker.sock:/var/run/docker.sock -v ${GITHUB_WORKSPACE}:/project -w /project wasmer/riscv64 cargo -# CROSS_DOCKER_IN_DOCKER: true -# CARGO_TARGET: riscv64gc-unknown-linux-gnu -# ENABLE_LLVM: 0 -# - name: Dist -# if: ${{ matrix.build-what.key == 'capi' }} -# run: | -# make distribution -# env: -# CARGO_BINARY: docker run -v /var/run/docker.sock:/var/run/docker.sock -v ${GITHUB_WORKSPACE}:/project -w /project wasmer/riscv64 cargo -# CROSS_DOCKER_IN_DOCKER: true -# CARGO_TARGET: riscv64gc-unknown-linux-gnu -# PKG_CONFIG_PATH: /usr/lib/riscv64-linux-gnu/pkgconfig -# PKG_CONFIG_ALLOW_CROSS: true -# TARGET: riscv64gc-unknown-linux-gnu -# TARGET_DIR: target/riscv64gc-unknown-linux-gnu/release -# - name: Upload Artifacts -# if: ${{ matrix.build-what.key == 'capi' }} -# uses: actions/upload-artifact@v4 -# with: -# name: capi-linux-riscv64 -# path: dist -# if-no-files-found: error -# retention-days: 2 + build_linux_riscv64: + name: ${{ matrix.build-what.name }} on linux-riscv64 + runs-on: ubuntu-22.04 + strategy: + fail-fast: false + matrix: + build-what: [ + { + key: capi, + build-cmd: 'make build-capi && make package-capi', + name: 'Build C-API' + }, + { + key: wasmer, + build-cmd: 'make build-wasmer && make package-wasmer && make tar-wasmer', + name: 'Build wasmer-cli' + } + ] + steps: + - uses: actions/checkout@v3 + #- uses: dtolnay/rust-toolchain@stable + # with: + # toolchain: ${{ env.MSRV }} + # target: riscv64gc-unknown-linux-gnu + - name: Build cross image + run: | + docker build -t wasmer/riscv64 ${GITHUB_WORKSPACE}/.github/cross-linux-riscv64/ + env: + CROSS_DOCKER_IN_DOCKER: true + - name: Build ${{ matrix.build-what.key }} + run: | + ${{ matrix.build-what.build-cmd }} + env: + CARGO_BINARY: docker run -v /var/run/docker.sock:/var/run/docker.sock -v ${GITHUB_WORKSPACE}:/project -w /project wasmer/riscv64 cargo + CROSS_DOCKER_IN_DOCKER: true + CARGO_TARGET: riscv64gc-unknown-linux-gnu + ENABLE_LLVM: 0 + - name: Dist + if: ${{ matrix.build-what.key == 'capi' }} + run: | + make distribution + env: + CARGO_BINARY: docker run -v /var/run/docker.sock:/var/run/docker.sock -v ${GITHUB_WORKSPACE}:/project -w /project wasmer/riscv64 cargo + CROSS_DOCKER_IN_DOCKER: true + CARGO_TARGET: riscv64gc-unknown-linux-gnu + PKG_CONFIG_PATH: /usr/lib/riscv64-linux-gnu/pkgconfig + PKG_CONFIG_ALLOW_CROSS: true + TARGET: riscv64gc-unknown-linux-gnu + TARGET_DIR: target/riscv64gc-unknown-linux-gnu/release + - name: Upload Artifacts + if: ${{ matrix.build-what.key == 'capi' }} + uses: actions/upload-artifact@v4 + with: + name: capi-linux-riscv64 + path: dist + if-no-files-found: error + retention-days: 2 -# build: -# name: ${{ matrix.build-what.name }} on ${{ matrix.metadata.build }} -# runs-on: ${{ matrix.metadata.os }} -# needs: setup -# strategy: -# fail-fast: false -# matrix: -# build-what: [ -# { -# key: capi, -# build-cmd: 'make build-capi && make build-capi-headless && make package-capi && make tar-capi', -# name: 'Build and test C-API' -# }, -# { -# key: wasmer, -# build-cmd: 'make build-wasmer && make package-wasmer && make tar-wasmer', -# name: 'Build wasmer-cli' -# } -# ] -# metadata: [ -# { -# build: linux-x64, -# os: ubuntu-22.04, -# target: x86_64-unknown-linux-gnu, -# exe: '', -# llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-amd64.tar.xz' -# }, -# { -# build: macos-x64, -# os: macos-12, -# target: x86_64-apple-darwin, -# exe: '', -# llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-amd64.tar.xz' + build: + name: ${{ matrix.build-what.name }} on ${{ matrix.metadata.build }} + runs-on: ${{ matrix.metadata.os }} + needs: setup + strategy: + fail-fast: false + matrix: + build-what: [ + { + key: capi, + build-cmd: 'make build-capi && make build-capi-headless && make package-capi && make tar-capi', + name: 'Build and test C-API' + }, + { + key: wasmer, + build-cmd: 'make build-wasmer && make package-wasmer && make tar-wasmer', + name: 'Build wasmer-cli' + } + ] + metadata: [ + { + build: linux-x64, + os: ubuntu-22.04, + target: x86_64-unknown-linux-gnu, + exe: '', + llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-amd64.tar.xz' + }, + { + build: macos-x64, + os: macos-12, + target: x86_64-apple-darwin, + exe: '', + llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-amd64.tar.xz' -# }, -# { -# build: macos-arm, -# os: macos-14, -# target: aarch64-apple-darwin, -# exe: '', -# # [todo] xdoardo: Reinstate when the code we generate for aarch64 is working correctly. -# # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-aarch64.tar.xz' -# }, -# { -# build: windows-x64, -# os: windows-2022, -# target: x86_64-pc-windows-msvc, -# exe: '.exe', -# # For now, disable LLVM in `windows-x64.` -# # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-windows-amd64.tar.xz' -# }, -# { -# build: windows-gnu, -# target: x86_64-pc-windows-gnu, -# os: ubuntu-22.04, -# }, -# { -# build: linux-musl, -# target: x86_64-unknown-linux-musl, -# os: ubuntu-22.04, -# exe: '', -# container: 'alpine:latest' -# } + }, + { + build: macos-arm, + os: macos-14, + target: aarch64-apple-darwin, + exe: '', + # [todo] xdoardo: Reinstate when the code we generate for aarch64 is working correctly. + # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-aarch64.tar.xz' + }, + { + build: windows-x64, + os: windows-2022, + target: x86_64-pc-windows-msvc, + exe: '.exe', + # For now, disable LLVM in `windows-x64.` + # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-windows-amd64.tar.xz' + }, + { + build: windows-gnu, + target: x86_64-pc-windows-gnu, + os: ubuntu-22.04, + }, + { + build: linux-musl, + target: x86_64-unknown-linux-musl, + os: ubuntu-22.04, + exe: '', + container: 'alpine:latest' + } -# ] -# container: ${{ matrix.metadata.container }} -# env: -# SCCACHE_AZURE_BLOB_CONTAINER: wasmerstoragesccacheblob -# SCCACHE_AZURE_CONNECTION_STRING: ${{ secrets.SCCACHE_AZURE_CONNECTION_STRING }} -# steps: -# - uses: actions/checkout@v3 -# - name: Set up libstdc++ on Linux -# if: matrix.metadata.build == 'linux-x64' -# run: | -# sudo apt-get update -y -# sudo apt-get install -y --allow-downgrades libstdc++6 libtinfo5 -# sudo apt-get install --reinstall g++ -# - name: Set up base deps on musl -# if: matrix.metadata.build == 'linux-musl' -# run: ./scripts/alpine-linux-install-deps.sh -# - name: Set up dependencies for Mac OS -# run: | -# brew install automake -# # using gnu-tar is a workaround for https://github.com/actions/cache/issues/403 -# brew install gnu-tar -# echo PATH="/usr/local/opt/gnu-tar/libexec/gnubin:$PATH" >> $GITHUB_ENV -# if: matrix.metadata.os == 'macos-12' -# - name: Install Rust -# uses: dtolnay/rust-toolchain@stable -# with: -# toolchain: ${{ env.MSRV }} -# target: ${{ matrix.metadata.target }} -# - name: Install Nextest -# uses: taiki-e/install-action@nextest -# - name: Install MSVC dev-cmd (Windows) -# uses: ilammy/msvc-dev-cmd@v1 -# if: ${{ matrix.metadata.build == 'windows-x64' }} -# - name: Delete unwanted link to stop it from interfering (Windows) -# shell: bash -# run: rm /usr/bin/link.exe -# if: ${{ matrix.metadata.build == 'windows-x64' }} -# - name: Install Windows-GNU linker -# if: ${{ matrix.metadata.build == 'windows-gnu' }} -# shell: bash -# run: | -# sudo apt install -y mingw-w64 -# - name: Install Windows-GNU target -# if: ${{ matrix.metadata.build == 'windows-gnu' }} -# shell: bash -# run: | -# rustup target add x86_64-pc-windows-gnu -# - name: Install Windows 10 SDK with xwin -# if: ${{ matrix.metadata.build == 'windows-gnu' }} -# shell: bash -# run: | -# mkdir -p /tmp/xwin -# mkdir -p /tmp/xwindownload -# mkdir -p /tmp/xwincache -# git clone https://github.com/wasmerio/xwin --depth=1 /tmp/xwin -# cargo build --release --manifest-path=/tmp/xwin/Cargo.toml -# /tmp/xwin/target/release/xwin --accept-license --cache-dir /tmp/xwincache splat --output /tmp/xwindownload -# mkdir -p /tmp/winsdk -# cp /tmp/xwindownload/sdk/lib/10.0.20348/um/x86_64/WS2_32.lib /tmp/winsdk/ -# cp /tmp/xwindownload/sdk/lib/10.0.20348/um/x86_64/KERNEL32.lib /tmp/winsdk/ -# cp /tmp/xwindownload/sdk/lib/10.0.20348/um/x86_64/BCRYPT.lib /tmp/winsdk/ -# cp /tmp/xwindownload/sdk/lib/10.0.20348/um/x86_64/ADVAPI32.lib /tmp/winsdk/ -# cp /tmp/xwindownload/sdk/lib/10.0.20348/um/x86_64/USERENV.lib /tmp/winsdk/ -# echo "WinSDK files:" -# ls -laH /tmp/winsdk -# echo "" -# mkdir -p package -# mkdir -p package/winsdk -# cp -r /tmp/winsdk/* package/winsdk -# - name: Install LLVM (macOS Apple Silicon) -# if: matrix.metadata.os == 'macos-12' && !matrix.metadata.llvm_url -# run: | -# brew install llvm -# - name: Install LLVM -# shell: bash -# if: matrix.metadata.llvm_url -# run: | -# curl --proto '=https' --tlsv1.2 -sSf ${{ matrix.metadata.llvm_url }} -L -o llvm.tar.xz -# LLVM_DIR=$(pwd)/${{ env.LLVM_DIR }} -# mkdir ${LLVM_DIR} -# tar xf llvm.tar.xz --strip-components=1 -C ${LLVM_DIR} -# echo "ENABLE_LLVM=1" >> $GITHUB_ENV -# echo "${LLVM_DIR}/bin" >> $GITHUB_PATH -# echo "${LLVM_DIR}/usr/bin" >> $GITHUB_PATH -# echo "LLVM_SYS_180_PREFIX=${LLVM_DIR}" >> $GITHUB_ENV -# env: -# LLVM_DIR: .llvm -# - name: Add `brew` libs to `RUSTFLAGS` -# if: matrix.metadata.os == 'macos-14' -# shell: bash -# run: | -# echo "RUSTFLAGS=-L/opt/homebrew/lib" >> $GITHUB_ENV -# - name: Setup Rust target -# shell: bash -# run: | -# mkdir -p .cargo -# cat << EOF > .cargo/config.toml -# [build] -# target = "${{ matrix.metadata.target }}" -# EOF -# if: matrix.metadata.target -# - name: which cargo -# if: ${{ matrix.build-what.key == 'capi' && matrix.metadata.build == 'windows-x64' }} -# run: which cargo -# - name: Set cargo env -# run: echo "CARGO_ROOT_DIR=$(dirname $(dirname $( which cargo )))" >> $GITHUB_ENV -# - name: List root dir -# shell: bash -# if: ${{ matrix.build-what.key == 'capi' && matrix.metadata.build == 'windows-x64' }} -# run: ls -R $CARGO_ROOT_DIR -# - name: Cache -# uses: whywaita/actions-cache-s3@v2 -# with: -# path: | -# ~/.cargo/* -# ./target/* -# $CARGO_ROOT_DIR/* -# key: r22-${{ github.repository }}-${{ runner.os }}-${{ hashFiles('Cargo.lock') }}-wasmer-make-build-wasmer-${{ matrix.build-what.key }}-${{ matrix.metadata.build }} -# aws-s3-bucket: wasmer-rust-artifacts-cache -# aws-access-key-id: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_TOKEN }} -# aws-secret-access-key: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_KEY }} -# aws-region: auto -# aws-endpoint: https://1541b1e8a3fc6ad155ce67ef38899700.r2.cloudflarestorage.com -# aws-s3-bucket-endpoint: false -# aws-s3-force-path-style: true -# - name: Build C-API -# shell: bash -# run: ${{ matrix.build-what.build-cmd }} -# if: ${{ matrix.build-what.key == 'capi' }} -# env: -# TARGET: ${{ matrix.metadata.target }} -# TARGET_DIR: target/${{ matrix.metadata.target }}/release -# CARGO_TARGET: ${{ matrix.metadata.target }} -# - name: Build Wasmer -# shell: bash -# if: ${{ matrix.build-what.key == 'wasmer' && matrix.metadata.build != 'windows-gnu' }} -# run: ${{ matrix.build-what.build-cmd }} -# env: -# TARGET: ${{ matrix.metadata.target }} -# TARGET_DIR: target/${{ matrix.metadata.target }}/release -# CARGO_TARGET: ${{ matrix.metadata.target }} -# - name: Test C-API -# shell: bash -# if: ${{ matrix.build-what.key == 'capi' && !(matrix.metadata.build == 'linux-musl' || matrix.metadata.build == 'windows-gnu') }} -# run: make test-capi-ci -# env: -# TARGET: ${{ matrix.metadata.target }} -# TARGET_DIR: target/${{ matrix.metadata.target }}/release -# CARGO_TARGET: ${{ matrix.metadata.target }} -# # C-API tests were disabled for linux-musl and macos-arm (we can't run them) -# - name: Test C-API integration -# shell: bash -# if: ${{ matrix.build-what.key == 'capi' && !(matrix.metadata.build == 'linux-musl' || matrix.metadata.build == 'windows-gnu') }} -# run: export WASMER_DIR=`pwd`/package && make test-stage-7-capi-integration-tests -# env: -# TARGET: ${{ matrix.metadata.target }} -# TARGET_DIR: target/${{ matrix.metadata.target }}/release -# CARGO_TARGET: ${{ matrix.metadata.target }} -# - name: Archive production artifacts -# uses: actions/upload-artifact@v4 -# with: -# name: wasmer-cli-${{ matrix.metadata.build }} -# path: build-wasmer.tar.gz -# if-no-files-found: ignore -# retention-days: 2 -# - name: Archive production artifacts -# uses: actions/upload-artifact@v4 -# with: -# name: capi-${{ matrix.metadata.build }} -# path: build-capi.tar.gz -# if-no-files-found: ignore -# retention-days: 2 + ] + container: ${{ matrix.metadata.container }} + env: + SCCACHE_AZURE_BLOB_CONTAINER: wasmerstoragesccacheblob + SCCACHE_AZURE_CONNECTION_STRING: ${{ secrets.SCCACHE_AZURE_CONNECTION_STRING }} + steps: + - uses: actions/checkout@v3 + - name: Set up libstdc++ on Linux + if: matrix.metadata.build == 'linux-x64' + run: | + sudo apt-get update -y + sudo apt-get install -y --allow-downgrades libstdc++6 libtinfo5 + sudo apt-get install --reinstall g++ + - name: Set up base deps on musl + if: matrix.metadata.build == 'linux-musl' + run: ./scripts/alpine-linux-install-deps.sh + - name: Set up dependencies for Mac OS + run: | + brew install automake + # using gnu-tar is a workaround for https://github.com/actions/cache/issues/403 + brew install gnu-tar + echo PATH="/usr/local/opt/gnu-tar/libexec/gnubin:$PATH" >> $GITHUB_ENV + if: matrix.metadata.os == 'macos-12' + - name: Install Rust + uses: dtolnay/rust-toolchain@stable + with: + toolchain: ${{ env.MSRV }} + target: ${{ matrix.metadata.target }} + - name: Install Nextest + uses: taiki-e/install-action@nextest + - name: Install MSVC dev-cmd (Windows) + uses: ilammy/msvc-dev-cmd@v1 + if: ${{ matrix.metadata.build == 'windows-x64' }} + - name: Delete unwanted link to stop it from interfering (Windows) + shell: bash + run: rm /usr/bin/link.exe + if: ${{ matrix.metadata.build == 'windows-x64' }} + - name: Install Windows-GNU linker + if: ${{ matrix.metadata.build == 'windows-gnu' }} + shell: bash + run: | + sudo apt install -y mingw-w64 + - name: Install Windows-GNU target + if: ${{ matrix.metadata.build == 'windows-gnu' }} + shell: bash + run: | + rustup target add x86_64-pc-windows-gnu + - name: Install Windows 10 SDK with xwin + if: ${{ matrix.metadata.build == 'windows-gnu' }} + shell: bash + run: | + mkdir -p /tmp/xwin + mkdir -p /tmp/xwindownload + mkdir -p /tmp/xwincache + git clone https://github.com/wasmerio/xwin --depth=1 /tmp/xwin + cargo build --release --manifest-path=/tmp/xwin/Cargo.toml + /tmp/xwin/target/release/xwin --accept-license --cache-dir /tmp/xwincache splat --output /tmp/xwindownload + mkdir -p /tmp/winsdk + cp /tmp/xwindownload/sdk/lib/10.0.20348/um/x86_64/WS2_32.lib /tmp/winsdk/ + cp /tmp/xwindownload/sdk/lib/10.0.20348/um/x86_64/KERNEL32.lib /tmp/winsdk/ + cp /tmp/xwindownload/sdk/lib/10.0.20348/um/x86_64/BCRYPT.lib /tmp/winsdk/ + cp /tmp/xwindownload/sdk/lib/10.0.20348/um/x86_64/ADVAPI32.lib /tmp/winsdk/ + cp /tmp/xwindownload/sdk/lib/10.0.20348/um/x86_64/USERENV.lib /tmp/winsdk/ + echo "WinSDK files:" + ls -laH /tmp/winsdk + echo "" + mkdir -p package + mkdir -p package/winsdk + cp -r /tmp/winsdk/* package/winsdk + - name: Install LLVM (macOS Apple Silicon) + if: matrix.metadata.os == 'macos-12' && !matrix.metadata.llvm_url + run: | + brew install llvm + - name: Install LLVM + shell: bash + if: matrix.metadata.llvm_url + run: | + curl --proto '=https' --tlsv1.2 -sSf ${{ matrix.metadata.llvm_url }} -L -o llvm.tar.xz + LLVM_DIR=$(pwd)/${{ env.LLVM_DIR }} + mkdir ${LLVM_DIR} + tar xf llvm.tar.xz --strip-components=1 -C ${LLVM_DIR} + echo "ENABLE_LLVM=1" >> $GITHUB_ENV + echo "${LLVM_DIR}/bin" >> $GITHUB_PATH + echo "${LLVM_DIR}/usr/bin" >> $GITHUB_PATH + echo "LLVM_SYS_180_PREFIX=${LLVM_DIR}" >> $GITHUB_ENV + env: + LLVM_DIR: .llvm + - name: Add `brew` libs to `RUSTFLAGS` + if: matrix.metadata.os == 'macos-14' + shell: bash + run: | + echo "RUSTFLAGS=-L/opt/homebrew/lib" >> $GITHUB_ENV + - name: Setup Rust target + shell: bash + run: | + mkdir -p .cargo + cat << EOF > .cargo/config.toml + [build] + target = "${{ matrix.metadata.target }}" + EOF + if: matrix.metadata.target + - name: which cargo + if: ${{ matrix.build-what.key == 'capi' && matrix.metadata.build == 'windows-x64' }} + run: which cargo + - name: Set cargo env + run: echo "CARGO_ROOT_DIR=$(dirname $(dirname $( which cargo )))" >> $GITHUB_ENV + - name: List root dir + shell: bash + if: ${{ matrix.build-what.key == 'capi' && matrix.metadata.build == 'windows-x64' }} + run: ls -R $CARGO_ROOT_DIR + - name: Cache + uses: whywaita/actions-cache-s3@v2 + with: + path: | + ~/.cargo/* + ./target/* + $CARGO_ROOT_DIR/* + key: r22-${{ github.repository }}-${{ runner.os }}-${{ hashFiles('Cargo.lock') }}-wasmer-make-build-wasmer-${{ matrix.build-what.key }}-${{ matrix.metadata.build }} + aws-s3-bucket: wasmer-rust-artifacts-cache + aws-access-key-id: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_TOKEN }} + aws-secret-access-key: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_KEY }} + aws-region: auto + aws-endpoint: https://1541b1e8a3fc6ad155ce67ef38899700.r2.cloudflarestorage.com + aws-s3-bucket-endpoint: false + aws-s3-force-path-style: true + - name: Build C-API + shell: bash + run: ${{ matrix.build-what.build-cmd }} + if: ${{ matrix.build-what.key == 'capi' }} + env: + TARGET: ${{ matrix.metadata.target }} + TARGET_DIR: target/${{ matrix.metadata.target }}/release + CARGO_TARGET: ${{ matrix.metadata.target }} + - name: Build Wasmer + shell: bash + if: ${{ matrix.build-what.key == 'wasmer' && matrix.metadata.build != 'windows-gnu' }} + run: ${{ matrix.build-what.build-cmd }} + env: + TARGET: ${{ matrix.metadata.target }} + TARGET_DIR: target/${{ matrix.metadata.target }}/release + CARGO_TARGET: ${{ matrix.metadata.target }} + - name: Test C-API + shell: bash + if: ${{ matrix.build-what.key == 'capi' && !(matrix.metadata.build == 'linux-musl' || matrix.metadata.build == 'windows-gnu') }} + run: make test-capi-ci + env: + TARGET: ${{ matrix.metadata.target }} + TARGET_DIR: target/${{ matrix.metadata.target }}/release + CARGO_TARGET: ${{ matrix.metadata.target }} + # C-API tests were disabled for linux-musl and macos-arm (we can't run them) + - name: Test C-API integration + shell: bash + if: ${{ matrix.build-what.key == 'capi' && !(matrix.metadata.build == 'linux-musl' || matrix.metadata.build == 'windows-gnu') }} + run: export WASMER_DIR=`pwd`/package && make test-stage-7-capi-integration-tests + env: + TARGET: ${{ matrix.metadata.target }} + TARGET_DIR: target/${{ matrix.metadata.target }}/release + CARGO_TARGET: ${{ matrix.metadata.target }} + - name: Archive production artifacts + uses: actions/upload-artifact@v4 + with: + name: wasmer-cli-${{ matrix.metadata.build }} + path: build-wasmer.tar.gz + if-no-files-found: ignore + retention-days: 2 + - name: Archive production artifacts + uses: actions/upload-artifact@v4 + with: + name: capi-${{ matrix.metadata.build }} + path: build-capi.tar.gz + if-no-files-found: ignore + retention-days: 2 -# test: -# name: ${{ matrix.stage.description }} on ${{ matrix.metadata.build }} -# runs-on: ${{ matrix.metadata.os }} -# needs: setup -# strategy: -# fail-fast: false -# matrix: -# stage: [ -# { -# description: 'Run wast test suite for all compilers', -# make: 'test-stage-0-wast', -# }, -# { -# description: 'Unit-test packages on std', -# make: 'test-stage-1-test-all', -# }, -# { -# description: 'Unit-test cranelift on no-std', -# make: 'test-stage-2-test-compiler-cranelift-nostd', -# }, -# { -# description: 'Unit-test singlepass on no-std', -# make: 'test-stage-3-test-compiler-singlepass-nostd', -# }, -# { -# description: 'Unit-test wasmer-cli', -# make: 'test-stage-4-wasmer-cli', -# }, -# { -# description: 'Unit-test examples', -# make: 'test-stage-5-test-examples', -# } -# ] -# metadata: [ -# # We cannot test on macos-arm since we don't have ARM runners -# { -# build: linux-x64, -# os: ubuntu-22.04, -# target: x86_64-unknown-linux-gnu, -# exe: '', -# llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-amd64.tar.xz' -# }, -# { -# build: macos-x64, -# os: macos-12, -# target: x86_64-apple-darwin, -# exe: '', -# llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-amd64.tar.xz' + test: + name: ${{ matrix.stage.description }} on ${{ matrix.metadata.build }} + runs-on: ${{ matrix.metadata.os }} + needs: setup + strategy: + fail-fast: false + matrix: + stage: [ + { + description: 'Run wast test suite for all compilers', + make: 'test-stage-0-wast', + }, + { + description: 'Unit-test packages on std', + make: 'test-stage-1-test-all', + }, + { + description: 'Unit-test cranelift on no-std', + make: 'test-stage-2-test-compiler-cranelift-nostd', + }, + { + description: 'Unit-test singlepass on no-std', + make: 'test-stage-3-test-compiler-singlepass-nostd', + }, + { + description: 'Unit-test wasmer-cli', + make: 'test-stage-4-wasmer-cli', + }, + { + description: 'Unit-test examples', + make: 'test-stage-5-test-examples', + } + ] + metadata: [ + # We cannot test on macos-arm since we don't have ARM runners + { + build: linux-x64, + os: ubuntu-22.04, + target: x86_64-unknown-linux-gnu, + exe: '', + llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-amd64.tar.xz' + }, + { + build: macos-x64, + os: macos-12, + target: x86_64-apple-darwin, + exe: '', + llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-amd64.tar.xz' -# }, -# { -# build: macos-arm64, -# os: macos-14, -# target: aarch64-apple-darwin, -# exe: '', -# # [todo] xdoardo: Reinstate when the code we generate for aarch64 is working correctly. -# # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-aarch64.tar.xz' -# }, -# { -# build: windows-x64, -# os: windows-2022, -# target: x86_64-pc-windows-msvc, -# exe: '.exe', -# # For now, disable LLVM in `windows-x64.` -# # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-windows-amd64.tar.xz' -# }, -# { -# build: linux-musl, -# target: x86_64-unknown-linux-musl, -# os: ubuntu-22.04, -# exe: '', -# container: 'alpine:latest' -# } -# ] -# container: ${{ matrix.metadata.container }} -# env: -# SCCACHE_AZURE_BLOB_CONTAINER: wasmerstoragesccacheblob -# SCCACHE_AZURE_CONNECTION_STRING: ${{ secrets.SCCACHE_AZURE_CONNECTION_STRING }} -# steps: -# - uses: actions/checkout@v3 -# - name: Set up libstdc++ on Linux -# if: matrix.metadata.build == 'linux-x64' -# run: | -# sudo apt-get update -y -# sudo apt-get install -y --allow-downgrades libstdc++6 -# sudo apt-get install --reinstall g++ -# - name: Set up base deps on musl -# if: matrix.metadata.build == 'linux-musl' -# run: ./scripts/alpine-linux-install-deps.sh -# - name: Install MSVC dev-cmd (Windows) -# uses: ilammy/msvc-dev-cmd@v1 -# if: ${{ matrix.metadata.build == 'windows-x64' }} -# - name: Delete unwanted link to stop it from interfering (Windows) -# shell: bash -# run: rm /usr/bin/link.exe -# if: ${{ matrix.metadata.build == 'windows-x64' }} + }, + { + build: macos-arm64, + os: macos-14, + target: aarch64-apple-darwin, + exe: '', + # [todo] xdoardo: Reinstate when the code we generate for aarch64 is working correctly. + # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-aarch64.tar.xz' + }, + { + build: windows-x64, + os: windows-2022, + target: x86_64-pc-windows-msvc, + exe: '.exe', + # For now, disable LLVM in `windows-x64.` + # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-windows-amd64.tar.xz' + }, + { + build: linux-musl, + target: x86_64-unknown-linux-musl, + os: ubuntu-22.04, + exe: '', + container: 'alpine:latest' + } + ] + container: ${{ matrix.metadata.container }} + env: + SCCACHE_AZURE_BLOB_CONTAINER: wasmerstoragesccacheblob + SCCACHE_AZURE_CONNECTION_STRING: ${{ secrets.SCCACHE_AZURE_CONNECTION_STRING }} + steps: + - uses: actions/checkout@v3 + - name: Set up libstdc++ on Linux + if: matrix.metadata.build == 'linux-x64' + run: | + sudo apt-get update -y + sudo apt-get install -y --allow-downgrades libstdc++6 + sudo apt-get install --reinstall g++ + - name: Set up base deps on musl + if: matrix.metadata.build == 'linux-musl' + run: ./scripts/alpine-linux-install-deps.sh + - name: Install MSVC dev-cmd (Windows) + uses: ilammy/msvc-dev-cmd@v1 + if: ${{ matrix.metadata.build == 'windows-x64' }} + - name: Delete unwanted link to stop it from interfering (Windows) + shell: bash + run: rm /usr/bin/link.exe + if: ${{ matrix.metadata.build == 'windows-x64' }} -# - name: Set up dependencies for Mac OS -# run: | -# brew install automake -# # using gnu-tar is a workaround for https://github.com/actions/cache/issues/403 -# brew install gnu-tar -# echo PATH="/usr/local/opt/gnu-tar/libexec/gnubin:$PATH" >> $GITHUB_ENV -# if: matrix.metadata.os == 'macos-12' -# - name: Install Rust -# uses: dtolnay/rust-toolchain@stable -# with: -# toolchain: ${{ env.MSRV }} -# target: ${{ matrix.metadata.target }} -# - name: Install Nextest -# uses: taiki-e/install-action@nextest -# - name: Install LLVM (macOS Apple Silicon) -# if: matrix.metadata.os == 'macos-12' && !matrix.metadata.llvm_url -# run: | -# brew install llvm -# - name: Install LLVM -# shell: bash -# if: matrix.metadata.llvm_url -# run: | -# curl --proto '=https' --tlsv1.2 -sSf ${{ matrix.metadata.llvm_url }} -L -o llvm.tar.xz -# LLVM_DIR=$(pwd)/${{ env.LLVM_DIR }} -# mkdir ${LLVM_DIR} -# tar xf llvm.tar.xz --strip-components=1 -C ${LLVM_DIR} -# echo "${LLVM_DIR}/bin" >> $GITHUB_PATH -# echo "${LLVM_DIR}/usr/bin" >> $GITHUB_PATH -# echo "LLVM_SYS_180_PREFIX=${LLVM_DIR}" >> $GITHUB_ENV -# echo "ENABLE_LLVM=1" >> $GITHUB_ENV -# env: -# LLVM_DIR: .llvm -# - name: Add `brew` libs to `RUSTFLAGS` -# if: matrix.metadata.os == 'macos-14' -# shell: bash -# run: | -# echo "RUSTFLAGS=-L/opt/homebrew/lib" >> $GITHUB_ENV -# - name: Setup Rust target -# shell: bash -# run: | -# mkdir -p .cargo -# cat << EOF > .cargo/config.toml -# [build] -# target = "${{ matrix.metadata.target }}" -# EOF -# if: matrix.metadata.target -# - name: Cache -# uses: whywaita/actions-cache-s3@v2 -# with: -# path: | -# ~/.cargo/* -# ./target/* -# key: r22-${{ github.repository }}-${{ runner.os }}-${{ hashFiles('Cargo.lock') }}-wasmer-make-test-stage-${{ matrix.stage.make }}-${{ matrix.metadata.build }} -# aws-s3-bucket: wasmer-rust-artifacts-cache -# aws-access-key-id: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_TOKEN }} -# aws-secret-access-key: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_KEY }} -# aws-region: auto -# aws-endpoint: https://1541b1e8a3fc6ad155ce67ef38899700.r2.cloudflarestorage.com -# aws-s3-bucket-endpoint: false -# aws-s3-force-path-style: true -# - name: ${{ matrix.stage.description }} -# shell: bash -# run: make ${{ matrix.stage.make }} -# env: -# TARGET: ${{ matrix.metadata.target }} -# TARGET_DIR: target/${{ matrix.metadata.target }}/release -# CARGO_TARGET: ${{ matrix.metadata.target }} + - name: Set up dependencies for Mac OS + run: | + brew install automake + # using gnu-tar is a workaround for https://github.com/actions/cache/issues/403 + brew install gnu-tar + echo PATH="/usr/local/opt/gnu-tar/libexec/gnubin:$PATH" >> $GITHUB_ENV + if: matrix.metadata.os == 'macos-12' + - name: Install Rust + uses: dtolnay/rust-toolchain@stable + with: + toolchain: ${{ env.MSRV }} + target: ${{ matrix.metadata.target }} + - name: Install Nextest + uses: taiki-e/install-action@nextest + - name: Install LLVM (macOS Apple Silicon) + if: matrix.metadata.os == 'macos-12' && !matrix.metadata.llvm_url + run: | + brew install llvm + - name: Install LLVM + shell: bash + if: matrix.metadata.llvm_url + run: | + curl --proto '=https' --tlsv1.2 -sSf ${{ matrix.metadata.llvm_url }} -L -o llvm.tar.xz + LLVM_DIR=$(pwd)/${{ env.LLVM_DIR }} + mkdir ${LLVM_DIR} + tar xf llvm.tar.xz --strip-components=1 -C ${LLVM_DIR} + echo "${LLVM_DIR}/bin" >> $GITHUB_PATH + echo "${LLVM_DIR}/usr/bin" >> $GITHUB_PATH + echo "LLVM_SYS_180_PREFIX=${LLVM_DIR}" >> $GITHUB_ENV + echo "ENABLE_LLVM=1" >> $GITHUB_ENV + env: + LLVM_DIR: .llvm + - name: Add `brew` libs to `RUSTFLAGS` + if: matrix.metadata.os == 'macos-14' + shell: bash + run: | + echo "RUSTFLAGS=-L/opt/homebrew/lib" >> $GITHUB_ENV + - name: Setup Rust target + shell: bash + run: | + mkdir -p .cargo + cat << EOF > .cargo/config.toml + [build] + target = "${{ matrix.metadata.target }}" + EOF + if: matrix.metadata.target + - name: Cache + uses: whywaita/actions-cache-s3@v2 + with: + path: | + ~/.cargo/* + ./target/* + key: r22-${{ github.repository }}-${{ runner.os }}-${{ hashFiles('Cargo.lock') }}-wasmer-make-test-stage-${{ matrix.stage.make }}-${{ matrix.metadata.build }} + aws-s3-bucket: wasmer-rust-artifacts-cache + aws-access-key-id: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_TOKEN }} + aws-secret-access-key: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_KEY }} + aws-region: auto + aws-endpoint: https://1541b1e8a3fc6ad155ce67ef38899700.r2.cloudflarestorage.com + aws-s3-bucket-endpoint: false + aws-s3-force-path-style: true + - name: ${{ matrix.stage.description }} + shell: bash + run: make ${{ matrix.stage.make }} + env: + TARGET: ${{ matrix.metadata.target }} + TARGET_DIR: target/${{ matrix.metadata.target }}/release + CARGO_TARGET: ${{ matrix.metadata.target }} -# test_integration_cli: -# name: CLI integration tests on ${{ matrix.build }} -# runs-on: ${{ matrix.os }} -# needs: [build, build_linux_aarch64, build_linux_riscv64] -# strategy: -# fail-fast: false -# matrix: -# include: -# - build: linux-x64 -# os: ubuntu-22.04 -# target: x86_64-unknown-linux-gnu -# llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-amd64.tar.xz' -# - build: macos-x64 -# os: macos-12 -# target: x86_64-apple-darwin -# # we only build the integration-test CLI, we don't run tests -# - build: macos-arm64 -# os: macos-12 -# target: aarch64-apple-darwin, -# - build: linux-musl -# target: x86_64-unknown-linux-musl -# os: ubuntu-22.04 -# container: alpine:latest -# - build: windows-x64 -# os: windows-2019 -# target: x86_64-pc-windows-msvc -# # For now, disable LLVM in `windows-x64.` -# # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-windows-amd64.tar.xz' + test_integration_cli: + name: CLI integration tests on ${{ matrix.build }} + runs-on: ${{ matrix.os }} + needs: [build, build_linux_aarch64, build_linux_riscv64] + strategy: + fail-fast: false + matrix: + include: + - build: linux-x64 + os: ubuntu-22.04 + target: x86_64-unknown-linux-gnu + llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-amd64.tar.xz' + - build: macos-x64 + os: macos-12 + target: x86_64-apple-darwin + # we only build the integration-test CLI, we don't run tests + - build: macos-arm64 + os: macos-12 + target: aarch64-apple-darwin, + - build: linux-musl + target: x86_64-unknown-linux-musl + os: ubuntu-22.04 + container: alpine:latest + - build: windows-x64 + os: windows-2019 + target: x86_64-pc-windows-msvc + # For now, disable LLVM in `windows-x64.` + # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-windows-amd64.tar.xz' -# container: ${{ matrix.container }} -# env: -# SCCACHE_AZURE_BLOB_CONTAINER: wasmerstoragesccacheblob -# SCCACHE_AZURE_CONNECTION_STRING: ${{ secrets.SCCACHE_AZURE_CONNECTION_STRING }} -# steps: -# - uses: actions/checkout@v3 -# - uses: goto-bus-stop/setup-zig@v2 -# with: -# version: 0.10.0 -# - name: Set up base deps on musl -# if: matrix.build == 'linux-musl' -# run: ./scripts/alpine-linux-install-deps.sh -# - uses: actions/download-artifact@v4 -# id: download -# with: -# name: capi-${{ matrix.build }} -# - uses: actions/download-artifact@v4 -# with: -# name: wasmer-cli-${{ matrix.build }} -# - name: 'Echo download path' -# run: echo ${{steps.download.outputs.download-path}} -# - name: Install Rust -# uses: dtolnay/rust-toolchain@stable -# with: -# toolchain: ${{ env.MSRV }} -# target: ${{ matrix.metadata.target }} -# - name: Install Nextest -# uses: taiki-e/install-action@nextest -# - name: Cache -# uses: whywaita/actions-cache-s3@v2 -# with: -# path: | -# ~/.cargo/* -# ./target/* -# key: r22-${{ github.repository }}-${{ runner.os }}-${{ hashFiles('Cargo.lock') }}-wasmer-make-test-integration-cli-${{ matrix.build }} -# aws-s3-bucket: wasmer-rust-artifacts-cache -# aws-access-key-id: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_TOKEN }} -# aws-secret-access-key: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_KEY }} -# aws-region: auto -# aws-endpoint: https://1541b1e8a3fc6ad155ce67ef38899700.r2.cloudflarestorage.com -# aws-s3-bucket-endpoint: false -# aws-s3-force-path-style: true -# - name: Prepare package directory -# shell: bash -# run: | -# mkdir -p package -# mkdir -p package/cache -# - uses: actions/download-artifact@v4 -# with: -# name: capi-linux-aarch64 -# path: package/cache/wasmercache1 -# - uses: actions/download-artifact@v4 -# with: -# name: capi-windows-x64 -# path: package/cache/wasmercache2 -# - uses: actions/download-artifact@v4 -# with: -# name: capi-macos-arm -# path: package/cache/wasmercache3 -# - uses: actions/download-artifact@v4 -# with: -# name: capi-macos-x64 -# path: package/cache/wasmercache4 -# - uses: actions/download-artifact@v4 -# with: -# name: capi-linux-x64 -# path: package/cache/wasmercache5 -# - uses: actions/download-artifact@v4 -# with: -# name: capi-linux-riscv64 -# path: package/cache/wasmercache6 -# - name: Copy .tar.gz files to proper location -# shell: bash -# run: | -# ls package/cache/wasmercache1 -# ls package/cache/wasmercache2 -# ls package/cache/wasmercache3 -# ls package/cache/wasmercache4 -# ls package/cache/wasmercache5 -# cp package/cache/wasmercache1/wasmer.tar.gz package/cache/wasmer-linux-aarch64.tar.gz -# cp package/cache/wasmercache2/build-capi.tar.gz package/cache/wasmer-windows-gnu64.tar.gz -# cp package/cache/wasmercache3/build-capi.tar.gz package/cache/wasmer-darwin-arm64.tar.gz -# cp package/cache/wasmercache4/build-capi.tar.gz package/cache/wasmer-darwin-amd64.tar.gz -# cp package/cache/wasmercache5/build-capi.tar.gz package/cache/wasmer-linux-amd64.tar.gz -# cp package/cache/wasmercache6/wasmer.tar.gz package/cache/wasmer-linux-riscv64.tar.gz -# - uses: actions/download-artifact@v4 -# if: ${{ matrix.build == 'windows-x64' }} -# with: -# name: capi-windows-x64 -# path: download_link -# - uses: actions/download-artifact@v4 -# if: ${{ matrix.build == 'linux-musl' }} -# with: -# name: capi-linux-musl -# path: download_link -# - uses: actions/download-artifact@v4 -# if: ${{ matrix.build == 'macos-arm64' }} -# with: -# name: capi-macos-arm -# path: download_link -# - uses: actions/download-artifact@v4 -# if: ${{ matrix.build == 'macos-x64' }} -# with: -# name: capi-macos-x64 -# path: download_link -# - uses: actions/download-artifact@v4 -# if: ${{ matrix.build == 'linux-x64' }} -# with: -# name: capi-linux-x64 -# path: download_link -# - name: Copy build-capi.tar.gz to link.tar.gz -# shell: bash -# run: | -# cp download_link/build-capi.tar.gz link.tar.gz -# - name: Unzip Artifacts -# shell: bash -# run: | -# make untar-capi -# - name: Unzip Artifacts -# shell: bash -# run: | -# make untar-wasmer + container: ${{ matrix.container }} + env: + SCCACHE_AZURE_BLOB_CONTAINER: wasmerstoragesccacheblob + SCCACHE_AZURE_CONNECTION_STRING: ${{ secrets.SCCACHE_AZURE_CONNECTION_STRING }} + steps: + - uses: actions/checkout@v3 + - uses: goto-bus-stop/setup-zig@v2 + with: + version: 0.10.0 + - name: Set up base deps on musl + if: matrix.build == 'linux-musl' + run: ./scripts/alpine-linux-install-deps.sh + - uses: actions/download-artifact@v4 + id: download + with: + name: capi-${{ matrix.build }} + - uses: actions/download-artifact@v4 + with: + name: wasmer-cli-${{ matrix.build }} + - name: 'Echo download path' + run: echo ${{steps.download.outputs.download-path}} + - name: Install Rust + uses: dtolnay/rust-toolchain@stable + with: + toolchain: ${{ env.MSRV }} + target: ${{ matrix.metadata.target }} + - name: Install Nextest + uses: taiki-e/install-action@nextest + - name: Cache + uses: whywaita/actions-cache-s3@v2 + with: + path: | + ~/.cargo/* + ./target/* + key: r22-${{ github.repository }}-${{ runner.os }}-${{ hashFiles('Cargo.lock') }}-wasmer-make-test-integration-cli-${{ matrix.build }} + aws-s3-bucket: wasmer-rust-artifacts-cache + aws-access-key-id: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_TOKEN }} + aws-secret-access-key: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_KEY }} + aws-region: auto + aws-endpoint: https://1541b1e8a3fc6ad155ce67ef38899700.r2.cloudflarestorage.com + aws-s3-bucket-endpoint: false + aws-s3-force-path-style: true + - name: Prepare package directory + shell: bash + run: | + mkdir -p package + mkdir -p package/cache + - uses: actions/download-artifact@v4 + with: + name: capi-linux-aarch64 + path: package/cache/wasmercache1 + - uses: actions/download-artifact@v4 + with: + name: capi-windows-x64 + path: package/cache/wasmercache2 + - uses: actions/download-artifact@v4 + with: + name: capi-macos-arm + path: package/cache/wasmercache3 + - uses: actions/download-artifact@v4 + with: + name: capi-macos-x64 + path: package/cache/wasmercache4 + - uses: actions/download-artifact@v4 + with: + name: capi-linux-x64 + path: package/cache/wasmercache5 + - uses: actions/download-artifact@v4 + with: + name: capi-linux-riscv64 + path: package/cache/wasmercache6 + - name: Copy .tar.gz files to proper location + shell: bash + run: | + ls package/cache/wasmercache1 + ls package/cache/wasmercache2 + ls package/cache/wasmercache3 + ls package/cache/wasmercache4 + ls package/cache/wasmercache5 + cp package/cache/wasmercache1/wasmer.tar.gz package/cache/wasmer-linux-aarch64.tar.gz + cp package/cache/wasmercache2/build-capi.tar.gz package/cache/wasmer-windows-gnu64.tar.gz + cp package/cache/wasmercache3/build-capi.tar.gz package/cache/wasmer-darwin-arm64.tar.gz + cp package/cache/wasmercache4/build-capi.tar.gz package/cache/wasmer-darwin-amd64.tar.gz + cp package/cache/wasmercache5/build-capi.tar.gz package/cache/wasmer-linux-amd64.tar.gz + cp package/cache/wasmercache6/wasmer.tar.gz package/cache/wasmer-linux-riscv64.tar.gz + - uses: actions/download-artifact@v4 + if: ${{ matrix.build == 'windows-x64' }} + with: + name: capi-windows-x64 + path: download_link + - uses: actions/download-artifact@v4 + if: ${{ matrix.build == 'linux-musl' }} + with: + name: capi-linux-musl + path: download_link + - uses: actions/download-artifact@v4 + if: ${{ matrix.build == 'macos-arm64' }} + with: + name: capi-macos-arm + path: download_link + - uses: actions/download-artifact@v4 + if: ${{ matrix.build == 'macos-x64' }} + with: + name: capi-macos-x64 + path: download_link + - uses: actions/download-artifact@v4 + if: ${{ matrix.build == 'linux-x64' }} + with: + name: capi-linux-x64 + path: download_link + - name: Copy build-capi.tar.gz to link.tar.gz + shell: bash + run: | + cp download_link/build-capi.tar.gz link.tar.gz + - name: Unzip Artifacts + shell: bash + run: | + make untar-capi + - name: Unzip Artifacts + shell: bash + run: | + make untar-wasmer -# # Removed in favour of freestanding integration tests -# # -# # - name: Test integration CLI -# # if: false # matrix.build != 'macos-arm' -# # shell: bash -# # run: | -# # export WASMER_PATH=`pwd`/target/${{ matrix.target }}/release/wasmer${{ matrix.exe }} -# # export WASMER_DIR=`pwd`/package && make test-integration-cli-ci -# # env: -# # TARGET: ${{ matrix.target }} -# # TARGET_DIR: target/${{ matrix.target }}/release -# # CARGO_TARGET: ${{ matrix.target }} -# # WAPM_DEV_TOKEN: ${{ secrets.WAPM_DEV_TOKEN }} -# # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # Removed in favour of freestanding integration tests + # + # - name: Test integration CLI + # if: false # matrix.build != 'macos-arm' + # shell: bash + # run: | + # export WASMER_PATH=`pwd`/target/${{ matrix.target }}/release/wasmer${{ matrix.exe }} + # export WASMER_DIR=`pwd`/package && make test-integration-cli-ci + # env: + # TARGET: ${{ matrix.target }} + # TARGET_DIR: target/${{ matrix.target }}/release + # CARGO_TARGET: ${{ matrix.target }} + # WAPM_DEV_TOKEN: ${{ secrets.WAPM_DEV_TOKEN }} + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} -# # ---- -# # Note (xdoardo on 2024/10/07): -# # --- -# # As of now the WAMR, WASMI (and V8) backends are not that mature enough. We will re-enable these tests -# # when they've been used and matured. -# # ---- -# # -# # - name: Test CLI integration (WAMR) -# # shell: bash -# # run: | -# # export WASMER_PATH=`pwd`/target/${{ matrix.target }}/release/wasmer${{ matrix.exe }} -# # export WASMER_DIR=`pwd`/package && make test-integration-cli-wamr-ci -# # env: -# # TARGET: ${{ matrix.target }} -# # TARGET_DIR: target/${{ matrix.target }}/release -# # CARGO_TARGET: ${{ matrix.target }} -# # WAPM_DEV_TOKEN: ${{ secrets.WAPM_DEV_TOKEN }} -# # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # ---- + # Note (xdoardo on 2024/10/07): + # --- + # As of now the WAMR, WASMI (and V8) backends are not that mature enough. We will re-enable these tests + # when they've been used and matured. + # ---- + # + # - name: Test CLI integration (WAMR) + # shell: bash + # run: | + # export WASMER_PATH=`pwd`/target/${{ matrix.target }}/release/wasmer${{ matrix.exe }} + # export WASMER_DIR=`pwd`/package && make test-integration-cli-wamr-ci + # env: + # TARGET: ${{ matrix.target }} + # TARGET_DIR: target/${{ matrix.target }}/release + # CARGO_TARGET: ${{ matrix.target }} + # WAPM_DEV_TOKEN: ${{ secrets.WAPM_DEV_TOKEN }} + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} -# # - name: Test CLI integration (WASMI) -# # shell: bash -# # run: | -# # export WASMER_PATH=`pwd`/target/${{ matrix.target }}/release/wasmer${{ matrix.exe }} -# # export WASMER_DIR=`pwd`/package && make test-integration-cli-wasmi-ci -# # env: -# # TARGET: ${{ matrix.target }} -# # TARGET_DIR: target/${{ matrix.target }}/release -# # CARGO_TARGET: ${{ matrix.target }} -# # WAPM_DEV_TOKEN: ${{ secrets.WAPM_DEV_TOKEN }} -# # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # - name: Test CLI integration (WASMI) + # shell: bash + # run: | + # export WASMER_PATH=`pwd`/target/${{ matrix.target }}/release/wasmer${{ matrix.exe }} + # export WASMER_DIR=`pwd`/package && make test-integration-cli-wasmi-ci + # env: + # TARGET: ${{ matrix.target }} + # TARGET_DIR: target/${{ matrix.target }}/release + # CARGO_TARGET: ${{ matrix.target }} + # WAPM_DEV_TOKEN: ${{ secrets.WAPM_DEV_TOKEN }} + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} -# # there is another set of integration tests in 'wasmer-integration-tests' repo. Run those -# test-wasmer-integration-tests: -# needs: [build] -# runs-on: ubuntu-22.04 -# steps: -# - name: Checkout wasmer-integration-tests repository -# uses: actions/checkout@v3 -# with: -# repository: wasmerio/wasmer-integration-tests -# submodules: true -# token: ${{ secrets.CLONE_WASMER_INTEGRATION_TESTS }} -# - uses: actions/download-artifact@v4 -# with: -# name: wasmer-cli-linux-x64 -# - name: Cargo Registry Cache -# uses: actions/cache@v3 -# with: -# path: | -# ~/.cargo/advisory-db -# ~/.cargo/git -# ~/.cargo/registry -# key: cargo-registry-${{ hashFiles('**/Cargo.lock') }} -# - name: Cargo target cache -# uses: actions/cache@v3 -# with: -# path: | -# target/ -# key: cargo-release-${{ hashFiles('**/Cargo.lock') }} -# - run: | -# # install rust toolchain -# curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y -# . "$HOME/.cargo/env" + # there is another set of integration tests in 'wasmer-integration-tests' repo. Run those + test-wasmer-integration-tests: + needs: [build] + runs-on: ubuntu-22.04 + steps: + - name: Checkout wasmer-integration-tests repository + uses: actions/checkout@v3 + with: + repository: wasmerio/wasmer-integration-tests + submodules: true + token: ${{ secrets.CLONE_WASMER_INTEGRATION_TESTS }} + - uses: actions/download-artifact@v4 + with: + name: wasmer-cli-linux-x64 + - name: Cargo Registry Cache + uses: actions/cache@v3 + with: + path: | + ~/.cargo/advisory-db + ~/.cargo/git + ~/.cargo/registry + key: cargo-registry-${{ hashFiles('**/Cargo.lock') }} + - name: Cargo target cache + uses: actions/cache@v3 + with: + path: | + target/ + key: cargo-release-${{ hashFiles('**/Cargo.lock') }} + - run: | + # install rust toolchain + curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y + . "$HOME/.cargo/env" -# # add wasmer cli to PATH -# tar -xzf build-wasmer.tar.gz + # add wasmer cli to PATH + tar -xzf build-wasmer.tar.gz -# docker build -t tmp . -# docker run -v $PWD:/app -w /app tmp bash -c " \ -# cp ./bin/wasmer /root/.wasmer/bin/wasmer &&\ -# export MYSQL_HOST='${{ vars.INTEGRATION_TEST_MYSQL_HOST }}' &&\ -# export MYSQL_DBNAME='${{ vars.INTEGRATION_TEST_MYSQL_DBNAME }}' &&\ -# export MYSQL_USERNAME='${{ secrets.INTEGRATION_TEST_MYSQL_USERNAME }}' &&\ -# export MYSQL_PASSWORD='${{ secrets.INTEGRATION_TEST_MYSQL_PASSWORD }}' &&\ -# export MYSQL_PORT='${{ vars.INTEGRATION_TEST_MYSQL_PORT }}' &&\ -# export MYSQL_CERT='${{ secrets.INTEGRATION_TEST_MYSQL_CERT }}' &&\ -# export PG_HOST='${{ vars.INTEGRATION_TEST_PG_HOST }}' &&\ -# export PG_DBNAME='${{ vars.INTEGRATION_TEST_PG_DBNAME }}' &&\ -# export PG_USERNAME='${{ secrets.INTEGRATION_TEST_PG_USERNAME }}' &&\ -# export PG_PASSWORD='${{ secrets.INTEGRATION_TEST_PG_PASSWORD }}' &&\ -# export PG_PORT='${{ vars.INTEGRATION_TEST_PG_PORT }}' &&\ -# wasmer config set registry.url https://registry.wasmer.io/graphql &&\ -# wasmer login '${{ secrets.WAPM_PROD_TOKEN }}' &&\ -# wasmer config set registry.url https://registry.wasmer.wtf/graphql &&\ -# wasmer login '${{ secrets.WAPM_DEV_TOKEN }}' &&\ -# cargo test --no-fail-fast" -# - name: notify failure in slack -# if: failure() -# run: | -# curl -X POST -H 'Content-type: application/json' --data '{"text":"Integration tests failed ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"}' ${{ secrets.INTEGRATION_TEST_SLACK_WEBHOOK }} + docker build -t tmp . + docker run -v $PWD:/app -w /app tmp bash -c " \ + cp ./bin/wasmer /root/.wasmer/bin/wasmer &&\ + export MYSQL_HOST='${{ vars.INTEGRATION_TEST_MYSQL_HOST }}' &&\ + export MYSQL_DBNAME='${{ vars.INTEGRATION_TEST_MYSQL_DBNAME }}' &&\ + export MYSQL_USERNAME='${{ secrets.INTEGRATION_TEST_MYSQL_USERNAME }}' &&\ + export MYSQL_PASSWORD='${{ secrets.INTEGRATION_TEST_MYSQL_PASSWORD }}' &&\ + export MYSQL_PORT='${{ vars.INTEGRATION_TEST_MYSQL_PORT }}' &&\ + export MYSQL_CERT='${{ secrets.INTEGRATION_TEST_MYSQL_CERT }}' &&\ + export PG_HOST='${{ vars.INTEGRATION_TEST_PG_HOST }}' &&\ + export PG_DBNAME='${{ vars.INTEGRATION_TEST_PG_DBNAME }}' &&\ + export PG_USERNAME='${{ secrets.INTEGRATION_TEST_PG_USERNAME }}' &&\ + export PG_PASSWORD='${{ secrets.INTEGRATION_TEST_PG_PASSWORD }}' &&\ + export PG_PORT='${{ vars.INTEGRATION_TEST_PG_PORT }}' &&\ + wasmer config set registry.url https://registry.wasmer.io/graphql &&\ + wasmer login '${{ secrets.WAPM_PROD_TOKEN }}' &&\ + wasmer config set registry.url https://registry.wasmer.wtf/graphql &&\ + wasmer login '${{ secrets.WAPM_DEV_TOKEN }}' &&\ + cargo test --no-fail-fast" + - name: notify failure in slack + if: failure() + run: | + curl -X POST -H 'Content-type: application/json' --data '{"text":"Integration tests failed ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"}' ${{ secrets.INTEGRATION_TEST_SLACK_WEBHOOK }} diff --git a/.github/workflows/wasmer-config.yaml b/.github/workflows/wasmer-config.yaml index 90a36b31efd..9091574b1e3 100644 --- a/.github/workflows/wasmer-config.yaml +++ b/.github/workflows/wasmer-config.yaml @@ -1,54 +1,54 @@ -# # Dedicated workflow just for the wasmer-config crate -# name: wasmer-config +# Dedicated workflow just for the wasmer-config crate +name: wasmer-config -# on: -# push: -# branches: -# - main -# pull_request: +on: + push: + branches: + - main + pull_request: -# # Automatically cancel previous workflow runs when a new commit is pushed. -# concurrency: -# group: ${{ github.workflow }}-${{ github.ref }} -# cancel-in-progress: true +# Automatically cancel previous workflow runs when a new commit is pushed. +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true -# env: -# DEFAULT_CRATE_NAME: wasmer_toml +env: + DEFAULT_CRATE_NAME: wasmer_toml -# jobs: -# check: -# name: Compile and Test -# runs-on: ubuntu-latest -# steps: -# - uses: actions/checkout@v2 -# - name: Rust Cache -# uses: Swatinem/rust-cache@v2 -# - name: Setup Rust -# uses: dsherret/rust-toolchain-file@v1 -# - name: Install Nextest -# uses: taiki-e/install-action@nextest -# - name: Type Checking -# run: | -# cd lib/config && cargo check --verbose --locked -# - name: Build -# run: | -# cd lib/config && cargo build --verbose --locked -# - name: Test -# run: | -# cd lib/config && cargo nextest run --verbose --locked +jobs: + check: + name: Compile and Test + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Rust Cache + uses: Swatinem/rust-cache@v2 + - name: Setup Rust + uses: dsherret/rust-toolchain-file@v1 + - name: Install Nextest + uses: taiki-e/install-action@nextest + - name: Type Checking + run: | + cd lib/config && cargo check --verbose --locked + - name: Build + run: | + cd lib/config && cargo build --verbose --locked + - name: Test + run: | + cd lib/config && cargo nextest run --verbose --locked -# lints: -# name: Linting and Formatting -# runs-on: ubuntu-latest -# steps: -# - uses: actions/checkout@v2 -# - name: Rust Cache -# uses: Swatinem/rust-cache@v2 -# - name: Setup Rust -# uses: dsherret/rust-toolchain-file@v1 -# - name: Check Formatting -# run: | -# cd lib/config && cargo fmt --verbose --check -# - name: Clippy -# run: | -# cd lib/config && cargo clippy --verbose + lints: + name: Linting and Formatting + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Rust Cache + uses: Swatinem/rust-cache@v2 + - name: Setup Rust + uses: dsherret/rust-toolchain-file@v1 + - name: Check Formatting + run: | + cd lib/config && cargo fmt --verbose --check + - name: Clippy + run: | + cd lib/config && cargo clippy --verbose diff --git a/.github/workflows/wasmer-integration-tests.yaml b/.github/workflows/wasmer-integration-tests.yaml index f06a96fd5c8..8cbf068de8f 100644 --- a/.github/workflows/wasmer-integration-tests.yaml +++ b/.github/workflows/wasmer-integration-tests.yaml @@ -1,51 +1,51 @@ -# name: test-sys +name: test-sys -# on: -# push: -# branches: -# - sre-383-re-enable-ignored-integration-test-test_php_extensions +on: + push: + branches: + - sre-383-re-enable-ignored-integration-test-test_php_extensions -# jobs: -# # there is another set of integration tests in 'wasmer-integration-tests' repo. Run those -# test-wasmer-integration-tests: -# runs-on: ubuntu-22.04 -# steps: -# - name: Checkout wasmer-integration-tests repository -# uses: actions/checkout@v3 -# with: -# repository: wasmerio/wasmer-integration-tests -# submodules: true -# token: ${{ secrets.CLONE_WASMER_INTEGRATION_TESTS }} -# - name: Cargo Registry Cache -# uses: actions/cache@v3 -# with: -# path: | -# ~/.cargo/advisory-db -# ~/.cargo/git -# ~/.cargo/registry -# key: cargo-registry-${{ hashFiles('**/Cargo.lock') }} -# - name: Cargo target cache -# uses: actions/cache@v3 -# with: -# path: | -# target/ -# key: cargo-release-${{ hashFiles('**/Cargo.lock') }} -# - run: | -# docker build -t tmp . -# docker run -v $PWD:/app -w /app tmp bash -c " \ -# export MYSQL_HOST='${{ vars.INTEGRATION_TEST_MYSQL_HOST }}' &&\ -# export MYSQL_DBNAME='${{ vars.INTEGRATION_TEST_MYSQL_DBNAME }}' &&\ -# export MYSQL_USERNAME='${{ secrets.INTEGRATION_TEST_MYSQL_USERNAME }}' &&\ -# export MYSQL_PASSWORD='${{ secrets.INTEGRATION_TEST_MYSQL_PASSWORD }}' &&\ -# export MYSQL_PORT='${{ vars.INTEGRATION_TEST_MYSQL_PORT }}' &&\ -# export MYSQL_CERT='${{ secrets.INTEGRATION_TEST_MYSQL_CERT }}' &&\ -# export PG_HOST='${{ vars.INTEGRATION_TEST_PG_HOST }}' &&\ -# export PG_DBNAME='${{ vars.INTEGRATION_TEST_PG_DBNAME }}' &&\ -# export PG_USERNAME='${{ secrets.INTEGRATION_TEST_PG_USERNAME }}' &&\ -# export PG_PASSWORD='${{ secrets.INTEGRATION_TEST_PG_PASSWORD }}' &&\ -# export PG_PORT='${{ vars.INTEGRATION_TEST_PG_PORT }}' &&\ -# wasmer config set registry.url https://registry.wasmer.io/graphql &&\ -# wasmer login ${{ secrets.WAPM_PROD_TOKEN }} &&\ -# wasmer config set registry.url https://registry.wasmer.wtf/graphql &&\ -# wasmer login ${{ secrets.WAPM_DEV_TOKEN }} &&\ -# cargo test --no-fail-fast" \ No newline at end of file +jobs: + # there is another set of integration tests in 'wasmer-integration-tests' repo. Run those + test-wasmer-integration-tests: + runs-on: ubuntu-22.04 + steps: + - name: Checkout wasmer-integration-tests repository + uses: actions/checkout@v3 + with: + repository: wasmerio/wasmer-integration-tests + submodules: true + token: ${{ secrets.CLONE_WASMER_INTEGRATION_TESTS }} + - name: Cargo Registry Cache + uses: actions/cache@v3 + with: + path: | + ~/.cargo/advisory-db + ~/.cargo/git + ~/.cargo/registry + key: cargo-registry-${{ hashFiles('**/Cargo.lock') }} + - name: Cargo target cache + uses: actions/cache@v3 + with: + path: | + target/ + key: cargo-release-${{ hashFiles('**/Cargo.lock') }} + - run: | + docker build -t tmp . + docker run -v $PWD:/app -w /app tmp bash -c " \ + export MYSQL_HOST='${{ vars.INTEGRATION_TEST_MYSQL_HOST }}' &&\ + export MYSQL_DBNAME='${{ vars.INTEGRATION_TEST_MYSQL_DBNAME }}' &&\ + export MYSQL_USERNAME='${{ secrets.INTEGRATION_TEST_MYSQL_USERNAME }}' &&\ + export MYSQL_PASSWORD='${{ secrets.INTEGRATION_TEST_MYSQL_PASSWORD }}' &&\ + export MYSQL_PORT='${{ vars.INTEGRATION_TEST_MYSQL_PORT }}' &&\ + export MYSQL_CERT='${{ secrets.INTEGRATION_TEST_MYSQL_CERT }}' &&\ + export PG_HOST='${{ vars.INTEGRATION_TEST_PG_HOST }}' &&\ + export PG_DBNAME='${{ vars.INTEGRATION_TEST_PG_DBNAME }}' &&\ + export PG_USERNAME='${{ secrets.INTEGRATION_TEST_PG_USERNAME }}' &&\ + export PG_PASSWORD='${{ secrets.INTEGRATION_TEST_PG_PASSWORD }}' &&\ + export PG_PORT='${{ vars.INTEGRATION_TEST_PG_PORT }}' &&\ + wasmer config set registry.url https://registry.wasmer.io/graphql &&\ + wasmer login ${{ secrets.WAPM_PROD_TOKEN }} &&\ + wasmer config set registry.url https://registry.wasmer.wtf/graphql &&\ + wasmer login ${{ secrets.WAPM_DEV_TOKEN }} &&\ + cargo test --no-fail-fast" From ab0f3d3d27221dc59f5c41ed3f77d3624ea0e7d4 Mon Sep 17 00:00:00 2001 From: "M.Amin Rayej" Date: Mon, 21 Oct 2024 12:39:03 +0330 Subject: [PATCH 43/45] disable riscv and aarch64 on Linux as requirements for release --- .github/workflows/build.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 523846c70d4..08760131562 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -653,7 +653,8 @@ jobs: retention-days: 2 release: - needs: [setup, build, linux_aarch64, windows_gnu, linux_riscv64] + # needs: [setup, build, linux_aarch64, windows_gnu, linux_riscv64] + needs: [setup, build, windows_gnu] runs-on: ubuntu-latest if: needs.setup.outputs.DOING_RELEASE == '1' || github.event.inputs.release != '' steps: From fb537fd89c535f25995fb49218250f6e916cf6ec Mon Sep 17 00:00:00 2001 From: "M.Amin Rayej" Date: Mon, 21 Oct 2024 12:47:52 +0330 Subject: [PATCH 44/45] disable asset upload for riscv and aarch64 --- .github/workflows/build.yml | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 08760131562..d493f7e8b28 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -753,24 +753,24 @@ jobs: asset_path: artifacts/wasmer-wasmi-linux-amd64/wasmer.tar.gz asset_name: wasmer-wasmi-linux-amd64.tar.gz asset_content_type: application/gzip - - name: Upload Release Asset Linux aarch64 - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: artifacts/wasmer-linux-aarch64/wasmer.tar.gz - asset_name: wasmer-linux-aarch64.tar.gz - asset_content_type: application/gzip - - name: Upload Release Asset Linux riscv64 - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: artifacts/wasmer-linux-riscv64/wasmer.tar.gz - asset_name: wasmer-linux-riscv64.tar.gz - asset_content_type: application/gzip + # - name: Upload Release Asset Linux aarch64 + # uses: actions/upload-release-asset@v1 + # env: + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # with: + # upload_url: ${{ steps.create_release.outputs.upload_url }} + # asset_path: artifacts/wasmer-linux-aarch64/wasmer.tar.gz + # asset_name: wasmer-linux-aarch64.tar.gz + # asset_content_type: application/gzip + # - name: Upload Release Asset Linux riscv64 + # uses: actions/upload-release-asset@v1 + # env: + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # with: + # upload_url: ${{ steps.create_release.outputs.upload_url }} + # asset_path: artifacts/wasmer-linux-riscv64/wasmer.tar.gz + # asset_name: wasmer-linux-riscv64.tar.gz + # asset_content_type: application/gzip - name: Upload Release Asset Windows gnu64 uses: actions/upload-release-asset@v1 env: From 43ce44697c542c73136b2ccb0bba96c7b44b4899 Mon Sep 17 00:00:00 2001 From: "M.Amin Rayej" Date: Mon, 21 Oct 2024 13:13:43 +0330 Subject: [PATCH 45/45] fix artifact missing on macos-arm --- .github/workflows/test.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index ddffe58f499..112367d6beb 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -759,7 +759,7 @@ jobs: }, { - build: macos-arm64, + build: macos-arm, os: macos-14, target: aarch64-apple-darwin, exe: '', @@ -890,7 +890,7 @@ jobs: os: macos-12 target: x86_64-apple-darwin # we only build the integration-test CLI, we don't run tests - - build: macos-arm64 + - build: macos-arm os: macos-12 target: aarch64-apple-darwin, - build: linux-musl @@ -999,7 +999,7 @@ jobs: name: capi-linux-musl path: download_link - uses: actions/download-artifact@v4 - if: ${{ matrix.build == 'macos-arm64' }} + if: ${{ matrix.build == 'macos-arm' }} with: name: capi-macos-arm path: download_link