From 4379f09b16e3b398a36a51fa404d954d7d322523 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Tue, 22 Nov 2022 12:32:26 +0100 Subject: [PATCH 001/226] Remove unnecessary CI runs --- .github/workflows/documentation.yaml | 37 -------- .github/workflows/test-sys.yaml | 132 +++++---------------------- 2 files changed, 23 insertions(+), 146 deletions(-) delete mode 100644 .github/workflows/documentation.yaml diff --git a/.github/workflows/documentation.yaml b/.github/workflows/documentation.yaml deleted file mode 100644 index ae018dd312d..00000000000 --- a/.github/workflows/documentation.yaml +++ /dev/null @@ -1,37 +0,0 @@ -name: Documentation - -on: - push: - branches: - - 'master' - paths: - - 'lib/**' - -jobs: - documentation: - name: Documentation - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: Install Rust - uses: dtolnay/rust-toolchain@stable - with: - toolchain: 1.63 - - name: Install LLVM - shell: bash - run: | - curl --proto '=https' --tlsv1.2 -sSf ${{ env.LLVM_URL }} -L -o llvm.tar.xz - mkdir ${{ env.LLVM_DIR }} - tar xf llvm.tar.xz --strip-components=1 -C ${{ env.LLVM_DIR }} - echo "${{ env.LLVM_DIR }}/bin" >> $GITHUB_PATH - echo "LLVM_SYS_120_PREFIX=${{ env.LLVM_DIR }}" >> $GITHUB_ENV - env: - LLVM_DIR: ${{ github.workspace }}/llvm-13 - LLVM_URL: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz' - - name: Build & package documentation - run: make package-docs - - name: Publish documentation - uses: peaceiris/actions-gh-pages@v3 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: ./package/docs diff --git a/.github/workflows/test-sys.yaml b/.github/workflows/test-sys.yaml index f440ede6fda..72b22980412 100644 --- a/.github/workflows/test-sys.yaml +++ b/.github/workflows/test-sys.yaml @@ -4,116 +4,35 @@ env: RUST_BACKTRACE: 1 on: - workflow_dispatch: push: branches: - 'master' - 'staging' - 'trying' - paths: - - 'lib/**' - 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: paths: - - 'lib/**' + - '**' jobs: - setup: - name: Set up - runs-on: ubuntu-latest - 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 ::set-output name=VERSION::${VERSION} - DOING_RELEASE=$(echo $VERSION | grep -c '^[0-9]\+\.[0-9]\+\.[0-9]\+\(-\([a-zA-Z]\+\)\?[0-9]*\)\?$' || true) - echo ::set-output name=DOING_RELEASE::${DOING_RELEASE} - echo $VERSION - echo $DOING_RELEASE - test: - name: Test on ${{ matrix.build }} - runs-on: ${{ matrix.os }} + check_linux_x64: + name: cargo check on linux-x86_64-gnu + runs-on: ubuntu-latest needs: setup - strategy: - fail-fast: false - matrix: - include: - - build: linux-x64 - os: ubuntu-18.04 - target: x86_64-unknown-linux-gnu - llvm_url: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz' - run_test: true - run_test_capi: true - run_integration_tests: true - run_build_docs: true - use_sccache: true - - build: macos-x64 - os: macos-11 - target: x86_64-apple-darwin - llvm_url: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-apple-darwin.tar.xz' - run_test: true - run_test_capi: true - use_sccache: true - run_integration_tests: true - run_ios_tests: true - run_build_docs: false - - build: macos-arm64 - os: macos-11.0 - target: aarch64-apple-darwin - use_sccache: true - run_test: false - run_test_capi: false - run_build_docs: false - - build: windows-x64 - os: windows-2019 - #target: x86_64-pc-windows-msvc commented because of bug in rust setup action - # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/12.x/windows-amd64.tar.gz' - llvm_choco_version: 13.0.0 - run_integration_tests: true - use_sccache: true - run_test: true - run_test_capi: false # We can't run yet the capi tests on Windows - run_build_docs: false - - build: linux-musl-x64 - target: x86_64-unknown-linux-musl - os: ubuntu-latest - container: alpine:latest - run_test: true - run_test_capi: false # It can't run the capi tests because of a cc linker issue (`wasm_engine_new` is redefined) - run_integration_tests: false - run_build_docs: false - use_sccache: false - container: ${{ matrix.container }} env: - SCCACHE_AZURE_BLOB_CONTAINER: wasmerstoragesccacheblob - SCCACHE_AZURE_CONNECTION_STRING: ${{ secrets.SCCACHE_AZURE_CONNECTION_STRING }} - steps: + TARGET: linux-x86_64-gnu + steps: - uses: actions/checkout@v3 - - uses: goto-bus-stop/setup-zig@v2 - with: - version: 0.10.0 - name: Set up libstdc++ on Linux - if: matrix.build == 'linux-x64' run: | sudo apt-get update -y sudo apt-get install -y --allow-downgrades libstdc++6=8.4.0-1ubuntu1~18.04 sudo apt-get install --reinstall g++-8 - - name: Set up base deps on musl - if: matrix.build == 'linux-musl-x64' - run: | - apk add build-base bash musl-dev curl make libtool libffi-dev gcc automake autoconf git openssl-dev g++ - name: Install Rust uses: dtolnay/rust-toolchain@stable with: toolchain: 1.63 +<<<<<<< HEAD target: ${{ matrix.target }} - uses: Swatinem/rust-cache@v1 if: matrix.use_sccache != true @@ -278,26 +197,21 @@ jobs: audit: name: Audit - env: - CARGO_AUDIT_VERSION: 0.16.0 - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: actions/cache@master - with: - path: ${{ runner.tool_cache }}/cargo-audit - key: cargo-audit-bin-${{ env.CARGO_AUDIT_VERSION }} - - run: | - echo "'${{ runner.tool_cache }}/cargo-audit/bin'" >> $GITHUB_PATH - - run: | - cargo install cargo-audit --version ${{ env.CARGO_AUDIT_VERSION }} --root '${{ runner.tool_cache }}/cargo-audit' - cargo audit +======= + target: linux-x86_64-gnu - test-wasm-build: - name: Test wasm build + check_linux_musl: + name: cargo check on linux-x86_64-musl runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - run: | - rustup target add wasm32-wasi - make build-wasmer-wasm + needs: setup + container: alpine:latest +>>>>>>> 3e578e17a5 (Remove unnecessary CI runs) + env: + TARGET: linux-x86_64-musl + steps: + - uses: actions/checkout@v3 + - name: Install Rust + uses: dtolnay/rust-toolchain@stable + with: + toolchain: 1.63 + target: linux-x86_64-musl From df56830928774dd8e042efe44529c02bd83102c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Tue, 22 Nov 2022 12:37:47 +0100 Subject: [PATCH 002/226] Always run test-sys on every pull request --- .github/workflows/test-sys.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/test-sys.yaml b/.github/workflows/test-sys.yaml index 72b22980412..c2d0dedf369 100644 --- a/.github/workflows/test-sys.yaml +++ b/.github/workflows/test-sys.yaml @@ -10,8 +10,7 @@ on: - 'staging' - 'trying' pull_request: - paths: - - '**' + types: [ synchronize ] jobs: From d963119ff05dd71b982dc86b906e5a2775ba7c03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Tue, 22 Nov 2022 12:39:27 +0100 Subject: [PATCH 003/226] Run on every branch --- .github/workflows/test-sys.yaml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/test-sys.yaml b/.github/workflows/test-sys.yaml index c2d0dedf369..2b4afe7a300 100644 --- a/.github/workflows/test-sys.yaml +++ b/.github/workflows/test-sys.yaml @@ -6,9 +6,7 @@ env: on: push: branches: - - 'master' - - 'staging' - - 'trying' + - '*' pull_request: types: [ synchronize ] From c19967ce64f3bf4d55a6bd1de55b57b666cbfaaa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Tue, 22 Nov 2022 12:40:20 +0100 Subject: [PATCH 004/226] Remove setup step --- .github/workflows/test-sys.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/test-sys.yaml b/.github/workflows/test-sys.yaml index 2b4afe7a300..739a3a690df 100644 --- a/.github/workflows/test-sys.yaml +++ b/.github/workflows/test-sys.yaml @@ -15,7 +15,6 @@ jobs: check_linux_x64: name: cargo check on linux-x86_64-gnu runs-on: ubuntu-latest - needs: setup env: TARGET: linux-x86_64-gnu steps: @@ -200,7 +199,6 @@ jobs: check_linux_musl: name: cargo check on linux-x86_64-musl runs-on: ubuntu-latest - needs: setup container: alpine:latest >>>>>>> 3e578e17a5 (Remove unnecessary CI runs) env: From 6926e898f5de144bb60bf93ae84c5399263731f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Tue, 22 Nov 2022 12:42:05 +0100 Subject: [PATCH 005/226] Fix test-sys --- .github/workflows/test-sys.yaml | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/.github/workflows/test-sys.yaml b/.github/workflows/test-sys.yaml index 739a3a690df..eecb9f0169b 100644 --- a/.github/workflows/test-sys.yaml +++ b/.github/workflows/test-sys.yaml @@ -1,14 +1,15 @@ -name: Runtime tests - -env: - RUST_BACKTRACE: 1 +name: test-sys on: push: branches: - - '*' - pull_request: - types: [ synchronize ] + - '**' + - '!master' + pull_request: + types: [ synchronize ] + +env: + RUST_BACKTRACE: 1 jobs: From 1b9152062132f98ddf3e7809ecf605f01c47a654 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Tue, 22 Nov 2022 12:44:30 +0100 Subject: [PATCH 006/226] Add musl basics --- .github/workflows/test-sys.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/test-sys.yaml b/.github/workflows/test-sys.yaml index eecb9f0169b..ae914716d04 100644 --- a/.github/workflows/test-sys.yaml +++ b/.github/workflows/test-sys.yaml @@ -206,6 +206,10 @@ jobs: TARGET: linux-x86_64-musl steps: - uses: actions/checkout@v3 + - name: Set up base deps on musl + if: matrix.build == 'linux-musl-x64' + run: | + apk add build-base bash musl-dev curl make libtool libffi-dev gcc automake autoconf git openssl-dev g++ - name: Install Rust uses: dtolnay/rust-toolchain@stable with: From 9535aa7e78237c0e31ae3b24e7360b6536a3b06f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Tue, 22 Nov 2022 12:46:46 +0100 Subject: [PATCH 007/226] Sync Ci --- .github/workflows/test-sys.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-sys.yaml b/.github/workflows/test-sys.yaml index ae914716d04..0a039ffd796 100644 --- a/.github/workflows/test-sys.yaml +++ b/.github/workflows/test-sys.yaml @@ -15,7 +15,7 @@ jobs: check_linux_x64: name: cargo check on linux-x86_64-gnu - runs-on: ubuntu-latest + runs-on: ubuntu-18.04 env: TARGET: linux-x86_64-gnu steps: From 2d9c062fce0704a6c3634bfd10451ec719ae527b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Tue, 22 Nov 2022 15:31:03 +0100 Subject: [PATCH 008/226] Add cargo xtask --- .cargo/config | 2 ++ .github/codecov.yml | 11 ----------- .github/workflows/test-sys.yaml | 10 ++++++++++ Cargo.lock | 4 ++++ Cargo.toml | 1 + xtask/Cargo.toml | 8 ++++++++ xtask/src/main.rs | 3 +++ 7 files changed, 28 insertions(+), 11 deletions(-) create mode 100644 .cargo/config delete mode 100644 .github/codecov.yml create mode 100644 xtask/Cargo.toml create mode 100644 xtask/src/main.rs diff --git a/.cargo/config b/.cargo/config new file mode 100644 index 00000000000..94837d8ae3e --- /dev/null +++ b/.cargo/config @@ -0,0 +1,2 @@ +[alias] +xtaskci = "run --package xtask --" \ No newline at end of file diff --git a/.github/codecov.yml b/.github/codecov.yml deleted file mode 100644 index af427cff68e..00000000000 --- a/.github/codecov.yml +++ /dev/null @@ -1,11 +0,0 @@ -coverage: - status: - project: - default: - target: auto - threshold: 1% - patch: - default: - target: auto - threshold: 5% - base: auto diff --git a/.github/workflows/test-sys.yaml b/.github/workflows/test-sys.yaml index 0a039ffd796..2cd379b0e0a 100644 --- a/.github/workflows/test-sys.yaml +++ b/.github/workflows/test-sys.yaml @@ -196,6 +196,11 @@ jobs: name: Audit ======= target: linux-x86_64-gnu + - name: Install cargo xtask + run: | + cargo install cargo-xtask + - name: cargo xtask build-wasmer + script: cargo xtaskci check_linux_musl: name: cargo check on linux-x86_64-musl @@ -215,3 +220,8 @@ jobs: with: toolchain: 1.63 target: linux-x86_64-musl + - name: Install cargo xtask + run: | + cargo install cargo-xtask + - name: cargo xtask build-wasmer + script: cargo xtaskci diff --git a/Cargo.lock b/Cargo.lock index 65436293f0c..c0f81c1263a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4971,6 +4971,10 @@ version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d2d7d3948613f75c98fd9328cfdcc45acc4d360655289d0a7d4ec931392200a3" +[[package]] +name = "xtask" +version = "0.1.0" + [[package]] name = "yaml-rust" version = "0.4.5" diff --git a/Cargo.toml b/Cargo.toml index cf1b064397b..b42a0c94a83 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -26,6 +26,7 @@ cfg-if = "1.0" [workspace] members = [ + "xtask", "lib/api", "lib/cache", "lib/c-api", diff --git a/xtask/Cargo.toml b/xtask/Cargo.toml new file mode 100644 index 00000000000..d9dff7217ee --- /dev/null +++ b/xtask/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "xtask" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] diff --git a/xtask/src/main.rs b/xtask/src/main.rs new file mode 100644 index 00000000000..6362222dac2 --- /dev/null +++ b/xtask/src/main.rs @@ -0,0 +1,3 @@ +fn main() { + println!("Hello, world! 2"); +} From 3650115a8f4aa54a8bf8385c2fe76007b57db560 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Tue, 22 Nov 2022 15:33:49 +0100 Subject: [PATCH 009/226] Use "run" step instead of script --- .github/workflows/test-sys.yaml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-sys.yaml b/.github/workflows/test-sys.yaml index 2cd379b0e0a..1541281caa8 100644 --- a/.github/workflows/test-sys.yaml +++ b/.github/workflows/test-sys.yaml @@ -200,7 +200,8 @@ jobs: run: | cargo install cargo-xtask - name: cargo xtask build-wasmer - script: cargo xtaskci + run: | + cargo xtaskci check_linux_musl: name: cargo check on linux-x86_64-musl @@ -224,4 +225,5 @@ jobs: run: | cargo install cargo-xtask - name: cargo xtask build-wasmer - script: cargo xtaskci + run: | + cargo xtaskci \ No newline at end of file From 11993296b5c0a7c3e0aa87d24ed71143bfd39a38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Tue, 22 Nov 2022 15:36:58 +0100 Subject: [PATCH 010/226] Fix Rust version --- .github/workflows/test-sys.yaml | 170 +------------------------------- 1 file changed, 2 insertions(+), 168 deletions(-) diff --git a/.github/workflows/test-sys.yaml b/.github/workflows/test-sys.yaml index 1541281caa8..f02290f2faa 100644 --- a/.github/workflows/test-sys.yaml +++ b/.github/workflows/test-sys.yaml @@ -29,173 +29,7 @@ jobs: uses: dtolnay/rust-toolchain@stable with: toolchain: 1.63 -<<<<<<< HEAD - target: ${{ matrix.target }} - - uses: Swatinem/rust-cache@v1 - if: matrix.use_sccache != true - - name: Install LLVM (Choco - Windows) - if: matrix.llvm_choco_version - shell: bash - run: | - choco install llvm --version ${{ matrix.llvm_choco_version }} --allow-downgrade - cd 'C:\Program Files\LLVM\' - LLVM_DIR=$(pwd) - echo "LLVM_SYS_120_PREFIX=${LLVM_DIR}" >> $GITHUB_ENV - - name: Install LLVM (macOS Apple Silicon) - if: matrix.os == 'macos-11.0' && !matrix.llvm_url - run: | - brew install llvm - - name: Install LLVM - if: matrix.llvm_url - shell: bash - run: | - curl --proto '=https' --tlsv1.2 -sSf ${{ matrix.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_SYS_120_PREFIX=${LLVM_DIR}" >> $GITHUB_ENV - env: - LLVM_DIR: .llvm - - 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.os == 'macos-latest' || matrix.os == 'macos-11.0' - - uses: actions/cache@v2 - with: - path: | - ~/.cargo/registry - ~/.cargo/git - key: ${{ matrix.build }}-${{ matrix.target }}-cargo-${{ hashFiles('Cargo.lock') }}-v1 - - uses: actions/cache@v2 - if: matrix.use_sccache - with: - path: ${{ runner.tool_cache }}/cargo-sccache - key: ${{ matrix.build }}-${{ matrix.target }}-sccache-bin-${{ env.CARGO_SCCACHE_VERSION }}-v1 - - name: Install sccache - if: matrix.use_sccache - run: | - if [ ! -f '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' ]; then - cargo install sccache --no-default-features --features=dist-client,azure --root '${{ runner.tool_cache }}/cargo-sccache' - fi - shell: bash - - name: Setup Rust target - run: | - mkdir -p .cargo - cat << EOF > .cargo/config.toml - [build] - target = "${{ matrix.target }}" - EOF - if: matrix.target - - name: Set sccache port - if: matrix.use_sccache && matrix.random_sccache_port - run: | - netstat -aln | awk ' - $6 == "LISTEN" { - if ($4 ~ "[.:][0-9]+$") { - n = split($4, a, /[:.]/); - port = a[n]; - p[port] = 1 - } - } - END { - for (i = 3000; i < 65000 && p[i]; i++){}; - if (i == 65000) {exit 1}; - print "SCCACHE_SERVER_PORT=" i - } - ' >> $GITHUB_ENV - # echo "SCCACHE_SERVER_PORT=9000" - echo "Setting random sccache port to: $SCCACHE_SERVER_PORT" - shell: bash - - name: Start sccache - if: matrix.use_sccache - run: | - chmod +x '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' - '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' --start-server - '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' -s - echo 'RUSTC_WRAPPER=${{ runner.tool_cache }}/cargo-sccache/bin/sccache' >> $GITHUB_ENV - shell: bash - - name: Test integration CLI - if: matrix.run_test && matrix.os != 'windows-2019' - shell: bash - run: | - make build-wasmer && make build-capi && make package-capi && make package && export WASMER_DIR=`pwd`/package && make test-integration-cli - env: - TARGET: ${{ matrix.target }} - TARGET_DIR: target/${{ matrix.target }}/release - CARGO_TARGET: --target ${{ matrix.target }} - WAPM_DEV_TOKEN: ${{ secrets.WAPM_DEV_TOKEN }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Test integration CLI - if: matrix.run_test && matrix.os == 'windows-2019' - shell: bash - run: | - make build-wasmer && - cargo test --package wasmer-integration-tests-cli --test run -- test_wasmer_run_complex_url --exact --nocapture - env: - TARGET: ${{ matrix.target }} - TARGET_DIR: target/${{ matrix.target }}/release - CARGO_TARGET: --target x86_64-pc-windows-msvc - WAPM_DEV_TOKEN: ${{ secrets.WAPM_DEV_TOKEN }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # cargo test --package wasmer-integration-tests-cli --test run -- test_wasmer_run_complex_url --exact --nocapture - #- name: Test integration CLI - # if: matrix.run_test && matrix.os == 'windows-2019' - # shell: bash - # run: | - # make && make build-wasmer && make build-capi && make package-capi && make package - # export WASMER_DIR=`pwd`/package - # make test-integration-cli - # env: - # TARGET: x86_64-pc-windows-msvc - # TARGET_DIR: target/x86_64-pc-windows-msvc/release - # CARGO_TARGET: --target x86_64-pc-windows-msvc - - name: Test - if: matrix.run_test && matrix.os != 'windows-2019' - run: | - make - env: - TARGET: ${{ matrix.target }} - TARGET_DIR: target/${{ matrix.target }}/release - CARGO_TARGET: --target ${{ matrix.target }} - - name: Test - if: matrix.run_test && matrix.os != 'windows-2019' - run: | - make build-capi && make package-capi && export WASMER_DIR=`pwd`/package && make test - env: - TARGET: ${{ matrix.target }} - TARGET_DIR: target/${{ matrix.target }}/release - CARGO_TARGET: --target ${{ matrix.target }} - - name: Test C API - if: matrix.run_test_capi && matrix.os != 'windows-2019' - run: | - make test-capi - env: - TARGET: ${{ matrix.target }} - TARGET_DIR: target/${{ matrix.target }}/release - CARGO_TARGET: --target ${{ matrix.target }} - - name: Test - if: matrix.run_test && matrix.os == 'windows-2019' - shell: bash - run: | - make build-capi && make package-capi && export WASMER_DIR=`pwd`/package && make test - - name: Test C API - if: matrix.run_test_capi && matrix.os == 'windows-2019' - shell: bash - run: | - export WASMER_DIR=`pwd`/package && make test-capi - - name: Build Doc - if: matrix.run_build_docs - run: | - make package-docs - - audit: - name: Audit -======= - target: linux-x86_64-gnu + target: x86_64-unknown-linux-gnu - name: Install cargo xtask run: | cargo install cargo-xtask @@ -220,7 +54,7 @@ jobs: uses: dtolnay/rust-toolchain@stable with: toolchain: 1.63 - target: linux-x86_64-musl + target: x86_64-unknown-linux-musl - name: Install cargo xtask run: | cargo install cargo-xtask From 6b9c53e4e9171465b7b2791e5dee2ae1065b283d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Tue, 22 Nov 2022 15:39:17 +0100 Subject: [PATCH 011/226] Fix musl rust target --- .github/workflows/test-sys.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-sys.yaml b/.github/workflows/test-sys.yaml index f02290f2faa..40764826979 100644 --- a/.github/workflows/test-sys.yaml +++ b/.github/workflows/test-sys.yaml @@ -54,7 +54,7 @@ jobs: uses: dtolnay/rust-toolchain@stable with: toolchain: 1.63 - target: x86_64-unknown-linux-musl + target: x86_64-linux-musl - name: Install cargo xtask run: | cargo install cargo-xtask From 5c8494fee105f31ce3004dc9b22a0fc157441e0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Tue, 22 Nov 2022 15:42:54 +0100 Subject: [PATCH 012/226] Fix musl target again --- .github/workflows/test-sys.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-sys.yaml b/.github/workflows/test-sys.yaml index 40764826979..f02290f2faa 100644 --- a/.github/workflows/test-sys.yaml +++ b/.github/workflows/test-sys.yaml @@ -54,7 +54,7 @@ jobs: uses: dtolnay/rust-toolchain@stable with: toolchain: 1.63 - target: x86_64-linux-musl + target: x86_64-unknown-linux-musl - name: Install cargo xtask run: | cargo install cargo-xtask From ca47ae8a9890cf1d3ecf015c3540195562e65705 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Tue, 22 Nov 2022 15:44:04 +0100 Subject: [PATCH 013/226] Setup base deps on musl --- .github/workflows/test-sys.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/test-sys.yaml b/.github/workflows/test-sys.yaml index f02290f2faa..26767375a31 100644 --- a/.github/workflows/test-sys.yaml +++ b/.github/workflows/test-sys.yaml @@ -47,7 +47,6 @@ jobs: steps: - uses: actions/checkout@v3 - name: Set up base deps on musl - if: matrix.build == 'linux-musl-x64' run: | apk add build-base bash musl-dev curl make libtool libffi-dev gcc automake autoconf git openssl-dev g++ - name: Install Rust From 49204c9ac2a4ececb692d9f01666c867bf5e3e91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Tue, 22 Nov 2022 15:48:33 +0100 Subject: [PATCH 014/226] Remove requirement to change CHANGELOG from pull request template --- .github/pull_request_template.md | 4 ---- .github/workflows/test-sys.yaml | 19 +++++++++++++++++++ 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 60e912fdb4f..96866a36764 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -9,7 +9,3 @@ https://github.com/wasmerio/wasmer/blob/master/CONTRIBUTING.md#pull-requests Provide details regarding the change including motivation, links to related issues, and the context of the PR. --> - -# Review - -- [ ] Add a short description of the change to the CHANGELOG.md file diff --git a/.github/workflows/test-sys.yaml b/.github/workflows/test-sys.yaml index 26767375a31..0e2b6f94004 100644 --- a/.github/workflows/test-sys.yaml +++ b/.github/workflows/test-sys.yaml @@ -49,6 +49,25 @@ jobs: - name: Set up base deps on musl run: | apk add build-base bash musl-dev curl make libtool libffi-dev gcc automake autoconf git openssl-dev g++ + - name: Install Rust + uses: dtolnay/rust-toolchain@stable + with: + toolchain: 1.63 + target: x86_64-unknown-linux-musl + - name: Install cargo xtask + run: | + cargo install cargo-xtask + - name: cargo xtask build-wasmer + run: | + cargo xtaskci + + check_windows: + name: cargo check on windows-x64 + runs-on: windows-2019 + env: + TARGET: windows-x86_64-msvc + steps: + - uses: actions/checkout@v3 - name: Install Rust uses: dtolnay/rust-toolchain@stable with: From 6dccd12f53934d5a5c920862233ce194d888d370 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Wed, 7 Dec 2022 14:55:31 +0100 Subject: [PATCH 015/226] CI: check that the flow graph is working --- .github/workflows/cargo-deny.yaml | 15 - .github/workflows/lint.yaml | 43 --- .github/workflows/test-js.yaml | 51 --- .github/workflows/test.yaml | 523 ++++++++++++++++++++++++++++++ 4 files changed, 523 insertions(+), 109 deletions(-) delete mode 100644 .github/workflows/cargo-deny.yaml delete mode 100644 .github/workflows/lint.yaml delete mode 100644 .github/workflows/test-js.yaml create mode 100644 .github/workflows/test.yaml diff --git a/.github/workflows/cargo-deny.yaml b/.github/workflows/cargo-deny.yaml deleted file mode 100644 index 6da23e07331..00000000000 --- a/.github/workflows/cargo-deny.yaml +++ /dev/null @@ -1,15 +0,0 @@ -on: - push: - branches: - - '**' - - '!master' - -name: cargo-deny - -jobs: - deny-check: - name: cargo-deny - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: EmbarkStudios/cargo-deny-action@v1 diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml deleted file mode 100644 index 65ef0043af1..00000000000 --- a/.github/workflows/lint.yaml +++ /dev/null @@ -1,43 +0,0 @@ -on: - push: - branches: - - '**' - - '!master' - -name: lint - -env: - RUST_BACKTRACE: 1 - -jobs: - lint: - name: Code lint - runs-on: ubuntu-18.04 - steps: - - uses: actions/checkout@v3 - - name: Set up libstdc++ on Linux - run: | - sudo apt-get update -y - sudo apt-get install -y --allow-downgrades libstdc++6=8.4.0-1ubuntu1~18.04 - sudo apt-get install --reinstall g++-8 - - name: Install Rust - uses: dtolnay/rust-toolchain@stable - with: - toolchain: 1.63 - components: rustfmt, clippy - - name: Install LLVM (Linux) - run: | - curl --proto '=https' --tlsv1.2 -sSf https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz -L -o /opt/llvm.tar.xz - mkdir -p /opt/llvm-12 - tar xf /opt/llvm.tar.xz --strip-components=1 -C /opt/llvm-12 - echo '/opt/llvm-12/bin' >> $GITHUB_PATH - echo 'LLVM_SYS_120_PREFIX=/opt/llvm-12' >> $GITHUB_ENV - - 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) ]] diff --git a/.github/workflows/test-js.yaml b/.github/workflows/test-js.yaml deleted file mode 100644 index 75ba39ca114..00000000000 --- a/.github/workflows/test-js.yaml +++ /dev/null @@ -1,51 +0,0 @@ -name: Runtime tests - JS - -env: - RUST_BACKTRACE: 1 - -on: - workflow_dispatch: - push: - branches: - - 'master' - - 'staging' - - 'trying' - paths: - - 'lib/api/**' - - 'lib/wasi/**' - 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: - paths: - - 'lib/api/**' - - 'lib/wasi/**' - -jobs: - test: - name: Test on NodeJS - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v3 - - - name: Install Rust - uses: dtolnay/rust-toolchain@stable - with: - toolchain: 1.63 - - - 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: Compile Wasmer to WebAssembly and test with a JavaScript host - run: make test-js - - - name: Compile Wasmer to WebAssembly and test with a JavaScript host (no-std) - run: make test-js-core \ No newline at end of file diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml new file mode 100644 index 00000000000..21e015d3a47 --- /dev/null +++ b/.github/workflows/test.yaml @@ -0,0 +1,523 @@ +name: test-sys + +on: + push: + branches: + - '**' + - '!master' + pull_request: + types: [ synchronize ] + +env: + RUST_BACKTRACE: 1 + +jobs: + + lint: + name: Code lint + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Install Rust + uses: dtolnay/rust-toolchain@stable + with: + toolchain: 1.63 + components: rustfmt, clippy + - name: Install LLVM (Linux) + run: | + curl --proto '=https' --tlsv1.2 -sSf https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz -L -o /opt/llvm.tar.xz + mkdir -p /opt/llvm-12 + tar xf /opt/llvm.tar.xz --strip-components=1 -C /opt/llvm-12 + echo '/opt/llvm-12/bin' >> $GITHUB_PATH + echo 'LLVM_SYS_120_PREFIX=/opt/llvm-12' >> $GITHUB_ENV + - 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-latest + steps: + - uses: actions/checkout@v2 + - uses: EmbarkStudios/cargo-deny-action@v1 + + test_nodejs: + name: Test on NodeJS + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Install Rust + uses: dtolnay/rust-toolchain@stable + with: + toolchain: 1.63 + - 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: Install cargo xtask + run: | + cargo install cargo-xtask + - name: cargo xtask test-js + run: | + cargo xtaskci test-js-core + - name: cargo xtask build-wasmer + run: | + cargo xtaskci test-js-core + + # build-wasmer: run build-wasmer and build-capi for every OS in parallel + build_wasmer_linux_x64: + name: cargo check on linux-x86_64-gnu + runs-on: ubuntu-18.04 + env: + TARGET: linux-x86_64-gnu + steps: + - uses: actions/checkout@v3 + - name: Set up libstdc++ on Linux + run: | + sudo apt-get update -y + sudo apt-get install -y --allow-downgrades libstdc++6=8.4.0-1ubuntu1~18.04 + sudo apt-get install --reinstall g++-8 + - name: Install Rust + uses: dtolnay/rust-toolchain@stable + with: + toolchain: 1.63 + target: x86_64-unknown-linux-gnu + - name: Install cargo xtask + run: | + cargo install cargo-xtask + - name: cargo xtask build-wasmer + run: | + cargo xtaskci build-wasmer + + build_wasmer_linux_musl: + name: cargo check on linux-x86_64-musl + runs-on: ubuntu-latest + container: alpine:latest + env: + TARGET: linux-x86_64-musl + steps: + - uses: actions/checkout@v3 + - name: Set up base deps on musl + run: | + apk add build-base bash musl-dev curl make libtool libffi-dev gcc automake autoconf git openssl-dev g++ + - name: Install Rust + uses: dtolnay/rust-toolchain@stable + with: + toolchain: 1.63 + target: x86_64-unknown-linux-musl + - name: Install cargo xtask + run: | + cargo install cargo-xtask + - name: cargo xtask build-wasmer + run: | + cargo xtaskci build-wasmer + + build_wasmer_macos_x86: + name: build wasmer on macos-x86 + runs-on: macos-11 + env: + TARGET: x86_64-apple-darwin + steps: + - uses: actions/checkout@v3 + - name: Install Rust + uses: dtolnay/rust-toolchain@stable + with: + toolchain: 1.63 + target: x86_64-unknown-linux-musl + - name: Install cargo xtask + run: | + cargo install cargo-xtask + - name: cargo xtask build-wasmer + run: | + cargo xtaskci build-wasmer + + build_wasmer_windows_x86: + name: cargo check on windows-x64 + runs-on: windows-2019 + env: + TARGET: windows-x86_64-msvc + steps: + - uses: actions/checkout@v3 + - name: Install Rust + uses: dtolnay/rust-toolchain@stable + with: + toolchain: 1.63 + target: x86_64-unknown-linux-musl + - name: Install cargo xtask + run: | + cargo install cargo-xtask + - name: cargo xtask build-wasmer + run: | + cargo xtaskci build-wasmer + + + # build-capi: run build-capi for every OS, does NOT depend on build-wasmer + # (can run in parallel with build-wasmer step) + + build_capi_linux_x64: + name: build capi on linux-x86_64-gnu + runs-on: ubuntu-18.04 + env: + TARGET: linux-x86_64-gnu + steps: + - uses: actions/checkout@v3 + - name: Set up libstdc++ on Linux + run: | + sudo apt-get update -y + sudo apt-get install -y --allow-downgrades libstdc++6=8.4.0-1ubuntu1~18.04 + sudo apt-get install --reinstall g++-8 + - name: Install Rust + uses: dtolnay/rust-toolchain@stable + with: + toolchain: 1.63 + target: x86_64-unknown-linux-gnu + - name: Install cargo xtask + run: | + cargo install cargo-xtask + - name: cargo xtask build-capi + run: | + cargo xtaskci build-capi + + build_capi_linux_musl: + name: build capi on linux-x86_64-musl + runs-on: ubuntu-latest + container: alpine:latest + env: + TARGET: linux-x86_64-musl + steps: + - uses: actions/checkout@v3 + - name: Set up base deps on musl + run: | + apk add build-base bash musl-dev curl make libtool libffi-dev gcc automake autoconf git openssl-dev g++ + - name: Install Rust + uses: dtolnay/rust-toolchain@stable + with: + toolchain: 1.63 + target: x86_64-unknown-linux-musl + - name: Install cargo xtask + run: | + cargo install cargo-xtask + - name: cargo xtask build-capi + run: | + cargo xtaskci build-capi + + build_capi_macos_x86: + name: build capi on macos-x86 + runs-on: macos-11 + env: + TARGET: x86_64-apple-darwin + steps: + - uses: actions/checkout@v3 + - name: Install Rust + uses: dtolnay/rust-toolchain@stable + with: + toolchain: 1.63 + target: x86_64-unknown-linux-musl + - name: Install cargo xtask + run: | + cargo install cargo-xtask + - name: cargo xtask build-capi + run: | + cargo xtaskci build-capi + + build_capi_windows_x86: + name: build capi on windows-x64 + runs-on: windows-2019 + env: + TARGET: windows-x86_64-msvc + steps: + - uses: actions/checkout@v3 + - name: Install Rust + uses: dtolnay/rust-toolchain@stable + with: + toolchain: 1.63 + target: x86_64-unknown-linux-musl + - name: Install cargo xtask + run: | + cargo install cargo-xtask + - name: cargo xtask build-capi + run: | + cargo xtaskci build-capi + + # test-wasmer: run unit tests for wasmer, depends on build-wasmer step + # (can run in parallel with build-capi step) + test_wasmer_linux_x64: + name: test wasmer on linux-x86_64-gnu + runs-on: ubuntu-18.04 + needs: [build_wasmer_linux_x64] + env: + TARGET: linux-x86_64-gnu + steps: + - uses: actions/checkout@v3 + - name: Set up libstdc++ on Linux + run: | + sudo apt-get update -y + sudo apt-get install -y --allow-downgrades libstdc++6=8.4.0-1ubuntu1~18.04 + sudo apt-get install --reinstall g++-8 + - name: Install Rust + uses: dtolnay/rust-toolchain@stable + with: + toolchain: 1.63 + target: x86_64-unknown-linux-gnu + - name: Install cargo xtask + run: | + cargo install cargo-xtask + - name: cargo xtask test-wasmer + run: | + cargo xtaskci test-wasmer + + test_wasmer_linux_musl: + name: test wasmer on linux-x86_64-musl + runs-on: ubuntu-latest + needs: [build_wasmer_linux_musl] + container: alpine:latest + env: + TARGET: linux-x86_64-musl + steps: + - uses: actions/checkout@v3 + - name: Set up base deps on musl + run: | + apk add build-base bash musl-dev curl make libtool libffi-dev gcc automake autoconf git openssl-dev g++ + - name: Install Rust + uses: dtolnay/rust-toolchain@stable + with: + toolchain: 1.63 + target: x86_64-unknown-linux-musl + - name: Install cargo xtask + run: | + cargo install cargo-xtask + - name: cargo xtask test-wasmer + run: | + cargo xtaskci test-wasmer + + test_wasmer_macos_x86: + name: test wasmer on macos-x86 + runs-on: macos-11 + needs: [build_wasmer_macos_x86] + env: + TARGET: x86_64-apple-darwin + steps: + - uses: actions/checkout@v3 + - name: Install Rust + uses: dtolnay/rust-toolchain@stable + with: + toolchain: 1.63 + target: x86_64-unknown-linux-musl + - name: Install cargo xtask + run: | + cargo install cargo-xtask + - name: cargo xtask test-wasmer + run: | + cargo xtaskci test-wasmer + + test_wasmer_windows_x86: + name: test wasmer on windows-x64 + runs-on: windows-2019 + needs: [build_wasmer_windows_x86] + env: + TARGET: windows-x86_64-msvc + steps: + - uses: actions/checkout@v3 + - name: Install Rust + uses: dtolnay/rust-toolchain@stable + with: + toolchain: 1.63 + target: x86_64-unknown-linux-musl + - name: Install cargo xtask + run: | + cargo install cargo-xtask + - name: cargo xtask test-wasmer + run: | + cargo xtaskci test-wasmer + + + # test-capi: run unit test for capi, depends on build-capi step + # (can run in parallel with build-wasmer step) + test_capi_linux_x64: + name: test capi on linux-x86_64-gnu + runs-on: ubuntu-18.04 + needs: [build_capi_linux_x64] + env: + TARGET: linux-x86_64-gnu + steps: + - uses: actions/checkout@v3 + - name: Set up libstdc++ on Linux + run: | + sudo apt-get update -y + sudo apt-get install -y --allow-downgrades libstdc++6=8.4.0-1ubuntu1~18.04 + sudo apt-get install --reinstall g++-8 + - name: Install Rust + uses: dtolnay/rust-toolchain@stable + with: + toolchain: 1.63 + target: x86_64-unknown-linux-gnu + - name: Install cargo xtask + run: | + cargo install cargo-xtask + - name: cargo xtask test-capi + run: | + cargo xtaskci test-capi + + test_capi_linux_musl: + name: test capi on linux-x86_64-musl + runs-on: ubuntu-latest + needs: [build_capi_linux_musl] + container: alpine:latest + env: + TARGET: linux-x86_64-musl + steps: + - uses: actions/checkout@v3 + - name: Set up base deps on musl + run: | + apk add build-base bash musl-dev curl make libtool libffi-dev gcc automake autoconf git openssl-dev g++ + - name: Install Rust + uses: dtolnay/rust-toolchain@stable + with: + toolchain: 1.63 + target: x86_64-unknown-linux-musl + - name: Install cargo xtask + run: | + cargo install cargo-xtask + - name: cargo xtask test-capi + run: | + cargo xtaskci test-capi + + test_capi_macos_x86: + name: test capi on macos-x86 + runs-on: macos-11 + needs: [build_capi_macos_x86] + env: + TARGET: x86_64-apple-darwin + steps: + - uses: actions/checkout@v3 + - name: Install Rust + uses: dtolnay/rust-toolchain@stable + with: + toolchain: 1.63 + target: x86_64-unknown-linux-musl + - name: Install cargo xtask + run: | + cargo install cargo-xtask + - name: cargo xtask test-capi + run: | + cargo xtaskci test-capi + + test_capi_windows_x86: + name: test capi on windows-x64 + runs-on: windows-2019 + needs: [build_capi_windows_x86] + env: + TARGET: windows-x86_64-msvc + steps: + - uses: actions/checkout@v3 + - name: Install Rust + uses: dtolnay/rust-toolchain@stable + with: + toolchain: 1.63 + target: x86_64-unknown-linux-musl + - name: Install cargo xtask + run: | + cargo install cargo-xtask + - name: cargo xtask test-capi + run: | + cargo xtaskci test-capi + + + # test-integration-cli: run integration tests for wasmer, depends on build-capi and build-wasmer steps + test_integration_linux_x64: + name: integration tests on linux-x86_64-gnu + runs-on: ubuntu-18.04 + needs: [build_wasmer_linux_x64, build_capi_linux_x64] + env: + TARGET: linux-x86_64-gnu + steps: + - uses: actions/checkout@v3 + - name: Set up libstdc++ on Linux + run: | + sudo apt-get update -y + sudo apt-get install -y --allow-downgrades libstdc++6=8.4.0-1ubuntu1~18.04 + sudo apt-get install --reinstall g++-8 + - name: Install Rust + uses: dtolnay/rust-toolchain@stable + with: + toolchain: 1.63 + target: x86_64-unknown-linux-gnu + - name: Install cargo xtask + run: | + cargo install cargo-xtask + - name: cargo xtask test-integration + run: | + cargo xtaskci test-integration + + test_integration_linux_musl: + name: integration tests on linux-x86_64-musl + runs-on: ubuntu-latest + needs: [build_wasmer_linux_x64, build_capi_linux_musl] + container: alpine:latest + env: + TARGET: linux-x86_64-musl + steps: + - uses: actions/checkout@v3 + - name: Set up base deps on musl + run: | + apk add build-base bash musl-dev curl make libtool libffi-dev gcc automake autoconf git openssl-dev g++ + - name: Install Rust + uses: dtolnay/rust-toolchain@stable + with: + toolchain: 1.63 + target: x86_64-unknown-linux-musl + - name: Install cargo xtask + run: | + cargo install cargo-xtask + - name: cargo xtask test-integration + run: | + cargo xtaskci test-integration + + test_integration_macos_x86: + name: integration tests on macos-x86 + runs-on: macos-11 + needs: [build_wasmer_linux_x64, build_capi_macos_x86] + env: + TARGET: x86_64-apple-darwin + steps: + - uses: actions/checkout@v3 + - name: Install Rust + uses: dtolnay/rust-toolchain@stable + with: + toolchain: 1.63 + target: x86_64-unknown-linux-musl + - name: Install cargo xtask + run: | + cargo install cargo-xtask + - name: cargo xtask test-integration + run: | + cargo xtaskci test-integration + + test_integration_windows_x86: + name: integration tests on windows-x64 + runs-on: windows-2019 + needs: [build_wasmer_linux_x64, build_capi_windows_x86] + env: + TARGET: windows-x86_64-msvc + steps: + - uses: actions/checkout@v3 + - name: Install Rust + uses: dtolnay/rust-toolchain@stable + with: + toolchain: 1.63 + target: x86_64-unknown-linux-musl + - name: Install cargo xtask + run: | + cargo install cargo-xtask + - name: cargo xtask test-integration + run: | + cargo xtaskci test-integration From a4390de0b42f201d74c862d587aeeb5a0e46b342 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Wed, 23 Nov 2022 12:26:32 +0100 Subject: [PATCH 016/226] Try using M1 runners --- .github/workflows/test.yaml | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 21e015d3a47..3b5738330c0 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -44,7 +44,7 @@ jobs: name: cargo-deny runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - uses: EmbarkStudios/cargo-deny-action@v1 test_nodejs: @@ -123,7 +123,7 @@ jobs: build_wasmer_macos_x86: name: build wasmer on macos-x86 - runs-on: macos-11 + runs-on: osx-arm64 env: TARGET: x86_64-apple-darwin steps: @@ -212,7 +212,7 @@ jobs: build_capi_macos_x86: name: build capi on macos-x86 - runs-on: macos-11 + runs-on: osx-arm64 env: TARGET: x86_64-apple-darwin steps: @@ -301,7 +301,7 @@ jobs: test_wasmer_macos_x86: name: test wasmer on macos-x86 - runs-on: macos-11 + runs-on: osx-arm64 needs: [build_wasmer_macos_x86] env: TARGET: x86_64-apple-darwin @@ -393,7 +393,7 @@ jobs: test_capi_macos_x86: name: test capi on macos-x86 - runs-on: macos-11 + runs-on: osx-arm64 needs: [build_capi_macos_x86] env: TARGET: x86_64-apple-darwin @@ -431,7 +431,6 @@ jobs: run: | cargo xtaskci test-capi - # test-integration-cli: run integration tests for wasmer, depends on build-capi and build-wasmer steps test_integration_linux_x64: name: integration tests on linux-x86_64-gnu @@ -484,7 +483,7 @@ jobs: test_integration_macos_x86: name: integration tests on macos-x86 - runs-on: macos-11 + runs-on: osx-arm64 needs: [build_wasmer_linux_x64, build_capi_macos_x86] env: TARGET: x86_64-apple-darwin From b1181cc4c4336361c3174433dfbf603e458a2b83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Wed, 23 Nov 2022 13:06:16 +0100 Subject: [PATCH 017/226] Remove unnecessary TARGET configs, added separate xtask crates --- .cargo/config | 7 +- .github/workflows/test.yaml | 150 ++++++++++------------- Cargo.lock | 18 ++- Cargo.toml | 6 +- xtask/src/main.rs | 3 - xtask/xtask-build-capi/Cargo.toml | 8 ++ xtask/xtask-build-capi/src/main.rs | 4 + xtask/xtask-build-wasmer/Cargo.toml | 8 ++ xtask/xtask-build-wasmer/src/main.rs | 4 + xtask/{ => xtask-test-capi}/Cargo.toml | 2 +- xtask/xtask-test-capi/src/main.rs | 4 + xtask/xtask-test-integration/Cargo.toml | 8 ++ xtask/xtask-test-integration/src/main.rs | 3 + xtask/xtask-test-wasmer/Cargo.toml | 8 ++ xtask/xtask-test-wasmer/src/main.rs | 4 + 15 files changed, 144 insertions(+), 93 deletions(-) delete mode 100644 xtask/src/main.rs create mode 100644 xtask/xtask-build-capi/Cargo.toml create mode 100644 xtask/xtask-build-capi/src/main.rs create mode 100644 xtask/xtask-build-wasmer/Cargo.toml create mode 100644 xtask/xtask-build-wasmer/src/main.rs rename xtask/{ => xtask-test-capi}/Cargo.toml (86%) create mode 100644 xtask/xtask-test-capi/src/main.rs create mode 100644 xtask/xtask-test-integration/Cargo.toml create mode 100644 xtask/xtask-test-integration/src/main.rs create mode 100644 xtask/xtask-test-wasmer/Cargo.toml create mode 100644 xtask/xtask-test-wasmer/src/main.rs diff --git a/.cargo/config b/.cargo/config index 94837d8ae3e..1412e1e8b2c 100644 --- a/.cargo/config +++ b/.cargo/config @@ -1,2 +1,7 @@ [alias] -xtaskci = "run --package xtask --" \ No newline at end of file +build-wasmer = "run --package xtask-build-wasmer --" +build-capi = "run --package xtask-build-capi --" +test-wasmer = "run --package xtask-test-wasmer --" +test-capi = "run --package xtask-test-capi --" +test-integration = "run --package xtask-test-integration --" +integration-tests = "run --package xtask-test-integration --" diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 3b5738330c0..e0f6a0bf875 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -68,17 +68,15 @@ jobs: cargo install cargo-xtask - name: cargo xtask test-js run: | - cargo xtaskci test-js-core + cargo test-js-core - name: cargo xtask build-wasmer run: | - cargo xtaskci test-js-core + cargo test-js-core # build-wasmer: run build-wasmer and build-capi for every OS in parallel build_wasmer_linux_x64: name: cargo check on linux-x86_64-gnu runs-on: ubuntu-18.04 - env: - TARGET: linux-x86_64-gnu steps: - uses: actions/checkout@v3 - name: Set up libstdc++ on Linux @@ -90,20 +88,19 @@ jobs: uses: dtolnay/rust-toolchain@stable with: toolchain: 1.63 - target: x86_64-unknown-linux-gnu - name: Install cargo xtask run: | cargo install cargo-xtask - name: cargo xtask build-wasmer run: | - cargo xtaskci build-wasmer + cargo build-wasmer + env: + COMPILERS: cranelift,llvm,singlepass build_wasmer_linux_musl: name: cargo check on linux-x86_64-musl runs-on: ubuntu-latest container: alpine:latest - env: - TARGET: linux-x86_64-musl steps: - uses: actions/checkout@v3 - name: Set up base deps on musl @@ -113,52 +110,50 @@ jobs: uses: dtolnay/rust-toolchain@stable with: toolchain: 1.63 - target: x86_64-unknown-linux-musl - name: Install cargo xtask run: | cargo install cargo-xtask - name: cargo xtask build-wasmer run: | - cargo xtaskci build-wasmer - + cargo build-wasmer + env: + COMPILERS: cranelift,llvm,singlepass + build_wasmer_macos_x86: name: build wasmer on macos-x86 - runs-on: osx-arm64 - env: - TARGET: x86_64-apple-darwin + runs-on: macos-11 steps: - uses: actions/checkout@v3 - name: Install Rust uses: dtolnay/rust-toolchain@stable with: toolchain: 1.63 - target: x86_64-unknown-linux-musl - name: Install cargo xtask run: | cargo install cargo-xtask - name: cargo xtask build-wasmer run: | - cargo xtaskci build-wasmer + cargo build-wasmer + env: + COMPILERS: cranelift,llvm,singlepass build_wasmer_windows_x86: name: cargo check on windows-x64 runs-on: windows-2019 - env: - TARGET: windows-x86_64-msvc steps: - uses: actions/checkout@v3 - name: Install Rust uses: dtolnay/rust-toolchain@stable with: toolchain: 1.63 - target: x86_64-unknown-linux-musl - name: Install cargo xtask run: | cargo install cargo-xtask - name: cargo xtask build-wasmer run: | - cargo xtaskci build-wasmer - + cargo build-wasmer + env: + COMPILERS: cranelift,llvm,singlepass # build-capi: run build-capi for every OS, does NOT depend on build-wasmer # (can run in parallel with build-wasmer step) @@ -166,8 +161,6 @@ jobs: build_capi_linux_x64: name: build capi on linux-x86_64-gnu runs-on: ubuntu-18.04 - env: - TARGET: linux-x86_64-gnu steps: - uses: actions/checkout@v3 - name: Set up libstdc++ on Linux @@ -179,20 +172,19 @@ jobs: uses: dtolnay/rust-toolchain@stable with: toolchain: 1.63 - target: x86_64-unknown-linux-gnu - name: Install cargo xtask run: | cargo install cargo-xtask - name: cargo xtask build-capi run: | - cargo xtaskci build-capi + cargo build-capi + env: + COMPILERS: cranelift,llvm,singlepass build_capi_linux_musl: name: build capi on linux-x86_64-musl runs-on: ubuntu-latest container: alpine:latest - env: - TARGET: linux-x86_64-musl steps: - uses: actions/checkout@v3 - name: Set up base deps on musl @@ -202,51 +194,50 @@ jobs: uses: dtolnay/rust-toolchain@stable with: toolchain: 1.63 - target: x86_64-unknown-linux-musl - name: Install cargo xtask run: | cargo install cargo-xtask - name: cargo xtask build-capi run: | - cargo xtaskci build-capi - + cargo build-capi + env: + COMPILERS: cranelift,llvm,singlepass + build_capi_macos_x86: - name: build capi on macos-x86 - runs-on: osx-arm64 - env: - TARGET: x86_64-apple-darwin + name: build capi on macos-aarch64 + runs-on: macos-11 steps: - uses: actions/checkout@v3 - name: Install Rust uses: dtolnay/rust-toolchain@stable with: toolchain: 1.63 - target: x86_64-unknown-linux-musl - name: Install cargo xtask run: | cargo install cargo-xtask - name: cargo xtask build-capi run: | - cargo xtaskci build-capi + cargo build-capi + env: + COMPILERS: cranelift,llvm,singlepass build_capi_windows_x86: name: build capi on windows-x64 runs-on: windows-2019 - env: - TARGET: windows-x86_64-msvc steps: - uses: actions/checkout@v3 - name: Install Rust uses: dtolnay/rust-toolchain@stable with: toolchain: 1.63 - target: x86_64-unknown-linux-musl - name: Install cargo xtask run: | cargo install cargo-xtask - name: cargo xtask build-capi run: | - cargo xtaskci build-capi + cargo build-capi + env: + COMPILERS: cranelift,llvm,singlepass # test-wasmer: run unit tests for wasmer, depends on build-wasmer step # (can run in parallel with build-capi step) @@ -254,8 +245,6 @@ jobs: name: test wasmer on linux-x86_64-gnu runs-on: ubuntu-18.04 needs: [build_wasmer_linux_x64] - env: - TARGET: linux-x86_64-gnu steps: - uses: actions/checkout@v3 - name: Set up libstdc++ on Linux @@ -267,21 +256,20 @@ jobs: uses: dtolnay/rust-toolchain@stable with: toolchain: 1.63 - target: x86_64-unknown-linux-gnu - name: Install cargo xtask run: | cargo install cargo-xtask - name: cargo xtask test-wasmer run: | - cargo xtaskci test-wasmer + cargo test-wasmer + env: + COMPILERS: cranelift,llvm,singlepass test_wasmer_linux_musl: name: test wasmer on linux-x86_64-musl runs-on: ubuntu-latest needs: [build_wasmer_linux_musl] container: alpine:latest - env: - TARGET: linux-x86_64-musl steps: - uses: actions/checkout@v3 - name: Set up base deps on musl @@ -291,54 +279,52 @@ jobs: uses: dtolnay/rust-toolchain@stable with: toolchain: 1.63 - target: x86_64-unknown-linux-musl - name: Install cargo xtask run: | cargo install cargo-xtask - name: cargo xtask test-wasmer run: | - cargo xtaskci test-wasmer - + cargo test-wasmer + env: + COMPILERS: cranelift,llvm,singlepass + test_wasmer_macos_x86: name: test wasmer on macos-x86 - runs-on: osx-arm64 + runs-on: macos-11 needs: [build_wasmer_macos_x86] - env: - TARGET: x86_64-apple-darwin steps: - uses: actions/checkout@v3 - name: Install Rust uses: dtolnay/rust-toolchain@stable with: toolchain: 1.63 - target: x86_64-unknown-linux-musl - name: Install cargo xtask run: | cargo install cargo-xtask - name: cargo xtask test-wasmer run: | - cargo xtaskci test-wasmer + cargo test-wasmer + env: + COMPILERS: cranelift,llvm,singlepass test_wasmer_windows_x86: name: test wasmer on windows-x64 runs-on: windows-2019 needs: [build_wasmer_windows_x86] - env: - TARGET: windows-x86_64-msvc steps: - uses: actions/checkout@v3 - name: Install Rust uses: dtolnay/rust-toolchain@stable with: toolchain: 1.63 - target: x86_64-unknown-linux-musl - name: Install cargo xtask run: | cargo install cargo-xtask - name: cargo xtask test-wasmer run: | - cargo xtaskci test-wasmer - + cargo test-wasmer + env: + COMPILERS: cranelift,llvm,singlepass # test-capi: run unit test for capi, depends on build-capi step # (can run in parallel with build-wasmer step) @@ -346,8 +332,6 @@ jobs: name: test capi on linux-x86_64-gnu runs-on: ubuntu-18.04 needs: [build_capi_linux_x64] - env: - TARGET: linux-x86_64-gnu steps: - uses: actions/checkout@v3 - name: Set up libstdc++ on Linux @@ -359,21 +343,20 @@ jobs: uses: dtolnay/rust-toolchain@stable with: toolchain: 1.63 - target: x86_64-unknown-linux-gnu - name: Install cargo xtask run: | cargo install cargo-xtask - name: cargo xtask test-capi run: | - cargo xtaskci test-capi + cargo test-capi + env: + COMPILERS: cranelift,llvm,singlepass test_capi_linux_musl: name: test capi on linux-x86_64-musl runs-on: ubuntu-latest needs: [build_capi_linux_musl] container: alpine:latest - env: - TARGET: linux-x86_64-musl steps: - uses: actions/checkout@v3 - name: Set up base deps on musl @@ -383,53 +366,52 @@ jobs: uses: dtolnay/rust-toolchain@stable with: toolchain: 1.63 - target: x86_64-unknown-linux-musl - name: Install cargo xtask run: | cargo install cargo-xtask - name: cargo xtask test-capi run: | - cargo xtaskci test-capi - + cargo test-capi + env: + COMPILERS: cranelift,llvm,singlepass + test_capi_macos_x86: name: test capi on macos-x86 - runs-on: osx-arm64 + runs-on: macos-11 needs: [build_capi_macos_x86] - env: - TARGET: x86_64-apple-darwin steps: - uses: actions/checkout@v3 - name: Install Rust uses: dtolnay/rust-toolchain@stable with: toolchain: 1.63 - target: x86_64-unknown-linux-musl - name: Install cargo xtask run: | cargo install cargo-xtask - name: cargo xtask test-capi run: | - cargo xtaskci test-capi + cargo test-capi + env: + COMPILERS: cranelift,llvm,singlepass test_capi_windows_x86: name: test capi on windows-x64 runs-on: windows-2019 needs: [build_capi_windows_x86] - env: - TARGET: windows-x86_64-msvc steps: - uses: actions/checkout@v3 - name: Install Rust uses: dtolnay/rust-toolchain@stable with: toolchain: 1.63 - target: x86_64-unknown-linux-musl - name: Install cargo xtask run: | cargo install cargo-xtask - name: cargo xtask test-capi run: | - cargo xtaskci test-capi + cargo test-capi + env: + COMPILERS: cranelift,llvm,singlepass # test-integration-cli: run integration tests for wasmer, depends on build-capi and build-wasmer steps test_integration_linux_x64: @@ -449,13 +431,12 @@ jobs: uses: dtolnay/rust-toolchain@stable with: toolchain: 1.63 - target: x86_64-unknown-linux-gnu - name: Install cargo xtask run: | cargo install cargo-xtask - name: cargo xtask test-integration run: | - cargo xtaskci test-integration + cargo test-integration test_integration_linux_musl: name: integration tests on linux-x86_64-musl @@ -473,17 +454,16 @@ jobs: uses: dtolnay/rust-toolchain@stable with: toolchain: 1.63 - target: x86_64-unknown-linux-musl - name: Install cargo xtask run: | cargo install cargo-xtask - name: cargo xtask test-integration run: | - cargo xtaskci test-integration + cargo test-integration test_integration_macos_x86: name: integration tests on macos-x86 - runs-on: osx-arm64 + runs-on: macos-11 needs: [build_wasmer_linux_x64, build_capi_macos_x86] env: TARGET: x86_64-apple-darwin @@ -493,13 +473,12 @@ jobs: uses: dtolnay/rust-toolchain@stable with: toolchain: 1.63 - target: x86_64-unknown-linux-musl - name: Install cargo xtask run: | cargo install cargo-xtask - name: cargo xtask test-integration run: | - cargo xtaskci test-integration + cargo test-integration test_integration_windows_x86: name: integration tests on windows-x64 @@ -513,10 +492,9 @@ jobs: uses: dtolnay/rust-toolchain@stable with: toolchain: 1.63 - target: x86_64-unknown-linux-musl - name: Install cargo xtask run: | cargo install cargo-xtask - name: cargo xtask test-integration run: | - cargo xtaskci test-integration + cargo test-integration diff --git a/Cargo.lock b/Cargo.lock index c0f81c1263a..1503b05190f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4972,7 +4972,23 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d2d7d3948613f75c98fd9328cfdcc45acc4d360655289d0a7d4ec931392200a3" [[package]] -name = "xtask" +name = "xtask-build-capi" +version = "0.1.0" + +[[package]] +name = "xtask-build-wasmer" +version = "0.1.0" + +[[package]] +name = "xtask-test-capi" +version = "0.1.0" + +[[package]] +name = "xtask-test-integration" +version = "0.1.0" + +[[package]] +name = "xtask-test-wasmer" version = "0.1.0" [[package]] diff --git a/Cargo.toml b/Cargo.toml index b42a0c94a83..76d4d6ad39f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -26,7 +26,11 @@ cfg-if = "1.0" [workspace] members = [ - "xtask", + "xtask/xtask-build-capi", + "xtask/xtask-build-wasmer", + "xtask/xtask-test-capi", + "xtask/xtask-test-integration", + "xtask/xtask-test-wasmer", "lib/api", "lib/cache", "lib/c-api", diff --git a/xtask/src/main.rs b/xtask/src/main.rs deleted file mode 100644 index 6362222dac2..00000000000 --- a/xtask/src/main.rs +++ /dev/null @@ -1,3 +0,0 @@ -fn main() { - println!("Hello, world! 2"); -} diff --git a/xtask/xtask-build-capi/Cargo.toml b/xtask/xtask-build-capi/Cargo.toml new file mode 100644 index 00000000000..23303fafa3b --- /dev/null +++ b/xtask/xtask-build-capi/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "xtask-build-capi" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] diff --git a/xtask/xtask-build-capi/src/main.rs b/xtask/xtask-build-capi/src/main.rs new file mode 100644 index 00000000000..9949c9c2560 --- /dev/null +++ b/xtask/xtask-build-capi/src/main.rs @@ -0,0 +1,4 @@ +fn main() { + let compilers = std::env::var("COMPILERS").unwrap(); + println!("build capi, compilers = {compilers}"); +} diff --git a/xtask/xtask-build-wasmer/Cargo.toml b/xtask/xtask-build-wasmer/Cargo.toml new file mode 100644 index 00000000000..bb46fb023f0 --- /dev/null +++ b/xtask/xtask-build-wasmer/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "xtask-build-wasmer" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] diff --git a/xtask/xtask-build-wasmer/src/main.rs b/xtask/xtask-build-wasmer/src/main.rs new file mode 100644 index 00000000000..cab59140e29 --- /dev/null +++ b/xtask/xtask-build-wasmer/src/main.rs @@ -0,0 +1,4 @@ +fn main() { + let compilers = std::env::var("COMPILERS").unwrap(); + println!("build wasmer, compilers = {compilers}"); +} diff --git a/xtask/Cargo.toml b/xtask/xtask-test-capi/Cargo.toml similarity index 86% rename from xtask/Cargo.toml rename to xtask/xtask-test-capi/Cargo.toml index d9dff7217ee..f183a12f5c2 100644 --- a/xtask/Cargo.toml +++ b/xtask/xtask-test-capi/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "xtask" +name = "xtask-test-capi" version = "0.1.0" edition = "2021" diff --git a/xtask/xtask-test-capi/src/main.rs b/xtask/xtask-test-capi/src/main.rs new file mode 100644 index 00000000000..d952c4c0744 --- /dev/null +++ b/xtask/xtask-test-capi/src/main.rs @@ -0,0 +1,4 @@ +fn main() { + let compilers = std::env::var("COMPILERS").unwrap(); + println!("test capi, compilers = {compilers}"); +} diff --git a/xtask/xtask-test-integration/Cargo.toml b/xtask/xtask-test-integration/Cargo.toml new file mode 100644 index 00000000000..ccd5d126ee1 --- /dev/null +++ b/xtask/xtask-test-integration/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "xtask-test-integration" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] diff --git a/xtask/xtask-test-integration/src/main.rs b/xtask/xtask-test-integration/src/main.rs new file mode 100644 index 00000000000..c72e23df996 --- /dev/null +++ b/xtask/xtask-test-integration/src/main.rs @@ -0,0 +1,3 @@ +fn main() { + println!("test integration!"); +} diff --git a/xtask/xtask-test-wasmer/Cargo.toml b/xtask/xtask-test-wasmer/Cargo.toml new file mode 100644 index 00000000000..7751d1c7253 --- /dev/null +++ b/xtask/xtask-test-wasmer/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "xtask-test-wasmer" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] diff --git a/xtask/xtask-test-wasmer/src/main.rs b/xtask/xtask-test-wasmer/src/main.rs new file mode 100644 index 00000000000..64a24dfbc2e --- /dev/null +++ b/xtask/xtask-test-wasmer/src/main.rs @@ -0,0 +1,4 @@ +fn main() { + let compilers = std::env::var("COMPILERS").unwrap(); + println!("test wasmer, compilers = {compilers}"); +} From df78a31d69bb756d244484132a70ded94f84b418 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Wed, 23 Nov 2022 13:12:20 +0100 Subject: [PATCH 018/226] Remove usless cargo install cargo-xtask --- .github/workflows/test.yaml | 63 ------------------------------------- 1 file changed, 63 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index e0f6a0bf875..ada09f706ac 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -63,9 +63,6 @@ jobs: - name: Install wasm-pack run: | curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh - - name: Install cargo xtask - run: | - cargo install cargo-xtask - name: cargo xtask test-js run: | cargo test-js-core @@ -88,9 +85,6 @@ jobs: uses: dtolnay/rust-toolchain@stable with: toolchain: 1.63 - - name: Install cargo xtask - run: | - cargo install cargo-xtask - name: cargo xtask build-wasmer run: | cargo build-wasmer @@ -110,9 +104,6 @@ jobs: uses: dtolnay/rust-toolchain@stable with: toolchain: 1.63 - - name: Install cargo xtask - run: | - cargo install cargo-xtask - name: cargo xtask build-wasmer run: | cargo build-wasmer @@ -128,9 +119,6 @@ jobs: uses: dtolnay/rust-toolchain@stable with: toolchain: 1.63 - - name: Install cargo xtask - run: | - cargo install cargo-xtask - name: cargo xtask build-wasmer run: | cargo build-wasmer @@ -146,9 +134,6 @@ jobs: uses: dtolnay/rust-toolchain@stable with: toolchain: 1.63 - - name: Install cargo xtask - run: | - cargo install cargo-xtask - name: cargo xtask build-wasmer run: | cargo build-wasmer @@ -172,9 +157,6 @@ jobs: uses: dtolnay/rust-toolchain@stable with: toolchain: 1.63 - - name: Install cargo xtask - run: | - cargo install cargo-xtask - name: cargo xtask build-capi run: | cargo build-capi @@ -194,9 +176,6 @@ jobs: uses: dtolnay/rust-toolchain@stable with: toolchain: 1.63 - - name: Install cargo xtask - run: | - cargo install cargo-xtask - name: cargo xtask build-capi run: | cargo build-capi @@ -212,9 +191,6 @@ jobs: uses: dtolnay/rust-toolchain@stable with: toolchain: 1.63 - - name: Install cargo xtask - run: | - cargo install cargo-xtask - name: cargo xtask build-capi run: | cargo build-capi @@ -230,9 +206,6 @@ jobs: uses: dtolnay/rust-toolchain@stable with: toolchain: 1.63 - - name: Install cargo xtask - run: | - cargo install cargo-xtask - name: cargo xtask build-capi run: | cargo build-capi @@ -256,9 +229,6 @@ jobs: uses: dtolnay/rust-toolchain@stable with: toolchain: 1.63 - - name: Install cargo xtask - run: | - cargo install cargo-xtask - name: cargo xtask test-wasmer run: | cargo test-wasmer @@ -279,9 +249,6 @@ jobs: uses: dtolnay/rust-toolchain@stable with: toolchain: 1.63 - - name: Install cargo xtask - run: | - cargo install cargo-xtask - name: cargo xtask test-wasmer run: | cargo test-wasmer @@ -298,9 +265,6 @@ jobs: uses: dtolnay/rust-toolchain@stable with: toolchain: 1.63 - - name: Install cargo xtask - run: | - cargo install cargo-xtask - name: cargo xtask test-wasmer run: | cargo test-wasmer @@ -317,9 +281,6 @@ jobs: uses: dtolnay/rust-toolchain@stable with: toolchain: 1.63 - - name: Install cargo xtask - run: | - cargo install cargo-xtask - name: cargo xtask test-wasmer run: | cargo test-wasmer @@ -343,9 +304,6 @@ jobs: uses: dtolnay/rust-toolchain@stable with: toolchain: 1.63 - - name: Install cargo xtask - run: | - cargo install cargo-xtask - name: cargo xtask test-capi run: | cargo test-capi @@ -366,9 +324,6 @@ jobs: uses: dtolnay/rust-toolchain@stable with: toolchain: 1.63 - - name: Install cargo xtask - run: | - cargo install cargo-xtask - name: cargo xtask test-capi run: | cargo test-capi @@ -385,9 +340,6 @@ jobs: uses: dtolnay/rust-toolchain@stable with: toolchain: 1.63 - - name: Install cargo xtask - run: | - cargo install cargo-xtask - name: cargo xtask test-capi run: | cargo test-capi @@ -404,9 +356,6 @@ jobs: uses: dtolnay/rust-toolchain@stable with: toolchain: 1.63 - - name: Install cargo xtask - run: | - cargo install cargo-xtask - name: cargo xtask test-capi run: | cargo test-capi @@ -431,9 +380,6 @@ jobs: uses: dtolnay/rust-toolchain@stable with: toolchain: 1.63 - - name: Install cargo xtask - run: | - cargo install cargo-xtask - name: cargo xtask test-integration run: | cargo test-integration @@ -454,9 +400,6 @@ jobs: uses: dtolnay/rust-toolchain@stable with: toolchain: 1.63 - - name: Install cargo xtask - run: | - cargo install cargo-xtask - name: cargo xtask test-integration run: | cargo test-integration @@ -473,9 +416,6 @@ jobs: uses: dtolnay/rust-toolchain@stable with: toolchain: 1.63 - - name: Install cargo xtask - run: | - cargo install cargo-xtask - name: cargo xtask test-integration run: | cargo test-integration @@ -492,9 +432,6 @@ jobs: uses: dtolnay/rust-toolchain@stable with: toolchain: 1.63 - - name: Install cargo xtask - run: | - cargo install cargo-xtask - name: cargo xtask test-integration run: | cargo test-integration From 8cc970dea19b54c15b4a77d82e6b4dfc2bec41fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Wed, 23 Nov 2022 13:18:27 +0100 Subject: [PATCH 019/226] Release: use --depth 1 to prevent git overload --- scripts/make-release.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/make-release.py b/scripts/make-release.py index c246b91a52f..375781b649a 100644 --- a/scripts/make-release.py +++ b/scripts/make-release.py @@ -151,7 +151,7 @@ def make_release(version): proc = subprocess.Popen(['git','checkout', "-b", "release-" + RELEASE_VERSION], stdout = subprocess.PIPE, cwd = temp_dir.name) proc.wait() - proc = subprocess.Popen(['git','pull', "origin", "release-" + RELEASE_VERSION], stdout = subprocess.PIPE, cwd = temp_dir.name) + proc = subprocess.Popen(['git','pull', "origin", "release-" + RELEASE_VERSION, "--depth", "1"], stdout = subprocess.PIPE, cwd = temp_dir.name) proc.wait() proc = subprocess.Popen(['git','log', "--oneline"], stdout = subprocess.PIPE, cwd = temp_dir.name) @@ -331,7 +331,7 @@ def make_release(version): while not(already_released): print("git pull origin master...") - proc = subprocess.Popen(['git','pull', "origin", "master"], stdout = subprocess.PIPE, cwd = temp_dir.name) + proc = subprocess.Popen(['git','pull', "origin", "master", "--depth", "1"], stdout = subprocess.PIPE, cwd = temp_dir.name) proc.wait() if proc.returncode != 0: for line in proc.stdout: From 7e979adeafc9f8807bf1846b2be4a82ec16eaf0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Wed, 23 Nov 2022 13:19:52 +0100 Subject: [PATCH 020/226] Fix name error in CI --- .github/workflows/test.yaml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index ada09f706ac..f8dc4e33ad9 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -268,8 +268,8 @@ jobs: - name: cargo xtask test-wasmer run: | cargo test-wasmer - env: - COMPILERS: cranelift,llvm,singlepass + env: + COMPILERS: cranelift,llvm,singlepass test_wasmer_windows_x86: name: test wasmer on windows-x64 @@ -284,8 +284,8 @@ jobs: - name: cargo xtask test-wasmer run: | cargo test-wasmer - env: - COMPILERS: cranelift,llvm,singlepass + env: + COMPILERS: cranelift,llvm,singlepass # test-capi: run unit test for capi, depends on build-capi step # (can run in parallel with build-wasmer step) @@ -307,8 +307,8 @@ jobs: - name: cargo xtask test-capi run: | cargo test-capi - env: - COMPILERS: cranelift,llvm,singlepass + env: + COMPILERS: cranelift,llvm,singlepass test_capi_linux_musl: name: test capi on linux-x86_64-musl From 701924b1c718f79e5bf4104ed45b3b77dab9124c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Wed, 23 Nov 2022 13:23:38 +0100 Subject: [PATCH 021/226] Fix missing subcommands --- .cargo/config | 2 ++ .github/workflows/test.yaml | 6 +++--- Cargo.lock | 8 ++++++++ Cargo.toml | 2 ++ xtask/xtask-test-js-core/Cargo.toml | 8 ++++++++ xtask/xtask-test-js-core/src/main.rs | 3 +++ xtask/xtask-test-js/Cargo.toml | 8 ++++++++ xtask/xtask-test-js/src/main.rs | 3 +++ 8 files changed, 37 insertions(+), 3 deletions(-) create mode 100644 xtask/xtask-test-js-core/Cargo.toml create mode 100644 xtask/xtask-test-js-core/src/main.rs create mode 100644 xtask/xtask-test-js/Cargo.toml create mode 100644 xtask/xtask-test-js/src/main.rs diff --git a/.cargo/config b/.cargo/config index 1412e1e8b2c..e67efdd8e1f 100644 --- a/.cargo/config +++ b/.cargo/config @@ -4,4 +4,6 @@ build-capi = "run --package xtask-build-capi --" test-wasmer = "run --package xtask-test-wasmer --" test-capi = "run --package xtask-test-capi --" test-integration = "run --package xtask-test-integration --" +test-js = "run --package xtask-test-js --" +test-js-core = "run --package xtask-test-js-core --" integration-tests = "run --package xtask-test-integration --" diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index f8dc4e33ad9..9ac6daea98f 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -72,7 +72,7 @@ jobs: # build-wasmer: run build-wasmer and build-capi for every OS in parallel build_wasmer_linux_x64: - name: cargo check on linux-x86_64-gnu + name: build wasmer on linux-x86_64-gnu runs-on: ubuntu-18.04 steps: - uses: actions/checkout@v3 @@ -92,7 +92,7 @@ jobs: COMPILERS: cranelift,llvm,singlepass build_wasmer_linux_musl: - name: cargo check on linux-x86_64-musl + name: build wasmer on linux-x86_64-musl runs-on: ubuntu-latest container: alpine:latest steps: @@ -126,7 +126,7 @@ jobs: COMPILERS: cranelift,llvm,singlepass build_wasmer_windows_x86: - name: cargo check on windows-x64 + name: build wasmer on windows-x64 runs-on: windows-2019 steps: - uses: actions/checkout@v3 diff --git a/Cargo.lock b/Cargo.lock index 1503b05190f..887835f0876 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4987,6 +4987,14 @@ version = "0.1.0" name = "xtask-test-integration" version = "0.1.0" +[[package]] +name = "xtask-test-js" +version = "0.1.0" + +[[package]] +name = "xtask-test-js-core" +version = "0.1.0" + [[package]] name = "xtask-test-wasmer" version = "0.1.0" diff --git a/Cargo.toml b/Cargo.toml index 76d4d6ad39f..f96484a5aa9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -26,6 +26,8 @@ cfg-if = "1.0" [workspace] members = [ + "xtask/xtask-test-js", + "xtask/xtask-test-js-core", "xtask/xtask-build-capi", "xtask/xtask-build-wasmer", "xtask/xtask-test-capi", diff --git a/xtask/xtask-test-js-core/Cargo.toml b/xtask/xtask-test-js-core/Cargo.toml new file mode 100644 index 00000000000..042209687f0 --- /dev/null +++ b/xtask/xtask-test-js-core/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "xtask-test-js-core" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] diff --git a/xtask/xtask-test-js-core/src/main.rs b/xtask/xtask-test-js-core/src/main.rs new file mode 100644 index 00000000000..e7a11a969c0 --- /dev/null +++ b/xtask/xtask-test-js-core/src/main.rs @@ -0,0 +1,3 @@ +fn main() { + println!("Hello, world!"); +} diff --git a/xtask/xtask-test-js/Cargo.toml b/xtask/xtask-test-js/Cargo.toml new file mode 100644 index 00000000000..e2a151f2ce5 --- /dev/null +++ b/xtask/xtask-test-js/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "xtask-test-js" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] diff --git a/xtask/xtask-test-js/src/main.rs b/xtask/xtask-test-js/src/main.rs new file mode 100644 index 00000000000..e7a11a969c0 --- /dev/null +++ b/xtask/xtask-test-js/src/main.rs @@ -0,0 +1,3 @@ +fn main() { + println!("Hello, world!"); +} From 099dca9a3bb2d0596673145b5f4676b555cbf0db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Wed, 23 Nov 2022 13:25:41 +0100 Subject: [PATCH 022/226] Update Node dependency --- .github/workflows/test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 9ac6daea98f..c21d5cce58f 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -57,7 +57,7 @@ jobs: with: toolchain: 1.63 - name: Install NodeJS - uses: actions/setup-node@v2 + uses: actions/setup-node@v3 with: node-version: 16 - name: Install wasm-pack From ef4e8e7237fab9cbf4037fc8f180f46a3eb4ca1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Wed, 23 Nov 2022 13:46:58 +0100 Subject: [PATCH 023/226] Add tasks for cargo build-wasmer and cargo build-capi --- xtask/xtask-build-capi/src/main.rs | 54 +++++++++++++++++++++++- xtask/xtask-build-wasmer/src/main.rs | 52 ++++++++++++++++++++++- xtask/xtask-test-capi/src/main.rs | 11 +++++ xtask/xtask-test-integration/src/main.rs | 11 +++++ xtask/xtask-test-js-core/src/main.rs | 11 +++++ xtask/xtask-test-js/src/main.rs | 11 +++++ xtask/xtask-test-wasmer/src/main.rs | 12 ++++++ 7 files changed, 158 insertions(+), 4 deletions(-) diff --git a/xtask/xtask-build-capi/src/main.rs b/xtask/xtask-build-capi/src/main.rs index 9949c9c2560..eb08e05377f 100644 --- a/xtask/xtask-build-capi/src/main.rs +++ b/xtask/xtask-build-capi/src/main.rs @@ -1,4 +1,54 @@ +use std::env; +use std::path::{Path, PathBuf}; +use std::process::{Command, Stdio}; + +fn project_root() -> PathBuf { + Path::new(&env!("CARGO_MANIFEST_DIR")) + .ancestors() + .nth(2) + .unwrap() + .to_path_buf() +} + fn main() { - let compilers = std::env::var("COMPILERS").unwrap(); - println!("build capi, compilers = {compilers}"); + let compilers = env::var("COMPILERS").unwrap_or("cranelift".to_string()); + let cargo = env::var("CARGO").unwrap_or_else(|_| "cargo".to_string()); + let mut capi_compiler_features = compilers + .replace(" ", ",") + .split(",") + .filter(|i| *i != "llvm") + .collect::>() + .join(","); + if !capi_compiler_features.is_empty() { + capi_compiler_features.push(','); + }; + let mut cmd = Command::new(cargo); + cmd.current_dir(project_root()); + cmd.stdin(Stdio::null()); + cmd.stdout(Stdio::inherit()); + cmd.stderr(Stdio::inherit()); + cmd.args(&[ + "build", + "--release", + "--manifest-path", + "lib/c-api/Cargo.toml", + "--no-default-features", + "--features", + "wat,compiler,wasi,middlewares,webc_runner", + "--features", + &format!("{capi_compiler_features}wasmer-artifact-create,static-artifact-create,wasmer-artifact-load,static-artifact-load"), + ]); + + println!("running {cmd:?}"); + + let cmd = cmd.output().unwrap(); + + if !cmd.status.success() { + println!("build capi paniced with status {}", cmd.status); + println!("stdout: {}", String::from_utf8_lossy(&cmd.stdout)); + println!("stderr: {}", String::from_utf8_lossy(&cmd.stdout)); + panic!("build capi failed"); + } + + println!("build capi succeeded, compilers = {compilers}"); } diff --git a/xtask/xtask-build-wasmer/src/main.rs b/xtask/xtask-build-wasmer/src/main.rs index cab59140e29..ec13493fffb 100644 --- a/xtask/xtask-build-wasmer/src/main.rs +++ b/xtask/xtask-build-wasmer/src/main.rs @@ -1,4 +1,52 @@ +use std::env; +use std::path::{Path, PathBuf}; +use std::process::{Command, Stdio}; + +fn project_root() -> PathBuf { + Path::new(&env!("CARGO_MANIFEST_DIR")) + .ancestors() + .nth(2) + .unwrap() + .to_path_buf() +} + fn main() { - let compilers = std::env::var("COMPILERS").unwrap(); - println!("build wasmer, compilers = {compilers}"); + let compilers = env::var("COMPILERS").unwrap_or("cranelift".to_string()); + let cargo = env::var("CARGO").unwrap_or_else(|_| "cargo".to_string()); + let mut compiler_features = compilers + .replace(" ", ",") + .split(",") + .collect::>() + .join(","); + if !compiler_features.is_empty() { + compiler_features.push(','); + }; + let mut cmd = Command::new(cargo); + cmd.current_dir(project_root()); + cmd.stdin(Stdio::null()); + cmd.stdout(Stdio::inherit()); + cmd.stderr(Stdio::inherit()); + cmd.args(&[ + "build", + "--release", + "--manifest-path", + "lib/cli/Cargo.toml", + "--features", + "webc_runner", + "--features", + &format!("{compiler_features}wasmer-artifact-create,static-artifact-create,wasmer-artifact-load,static-artifact-load"), + ]); + + println!("running {cmd:?}"); + + let cmd = cmd.output().unwrap(); + + if !cmd.status.success() { + println!("build capi paniced with status {}", cmd.status); + println!("stdout: {}", String::from_utf8_lossy(&cmd.stdout)); + println!("stderr: {}", String::from_utf8_lossy(&cmd.stdout)); + panic!("build capi failed"); + } + + println!("build capi succeeded, compilers = {compilers}"); } diff --git a/xtask/xtask-test-capi/src/main.rs b/xtask/xtask-test-capi/src/main.rs index d952c4c0744..fd051d13f54 100644 --- a/xtask/xtask-test-capi/src/main.rs +++ b/xtask/xtask-test-capi/src/main.rs @@ -1,3 +1,14 @@ +use std::path::{Path, PathBuf}; +use std::process::{Command, Stdio}; + +fn project_root() -> PathBuf { + Path::new(&env!("CARGO_MANIFEST_DIR")) + .ancestors() + .nth(2) + .unwrap() + .to_path_buf() +} + fn main() { let compilers = std::env::var("COMPILERS").unwrap(); println!("test capi, compilers = {compilers}"); diff --git a/xtask/xtask-test-integration/src/main.rs b/xtask/xtask-test-integration/src/main.rs index c72e23df996..a1f2160fbb6 100644 --- a/xtask/xtask-test-integration/src/main.rs +++ b/xtask/xtask-test-integration/src/main.rs @@ -1,3 +1,14 @@ +use std::path::{Path, PathBuf}; +use std::process::{Command, Stdio}; + +fn project_root() -> PathBuf { + Path::new(&env!("CARGO_MANIFEST_DIR")) + .ancestors() + .nth(2) + .unwrap() + .to_path_buf() +} + fn main() { println!("test integration!"); } diff --git a/xtask/xtask-test-js-core/src/main.rs b/xtask/xtask-test-js-core/src/main.rs index e7a11a969c0..1aa937ed9bf 100644 --- a/xtask/xtask-test-js-core/src/main.rs +++ b/xtask/xtask-test-js-core/src/main.rs @@ -1,3 +1,14 @@ +use std::path::{Path, PathBuf}; +use std::process::{Command, Stdio}; + +fn project_root() -> PathBuf { + Path::new(&env!("CARGO_MANIFEST_DIR")) + .ancestors() + .nth(2) + .unwrap() + .to_path_buf() +} + fn main() { println!("Hello, world!"); } diff --git a/xtask/xtask-test-js/src/main.rs b/xtask/xtask-test-js/src/main.rs index e7a11a969c0..1aa937ed9bf 100644 --- a/xtask/xtask-test-js/src/main.rs +++ b/xtask/xtask-test-js/src/main.rs @@ -1,3 +1,14 @@ +use std::path::{Path, PathBuf}; +use std::process::{Command, Stdio}; + +fn project_root() -> PathBuf { + Path::new(&env!("CARGO_MANIFEST_DIR")) + .ancestors() + .nth(2) + .unwrap() + .to_path_buf() +} + fn main() { println!("Hello, world!"); } diff --git a/xtask/xtask-test-wasmer/src/main.rs b/xtask/xtask-test-wasmer/src/main.rs index 64a24dfbc2e..2213641b473 100644 --- a/xtask/xtask-test-wasmer/src/main.rs +++ b/xtask/xtask-test-wasmer/src/main.rs @@ -1,4 +1,16 @@ +use std::path::{Path, PathBuf}; +use std::process::{Command, Stdio}; + +fn project_root() -> PathBuf { + Path::new(&env!("CARGO_MANIFEST_DIR")) + .ancestors() + .nth(2) + .unwrap() + .to_path_buf() +} + fn main() { + // $(CARGO_BINARY) test $(CARGO_TARGET) --release --tests $(compiler_features) let compilers = std::env::var("COMPILERS").unwrap(); println!("test wasmer, compilers = {compilers}"); } From a8d22f31ac69c2e6403462a93ab252fb168624b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Wed, 23 Nov 2022 13:47:43 +0100 Subject: [PATCH 024/226] Downgrade node dependency --- .github/workflows/test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index c21d5cce58f..9ac6daea98f 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -57,7 +57,7 @@ jobs: with: toolchain: 1.63 - name: Install NodeJS - uses: actions/setup-node@v3 + uses: actions/setup-node@v2 with: node-version: 16 - name: Install wasm-pack From 61819d6e39f59afa068d3491e8f9034e0066972a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Wed, 23 Nov 2022 17:29:39 +0100 Subject: [PATCH 025/226] Fix cargo build-wasmer --- .github/workflows/test.yaml | 169 ++++++++++++++++++++++++++- .gitignore | 2 + Cargo.lock | 8 ++ xtask/xtask-build-capi/Cargo.toml | 2 + xtask/xtask-build-capi/src/main.rs | 35 ++++++ xtask/xtask-build-wasmer/Cargo.toml | 2 + xtask/xtask-build-wasmer/src/main.rs | 37 +++++- xtask/xtask-test-capi/src/main.rs | 23 ++++ xtask/xtask-test-wasmer/src/main.rs | 92 ++++++++++++++- 9 files changed, 365 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 9ac6daea98f..fe7e65de7ba 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -7,12 +7,33 @@ on: - '!master' pull_request: types: [ synchronize ] - + workflow_dispatch: + inputs: + release: + description: 'Make release' env: RUST_BACKTRACE: 1 jobs: + setup: + name: Set up + runs-on: ubuntu-latest + 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 ::set-output name=VERSION::${VERSION} + DOING_RELEASE=$(echo $VERSION | grep -c '^[0-9]\+\.[0-9]\+\.[0-9]\+\(-\([a-zA-Z]\+\)\?[0-9]*\)\?$' || true) + echo ::set-output name=DOING_RELEASE::${DOING_RELEASE} + echo $VERSION + echo $DOING_RELEASE + lint: name: Code lint runs-on: ubuntu-latest @@ -90,6 +111,12 @@ jobs: cargo build-wasmer env: COMPILERS: cranelift,llvm,singlepass + - name: Archive production artifacts + uses: actions/upload-artifact@v3 + with: + name: wasmer-cli-x86_64-unknown-linux-gnu + path: | + build-wasmer.tar.gz build_wasmer_linux_musl: name: build wasmer on linux-x86_64-musl @@ -109,6 +136,12 @@ jobs: cargo build-wasmer env: COMPILERS: cranelift,llvm,singlepass + - name: Archive production artifacts + uses: actions/upload-artifact@v3 + with: + name: wasmer-cli-x86_64-unknown-linux-musl + path: | + build-wasmer.tar.gz build_wasmer_macos_x86: name: build wasmer on macos-x86 @@ -124,6 +157,12 @@ jobs: cargo build-wasmer env: COMPILERS: cranelift,llvm,singlepass + - name: Archive production artifacts + uses: actions/upload-artifact@v3 + with: + name: wasmer-cli-x86_64-x86_64-apple-darwin + path: | + build-wasmer.tar.gz build_wasmer_windows_x86: name: build wasmer on windows-x64 @@ -139,6 +178,12 @@ jobs: cargo build-wasmer env: COMPILERS: cranelift,llvm,singlepass + - name: Archive production artifacts + uses: actions/upload-artifact@v3 + with: + name: wasmer-cli-x86_64-pc-windows-msvc + path: | + build-wasmer.tar.gz # build-capi: run build-capi for every OS, does NOT depend on build-wasmer # (can run in parallel with build-wasmer step) @@ -162,6 +207,12 @@ jobs: cargo build-capi env: COMPILERS: cranelift,llvm,singlepass + - name: Archive production artifacts + uses: actions/upload-artifact@v3 + with: + name: capi-x86_64-unknown-linux-gnu + path: | + build-capi.tar.gz build_capi_linux_musl: name: build capi on linux-x86_64-musl @@ -181,6 +232,12 @@ jobs: cargo build-capi env: COMPILERS: cranelift,llvm,singlepass + - name: Archive production artifacts + uses: actions/upload-artifact@v3 + with: + name: capi-x86_64-unknown-linux-musl + path: | + build-capi.tar.gz build_capi_macos_x86: name: build capi on macos-aarch64 @@ -196,6 +253,12 @@ jobs: cargo build-capi env: COMPILERS: cranelift,llvm,singlepass + - name: Archive production artifacts + uses: actions/upload-artifact@v3 + with: + name: capi-x86_64-apple-darwin + path: | + build-capi.tar.gz build_capi_windows_x86: name: build capi on windows-x64 @@ -211,9 +274,19 @@ jobs: cargo build-capi env: COMPILERS: cranelift,llvm,singlepass + - name: Archive production artifacts + uses: actions/upload-artifact@v3 + with: + name: capi-x86_64-pc-windows-msvc + path: | + build-capi.tar.gz # test-wasmer: run unit tests for wasmer, depends on build-wasmer step # (can run in parallel with build-capi step) + + # NOTE: testing is decoupled from building because when we do a release + # we don't have to go through the "testing" phase again since we assume + # that master is green test_wasmer_linux_x64: name: test wasmer on linux-x86_64-gnu runs-on: ubuntu-18.04 @@ -435,3 +508,97 @@ jobs: - name: cargo xtask test-integration run: | cargo test-integration + + # release step, only run if DOING_RELEASE is present + release: + # needs: [setup, build, linux_aarch64, windows_gnu] + runs-on: ubuntu-latest + if: needs.setup.outputs.DOING_RELEASE == '1' || github.event.inputs.release != '' + steps: + - name: Download the Artifacts + uses: actions/download-artifact@v2 + with: + path: artifacts + - name: Create Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ needs.setup.outputs.VERSION }} + release_name: Release ${{ needs.setup.outputs.VERSION }} + draft: true + prerelease: false + - name: Upload Release Asset Windows Installer + 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-windows-amd64/WasmerInstaller.exe + asset_name: wasmer-windows.exe + asset_content_type: application/vnd.microsoft.portable-executable + - name: Upload Release Asset Windows + 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-windows-amd64/wasmer.tar.gz + asset_name: wasmer-windows-amd64.tar.gz + asset_content_type: application/gzip + - name: Upload Release Asset 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-linux-amd64/wasmer.tar.gz + asset_name: wasmer-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 Windows gnu64 + 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-windows-gnu64/wasmer.tar.gz + asset_name: wasmer-windows-gnu64.tar.gz + asset_content_type: application/gzip + - name: Upload Release Asset Linux amd64 (musl) + id: upload-release-asset-linux-musl-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-linux-musl-amd64/wasmer.tar.gz + asset_name: wasmer-linux-musl-amd64.tar.gz + asset_content_type: application/gzip + - name: Upload Release Asset Mac 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-darwin-amd64/wasmer.tar.gz + asset_name: wasmer-darwin-amd64.tar.gz + asset_content_type: application/gzip + - name: Upload Release Asset Mac arm64 + 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-darwin-arm64/wasmer.tar.gz + asset_name: wasmer-darwin-arm64.tar.gz + asset_content_type: application/gzip diff --git a/.gitignore b/.gitignore index 24affcea4df..49d5005c5c2 100644 --- a/.gitignore +++ b/.gitignore @@ -16,3 +16,5 @@ api-docs-repo/ /avd /core out.txt +build-capi.tar.gz +build-wasmer.tar.gz \ No newline at end of file diff --git a/Cargo.lock b/Cargo.lock index 887835f0876..78c40a87b35 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4974,10 +4974,18 @@ checksum = "d2d7d3948613f75c98fd9328cfdcc45acc4d360655289d0a7d4ec931392200a3" [[package]] name = "xtask-build-capi" version = "0.1.0" +dependencies = [ + "flate2", + "tar", +] [[package]] name = "xtask-build-wasmer" version = "0.1.0" +dependencies = [ + "flate2", + "tar", +] [[package]] name = "xtask-test-capi" diff --git a/xtask/xtask-build-capi/Cargo.toml b/xtask/xtask-build-capi/Cargo.toml index 23303fafa3b..ffffeffd6f5 100644 --- a/xtask/xtask-build-capi/Cargo.toml +++ b/xtask/xtask-build-capi/Cargo.toml @@ -6,3 +6,5 @@ edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] +flate2 = "1.0.24" +tar = "0.4.38" \ No newline at end of file diff --git a/xtask/xtask-build-capi/src/main.rs b/xtask/xtask-build-capi/src/main.rs index eb08e05377f..18c8a43ce7e 100644 --- a/xtask/xtask-build-capi/src/main.rs +++ b/xtask/xtask-build-capi/src/main.rs @@ -10,6 +10,37 @@ fn project_root() -> PathBuf { .to_path_buf() } +fn package_capi(out: &PathBuf) { + use flate2::write::GzEncoder; + use flate2::Compression; + use std::fs::File; + let tar = File::create(out).unwrap(); + let enc = GzEncoder::new(tar, Compression::none()); + let mut a = tar::Builder::new(enc); + + let in_dir = project_root(); + let lib_dir = project_root().join("package").join("lib"); + let include_dir = project_root().join("package").join("include"); + let release_dir = in_dir.join("target").join("release"); + + std::fs::create_dir_all(&lib_dir).unwrap(); + std::fs::create_dir_all(&include_dir).unwrap(); + + let libwasmer_path = release_dir.join("libwasmer.a"); + if libwasmer_path.exists() { + std::fs::copy(&libwasmer_path, lib_dir.join("libwasmer.a")).unwrap(); + } + + let dll_path = release_dir.join("wasmer.dll"); + if dll_path.exists() { + std::fs::copy(&dll_path, lib_dir.join("wasmer.dll")).unwrap(); + } + + a.append_dir_all("lib", &lib_dir).unwrap(); + a.append_dir_all("include", &include_dir).unwrap(); + a.finish().unwrap(); +} + fn main() { let compilers = env::var("COMPILERS").unwrap_or("cranelift".to_string()); let cargo = env::var("CARGO").unwrap_or_else(|_| "cargo".to_string()); @@ -51,4 +82,8 @@ fn main() { } println!("build capi succeeded, compilers = {compilers}"); + + let out_path = project_root().join("build-capi.tar.gz"); + package_capi(&out_path); + println!("packaged to {}", out_path.display()); } diff --git a/xtask/xtask-build-wasmer/Cargo.toml b/xtask/xtask-build-wasmer/Cargo.toml index bb46fb023f0..17e6c787966 100644 --- a/xtask/xtask-build-wasmer/Cargo.toml +++ b/xtask/xtask-build-wasmer/Cargo.toml @@ -6,3 +6,5 @@ edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] +flate2 = "1.0.24" +tar = "0.4.38" \ No newline at end of file diff --git a/xtask/xtask-build-wasmer/src/main.rs b/xtask/xtask-build-wasmer/src/main.rs index ec13493fffb..60de1249570 100644 --- a/xtask/xtask-build-wasmer/src/main.rs +++ b/xtask/xtask-build-wasmer/src/main.rs @@ -10,6 +10,34 @@ fn project_root() -> PathBuf { .to_path_buf() } +fn package_wasmer(out: &PathBuf) { + use flate2::write::GzEncoder; + use flate2::Compression; + use std::fs::File; + let tar = File::create(out).unwrap(); + let enc = GzEncoder::new(tar, Compression::none()); + let mut a = tar::Builder::new(enc); + + let in_dir = project_root(); + let bin_dir = project_root().join("package").join("bin"); + let release_dir = in_dir.join("target").join("release"); + + std::fs::create_dir_all(&bin_dir).unwrap(); + + let libwasmer_path = release_dir.join("wasmer"); + if libwasmer_path.exists() { + std::fs::copy(&libwasmer_path, bin_dir.join("wasmer")).unwrap(); + } + + let libwasmer_path = release_dir.join("wasmer.exe"); + if libwasmer_path.exists() { + std::fs::copy(&libwasmer_path, bin_dir.join("wasmer.exe")).unwrap(); + } + + a.append_dir_all("bin", &bin_dir).unwrap(); + a.finish().unwrap(); +} + fn main() { let compilers = env::var("COMPILERS").unwrap_or("cranelift".to_string()); let cargo = env::var("CARGO").unwrap_or_else(|_| "cargo".to_string()); @@ -35,6 +63,8 @@ fn main() { "webc_runner", "--features", &format!("{compiler_features}wasmer-artifact-create,static-artifact-create,wasmer-artifact-load,static-artifact-load"), + "--bin", + "wasmer", ]); println!("running {cmd:?}"); @@ -48,5 +78,10 @@ fn main() { panic!("build capi failed"); } - println!("build capi succeeded, compilers = {compilers}"); + println!("build wasmer succeeded, compilers = {compilers}"); + + let out_path = project_root().join("build-wasmer.tar.gz"); + package_wasmer(&out_path); + + println!("packaged to = {}", out_path.display()); } diff --git a/xtask/xtask-test-capi/src/main.rs b/xtask/xtask-test-capi/src/main.rs index fd051d13f54..983b6012daa 100644 --- a/xtask/xtask-test-capi/src/main.rs +++ b/xtask/xtask-test-capi/src/main.rs @@ -10,6 +10,29 @@ fn project_root() -> PathBuf { } fn main() { + /* + exclude_tests := --exclude wasmer-c-api --exclude wasmer-cli --exclude wasmer-compiler-cli + # Is failing to compile in Linux for some reason + exclude_tests += --exclude wasmer-wasi-experimental-io-devices + # We run integration tests separately (it requires building the c-api) + exclude_tests += --exclude wasmer-integration-tests-cli + exclude_tests += --exclude wasmer-integration-tests-ios + + ifneq (, $(findstring llvm,$(compilers))) + ENABLE_LLVM := 1 + else + # We exclude LLVM from our package testing + exclude_tests += --exclude wasmer-compiler-llvm + endif + */ + + // build-capi package-capi + // $(foreach compiler_engine,$(capi_compilers_engines),test-capi-crate-$(compiler_engine) test-capi-integration-$(compiler_engine)) + /* + WASMER_CAPI_CONFIG=$(shell echo $@ | sed -e s/test-capi-crate-//) $(CARGO_BINARY) test $(CARGO_TARGET) --manifest-path lib/c-api/Cargo.toml --release \ + --no-default-features --features wat,compiler,wasi,middlewares,webc_runner $(capi_compiler_features) -- --nocapture + */ + // std::fs::read("./build-capi.tar.gz"); let compilers = std::env::var("COMPILERS").unwrap(); println!("test capi, compilers = {compilers}"); } diff --git a/xtask/xtask-test-wasmer/src/main.rs b/xtask/xtask-test-wasmer/src/main.rs index 2213641b473..e0ec7d6c203 100644 --- a/xtask/xtask-test-wasmer/src/main.rs +++ b/xtask/xtask-test-wasmer/src/main.rs @@ -1,3 +1,4 @@ +use std::env; use std::path::{Path, PathBuf}; use std::process::{Command, Stdio}; @@ -9,8 +10,93 @@ fn project_root() -> PathBuf { .to_path_buf() } +fn start_test(args: &[&str]) { + let args = args.iter().map(|s| s.to_string()).collect::>(); + let cargo = env::var("CARGO").unwrap_or_else(|_| "cargo".to_string()); + let compilers = env::var("COMPILERS").unwrap_or("cranelift".to_string()); + + let mut cmd = Command::new(&cargo); + cmd.current_dir(project_root()); + cmd.stdin(Stdio::null()); + cmd.stdout(Stdio::inherit()); + cmd.stderr(Stdio::inherit()); + cmd.args(args); + + println!("running {cmd:?}"); + + let cmd = cmd.output().unwrap(); + + if !cmd.status.success() { + println!("test wasmer paniced with status {}", cmd.status); + println!("stdout: {}", String::from_utf8_lossy(&cmd.stdout)); + println!("stderr: {}", String::from_utf8_lossy(&cmd.stdout)); + panic!("test wasmer failed"); + } + + println!("{cmd:?} succeeded, compilers = {compilers}"); +} + fn main() { - // $(CARGO_BINARY) test $(CARGO_TARGET) --release --tests $(compiler_features) - let compilers = std::env::var("COMPILERS").unwrap(); - println!("test wasmer, compilers = {compilers}"); + let compilers = env::var("COMPILERS").unwrap_or("cranelift".to_string()); + let mut compiler_features = compilers + .replace(" ", ",") + .split(",") + .collect::>() + .join(","); + + if !compiler_features.is_empty() { + compiler_features.push(','); + }; + + let mut exclude_tests = vec![ + "wasmer-c-api", + "wasmer-cli", + "wasmer-compiler-cli", + "wasmer-wasi-experimental-io-devices", + "wasmer-integration-tests-ios", + ]; + + if !compiler_features.contains("llvm") { + exclude_tests.push("wasmer-compiler-llvm"); + } + + let exclude_tests = exclude_tests.join("--exclude "); + + start_test(&[ + "test", + "--release", + "--tests", + "--features", + "cranelift", + "--features", + &format!("{compiler_features}"), + ]); + + start_test(&[ + "test", + "--all", + "--release", + &exclude_tests, + "--features", + "cranelift", + ]); + + start_test(&[ + "test", + &compiler_features, + "--features", + "wasi,cranelift", + "--examples", + ]); + + start_test(&[ + "test", + &compiler_features, + "--features", + "wasi,cranelift", + "--examples", + "--release", // <- + ]); + + start_test(&["test", "--doc", "--all", "--features", "cranelift,std"]); } From 9e5432f85620d7b1aa8b7ca053f6549c352b701e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Wed, 23 Nov 2022 17:32:24 +0100 Subject: [PATCH 026/226] Remove dependency on build-capi for test --- .github/workflows/test.yaml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index fe7e65de7ba..a47ca3b93e7 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -290,7 +290,6 @@ jobs: test_wasmer_linux_x64: name: test wasmer on linux-x86_64-gnu runs-on: ubuntu-18.04 - needs: [build_wasmer_linux_x64] steps: - uses: actions/checkout@v3 - name: Set up libstdc++ on Linux @@ -311,7 +310,6 @@ jobs: test_wasmer_linux_musl: name: test wasmer on linux-x86_64-musl runs-on: ubuntu-latest - needs: [build_wasmer_linux_musl] container: alpine:latest steps: - uses: actions/checkout@v3 @@ -331,7 +329,6 @@ jobs: test_wasmer_macos_x86: name: test wasmer on macos-x86 runs-on: macos-11 - needs: [build_wasmer_macos_x86] steps: - uses: actions/checkout@v3 - name: Install Rust @@ -347,7 +344,6 @@ jobs: test_wasmer_windows_x86: name: test wasmer on windows-x64 runs-on: windows-2019 - needs: [build_wasmer_windows_x86] steps: - uses: actions/checkout@v3 - name: Install Rust @@ -365,7 +361,6 @@ jobs: test_capi_linux_x64: name: test capi on linux-x86_64-gnu runs-on: ubuntu-18.04 - needs: [build_capi_linux_x64] steps: - uses: actions/checkout@v3 - name: Set up libstdc++ on Linux @@ -386,7 +381,6 @@ jobs: test_capi_linux_musl: name: test capi on linux-x86_64-musl runs-on: ubuntu-latest - needs: [build_capi_linux_musl] container: alpine:latest steps: - uses: actions/checkout@v3 @@ -406,7 +400,6 @@ jobs: test_capi_macos_x86: name: test capi on macos-x86 runs-on: macos-11 - needs: [build_capi_macos_x86] steps: - uses: actions/checkout@v3 - name: Install Rust @@ -422,7 +415,6 @@ jobs: test_capi_windows_x86: name: test capi on windows-x64 runs-on: windows-2019 - needs: [build_capi_windows_x86] steps: - uses: actions/checkout@v3 - name: Install Rust From f7ea3efd14a2765b9a933523a393c5f4cf230a0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Wed, 23 Nov 2022 17:36:44 +0100 Subject: [PATCH 027/226] Fix dependencies --- .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 a47ca3b93e7..c514ddeafc5 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -452,7 +452,7 @@ jobs: test_integration_linux_musl: name: integration tests on linux-x86_64-musl runs-on: ubuntu-latest - needs: [build_wasmer_linux_x64, build_capi_linux_musl] + needs: [build_wasmer_linux_musl, build_capi_linux_musl] container: alpine:latest env: TARGET: linux-x86_64-musl @@ -472,7 +472,7 @@ jobs: test_integration_macos_x86: name: integration tests on macos-x86 runs-on: macos-11 - needs: [build_wasmer_linux_x64, build_capi_macos_x86] + needs: [build_wasmer_macos_x86, build_capi_macos_x86] env: TARGET: x86_64-apple-darwin steps: @@ -488,7 +488,7 @@ jobs: test_integration_windows_x86: name: integration tests on windows-x64 runs-on: windows-2019 - needs: [build_wasmer_linux_x64, build_capi_windows_x86] + needs: [build_wasmer_windows_x86, build_capi_windows_x86] env: TARGET: windows-x86_64-msvc steps: From 32b55726a582e1437bc87bc6d9510132820b87c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Wed, 23 Nov 2022 21:20:46 +0100 Subject: [PATCH 028/226] Add LLVM back --- .github/workflows/test.yaml | 49 +++++++++++++++++++++++++++++++++---- 1 file changed, 44 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index c514ddeafc5..dfaf132e836 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -106,6 +106,17 @@ jobs: uses: dtolnay/rust-toolchain@stable with: toolchain: 1.63 + - name: Install LLVM + shell: bash + run: | + LLVM_DIR=$(pwd)/${{ env.LLVM_DIR }} + mkdir -p ${LLVM_DIR} + curl --proto '=https' --tlsv1.2 -sSf "${{ env.LLVM_URL }}" -L -o - | tar xJv -C ${LLVM_DIR} + echo "${LLVM_DIR}/bin" >> $GITHUB_PATH + echo "LLVM_SYS_120_PREFIX=${LLVM_DIR}" >> $GITHUB_ENV + env: + LLVM_DIR: .llvm + LLVM_URL: https://github.com/wasmerio/llvm-custom-builds/releases/download/13.x/llvm-linux-amd64.tar.xz - name: cargo xtask build-wasmer run: | cargo build-wasmer @@ -135,7 +146,7 @@ jobs: run: | cargo build-wasmer env: - COMPILERS: cranelift,llvm,singlepass + COMPILERS: cranelift,singlepass # no llvm - name: Archive production artifacts uses: actions/upload-artifact@v3 with: @@ -148,10 +159,27 @@ jobs: runs-on: macos-11 steps: - uses: actions/checkout@v3 + - 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 - name: Install Rust uses: dtolnay/rust-toolchain@stable with: toolchain: 1.63 + - name: Install LLVM + shell: bash + run: | + LLVM_DIR=$(pwd)/${{ env.LLVM_DIR }} + mkdir -p ${LLVM_DIR} + curl --proto '=https' --tlsv1.2 -sSf "${{ env.LLVM_URL }}" -L -o - | tar xJv -C ${LLVM_DIR} + echo "${LLVM_DIR}/bin" >> $GITHUB_PATH + echo "LLVM_SYS_120_PREFIX=${LLVM_DIR}" >> $GITHUB_ENV + env: + LLVM_DIR: .llvm + LLVM_URL: https://github.com/wasmerio/llvm-custom-builds/releases/download/13.x/llvm-darwin-amd64.tar.xz - name: cargo xtask build-wasmer run: | cargo build-wasmer @@ -173,6 +201,17 @@ jobs: uses: dtolnay/rust-toolchain@stable with: toolchain: 1.63 + - name: Install LLVM + shell: bash + run: | + LLVM_DIR=$(pwd)/${{ env.LLVM_DIR }} + mkdir -p ${LLVM_DIR} + curl --proto '=https' --tlsv1.2 -sSf "${{ env.LLVM_URL }}" -L -o - | tar xJv -C ${LLVM_DIR} + echo "${LLVM_DIR}/bin" >> $GITHUB_PATH + echo "LLVM_SYS_120_PREFIX=${LLVM_DIR}" >> $GITHUB_ENV + env: + LLVM_DIR: .llvm + LLVM_URL: https://github.com/wasmerio/llvm-custom-builds/releases/download/13.x/llvm-windows-amd64.tar.xz - name: cargo xtask build-wasmer run: | cargo build-wasmer @@ -206,7 +245,7 @@ jobs: run: | cargo build-capi env: - COMPILERS: cranelift,llvm,singlepass + COMPILERS: cranelift,singlepass - name: Archive production artifacts uses: actions/upload-artifact@v3 with: @@ -231,7 +270,7 @@ jobs: run: | cargo build-capi env: - COMPILERS: cranelift,llvm,singlepass + COMPILERS: cranelift,singlepass - name: Archive production artifacts uses: actions/upload-artifact@v3 with: @@ -252,7 +291,7 @@ jobs: run: | cargo build-capi env: - COMPILERS: cranelift,llvm,singlepass + COMPILERS: cranelift,singlepass - name: Archive production artifacts uses: actions/upload-artifact@v3 with: @@ -273,7 +312,7 @@ jobs: run: | cargo build-capi env: - COMPILERS: cranelift,llvm,singlepass + COMPILERS: cranelift,singlepass - name: Archive production artifacts uses: actions/upload-artifact@v3 with: From 1ed14805568aa9d06887243172b7378f5a614c94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Wed, 23 Nov 2022 22:11:35 +0100 Subject: [PATCH 029/226] Fix make lint --- xtask/xtask-build-capi/src/main.rs | 6 +++--- xtask/xtask-build-wasmer/src/main.rs | 6 +++--- xtask/xtask-test-capi/src/main.rs | 9 ++++++--- xtask/xtask-test-integration/src/main.rs | 6 ++++-- xtask/xtask-test-js-core/src/main.rs | 3 +-- xtask/xtask-test-js/src/main.rs | 3 +-- xtask/xtask-test-wasmer/src/main.rs | 10 +++++----- 7 files changed, 23 insertions(+), 20 deletions(-) diff --git a/xtask/xtask-build-capi/src/main.rs b/xtask/xtask-build-capi/src/main.rs index 18c8a43ce7e..73a54b08827 100644 --- a/xtask/xtask-build-capi/src/main.rs +++ b/xtask/xtask-build-capi/src/main.rs @@ -42,11 +42,11 @@ fn package_capi(out: &PathBuf) { } fn main() { - let compilers = env::var("COMPILERS").unwrap_or("cranelift".to_string()); + let compilers = env::var("COMPILERS").unwrap_or_else(|_| "cranelift".to_string()); let cargo = env::var("CARGO").unwrap_or_else(|_| "cargo".to_string()); let mut capi_compiler_features = compilers - .replace(" ", ",") - .split(",") + .replace(' ', ",") + .split(',') .filter(|i| *i != "llvm") .collect::>() .join(","); diff --git a/xtask/xtask-build-wasmer/src/main.rs b/xtask/xtask-build-wasmer/src/main.rs index 60de1249570..0c2796e7a6b 100644 --- a/xtask/xtask-build-wasmer/src/main.rs +++ b/xtask/xtask-build-wasmer/src/main.rs @@ -39,11 +39,11 @@ fn package_wasmer(out: &PathBuf) { } fn main() { - let compilers = env::var("COMPILERS").unwrap_or("cranelift".to_string()); + let compilers = env::var("COMPILERS").unwrap_or_else(|_| "cranelift".to_string()); let cargo = env::var("CARGO").unwrap_or_else(|_| "cargo".to_string()); let mut compiler_features = compilers - .replace(" ", ",") - .split(",") + .replace(' ', ",") + .split(',') .collect::>() .join(","); if !compiler_features.is_empty() { diff --git a/xtask/xtask-test-capi/src/main.rs b/xtask/xtask-test-capi/src/main.rs index 983b6012daa..a908bad49f3 100644 --- a/xtask/xtask-test-capi/src/main.rs +++ b/xtask/xtask-test-capi/src/main.rs @@ -1,5 +1,5 @@ +use std::env; use std::path::{Path, PathBuf}; -use std::process::{Command, Stdio}; fn project_root() -> PathBuf { Path::new(&env!("CARGO_MANIFEST_DIR")) @@ -33,6 +33,9 @@ fn main() { --no-default-features --features wat,compiler,wasi,middlewares,webc_runner $(capi_compiler_features) -- --nocapture */ // std::fs::read("./build-capi.tar.gz"); - let compilers = std::env::var("COMPILERS").unwrap(); - println!("test capi, compilers = {compilers}"); + let compilers = env::var("COMPILERS").unwrap_or_else(|_| "cranelift".to_string()); + println!( + "test capi, compilers = {compilers}, project root = {}", + project_root().display() + ); } diff --git a/xtask/xtask-test-integration/src/main.rs b/xtask/xtask-test-integration/src/main.rs index a1f2160fbb6..3713bc1f9a1 100644 --- a/xtask/xtask-test-integration/src/main.rs +++ b/xtask/xtask-test-integration/src/main.rs @@ -1,5 +1,4 @@ use std::path::{Path, PathBuf}; -use std::process::{Command, Stdio}; fn project_root() -> PathBuf { Path::new(&env!("CARGO_MANIFEST_DIR")) @@ -10,5 +9,8 @@ fn project_root() -> PathBuf { } fn main() { - println!("test integration!"); + println!( + "test integration! project root = {}", + project_root().display() + ); } diff --git a/xtask/xtask-test-js-core/src/main.rs b/xtask/xtask-test-js-core/src/main.rs index 1aa937ed9bf..3a17dcb2bd1 100644 --- a/xtask/xtask-test-js-core/src/main.rs +++ b/xtask/xtask-test-js-core/src/main.rs @@ -1,5 +1,4 @@ use std::path::{Path, PathBuf}; -use std::process::{Command, Stdio}; fn project_root() -> PathBuf { Path::new(&env!("CARGO_MANIFEST_DIR")) @@ -10,5 +9,5 @@ fn project_root() -> PathBuf { } fn main() { - println!("Hello, world!"); + println!("Hello, world! root = {}", project_root().display()); } diff --git a/xtask/xtask-test-js/src/main.rs b/xtask/xtask-test-js/src/main.rs index 1aa937ed9bf..3a17dcb2bd1 100644 --- a/xtask/xtask-test-js/src/main.rs +++ b/xtask/xtask-test-js/src/main.rs @@ -1,5 +1,4 @@ use std::path::{Path, PathBuf}; -use std::process::{Command, Stdio}; fn project_root() -> PathBuf { Path::new(&env!("CARGO_MANIFEST_DIR")) @@ -10,5 +9,5 @@ fn project_root() -> PathBuf { } fn main() { - println!("Hello, world!"); + println!("Hello, world! root = {}", project_root().display()); } diff --git a/xtask/xtask-test-wasmer/src/main.rs b/xtask/xtask-test-wasmer/src/main.rs index e0ec7d6c203..8f78a55aa1d 100644 --- a/xtask/xtask-test-wasmer/src/main.rs +++ b/xtask/xtask-test-wasmer/src/main.rs @@ -13,7 +13,7 @@ fn project_root() -> PathBuf { fn start_test(args: &[&str]) { let args = args.iter().map(|s| s.to_string()).collect::>(); let cargo = env::var("CARGO").unwrap_or_else(|_| "cargo".to_string()); - let compilers = env::var("COMPILERS").unwrap_or("cranelift".to_string()); + let compilers = env::var("COMPILERS").unwrap_or_else(|_| "cranelift".to_string()); let mut cmd = Command::new(&cargo); cmd.current_dir(project_root()); @@ -37,10 +37,10 @@ fn start_test(args: &[&str]) { } fn main() { - let compilers = env::var("COMPILERS").unwrap_or("cranelift".to_string()); + let compilers = env::var("COMPILERS").unwrap_or_else(|_| "cranelift".to_string()); let mut compiler_features = compilers - .replace(" ", ",") - .split(",") + .replace(' ', ",") + .split(',') .collect::>() .join(","); @@ -69,7 +69,7 @@ fn main() { "--features", "cranelift", "--features", - &format!("{compiler_features}"), + &compiler_features, ]); start_test(&[ From e7756703f1faaf4a04193047a7587b5cc9df6098 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Thu, 24 Nov 2022 10:23:42 +0100 Subject: [PATCH 030/226] Fix LLVM installation on windows-x64 --- .github/workflows/test.yaml | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index dfaf132e836..056e4abbe64 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -201,17 +201,16 @@ jobs: uses: dtolnay/rust-toolchain@stable with: toolchain: 1.63 - - name: Install LLVM + - name: Install LLVM (Choco - Windows) + if: matrix.llvm_choco_version shell: bash run: | - LLVM_DIR=$(pwd)/${{ env.LLVM_DIR }} - mkdir -p ${LLVM_DIR} - curl --proto '=https' --tlsv1.2 -sSf "${{ env.LLVM_URL }}" -L -o - | tar xJv -C ${LLVM_DIR} - echo "${LLVM_DIR}/bin" >> $GITHUB_PATH + choco install llvm --version ${{ env.LLVM_VERSION }} --allow-downgrade + cd 'C:\Program Files\LLVM\' + LLVM_DIR=$(pwd) echo "LLVM_SYS_120_PREFIX=${LLVM_DIR}" >> $GITHUB_ENV env: - LLVM_DIR: .llvm - LLVM_URL: https://github.com/wasmerio/llvm-custom-builds/releases/download/13.x/llvm-windows-amd64.tar.xz + LLVM_VERSION: 13.0.0 - name: cargo xtask build-wasmer run: | cargo build-wasmer From 9bf2de59239337e230a9de2ba14c16a0b31688cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Thu, 24 Nov 2022 10:56:46 +0100 Subject: [PATCH 031/226] Fix everything up until test-capi step --- .github/workflows/test.yaml | 123 +++++++++++++++++++----- xtask/xtask-build-capi/src/main.rs | 61 ++++++++++-- xtask/xtask-build-wasmer/src/main.rs | 9 +- xtask/xtask-test-capi/src/main.rs | 136 ++++++++++++++++++++++----- 4 files changed, 272 insertions(+), 57 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 056e4abbe64..c5b78537fb7 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -91,6 +91,15 @@ jobs: run: | cargo test-js-core + test_wasm_build: + name: Test wasm build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - run: | + rustup target add wasm32-wasi + make build-wasmer-wasm + # build-wasmer: run build-wasmer and build-capi for every OS in parallel build_wasmer_linux_x64: name: build wasmer on linux-x86_64-gnu @@ -126,8 +135,9 @@ jobs: uses: actions/upload-artifact@v3 with: name: wasmer-cli-x86_64-unknown-linux-gnu - path: | - build-wasmer.tar.gz + path: build-wasmer.tar.gz + if-no-files-found: error + retention-days: 2 build_wasmer_linux_musl: name: build wasmer on linux-x86_64-musl @@ -151,8 +161,9 @@ jobs: uses: actions/upload-artifact@v3 with: name: wasmer-cli-x86_64-unknown-linux-musl - path: | - build-wasmer.tar.gz + path: build-wasmer.tar.gz + if-no-files-found: error + retention-days: 2 build_wasmer_macos_x86: name: build wasmer on macos-x86 @@ -189,8 +200,43 @@ jobs: uses: actions/upload-artifact@v3 with: name: wasmer-cli-x86_64-x86_64-apple-darwin - path: | - build-wasmer.tar.gz + path: build-wasmer.tar.gz + if-no-files-found: error + retention-days: 2 + + build_wasmer_macos_arm: + name: build wasmer on macos-arm + runs-on: macos-11.0 + steps: + - uses: actions/checkout@v3 + - 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 + - name: Install Rust + uses: dtolnay/rust-toolchain@stable + with: + toolchain: 1.63 + target: aarch64-apple-darwin + - name: Install LLVM + shell: bash + run: | + brew install llvm + - name: cargo xtask build-wasmer + run: | + cargo build-wasmer + env: + COMPILERS: cranelift,llvm,singlepass + CARGO_TARGET: aarch64-apple-darwin + - name: Archive production artifacts + uses: actions/upload-artifact@v3 + with: + name: wasmer-cli-aarch64-apple-darwin + path: build-capi.tar.gz + if-no-files-found: error + retention-days: 2 build_wasmer_windows_x86: name: build wasmer on windows-x64 @@ -220,8 +266,11 @@ jobs: uses: actions/upload-artifact@v3 with: name: wasmer-cli-x86_64-pc-windows-msvc - path: | - build-wasmer.tar.gz + path: build-capi.tar.gz + if-no-files-found: error + retention-days: 2 + + # todo: build wasmer headless # build-capi: run build-capi for every OS, does NOT depend on build-wasmer # (can run in parallel with build-wasmer step) @@ -249,8 +298,9 @@ jobs: uses: actions/upload-artifact@v3 with: name: capi-x86_64-unknown-linux-gnu - path: | - build-capi.tar.gz + path: build-capi.tar.gz + if-no-files-found: error + retention-days: 2 build_capi_linux_musl: name: build capi on linux-x86_64-musl @@ -274,8 +324,9 @@ jobs: uses: actions/upload-artifact@v3 with: name: capi-x86_64-unknown-linux-musl - path: | - build-capi.tar.gz + path: build-capi.tar.gz + if-no-files-found: error + retention-days: 2 build_capi_macos_x86: name: build capi on macos-aarch64 @@ -295,8 +346,39 @@ jobs: uses: actions/upload-artifact@v3 with: name: capi-x86_64-apple-darwin - path: | - build-capi.tar.gz + path: build-capi.tar.gz + if-no-files-found: error + retention-days: 2 + + build_capi_macos_arm: + name: build capi on macos-arm + runs-on: macos-11.0 + steps: + - uses: actions/checkout@v3 + - 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 + - name: Install Rust + uses: dtolnay/rust-toolchain@stable + with: + toolchain: 1.63 + target: aarch64-apple-darwin + - name: cargo xtask build-capi + run: | + cargo build-capi + env: + COMPILERS: cranelift,singlepass + CARGO_TARGET: aarch64-apple-darwin + - name: Archive production artifacts + uses: actions/upload-artifact@v3 + with: + name: capi-aarch64-apple-darwin + path: build-capi.tar.gz + if-no-files-found: error + retention-days: 2 build_capi_windows_x86: name: build capi on windows-x64 @@ -316,8 +398,9 @@ jobs: uses: actions/upload-artifact@v3 with: name: capi-x86_64-pc-windows-msvc - path: | - build-capi.tar.gz + path: build-capi.tar.gz + if-no-files-found: error + retention-days: 2 # test-wasmer: run unit tests for wasmer, depends on build-wasmer step # (can run in parallel with build-capi step) @@ -470,8 +553,6 @@ jobs: name: integration tests on linux-x86_64-gnu runs-on: ubuntu-18.04 needs: [build_wasmer_linux_x64, build_capi_linux_x64] - env: - TARGET: linux-x86_64-gnu steps: - uses: actions/checkout@v3 - name: Set up libstdc++ on Linux @@ -492,8 +573,6 @@ jobs: runs-on: ubuntu-latest needs: [build_wasmer_linux_musl, build_capi_linux_musl] container: alpine:latest - env: - TARGET: linux-x86_64-musl steps: - uses: actions/checkout@v3 - name: Set up base deps on musl @@ -511,8 +590,6 @@ jobs: name: integration tests on macos-x86 runs-on: macos-11 needs: [build_wasmer_macos_x86, build_capi_macos_x86] - env: - TARGET: x86_64-apple-darwin steps: - uses: actions/checkout@v3 - name: Install Rust @@ -527,8 +604,6 @@ jobs: name: integration tests on windows-x64 runs-on: windows-2019 needs: [build_wasmer_windows_x86, build_capi_windows_x86] - env: - TARGET: windows-x86_64-msvc steps: - uses: actions/checkout@v3 - name: Install Rust diff --git a/xtask/xtask-build-capi/src/main.rs b/xtask/xtask-build-capi/src/main.rs index 73a54b08827..f4dec804561 100644 --- a/xtask/xtask-build-capi/src/main.rs +++ b/xtask/xtask-build-capi/src/main.rs @@ -21,20 +21,59 @@ fn package_capi(out: &PathBuf) { let in_dir = project_root(); let lib_dir = project_root().join("package").join("lib"); let include_dir = project_root().join("package").join("include"); - let release_dir = in_dir.join("target").join("release"); + let release_dir = match std::env::var("CARGO_TARGET") { + Ok(o) => in_dir.join("target").join(o).join("release"), + Err(_) => in_dir.join("target").join("release"), + }; std::fs::create_dir_all(&lib_dir).unwrap(); std::fs::create_dir_all(&include_dir).unwrap(); - let libwasmer_path = release_dir.join("libwasmer.a"); - if libwasmer_path.exists() { - std::fs::copy(&libwasmer_path, lib_dir.join("libwasmer.a")).unwrap(); - } + std::fs::copy( + project_root().join("lib").join("c-api").join("wasmer.h"), + include_dir.join("wasmer.h"), + ) + .unwrap(); + std::fs::copy( + project_root() + .join("lib") + .join("c-api") + .join("wasmer_wasm.h"), + include_dir.join("wasmer_wasm.h"), + ) + .unwrap(); + std::fs::copy( + project_root() + .join("lib") + .join("c-api") + .join("tests") + .join("wasm-c-api") + .join("include") + .join("wasm.h"), + include_dir.join("wasm.h"), + ) + .unwrap(); + std::fs::copy( + project_root().join("lib").join("c-api").join("README.md"), + include_dir.join("README.md"), + ) + .unwrap(); - let dll_path = release_dir.join("wasmer.dll"); - if dll_path.exists() { - std::fs::copy(&dll_path, lib_dir.join("wasmer.dll")).unwrap(); - } + let _ = std::fs::copy(release_dir.join("wasmer.dll"), lib_dir.join("wasmer.dll")); + let _ = std::fs::copy( + release_dir.join("wasmer.dll.lib"), + lib_dir.join("wasmer.dll.lib"), + ); + let _ = std::fs::copy(release_dir.join("wasmer.lib"), lib_dir.join("wasmer.lib")); + let _ = std::fs::copy( + release_dir.join("libwasmer.dylib"), + lib_dir.join("libwasmer.dylib"), + ); + let _ = std::fs::copy( + release_dir.join("libwasmer.so"), + lib_dir.join("libwasmer.so"), + ); + let _ = std::fs::copy(release_dir.join("libwasmer.a"), lib_dir.join("libwasmer.a")); a.append_dir_all("lib", &lib_dir).unwrap(); a.append_dir_all("include", &include_dir).unwrap(); @@ -70,6 +109,10 @@ fn main() { &format!("{capi_compiler_features}wasmer-artifact-create,static-artifact-create,wasmer-artifact-load,static-artifact-load"), ]); + if let Ok(target) = std::env::var("CARGO_TARGET") { + cmd.args(&["--target", &target]); + } + println!("running {cmd:?}"); let cmd = cmd.output().unwrap(); diff --git a/xtask/xtask-build-wasmer/src/main.rs b/xtask/xtask-build-wasmer/src/main.rs index 0c2796e7a6b..89bbe3c4f90 100644 --- a/xtask/xtask-build-wasmer/src/main.rs +++ b/xtask/xtask-build-wasmer/src/main.rs @@ -20,7 +20,10 @@ fn package_wasmer(out: &PathBuf) { let in_dir = project_root(); let bin_dir = project_root().join("package").join("bin"); - let release_dir = in_dir.join("target").join("release"); + let release_dir = match std::env::var("CARGO_TARGET") { + Ok(o) => in_dir.join("target").join(o).join("release"), + Err(_) => in_dir.join("target").join("release"), + }; std::fs::create_dir_all(&bin_dir).unwrap(); @@ -67,6 +70,10 @@ fn main() { "wasmer", ]); + if let Ok(target) = std::env::var("CARGO_TARGET") { + cmd.args(&["--target", &target]); + } + println!("running {cmd:?}"); let cmd = cmd.output().unwrap(); diff --git a/xtask/xtask-test-capi/src/main.rs b/xtask/xtask-test-capi/src/main.rs index a908bad49f3..1608eeb9797 100644 --- a/xtask/xtask-test-capi/src/main.rs +++ b/xtask/xtask-test-capi/src/main.rs @@ -1,5 +1,6 @@ use std::env; use std::path::{Path, PathBuf}; +use std::process::{Command, Stdio}; fn project_root() -> PathBuf { Path::new(&env!("CARGO_MANIFEST_DIR")) @@ -9,33 +10,122 @@ fn project_root() -> PathBuf { .to_path_buf() } +fn start_test(args: &[&str]) { + let args = args.iter().map(|s| s.to_string()).collect::>(); + let cargo = env::var("CARGO").unwrap_or_else(|_| "cargo".to_string()); + let compilers = env::var("COMPILERS").unwrap_or_else(|_| "cranelift".to_string()); + + let mut cmd = Command::new(&cargo); + cmd.current_dir(project_root()); + cmd.stdin(Stdio::null()); + cmd.stdout(Stdio::inherit()); + cmd.stderr(Stdio::inherit()); + cmd.args(args); + + if let Ok(target) = std::env::var("CARGO_TARGET") { + cmd.args(&["--target", &target]); + } + + println!("running {cmd:?}"); + + let cmd = cmd.output().unwrap(); + + if !cmd.status.success() { + println!("test capi paniced with status {}", cmd.status); + println!("stdout: {}", String::from_utf8_lossy(&cmd.stdout)); + println!("stderr: {}", String::from_utf8_lossy(&cmd.stdout)); + panic!("test capi failed"); + } + + println!("{cmd:?} succeeded, compilers = {compilers}"); +} + fn main() { /* - exclude_tests := --exclude wasmer-c-api --exclude wasmer-cli --exclude wasmer-compiler-cli - # Is failing to compile in Linux for some reason - exclude_tests += --exclude wasmer-wasi-experimental-io-devices - # We run integration tests separately (it requires building the c-api) - exclude_tests += --exclude wasmer-integration-tests-cli - exclude_tests += --exclude wasmer-integration-tests-ios - - ifneq (, $(findstring llvm,$(compilers))) - ENABLE_LLVM := 1 - else - # We exclude LLVM from our package testing - exclude_tests += --exclude wasmer-compiler-llvm - endif - */ - // build-capi package-capi - // $(foreach compiler_engine,$(capi_compilers_engines),test-capi-crate-$(compiler_engine) test-capi-integration-$(compiler_engine)) - /* + test-capi: build-capi package-capi $(foreach compiler_engine,$(capi_compilers_engines),test-capi-crate-$(compiler_engine) test-capi-integration-$(compiler_engine)) + + test-capi-crate-%: WASMER_CAPI_CONFIG=$(shell echo $@ | sed -e s/test-capi-crate-//) $(CARGO_BINARY) test $(CARGO_TARGET) --manifest-path lib/c-api/Cargo.toml --release \ - --no-default-features --features wat,compiler,wasi,middlewares,webc_runner $(capi_compiler_features) -- --nocapture + --no-default-features --features wat,compiler,wasi,middlewares,webc_runner $(capi_compiler_features) -- --nocapture + + test-capi-integration-%: + # note: you need to do make build-capi and make package-capi first! + # Test the Wasmer C API tests for C + cd lib/c-api/tests; WASMER_CAPI_CONFIG=$(shell echo $@ | sed -e s/test-capi-integration-//) WASMER_DIR=`pwd`/../../../package make test + # Test the Wasmer C API examples + cd lib/c-api/examples; WASMER_CAPI_CONFIG=$(shell echo $@ | sed -e s/test-capi-integration-//) WASMER_DIR=`pwd`/../../../package make run + */ - // std::fs::read("./build-capi.tar.gz"); let compilers = env::var("COMPILERS").unwrap_or_else(|_| "cranelift".to_string()); - println!( - "test capi, compilers = {compilers}, project root = {}", - project_root().display() - ); + let mut compiler_features = compilers + .replace(' ', ",") + .split(',') + .collect::>() + .join(","); + + if !compiler_features.is_empty() { + compiler_features.push(','); + }; + let mut capi_compiler_features = compilers + .replace(' ', ",") + .split(',') + .filter(|i| *i != "llvm") + .collect::>() + .join(","); + if !capi_compiler_features.is_empty() { + capi_compiler_features.push(','); + }; + + let mut exclude_tests = vec![ + "wasmer-c-api", + "wasmer-cli", + "wasmer-compiler-cli", + "wasmer-wasi-experimental-io-devices", + "wasmer-integration-tests-ios", + ]; + + if !compiler_features.contains("llvm") { + exclude_tests.push("wasmer-compiler-llvm"); + } + + let exclude_tests = exclude_tests.join("--exclude "); + + start_test(&[ + "test", + "--release", + "--tests", + "--features", + "cranelift", + "--features", + &compiler_features, + ]); + + start_test(&[ + "test", + "--all", + "--release", + &exclude_tests, + "--features", + "cranelift", + ]); + + start_test(&[ + "test", + &compiler_features, + "--features", + "wasi,cranelift", + "--examples", + ]); + + start_test(&[ + "test", + &compiler_features, + "--features", + "wasi,cranelift", + "--examples", + "--release", // <- + ]); + + start_test(&["test", "--doc", "--all", "--features", "cranelift,std"]); } From 82e25dcb3c434eb8bb6273ba0f25cda45c1e9d8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Thu, 24 Nov 2022 11:46:46 +0100 Subject: [PATCH 032/226] Add LLVM on all targets --- .github/workflows/test.yaml | 72 ++++++++++++++++++++++++++++++++----- 1 file changed, 64 insertions(+), 8 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index c5b78537fb7..6b1f3d9da6a 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -223,7 +223,10 @@ jobs: - name: Install LLVM shell: bash run: | - brew install llvm + brew install llvm@13.0.0 + LLVM_DIR=$(brew --cellar llvm) + echo "${LLVM_DIR}/13.0.0/bin" >> $GITHUB_PATH + echo "LLVM_SYS_120_PREFIX=${LLVM_DIR}" >> $GITHUB_ENV - name: cargo xtask build-wasmer run: | cargo build-wasmer @@ -247,8 +250,7 @@ jobs: uses: dtolnay/rust-toolchain@stable with: toolchain: 1.63 - - name: Install LLVM (Choco - Windows) - if: matrix.llvm_choco_version + - name: Install LLVM shell: bash run: | choco install llvm --version ${{ env.LLVM_VERSION }} --allow-downgrade @@ -422,6 +424,17 @@ jobs: uses: dtolnay/rust-toolchain@stable with: toolchain: 1.63 + - name: Install LLVM + shell: bash + run: | + LLVM_DIR=$(pwd)/${{ env.LLVM_DIR }} + mkdir -p ${LLVM_DIR} + curl --proto '=https' --tlsv1.2 -sSf "${{ env.LLVM_URL }}" -L -o - | tar xJv -C ${LLVM_DIR} + echo "${LLVM_DIR}/bin" >> $GITHUB_PATH + echo "LLVM_SYS_120_PREFIX=${LLVM_DIR}" >> $GITHUB_ENV + env: + LLVM_DIR: .llvm + LLVM_URL: https://github.com/wasmerio/llvm-custom-builds/releases/download/13.x/llvm-linux-amd64.tar.xz - name: cargo xtask test-wasmer run: | cargo test-wasmer @@ -445,7 +458,7 @@ jobs: run: | cargo test-wasmer env: - COMPILERS: cranelift,llvm,singlepass + COMPILERS: cranelift,singlepass # no llvm test_wasmer_macos_x86: name: test wasmer on macos-x86 @@ -456,6 +469,40 @@ jobs: uses: dtolnay/rust-toolchain@stable with: toolchain: 1.63 + - name: Install LLVM + shell: bash + run: | + LLVM_DIR=$(pwd)/${{ env.LLVM_DIR }} + mkdir -p ${LLVM_DIR} + curl --proto '=https' --tlsv1.2 -sSf "${{ env.LLVM_URL }}" -L -o - | tar xJv -C ${LLVM_DIR} + echo "${LLVM_DIR}/bin" >> $GITHUB_PATH + echo "LLVM_SYS_120_PREFIX=${LLVM_DIR}" >> $GITHUB_ENV + env: + LLVM_DIR: .llvm + LLVM_URL: https://github.com/wasmerio/llvm-custom-builds/releases/download/13.x/llvm-darwin-amd64.tar.xz + - name: cargo xtask test-wasmer + run: | + cargo test-wasmer + env: + COMPILERS: cranelift,llvm,singlepass + + test_wasmer_macos_arm: + name: test wasmer on macos-x86 + runs-on: macos-11 + steps: + - uses: actions/checkout@v3 + - name: Install Rust + uses: dtolnay/rust-toolchain@stable + with: + toolchain: 1.63 + target: aarch64-apple-darwin + - name: Install LLVM + shell: bash + run: | + brew install llvm@13.0.0 + LLVM_DIR=$(brew --cellar llvm) + echo "${LLVM_DIR}/13.0.0/bin" >> $GITHUB_PATH + echo "LLVM_SYS_120_PREFIX=${LLVM_DIR}" >> $GITHUB_ENV - name: cargo xtask test-wasmer run: | cargo test-wasmer @@ -471,6 +518,15 @@ jobs: uses: dtolnay/rust-toolchain@stable with: toolchain: 1.63 + - name: Install LLVM + shell: bash + run: | + choco install llvm --version ${{ env.LLVM_VERSION }} --allow-downgrade + cd 'C:\Program Files\LLVM\' + LLVM_DIR=$(pwd) + echo "LLVM_SYS_120_PREFIX=${LLVM_DIR}" >> $GITHUB_ENV + env: + LLVM_VERSION: 13.0.0 - name: cargo xtask test-wasmer run: | cargo test-wasmer @@ -497,7 +553,7 @@ jobs: run: | cargo test-capi env: - COMPILERS: cranelift,llvm,singlepass + COMPILERS: cranelift,singlepass test_capi_linux_musl: name: test capi on linux-x86_64-musl @@ -516,7 +572,7 @@ jobs: run: | cargo test-capi env: - COMPILERS: cranelift,llvm,singlepass + COMPILERS: cranelift,singlepass test_capi_macos_x86: name: test capi on macos-x86 @@ -531,7 +587,7 @@ jobs: run: | cargo test-capi env: - COMPILERS: cranelift,llvm,singlepass + COMPILERS: cranelift,singlepass test_capi_windows_x86: name: test capi on windows-x64 @@ -546,7 +602,7 @@ jobs: run: | cargo test-capi env: - COMPILERS: cranelift,llvm,singlepass + COMPILERS: cranelift,singlepass # test-integration-cli: run integration tests for wasmer, depends on build-capi and build-wasmer steps test_integration_linux_x64: From f44f7071d150a3a0df92d703456b2130ccdc7786 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Thu, 24 Nov 2022 12:37:19 +0100 Subject: [PATCH 033/226] Add cargo test-integration and test-capi impl --- .github/workflows/test.yaml | 16 ++ Cargo.lock | 6 + lib/c-api/examples/Makefile | 44 ----- lib/c-api/tests/Makefile | 32 ---- .../tests/wasmer-c-api-test-runner/src/lib.rs | 82 +-------- xtask/xtask-test-capi/Cargo.toml | 1 + xtask/xtask-test-capi/src/main.rs | 163 +++++++++--------- xtask/xtask-test-integration/Cargo.toml | 1 + xtask/xtask-test-integration/src/main.rs | 69 +++++++- 9 files changed, 172 insertions(+), 242 deletions(-) delete mode 100644 lib/c-api/examples/Makefile delete mode 100644 lib/c-api/tests/Makefile diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 6b1f3d9da6a..aec9d75e539 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -589,6 +589,22 @@ jobs: env: COMPILERS: cranelift,singlepass + test_capi_macos_arm: + name: test capi on macos-arm + runs-on: macos-11.0 + steps: + - uses: actions/checkout@v3 + - name: Install Rust + uses: dtolnay/rust-toolchain@stable + with: + toolchain: 1.63 + target: aarch64-apple-darwin + - name: cargo xtask test-capi + run: | + cargo test-capi + env: + COMPILERS: cranelift,singlepass + test_capi_windows_x86: name: test capi on windows-x64 runs-on: windows-2019 diff --git a/Cargo.lock b/Cargo.lock index 78c40a87b35..aeec8c01e4f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4990,10 +4990,16 @@ dependencies = [ [[package]] name = "xtask-test-capi" version = "0.1.0" +dependencies = [ + "wasmer-registry", +] [[package]] name = "xtask-test-integration" version = "0.1.0" +dependencies = [ + "wasmer-registry", +] [[package]] name = "xtask-test-js" diff --git a/lib/c-api/examples/Makefile b/lib/c-api/examples/Makefile deleted file mode 100644 index 9bea95c12fc..00000000000 --- a/lib/c-api/examples/Makefile +++ /dev/null @@ -1,44 +0,0 @@ -WASMER_DIR:=$(realpath $(WASMER_DIR)) - -$(info Using provided WASMER_DIR=$(WASMER_DIR)) - -ROOT_DIR:=$(shell dirname $(realpath $(firstword $(MAKEFILE_LIST)))) -ROOT_DIR_PARENT:=$(shell dirname $(ROOT_DIR)) - -MSVC_CFLAGS:="" -MSVC_LDFLAGS:="" -MSVC_LDLIBS:="" - -ifeq (,$(wildcard $(WASMER_DIR)/bin/wasmer)) - CFLAGS = -g -I $(ROOT_DIR)/ -I $(WASMER_DIR)/include - LDFLAGS = -Wl,-rpath,$(WASMER_DIR)/lib - LDLIBS = -L $(WASMER_DIR)/lib -lwasmer - - MSVC_CFLAGS:= /DEBUG /I $(ROOT_DIR)/ /I $(WASMER_DIR)/include - MSVC_LDFLAGS:= "" - MSVC_LDLIBS:= /LIBPATH:$(WASMER_DIR)/lib wasmer.dll.lib -else - CFLAGS = -g -I $(ROOT_DIR)/ -I $(shell $(WASMER_DIR)/bin/wasmer config --includedir) - LDFLAGS = -Wl,-rpath,$(shell $(WASMER_DIR)/bin/wasmer config --libdir) - LDLIBS = $(shell $(WASMER_DIR)/bin/wasmer config --libs) - - MSVC_CFLAGS:= /DEBUG /I $(ROOT_DIR)/ /I $(shell $(WASMER_DIR)/bin/wasmer config --includedir) - MSVC_LDFLAGS:= "" - MSVC_LDLIBS:= /LIBPATH:$(shell $(WASMER_DIR)/bin/wasmer config --libs) wasmer.dll.lib -endif - -$(info * CFLAGS: $(CFLAGS)) -$(info * LDFLAGS: $(LDFLAGS)) -$(info * LDLIBS: $(LDLIBS)) - -ALL = deprecated-header early-exit instance imports-exports exports-function exports-global memory memory2 features wasi - -.PHONY: run -.SILENT: run -run: - WASMER_DIR="$(WASMER_DIR)" ROOT_DIR="$(ROOT_DIR)" CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" LDLIBS="$(LDLIBS)" cargo test --manifest-path="./wasmer-capi-examples-runner/Cargo.toml" -- --nocapture 2>&1 - -.SILENT: clean -.PHONY: clean -clean: - $(foreach file,$(ALL),rm -f $(file).o $(file)) diff --git a/lib/c-api/tests/Makefile b/lib/c-api/tests/Makefile deleted file mode 100644 index 05c01037923..00000000000 --- a/lib/c-api/tests/Makefile +++ /dev/null @@ -1,32 +0,0 @@ -WASMER_DIR:=$(realpath $(WASMER_DIR)) - -$(info Using provided WASMER_DIR=$(WASMER_DIR)) - -ROOT_DIR:=$(shell dirname $(realpath $(firstword $(MAKEFILE_LIST)))) -ROOT_DIR_PARENT:=$(shell dirname $(ROOT_DIR)) - -ifeq (,$(wildcard $(WASMER_DIR)/bin/wasmer)) - CFLAGS = -g -I $(ROOT_DIR) -I $(WASMER_DIR)/include - LDFLAGS = -Wl,-rpath,$(WASMER_DIR)/lib - LDLIBS = -L $(WASMER_DIR)/lib -lwasmer -else - CFLAGS = -g -I $(ROOT_DIR)/wasm-c-api/include/ -I $(shell $(WASMER_DIR)/bin/wasmer config --includedir) - LDFLAGS = -Wl,-rpath,$(shell $(WASMER_DIR)/bin/wasmer config --libdir) - LDLIBS = $(shell $(WASMER_DIR)/bin/wasmer config --libs) -endif - - -$(info * ROOT_DIR: $(ROOT_DIR)) -$(info * WASMER_DIR: $(WASMER_DIR)) -$(info * "") -$(info * CFLAGS: $(CFLAGS)) -$(info * LDFLAGS: $(LDFLAGS)) -$(info * LDLIBS: $(LDLIBS)) - -test: - cargo test --manifest-path="./wasmer-c-api-test-runner/Cargo.toml" -- --nocapture 2>&1 - -.SILENT: clean -.PHONY: clean -clean: - $(foreach file,$(ALL),rm -f $(file).o $(file)) diff --git a/lib/c-api/tests/wasmer-c-api-test-runner/src/lib.rs b/lib/c-api/tests/wasmer-c-api-test-runner/src/lib.rs index 60b2d300845..fe82ab0aef1 100644 --- a/lib/c-api/tests/wasmer-c-api-test-runner/src/lib.rs +++ b/lib/c-api/tests/wasmer-c-api-test-runner/src/lib.rs @@ -23,52 +23,7 @@ impl Config { if config.wasmer_dir.is_empty() { println!("manifest dir = {manifest_dir}, wasmer root dir = {wasmer_base_dir}"); config.wasmer_dir = wasmer_base_dir.clone() + "/package"; - if !std::path::Path::new(&config.wasmer_dir).exists() { - println!("running make build-capi..."); - // run make build-capi - let mut cmd = std::process::Command::new("make"); - cmd.arg("build-capi"); - cmd.current_dir(wasmer_base_dir.clone()); - let result = cmd.output(); - println!("make build-capi: {result:#?}"); - - println!("running make package..."); - // run make package-capi - let mut cmd = std::process::Command::new("make"); - cmd.arg("package-capi"); - cmd.current_dir(wasmer_base_dir.clone()); - let result = cmd.output(); - make_package(); - println!("make package: {result:#?}"); - - println!("list {}", config.wasmer_dir); - match std::fs::read_dir(&config.wasmer_dir) { - Ok(o) => { - for entry in o { - let entry = entry.unwrap(); - let path = entry.path(); - println!(" {:?}", path.file_name()); - } - } - Err(e) => { - println!("error in reading config.wasmer_dir: {e}"); - } - }; - - println!("list {}/include", config.wasmer_dir); - match std::fs::read_dir(&format!("{}/include", config.wasmer_dir)) { - Ok(o) => { - for entry in o { - let entry = entry.unwrap(); - let path = entry.path(); - println!(" {:?}", path.file_name()); - } - } - Err(e) => { - println!("error in reading config.wasmer_dir: {e}"); - } - }; - } + assert!(std::path::Path::new(&config.wasmer_dir).exists()); } if config.root_dir.is_empty() { config.root_dir = wasmer_base_dir + "/lib/c-api/tests"; @@ -132,41 +87,6 @@ impl Drop for RemoveTestsOnDrop { } } -fn make_package() { - let wasmer_root_dir = find_wasmer_base_dir(); - let _ = std::fs::create_dir_all(&format!("{wasmer_root_dir}/package/lib")); - let _ = std::fs::create_dir_all(&format!("{wasmer_root_dir}/package/include")); - let _ = std::fs::copy( - &format!("{wasmer_root_dir}/lib/c-api/tests/wasm.h"), - &format!("{wasmer_root_dir}/package/include/wasm.h"), - ); - let _ = std::fs::copy( - &format!("{wasmer_root_dir}/lib/c-api/tests/wasmer.h"), - &format!("{wasmer_root_dir}/package/include/wasmer.h"), - ); - #[cfg(target_os = "windows")] - let _ = std::fs::copy( - &format!("{wasmer_root_dir}/target/release/wasmer.dll"), - &format!("{wasmer_root_dir}/package/lib"), - ); - #[cfg(target_os = "windows")] - let _ = std::fs::copy( - &format!("{wasmer_root_dir}/target/release/wasmer.dll.lib"), - &format!("{wasmer_root_dir}/package/lib"), - ); - #[cfg(not(target_os = "windows"))] - let _ = std::fs::copy( - &format!("{wasmer_root_dir}/target/release/libwasmer.so"), - &format!("{wasmer_root_dir}/package/lib"), - ); - #[cfg(not(target_os = "windows"))] - let _ = std::fs::copy( - &format!("{wasmer_root_dir}/target/release/libwasmer.lib"), - &format!("{wasmer_root_dir}/package/lib"), - ); - println!("copying done (make package)"); -} - #[cfg(test)] pub const CAPI_BASE_TESTS: &[&str] = &[ "wasm-c-api/example/callback", diff --git a/xtask/xtask-test-capi/Cargo.toml b/xtask/xtask-test-capi/Cargo.toml index f183a12f5c2..2405057c96b 100644 --- a/xtask/xtask-test-capi/Cargo.toml +++ b/xtask/xtask-test-capi/Cargo.toml @@ -6,3 +6,4 @@ edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] +wasmer-registry = { version = "3.0.1", path = "../../lib/registry" } \ No newline at end of file diff --git a/xtask/xtask-test-capi/src/main.rs b/xtask/xtask-test-capi/src/main.rs index 1608eeb9797..2a49d1473e9 100644 --- a/xtask/xtask-test-capi/src/main.rs +++ b/xtask/xtask-test-capi/src/main.rs @@ -10,7 +10,8 @@ fn project_root() -> PathBuf { .to_path_buf() } -fn start_test(args: &[&str]) { + +fn start_test(args: &[&str], env_vars: &[(&str, String)]) { let args = args.iter().map(|s| s.to_string()).collect::>(); let cargo = env::var("CARGO").unwrap_or_else(|_| "cargo".to_string()); let compilers = env::var("COMPILERS").unwrap_or_else(|_| "cranelift".to_string()); @@ -21,6 +22,9 @@ fn start_test(args: &[&str]) { cmd.stdout(Stdio::inherit()); cmd.stderr(Stdio::inherit()); cmd.args(args); + for (k, v) in env_vars { + cmd.env(k, v); + } if let Ok(target) = std::env::var("CARGO_TARGET") { cmd.args(&["--target", &target]); @@ -40,92 +44,89 @@ fn start_test(args: &[&str]) { println!("{cmd:?} succeeded, compilers = {compilers}"); } -fn main() { - /* - test-capi: build-capi package-capi $(foreach compiler_engine,$(capi_compilers_engines),test-capi-crate-$(compiler_engine) test-capi-integration-$(compiler_engine)) - - test-capi-crate-%: - WASMER_CAPI_CONFIG=$(shell echo $@ | sed -e s/test-capi-crate-//) $(CARGO_BINARY) test $(CARGO_TARGET) --manifest-path lib/c-api/Cargo.toml --release \ - --no-default-features --features wat,compiler,wasi,middlewares,webc_runner $(capi_compiler_features) -- --nocapture +fn main() { + std::fs::create_dir_all(project_root().join("package")).expect("could not create package dir"); - test-capi-integration-%: - # note: you need to do make build-capi and make package-capi first! - # Test the Wasmer C API tests for C - cd lib/c-api/tests; WASMER_CAPI_CONFIG=$(shell echo $@ | sed -e s/test-capi-integration-//) WASMER_DIR=`pwd`/../../../package make test - # Test the Wasmer C API examples - cd lib/c-api/examples; WASMER_CAPI_CONFIG=$(shell echo $@ | sed -e s/test-capi-integration-//) WASMER_DIR=`pwd`/../../../package make run + wasmer_registry::try_unpack_targz( + project_root().join("build-capi.tar.gz"), + project_root().join("package"), + false, + ) + .expect("could not unpack build-capi.tar.gz, run cargo build-capi first!"); - */ let compilers = env::var("COMPILERS").unwrap_or_else(|_| "cranelift".to_string()); - let mut compiler_features = compilers - .replace(' ', ",") - .split(',') - .collect::>() - .join(","); - - if !compiler_features.is_empty() { - compiler_features.push(','); - }; - let mut capi_compiler_features = compilers + let capi_compiler_features = compilers .replace(' ', ",") .split(',') .filter(|i| *i != "llvm") - .collect::>() - .join(","); - if !capi_compiler_features.is_empty() { - capi_compiler_features.push(','); - }; - - let mut exclude_tests = vec![ - "wasmer-c-api", - "wasmer-cli", - "wasmer-compiler-cli", - "wasmer-wasi-experimental-io-devices", - "wasmer-integration-tests-ios", - ]; - - if !compiler_features.contains("llvm") { - exclude_tests.push("wasmer-compiler-llvm"); + .map(|s| s.to_string()) + .collect::>(); + + // we only have one engine + let capi_compiler_engines = capi_compiler_features + .iter() + .map(|f| format!("{f}-universal")) + .collect::>(); + + for engine in capi_compiler_engines { + let envs = &[ + ( + "WASMER_DIR", + format!("{}", project_root().join("package").display()), + ), + ("ROOT_DIR", format!("{}", project_root().display())), + ("WASMER_CAPI_CONFIG", engine.to_string()), + ]; + + // run capi test + start_test( + &[ + "test", + "--manifest-path", + &format!("{}/lib/c-api/Cargo.toml", project_root().display()), + "--release", + "--no-default-features", + "--features", + "wat,compiler,wasi,middlewares,webc_runner", + "--features", + &capi_compiler_features.join(","), + "--", + "--nocapture" + ], + envs, + ); + + // run integration tests + + // cargo test --manifest-path="lib/c-api/tests/wasmer-c-api-test-runner/Cargo.toml" + start_test( + &[ + "test", + "--manifest-path", + &format!( + "{}/lib/c-api/tests/wasmer-c-api-test-runner/Cargo.toml", + project_root().display() + ), + "--", + "--nocapture" + ], + envs, + ); + + // cargo test --manifest-path="lib/c-api/examples/wasmer-capi-examples-runner/Cargo.toml" + start_test( + &[ + "test", + "--manifest-path", + &format!( + "{}/lib/c-api/examples/wasmer-capi-examples-runner/Cargo.toml", + project_root().display() + ), + "--", + "--nocapture" + ], + envs, + ); } - - let exclude_tests = exclude_tests.join("--exclude "); - - start_test(&[ - "test", - "--release", - "--tests", - "--features", - "cranelift", - "--features", - &compiler_features, - ]); - - start_test(&[ - "test", - "--all", - "--release", - &exclude_tests, - "--features", - "cranelift", - ]); - - start_test(&[ - "test", - &compiler_features, - "--features", - "wasi,cranelift", - "--examples", - ]); - - start_test(&[ - "test", - &compiler_features, - "--features", - "wasi,cranelift", - "--examples", - "--release", // <- - ]); - - start_test(&["test", "--doc", "--all", "--features", "cranelift,std"]); } diff --git a/xtask/xtask-test-integration/Cargo.toml b/xtask/xtask-test-integration/Cargo.toml index ccd5d126ee1..5bb8f9883a2 100644 --- a/xtask/xtask-test-integration/Cargo.toml +++ b/xtask/xtask-test-integration/Cargo.toml @@ -6,3 +6,4 @@ edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] +wasmer-registry = { version = "3.0.1", path = "../../lib/registry" } \ No newline at end of file diff --git a/xtask/xtask-test-integration/src/main.rs b/xtask/xtask-test-integration/src/main.rs index 3713bc1f9a1..87fc6f7c1d5 100644 --- a/xtask/xtask-test-integration/src/main.rs +++ b/xtask/xtask-test-integration/src/main.rs @@ -1,4 +1,6 @@ use std::path::{Path, PathBuf}; +use std::env; +use std::process::{Command, Stdio}; fn project_root() -> PathBuf { Path::new(&env!("CARGO_MANIFEST_DIR")) @@ -8,9 +10,68 @@ fn project_root() -> PathBuf { .to_path_buf() } +fn start_test(args: &[&str], env_vars: &[(&str, String)]) { + let args = args.iter().map(|s| s.to_string()).collect::>(); + let cargo = env::var("CARGO").unwrap_or_else(|_| "cargo".to_string()); + let compilers = env::var("COMPILERS").unwrap_or_else(|_| "cranelift".to_string()); + + let mut cmd = Command::new(&cargo); + cmd.current_dir(project_root()); + cmd.stdin(Stdio::null()); + cmd.stdout(Stdio::inherit()); + cmd.stderr(Stdio::inherit()); + cmd.args(args); + for (k, v) in env_vars { + cmd.env(k, v); + } + + if let Ok(target) = std::env::var("CARGO_TARGET") { + cmd.args(&["--target", &target]); + } + + println!("running {cmd:?}"); + + let cmd = cmd.output().unwrap(); + + if !cmd.status.success() { + println!("test capi paniced with status {}", cmd.status); + println!("stdout: {}", String::from_utf8_lossy(&cmd.stdout)); + println!("stderr: {}", String::from_utf8_lossy(&cmd.stdout)); + panic!("test capi failed"); + } + + println!("{cmd:?} succeeded, compilers = {compilers}"); +} + fn main() { - println!( - "test integration! project root = {}", - project_root().display() - ); + std::fs::create_dir_all(project_root().join("package")).expect("could not create package dir"); + + wasmer_registry::try_unpack_targz( + project_root().join("build-capi.tar.gz"), + project_root().join("package"), + false, + ) + .expect("could not unpack build-capi.tar.gz, run cargo build-capi first!"); + + std::fs::create_dir_all(project_root().join("package")).expect("could not create package dir"); + + wasmer_registry::try_unpack_targz( + project_root().join("build-wasmer.tar.gz"), + project_root().join("package"), + false, + ) + .expect("could not unpack build-wasmer.tar.gz, run cargo build-wasmer first!"); + + start_test(&[ + "test", + "--features", + "webc_runner", + "--no-fail-fast", + "-p", + "wasmer-integration-tests-cli", + "--", + "--nocapture" + ], &[ + ("WASMER_DIR", format!("{}", project_root().join("package").display())), + ]); } From 96d7c68e9d641c2f6f8f05d47eba8cf89894fd61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Thu, 24 Nov 2022 12:39:15 +0100 Subject: [PATCH 034/226] Use llvm@13 formula (brew) --- .github/workflows/test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index aec9d75e539..7889716c5ba 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -223,7 +223,7 @@ jobs: - name: Install LLVM shell: bash run: | - brew install llvm@13.0.0 + brew install llvm@13 LLVM_DIR=$(brew --cellar llvm) echo "${LLVM_DIR}/13.0.0/bin" >> $GITHUB_PATH echo "LLVM_SYS_120_PREFIX=${LLVM_DIR}" >> $GITHUB_ENV From 236eb6d2fce90d604d1328e81452c189f94f2681 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Thu, 24 Nov 2022 12:39:53 +0100 Subject: [PATCH 035/226] Same for test-wasmer --- .github/workflows/test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 7889716c5ba..c2efa31d572 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -499,7 +499,7 @@ jobs: - name: Install LLVM shell: bash run: | - brew install llvm@13.0.0 + brew install llvm@13 LLVM_DIR=$(brew --cellar llvm) echo "${LLVM_DIR}/13.0.0/bin" >> $GITHUB_PATH echo "LLVM_SYS_120_PREFIX=${LLVM_DIR}" >> $GITHUB_ENV From e13f12092f8e4175ed795f07150f5c711859f583 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Thu, 24 Nov 2022 12:43:26 +0100 Subject: [PATCH 036/226] Fix make lint --- xtask/xtask-test-capi/src/main.rs | 8 +++---- xtask/xtask-test-integration/src/main.rs | 30 ++++++++++++++---------- 2 files changed, 20 insertions(+), 18 deletions(-) diff --git a/xtask/xtask-test-capi/src/main.rs b/xtask/xtask-test-capi/src/main.rs index 2a49d1473e9..285f7c58055 100644 --- a/xtask/xtask-test-capi/src/main.rs +++ b/xtask/xtask-test-capi/src/main.rs @@ -10,7 +10,6 @@ fn project_root() -> PathBuf { .to_path_buf() } - fn start_test(args: &[&str], env_vars: &[(&str, String)]) { let args = args.iter().map(|s| s.to_string()).collect::>(); let cargo = env::var("CARGO").unwrap_or_else(|_| "cargo".to_string()); @@ -44,7 +43,6 @@ fn start_test(args: &[&str], env_vars: &[(&str, String)]) { println!("{cmd:?} succeeded, compilers = {compilers}"); } - fn main() { std::fs::create_dir_all(project_root().join("package")).expect("could not create package dir"); @@ -92,7 +90,7 @@ fn main() { "--features", &capi_compiler_features.join(","), "--", - "--nocapture" + "--nocapture", ], envs, ); @@ -109,7 +107,7 @@ fn main() { project_root().display() ), "--", - "--nocapture" + "--nocapture", ], envs, ); @@ -124,7 +122,7 @@ fn main() { project_root().display() ), "--", - "--nocapture" + "--nocapture", ], envs, ); diff --git a/xtask/xtask-test-integration/src/main.rs b/xtask/xtask-test-integration/src/main.rs index 87fc6f7c1d5..38d08e5f833 100644 --- a/xtask/xtask-test-integration/src/main.rs +++ b/xtask/xtask-test-integration/src/main.rs @@ -1,5 +1,5 @@ -use std::path::{Path, PathBuf}; use std::env; +use std::path::{Path, PathBuf}; use std::process::{Command, Stdio}; fn project_root() -> PathBuf { @@ -62,16 +62,20 @@ fn main() { ) .expect("could not unpack build-wasmer.tar.gz, run cargo build-wasmer first!"); - start_test(&[ - "test", - "--features", - "webc_runner", - "--no-fail-fast", - "-p", - "wasmer-integration-tests-cli", - "--", - "--nocapture" - ], &[ - ("WASMER_DIR", format!("{}", project_root().join("package").display())), - ]); + start_test( + &[ + "test", + "--features", + "webc_runner", + "--no-fail-fast", + "-p", + "wasmer-integration-tests-cli", + "--", + "--nocapture", + ], + &[( + "WASMER_DIR", + format!("{}", project_root().join("package").display()), + )], + ); } From 228d5fa083b5edd609d2355fcb082179405c0828 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Thu, 24 Nov 2022 13:07:27 +0100 Subject: [PATCH 037/226] Add donwloading to integration and capi-test step --- .github/workflows/test.yaml | 158 +++++++++++++++--------------------- 1 file changed, 64 insertions(+), 94 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index c2efa31d572..1a49c47d820 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -538,6 +538,7 @@ jobs: test_capi_linux_x64: name: test capi on linux-x86_64-gnu runs-on: ubuntu-18.04 + needs: [build_capi_linux_x64] steps: - uses: actions/checkout@v3 - name: Set up libstdc++ on Linux @@ -549,6 +550,9 @@ jobs: uses: dtolnay/rust-toolchain@stable with: toolchain: 1.63 + - uses: actions/download-artifact@v3 + with: + name: capi-x86_64-unknown-linux-gnu - name: cargo xtask test-capi run: | cargo test-capi @@ -558,6 +562,7 @@ jobs: test_capi_linux_musl: name: test capi on linux-x86_64-musl runs-on: ubuntu-latest + needs: [build_capi_linux_musl] container: alpine:latest steps: - uses: actions/checkout@v3 @@ -568,6 +573,9 @@ jobs: uses: dtolnay/rust-toolchain@stable with: toolchain: 1.63 + - uses: actions/download-artifact@v3 + with: + name: capi-x86_64-unknown-linux-musl - name: cargo xtask test-capi run: | cargo test-capi @@ -577,12 +585,16 @@ jobs: test_capi_macos_x86: name: test capi on macos-x86 runs-on: macos-11 + needs: [build_capi_macos_x86] steps: - uses: actions/checkout@v3 - name: Install Rust uses: dtolnay/rust-toolchain@stable with: toolchain: 1.63 + - uses: actions/download-artifact@v3 + with: + name: capi-x86_64-apple-darwin - name: cargo xtask test-capi run: | cargo test-capi @@ -592,6 +604,7 @@ jobs: test_capi_macos_arm: name: test capi on macos-arm runs-on: macos-11.0 + needs: [build_capi_macos_arm] steps: - uses: actions/checkout@v3 - name: Install Rust @@ -599,6 +612,9 @@ jobs: with: toolchain: 1.63 target: aarch64-apple-darwin + - uses: actions/download-artifact@v3 + with: + name: capi-aarch64-apple-darwin - name: cargo xtask test-capi run: | cargo test-capi @@ -608,12 +624,16 @@ jobs: test_capi_windows_x86: name: test capi on windows-x64 runs-on: windows-2019 + needs: [build_capi_windows_x86] steps: - uses: actions/checkout@v3 - name: Install Rust uses: dtolnay/rust-toolchain@stable with: toolchain: 1.63 + - uses: actions/download-artifact@v3 + with: + name: capi-x86_64-pc-windows-msvc - name: cargo xtask test-capi run: | cargo test-capi @@ -636,6 +656,12 @@ jobs: uses: dtolnay/rust-toolchain@stable with: toolchain: 1.63 + - uses: actions/download-artifact@v3 + with: + name: capi-x86_64-unknown-linux-gnu + - uses: actions/download-artifact@v3 + with: + name: wasmer-cli-x86_64-unknown-linux-gnu - name: cargo xtask test-integration run: | cargo test-integration @@ -654,6 +680,12 @@ jobs: uses: dtolnay/rust-toolchain@stable with: toolchain: 1.63 + - uses: actions/download-artifact@v3 + with: + name: capi-x86_64-unknown-linux-musl + - uses: actions/download-artifact@v3 + with: + name: wasmer-cli-x86_64-unknown-linux-musl - name: cargo xtask test-integration run: | cargo test-integration @@ -668,6 +700,32 @@ jobs: uses: dtolnay/rust-toolchain@stable with: toolchain: 1.63 + - uses: actions/download-artifact@v3 + with: + name: capi-x86_64-apple-darwin + - uses: actions/download-artifact@v3 + with: + name: wasmer-cli-x86_64-apple-darwin + - name: cargo xtask test-integration + run: | + cargo test-integration + + test_integration_macos_arm: + name: integration tests on macos-x86 + runs-on: macos-11 + needs: [build_wasmer_macos_arm, build_capi_macos_arm] + steps: + - uses: actions/checkout@v3 + - name: Install Rust + uses: dtolnay/rust-toolchain@stable + with: + toolchain: 1.63 + - uses: actions/download-artifact@v3 + with: + name: capi-aarch64-apple-darwin + - uses: actions/download-artifact@v3 + with: + name: wasmer-cli-aarch64-apple-darwin - name: cargo xtask test-integration run: | cargo test-integration @@ -682,100 +740,12 @@ jobs: uses: dtolnay/rust-toolchain@stable with: toolchain: 1.63 + - uses: actions/download-artifact@v3 + with: + name: capi-x86_64-pc-windows-msvc + - uses: actions/download-artifact@v3 + with: + name: wasmer-cli-x86_64-pc-windows-msvc - name: cargo xtask test-integration run: | cargo test-integration - - # release step, only run if DOING_RELEASE is present - release: - # needs: [setup, build, linux_aarch64, windows_gnu] - runs-on: ubuntu-latest - if: needs.setup.outputs.DOING_RELEASE == '1' || github.event.inputs.release != '' - steps: - - name: Download the Artifacts - uses: actions/download-artifact@v2 - with: - path: artifacts - - name: Create Release - id: create_release - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - tag_name: ${{ needs.setup.outputs.VERSION }} - release_name: Release ${{ needs.setup.outputs.VERSION }} - draft: true - prerelease: false - - name: Upload Release Asset Windows Installer - 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-windows-amd64/WasmerInstaller.exe - asset_name: wasmer-windows.exe - asset_content_type: application/vnd.microsoft.portable-executable - - name: Upload Release Asset Windows - 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-windows-amd64/wasmer.tar.gz - asset_name: wasmer-windows-amd64.tar.gz - asset_content_type: application/gzip - - name: Upload Release Asset 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-linux-amd64/wasmer.tar.gz - asset_name: wasmer-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 Windows gnu64 - 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-windows-gnu64/wasmer.tar.gz - asset_name: wasmer-windows-gnu64.tar.gz - asset_content_type: application/gzip - - name: Upload Release Asset Linux amd64 (musl) - id: upload-release-asset-linux-musl-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-linux-musl-amd64/wasmer.tar.gz - asset_name: wasmer-linux-musl-amd64.tar.gz - asset_content_type: application/gzip - - name: Upload Release Asset Mac 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-darwin-amd64/wasmer.tar.gz - asset_name: wasmer-darwin-amd64.tar.gz - asset_content_type: application/gzip - - name: Upload Release Asset Mac arm64 - 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-darwin-arm64/wasmer.tar.gz - asset_name: wasmer-darwin-arm64.tar.gz - asset_content_type: application/gzip From d53bfaeeaef64b4e1c5b5cf2205b03775b56a213 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Thu, 24 Nov 2022 13:11:01 +0100 Subject: [PATCH 038/226] Fix LLVM installation on Windows --- .github/workflows/test.yaml | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 1a49c47d820..afdbaa68c00 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -253,12 +253,14 @@ jobs: - name: Install LLVM shell: bash run: | - choco install llvm --version ${{ env.LLVM_VERSION }} --allow-downgrade - cd 'C:\Program Files\LLVM\' - LLVM_DIR=$(pwd) + LLVM_DIR=$(pwd)/${{ env.LLVM_DIR }} + mkdir -p ${LLVM_DIR} + curl --proto '=https' --tlsv1.2 -sSf "${{ env.LLVM_URL }}" -L -o - | tar xJv -C ${LLVM_DIR} + echo "${LLVM_DIR}/bin" >> $GITHUB_PATH echo "LLVM_SYS_120_PREFIX=${LLVM_DIR}" >> $GITHUB_ENV env: - LLVM_VERSION: 13.0.0 + LLVM_DIR: .llvm + LLVM_URL: https://github.com/wasmerio/llvm-custom-builds/releases/download/13.x/llvm-windows-amd64.tar.xz - name: cargo xtask build-wasmer run: | cargo build-wasmer @@ -521,12 +523,14 @@ jobs: - name: Install LLVM shell: bash run: | - choco install llvm --version ${{ env.LLVM_VERSION }} --allow-downgrade - cd 'C:\Program Files\LLVM\' - LLVM_DIR=$(pwd) + LLVM_DIR=$(pwd)/${{ env.LLVM_DIR }} + mkdir -p ${LLVM_DIR} + curl --proto '=https' --tlsv1.2 -sSf "${{ env.LLVM_URL }}" -L -o - | tar xJv -C ${LLVM_DIR} + echo "${LLVM_DIR}/bin" >> $GITHUB_PATH echo "LLVM_SYS_120_PREFIX=${LLVM_DIR}" >> $GITHUB_ENV env: - LLVM_VERSION: 13.0.0 + LLVM_DIR: .llvm + LLVM_URL: https://github.com/wasmerio/llvm-custom-builds/releases/download/13.x/llvm-windows-amd64.tar.xz - name: cargo xtask test-wasmer run: | cargo test-wasmer From 1be6f06c5958e8c6115f027c7ceebaaf136929b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Thu, 24 Nov 2022 14:57:44 +0100 Subject: [PATCH 039/226] Add LLVM_SYS_120_PREFIX --- .github/workflows/test.yaml | 77 +++++++++++----- xtask/xtask-build-wasmer/src/main.rs | 4 + xtask/xtask-test-wasmer/src/main.rs | 128 +++++++++++++++++++-------- 3 files changed, 147 insertions(+), 62 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index afdbaa68c00..21b6638d1ce 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -131,6 +131,7 @@ jobs: cargo build-wasmer env: COMPILERS: cranelift,llvm,singlepass + LLVM_SYS_120_PREFIX: ${{ env.LLVM_SYS_120_PREFIX }} - name: Archive production artifacts uses: actions/upload-artifact@v3 with: @@ -196,6 +197,7 @@ jobs: cargo build-wasmer env: COMPILERS: cranelift,llvm,singlepass + LLVM_SYS_120_PREFIX: ${{ env.LLVM_SYS_120_PREFIX }} - name: Archive production artifacts uses: actions/upload-artifact@v3 with: @@ -233,6 +235,7 @@ jobs: env: COMPILERS: cranelift,llvm,singlepass CARGO_TARGET: aarch64-apple-darwin + LLVM_SYS_120_PREFIX: ${{ env.LLVM_SYS_120_PREFIX }} - name: Archive production artifacts uses: actions/upload-artifact@v3 with: @@ -266,6 +269,7 @@ jobs: cargo build-wasmer env: COMPILERS: cranelift,llvm,singlepass + LLVM_SYS_120_PREFIX: ${{ env.LLVM_SYS_120_PREFIX }} - name: Archive production artifacts uses: actions/upload-artifact@v3 with: @@ -415,6 +419,9 @@ jobs: test_wasmer_linux_x64: name: test wasmer on linux-x86_64-gnu runs-on: ubuntu-18.04 + strategy: + matrix: + stage: [1,2,3,4,5,6,7] steps: - uses: actions/checkout@v3 - name: Set up libstdc++ on Linux @@ -442,11 +449,16 @@ jobs: cargo test-wasmer env: COMPILERS: cranelift,llvm,singlepass + STAGE: ${{ matrix.stage }} + LLVM_SYS_120_PREFIX: ${{ env.LLVM_SYS_120_PREFIX }} test_wasmer_linux_musl: name: test wasmer on linux-x86_64-musl runs-on: ubuntu-latest container: alpine:latest + strategy: + matrix: + stage: [1,2,3,4,5,6,7] steps: - uses: actions/checkout@v3 - name: Set up base deps on musl @@ -461,36 +473,45 @@ jobs: cargo test-wasmer env: COMPILERS: cranelift,singlepass # no llvm + STAGE: ${{ matrix.stage }} test_wasmer_macos_x86: name: test wasmer on macos-x86 runs-on: macos-11 - steps: - - uses: actions/checkout@v3 - - name: Install Rust - uses: dtolnay/rust-toolchain@stable - with: - toolchain: 1.63 - - name: Install LLVM - shell: bash - run: | - LLVM_DIR=$(pwd)/${{ env.LLVM_DIR }} - mkdir -p ${LLVM_DIR} - curl --proto '=https' --tlsv1.2 -sSf "${{ env.LLVM_URL }}" -L -o - | tar xJv -C ${LLVM_DIR} - echo "${LLVM_DIR}/bin" >> $GITHUB_PATH - echo "LLVM_SYS_120_PREFIX=${LLVM_DIR}" >> $GITHUB_ENV - env: - LLVM_DIR: .llvm - LLVM_URL: https://github.com/wasmerio/llvm-custom-builds/releases/download/13.x/llvm-darwin-amd64.tar.xz - - name: cargo xtask test-wasmer - run: | - cargo test-wasmer - env: - COMPILERS: cranelift,llvm,singlepass + strategy: + matrix: + stage: [1,2,3,4,5,6,7] + steps: + - uses: actions/checkout@v3 + - name: Install Rust + uses: dtolnay/rust-toolchain@stable + with: + toolchain: 1.63 + - name: Install LLVM + shell: bash + run: | + LLVM_DIR=$(pwd)/${{ env.LLVM_DIR }} + mkdir -p ${LLVM_DIR} + curl --proto '=https' --tlsv1.2 -sSf "${{ env.LLVM_URL }}" -L -o - | tar xJv -C ${LLVM_DIR} + echo "${LLVM_DIR}/bin" >> $GITHUB_PATH + echo "LLVM_SYS_120_PREFIX=${LLVM_DIR}" >> $GITHUB_ENV + env: + LLVM_DIR: .llvm + LLVM_URL: https://github.com/wasmerio/llvm-custom-builds/releases/download/13.x/llvm-darwin-amd64.tar.xz + - name: cargo xtask test-wasmer + run: | + cargo test-wasmer + env: + COMPILERS: cranelift,llvm,singlepass + STAGE: ${{ matrix.stage }} + LLVM_SYS_120_PREFIX: ${{ env.LLVM_SYS_120_PREFIX }} test_wasmer_macos_arm: name: test wasmer on macos-x86 runs-on: macos-11 + strategy: + matrix: + stage: [1,2,3,4,5,6,7] steps: - uses: actions/checkout@v3 - name: Install Rust @@ -510,10 +531,15 @@ jobs: cargo test-wasmer env: COMPILERS: cranelift,llvm,singlepass + STAGE: ${{ matrix.stage }} + LLVM_SYS_120_PREFIX: ${{ env.LLVM_SYS_120_PREFIX }} test_wasmer_windows_x86: name: test wasmer on windows-x64 runs-on: windows-2019 + strategy: + matrix: + stage: [1,2,3,4,5,6,7] steps: - uses: actions/checkout@v3 - name: Install Rust @@ -536,6 +562,8 @@ jobs: cargo test-wasmer env: COMPILERS: cranelift,llvm,singlepass + STAGE: ${{ matrix.stage }} + LLVM_SYS_120_PREFIX: ${{ env.LLVM_SYS_120_PREFIX }} # test-capi: run unit test for capi, depends on build-capi step # (can run in parallel with build-wasmer step) @@ -715,7 +743,7 @@ jobs: cargo test-integration test_integration_macos_arm: - name: integration tests on macos-x86 + name: integration tests on macos-arm runs-on: macos-11 needs: [build_wasmer_macos_arm, build_capi_macos_arm] steps: @@ -724,6 +752,7 @@ jobs: uses: dtolnay/rust-toolchain@stable with: toolchain: 1.63 + target: aarch64-apple-darwin - uses: actions/download-artifact@v3 with: name: capi-aarch64-apple-darwin @@ -733,6 +762,8 @@ jobs: - name: cargo xtask test-integration run: | cargo test-integration + env: + CARGO_TARGET: aarch64-apple-darwin test_integration_windows_x86: name: integration tests on windows-x64 diff --git a/xtask/xtask-build-wasmer/src/main.rs b/xtask/xtask-build-wasmer/src/main.rs index 89bbe3c4f90..50e1d97a1cd 100644 --- a/xtask/xtask-build-wasmer/src/main.rs +++ b/xtask/xtask-build-wasmer/src/main.rs @@ -43,6 +43,10 @@ fn package_wasmer(out: &PathBuf) { fn main() { let compilers = env::var("COMPILERS").unwrap_or_else(|_| "cranelift".to_string()); + if compilers.contains("llvm") && env::var("LLVM_SYS_120_PREFIX").is_err() { + // don't even try to compile anything, just fail early + panic!("LLVM_SYS_120_PREFIX not set"); + } let cargo = env::var("CARGO").unwrap_or_else(|_| "cargo".to_string()); let mut compiler_features = compilers .replace(' ', ",") diff --git a/xtask/xtask-test-wasmer/src/main.rs b/xtask/xtask-test-wasmer/src/main.rs index 8f78a55aa1d..7b38eb367d5 100644 --- a/xtask/xtask-test-wasmer/src/main.rs +++ b/xtask/xtask-test-wasmer/src/main.rs @@ -38,6 +38,8 @@ fn start_test(args: &[&str]) { fn main() { let compilers = env::var("COMPILERS").unwrap_or_else(|_| "cranelift".to_string()); + let stage = env::var("STAGE").unwrap_or_else(|_| "all".to_string()); + let mut compiler_features = compilers .replace(' ', ",") .split(',') @@ -60,43 +62,91 @@ fn main() { exclude_tests.push("wasmer-compiler-llvm"); } - let exclude_tests = exclude_tests.join("--exclude "); - - start_test(&[ - "test", - "--release", - "--tests", - "--features", - "cranelift", - "--features", - &compiler_features, - ]); - - start_test(&[ - "test", - "--all", - "--release", - &exclude_tests, - "--features", - "cranelift", - ]); - - start_test(&[ - "test", - &compiler_features, - "--features", - "wasi,cranelift", - "--examples", - ]); - - start_test(&[ - "test", - &compiler_features, - "--features", - "wasi,cranelift", - "--examples", - "--release", // <- - ]); - - start_test(&["test", "--doc", "--all", "--features", "cranelift,std"]); + let exclude_tests = exclude_tests.join(" --exclude "); + + // cargo test --release --tests --features cranelift,singlepass, + // wasmer-artifact-create,static-artifact-create,wasmer-artifact-load,static-artifact-load + if stage == "1" || stage == "all" { + start_test(&[ + "test", + "--release", + "--tests", + "--features", + &format!("{compiler_features},wasmer-artifact-create,static-artifact-create,wasmer-artifact-load,static-artifact-load"), + ]); + } + + if stage == "2" || stage == "all" { + // cargo test --all --release --exclude wasmer-c-api --exclude wasmer-cli --exclude wasmer-compiler-cli --exclude wasmer-wasi-experimental-io-devices --exclude wasmer-integration-tests-cli + // --exclude wasmer-integration-tests-ios --exclude wasmer-compiler-llvm + let f = format!("{compiler_features},wasmer-artifact-create,static-artifact-create,wasmer-artifact-load,static-artifact-load"); + let mut args = vec!["test", "--all", "--features", &f, "--release"]; + for i in exclude_tests.split_whitespace() { + args.push(i); + } + start_test(&args); + } + + if stage == "3" || stage == "all" { + // cargo test --manifest-path lib/compiler-cranelift/Cargo.toml --release --no-default-features --features=std + // cargo test --manifest-path lib/compiler-singlepass/Cargo.toml --release --no-default-features --features=std + for compiler in compilers.split(',') { + start_test(&[ + "test", + "--manifest-path", + &format!("lib/compiler-{compiler}/Cargo.toml"), + "--release", + "--no-default-features", + "--features=std", + ]); + } + } + + // cargo test --manifest-path lib/cli/Cargo.toml --features cranelift,singlepass,wasmer-artifact-create,static-artifact-create,wasmer-artifact-load,static-artifact-load --release + if stage == "4" || stage == "all" { + start_test(&[ + "test", + "--manifest-path", + "lib/cli/Cargo.toml", + "--features", + &format!("{compiler_features},wasmer-artifact-create,static-artifact-create,wasmer-artifact-load,static-artifact-load"), + "--features", + "wasi", + "--examples", + ]); + } + + if stage == "5" || stage == "all" { + // cargo test --features cranelift,singlepass,wasmer-artifact-create,static-artifact-create,wasmer-artifact-load,static-artifact-load --features wasi --examples + start_test(&[ + "test", + "--features", + &format!("{compiler_features},wasmer-artifact-create,static-artifact-create,wasmer-artifact-load,static-artifact-load"), + "--features", + "wasi", + "--examples", + ]); + } + + if stage == "6" || stage == "all" { + // cargo test --release --features cranelift,singlepass,wasmer-artifact-create,static-artifact-create,wasmer-artifact-load,static-artifact-load --features wasi --examples + start_test(&[ + "test", + &format!("{compiler_features},wasmer-artifact-create,static-artifact-create,wasmer-artifact-load,static-artifact-load"), + "--features", + "wasi", + "--examples", + "--release", // <- + ]); + } + + if stage == "7" || stage == "all" { + start_test(&[ + "test", + "--doc", + "--all", + "--features", + &format!("{compiler_features},wasmer-artifact-create,static-artifact-create,wasmer-artifact-load,static-artifact-load"), + ]); + } } From 4f6eb12efeae435d8d5473250eeb556dae3ce46b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Thu, 24 Nov 2022 14:59:29 +0100 Subject: [PATCH 040/226] Fix indentation error in workflow file --- .github/workflows/test.yaml | 48 ++++++++++++++++++------------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 21b6638d1ce..b87d6b89300 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -481,30 +481,30 @@ jobs: strategy: matrix: stage: [1,2,3,4,5,6,7] - steps: - - uses: actions/checkout@v3 - - name: Install Rust - uses: dtolnay/rust-toolchain@stable - with: - toolchain: 1.63 - - name: Install LLVM - shell: bash - run: | - LLVM_DIR=$(pwd)/${{ env.LLVM_DIR }} - mkdir -p ${LLVM_DIR} - curl --proto '=https' --tlsv1.2 -sSf "${{ env.LLVM_URL }}" -L -o - | tar xJv -C ${LLVM_DIR} - echo "${LLVM_DIR}/bin" >> $GITHUB_PATH - echo "LLVM_SYS_120_PREFIX=${LLVM_DIR}" >> $GITHUB_ENV - env: - LLVM_DIR: .llvm - LLVM_URL: https://github.com/wasmerio/llvm-custom-builds/releases/download/13.x/llvm-darwin-amd64.tar.xz - - name: cargo xtask test-wasmer - run: | - cargo test-wasmer - env: - COMPILERS: cranelift,llvm,singlepass - STAGE: ${{ matrix.stage }} - LLVM_SYS_120_PREFIX: ${{ env.LLVM_SYS_120_PREFIX }} + steps: + - uses: actions/checkout@v3 + - name: Install Rust + uses: dtolnay/rust-toolchain@stable + with: + toolchain: 1.63 + - name: Install LLVM + shell: bash + run: | + LLVM_DIR=$(pwd)/${{ env.LLVM_DIR }} + mkdir -p ${LLVM_DIR} + curl --proto '=https' --tlsv1.2 -sSf "${{ env.LLVM_URL }}" -L -o - | tar xJv -C ${LLVM_DIR} + echo "${LLVM_DIR}/bin" >> $GITHUB_PATH + echo "LLVM_SYS_120_PREFIX=${LLVM_DIR}" >> $GITHUB_ENV + env: + LLVM_DIR: .llvm + LLVM_URL: https://github.com/wasmerio/llvm-custom-builds/releases/download/13.x/llvm-darwin-amd64.tar.xz + - name: cargo xtask test-wasmer + run: | + cargo test-wasmer + env: + COMPILERS: cranelift,llvm,singlepass + STAGE: ${{ matrix.stage }} + LLVM_SYS_120_PREFIX: ${{ env.LLVM_SYS_120_PREFIX }} test_wasmer_macos_arm: name: test wasmer on macos-x86 From 3d4fcaf5f26ab563320907d3de18f814eaafc53c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Thu, 24 Nov 2022 15:07:18 +0100 Subject: [PATCH 041/226] Use fail-fast: false for testing matrix --- .github/workflows/test.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index b87d6b89300..7676acbec6e 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -420,6 +420,7 @@ jobs: name: test wasmer on linux-x86_64-gnu runs-on: ubuntu-18.04 strategy: + fail-fast: false matrix: stage: [1,2,3,4,5,6,7] steps: @@ -457,6 +458,7 @@ jobs: runs-on: ubuntu-latest container: alpine:latest strategy: + fail-fast: false matrix: stage: [1,2,3,4,5,6,7] steps: @@ -479,6 +481,7 @@ jobs: name: test wasmer on macos-x86 runs-on: macos-11 strategy: + fail-fast: false matrix: stage: [1,2,3,4,5,6,7] steps: @@ -510,6 +513,7 @@ jobs: name: test wasmer on macos-x86 runs-on: macos-11 strategy: + fail-fast: false matrix: stage: [1,2,3,4,5,6,7] steps: @@ -538,6 +542,7 @@ jobs: name: test wasmer on windows-x64 runs-on: windows-2019 strategy: + fail-fast: false matrix: stage: [1,2,3,4,5,6,7] steps: From 1093faf8e4bafd0e00105301989c1526e5ff32bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Fri, 25 Nov 2022 12:22:30 +0100 Subject: [PATCH 042/226] Delete cargo xtasks (are going to be re-added in a separate PR) --- xtask/xtask-build-capi/Cargo.toml | 10 -- xtask/xtask-build-capi/src/main.rs | 132 -------------------- xtask/xtask-build-wasmer/Cargo.toml | 10 -- xtask/xtask-build-wasmer/src/main.rs | 98 --------------- xtask/xtask-test-capi/Cargo.toml | 9 -- xtask/xtask-test-capi/src/main.rs | 130 ------------------- xtask/xtask-test-integration/Cargo.toml | 9 -- xtask/xtask-test-integration/src/main.rs | 81 ------------ xtask/xtask-test-js-core/Cargo.toml | 8 -- xtask/xtask-test-js-core/src/main.rs | 13 -- xtask/xtask-test-js/Cargo.toml | 8 -- xtask/xtask-test-js/src/main.rs | 13 -- xtask/xtask-test-wasmer/Cargo.toml | 8 -- xtask/xtask-test-wasmer/src/main.rs | 152 ----------------------- 14 files changed, 681 deletions(-) delete mode 100644 xtask/xtask-build-capi/Cargo.toml delete mode 100644 xtask/xtask-build-capi/src/main.rs delete mode 100644 xtask/xtask-build-wasmer/Cargo.toml delete mode 100644 xtask/xtask-build-wasmer/src/main.rs delete mode 100644 xtask/xtask-test-capi/Cargo.toml delete mode 100644 xtask/xtask-test-capi/src/main.rs delete mode 100644 xtask/xtask-test-integration/Cargo.toml delete mode 100644 xtask/xtask-test-integration/src/main.rs delete mode 100644 xtask/xtask-test-js-core/Cargo.toml delete mode 100644 xtask/xtask-test-js-core/src/main.rs delete mode 100644 xtask/xtask-test-js/Cargo.toml delete mode 100644 xtask/xtask-test-js/src/main.rs delete mode 100644 xtask/xtask-test-wasmer/Cargo.toml delete mode 100644 xtask/xtask-test-wasmer/src/main.rs diff --git a/xtask/xtask-build-capi/Cargo.toml b/xtask/xtask-build-capi/Cargo.toml deleted file mode 100644 index ffffeffd6f5..00000000000 --- a/xtask/xtask-build-capi/Cargo.toml +++ /dev/null @@ -1,10 +0,0 @@ -[package] -name = "xtask-build-capi" -version = "0.1.0" -edition = "2021" - -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - -[dependencies] -flate2 = "1.0.24" -tar = "0.4.38" \ No newline at end of file diff --git a/xtask/xtask-build-capi/src/main.rs b/xtask/xtask-build-capi/src/main.rs deleted file mode 100644 index f4dec804561..00000000000 --- a/xtask/xtask-build-capi/src/main.rs +++ /dev/null @@ -1,132 +0,0 @@ -use std::env; -use std::path::{Path, PathBuf}; -use std::process::{Command, Stdio}; - -fn project_root() -> PathBuf { - Path::new(&env!("CARGO_MANIFEST_DIR")) - .ancestors() - .nth(2) - .unwrap() - .to_path_buf() -} - -fn package_capi(out: &PathBuf) { - use flate2::write::GzEncoder; - use flate2::Compression; - use std::fs::File; - let tar = File::create(out).unwrap(); - let enc = GzEncoder::new(tar, Compression::none()); - let mut a = tar::Builder::new(enc); - - let in_dir = project_root(); - let lib_dir = project_root().join("package").join("lib"); - let include_dir = project_root().join("package").join("include"); - let release_dir = match std::env::var("CARGO_TARGET") { - Ok(o) => in_dir.join("target").join(o).join("release"), - Err(_) => in_dir.join("target").join("release"), - }; - - std::fs::create_dir_all(&lib_dir).unwrap(); - std::fs::create_dir_all(&include_dir).unwrap(); - - std::fs::copy( - project_root().join("lib").join("c-api").join("wasmer.h"), - include_dir.join("wasmer.h"), - ) - .unwrap(); - std::fs::copy( - project_root() - .join("lib") - .join("c-api") - .join("wasmer_wasm.h"), - include_dir.join("wasmer_wasm.h"), - ) - .unwrap(); - std::fs::copy( - project_root() - .join("lib") - .join("c-api") - .join("tests") - .join("wasm-c-api") - .join("include") - .join("wasm.h"), - include_dir.join("wasm.h"), - ) - .unwrap(); - std::fs::copy( - project_root().join("lib").join("c-api").join("README.md"), - include_dir.join("README.md"), - ) - .unwrap(); - - let _ = std::fs::copy(release_dir.join("wasmer.dll"), lib_dir.join("wasmer.dll")); - let _ = std::fs::copy( - release_dir.join("wasmer.dll.lib"), - lib_dir.join("wasmer.dll.lib"), - ); - let _ = std::fs::copy(release_dir.join("wasmer.lib"), lib_dir.join("wasmer.lib")); - let _ = std::fs::copy( - release_dir.join("libwasmer.dylib"), - lib_dir.join("libwasmer.dylib"), - ); - let _ = std::fs::copy( - release_dir.join("libwasmer.so"), - lib_dir.join("libwasmer.so"), - ); - let _ = std::fs::copy(release_dir.join("libwasmer.a"), lib_dir.join("libwasmer.a")); - - a.append_dir_all("lib", &lib_dir).unwrap(); - a.append_dir_all("include", &include_dir).unwrap(); - a.finish().unwrap(); -} - -fn main() { - let compilers = env::var("COMPILERS").unwrap_or_else(|_| "cranelift".to_string()); - let cargo = env::var("CARGO").unwrap_or_else(|_| "cargo".to_string()); - let mut capi_compiler_features = compilers - .replace(' ', ",") - .split(',') - .filter(|i| *i != "llvm") - .collect::>() - .join(","); - if !capi_compiler_features.is_empty() { - capi_compiler_features.push(','); - }; - let mut cmd = Command::new(cargo); - cmd.current_dir(project_root()); - cmd.stdin(Stdio::null()); - cmd.stdout(Stdio::inherit()); - cmd.stderr(Stdio::inherit()); - cmd.args(&[ - "build", - "--release", - "--manifest-path", - "lib/c-api/Cargo.toml", - "--no-default-features", - "--features", - "wat,compiler,wasi,middlewares,webc_runner", - "--features", - &format!("{capi_compiler_features}wasmer-artifact-create,static-artifact-create,wasmer-artifact-load,static-artifact-load"), - ]); - - if let Ok(target) = std::env::var("CARGO_TARGET") { - cmd.args(&["--target", &target]); - } - - println!("running {cmd:?}"); - - let cmd = cmd.output().unwrap(); - - if !cmd.status.success() { - println!("build capi paniced with status {}", cmd.status); - println!("stdout: {}", String::from_utf8_lossy(&cmd.stdout)); - println!("stderr: {}", String::from_utf8_lossy(&cmd.stdout)); - panic!("build capi failed"); - } - - println!("build capi succeeded, compilers = {compilers}"); - - let out_path = project_root().join("build-capi.tar.gz"); - package_capi(&out_path); - println!("packaged to {}", out_path.display()); -} diff --git a/xtask/xtask-build-wasmer/Cargo.toml b/xtask/xtask-build-wasmer/Cargo.toml deleted file mode 100644 index 17e6c787966..00000000000 --- a/xtask/xtask-build-wasmer/Cargo.toml +++ /dev/null @@ -1,10 +0,0 @@ -[package] -name = "xtask-build-wasmer" -version = "0.1.0" -edition = "2021" - -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - -[dependencies] -flate2 = "1.0.24" -tar = "0.4.38" \ No newline at end of file diff --git a/xtask/xtask-build-wasmer/src/main.rs b/xtask/xtask-build-wasmer/src/main.rs deleted file mode 100644 index 50e1d97a1cd..00000000000 --- a/xtask/xtask-build-wasmer/src/main.rs +++ /dev/null @@ -1,98 +0,0 @@ -use std::env; -use std::path::{Path, PathBuf}; -use std::process::{Command, Stdio}; - -fn project_root() -> PathBuf { - Path::new(&env!("CARGO_MANIFEST_DIR")) - .ancestors() - .nth(2) - .unwrap() - .to_path_buf() -} - -fn package_wasmer(out: &PathBuf) { - use flate2::write::GzEncoder; - use flate2::Compression; - use std::fs::File; - let tar = File::create(out).unwrap(); - let enc = GzEncoder::new(tar, Compression::none()); - let mut a = tar::Builder::new(enc); - - let in_dir = project_root(); - let bin_dir = project_root().join("package").join("bin"); - let release_dir = match std::env::var("CARGO_TARGET") { - Ok(o) => in_dir.join("target").join(o).join("release"), - Err(_) => in_dir.join("target").join("release"), - }; - - std::fs::create_dir_all(&bin_dir).unwrap(); - - let libwasmer_path = release_dir.join("wasmer"); - if libwasmer_path.exists() { - std::fs::copy(&libwasmer_path, bin_dir.join("wasmer")).unwrap(); - } - - let libwasmer_path = release_dir.join("wasmer.exe"); - if libwasmer_path.exists() { - std::fs::copy(&libwasmer_path, bin_dir.join("wasmer.exe")).unwrap(); - } - - a.append_dir_all("bin", &bin_dir).unwrap(); - a.finish().unwrap(); -} - -fn main() { - let compilers = env::var("COMPILERS").unwrap_or_else(|_| "cranelift".to_string()); - if compilers.contains("llvm") && env::var("LLVM_SYS_120_PREFIX").is_err() { - // don't even try to compile anything, just fail early - panic!("LLVM_SYS_120_PREFIX not set"); - } - let cargo = env::var("CARGO").unwrap_or_else(|_| "cargo".to_string()); - let mut compiler_features = compilers - .replace(' ', ",") - .split(',') - .collect::>() - .join(","); - if !compiler_features.is_empty() { - compiler_features.push(','); - }; - let mut cmd = Command::new(cargo); - cmd.current_dir(project_root()); - cmd.stdin(Stdio::null()); - cmd.stdout(Stdio::inherit()); - cmd.stderr(Stdio::inherit()); - cmd.args(&[ - "build", - "--release", - "--manifest-path", - "lib/cli/Cargo.toml", - "--features", - "webc_runner", - "--features", - &format!("{compiler_features}wasmer-artifact-create,static-artifact-create,wasmer-artifact-load,static-artifact-load"), - "--bin", - "wasmer", - ]); - - if let Ok(target) = std::env::var("CARGO_TARGET") { - cmd.args(&["--target", &target]); - } - - println!("running {cmd:?}"); - - let cmd = cmd.output().unwrap(); - - if !cmd.status.success() { - println!("build capi paniced with status {}", cmd.status); - println!("stdout: {}", String::from_utf8_lossy(&cmd.stdout)); - println!("stderr: {}", String::from_utf8_lossy(&cmd.stdout)); - panic!("build capi failed"); - } - - println!("build wasmer succeeded, compilers = {compilers}"); - - let out_path = project_root().join("build-wasmer.tar.gz"); - package_wasmer(&out_path); - - println!("packaged to = {}", out_path.display()); -} diff --git a/xtask/xtask-test-capi/Cargo.toml b/xtask/xtask-test-capi/Cargo.toml deleted file mode 100644 index 2405057c96b..00000000000 --- a/xtask/xtask-test-capi/Cargo.toml +++ /dev/null @@ -1,9 +0,0 @@ -[package] -name = "xtask-test-capi" -version = "0.1.0" -edition = "2021" - -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - -[dependencies] -wasmer-registry = { version = "3.0.1", path = "../../lib/registry" } \ No newline at end of file diff --git a/xtask/xtask-test-capi/src/main.rs b/xtask/xtask-test-capi/src/main.rs deleted file mode 100644 index 285f7c58055..00000000000 --- a/xtask/xtask-test-capi/src/main.rs +++ /dev/null @@ -1,130 +0,0 @@ -use std::env; -use std::path::{Path, PathBuf}; -use std::process::{Command, Stdio}; - -fn project_root() -> PathBuf { - Path::new(&env!("CARGO_MANIFEST_DIR")) - .ancestors() - .nth(2) - .unwrap() - .to_path_buf() -} - -fn start_test(args: &[&str], env_vars: &[(&str, String)]) { - let args = args.iter().map(|s| s.to_string()).collect::>(); - let cargo = env::var("CARGO").unwrap_or_else(|_| "cargo".to_string()); - let compilers = env::var("COMPILERS").unwrap_or_else(|_| "cranelift".to_string()); - - let mut cmd = Command::new(&cargo); - cmd.current_dir(project_root()); - cmd.stdin(Stdio::null()); - cmd.stdout(Stdio::inherit()); - cmd.stderr(Stdio::inherit()); - cmd.args(args); - for (k, v) in env_vars { - cmd.env(k, v); - } - - if let Ok(target) = std::env::var("CARGO_TARGET") { - cmd.args(&["--target", &target]); - } - - println!("running {cmd:?}"); - - let cmd = cmd.output().unwrap(); - - if !cmd.status.success() { - println!("test capi paniced with status {}", cmd.status); - println!("stdout: {}", String::from_utf8_lossy(&cmd.stdout)); - println!("stderr: {}", String::from_utf8_lossy(&cmd.stdout)); - panic!("test capi failed"); - } - - println!("{cmd:?} succeeded, compilers = {compilers}"); -} - -fn main() { - std::fs::create_dir_all(project_root().join("package")).expect("could not create package dir"); - - wasmer_registry::try_unpack_targz( - project_root().join("build-capi.tar.gz"), - project_root().join("package"), - false, - ) - .expect("could not unpack build-capi.tar.gz, run cargo build-capi first!"); - - let compilers = env::var("COMPILERS").unwrap_or_else(|_| "cranelift".to_string()); - let capi_compiler_features = compilers - .replace(' ', ",") - .split(',') - .filter(|i| *i != "llvm") - .map(|s| s.to_string()) - .collect::>(); - - // we only have one engine - let capi_compiler_engines = capi_compiler_features - .iter() - .map(|f| format!("{f}-universal")) - .collect::>(); - - for engine in capi_compiler_engines { - let envs = &[ - ( - "WASMER_DIR", - format!("{}", project_root().join("package").display()), - ), - ("ROOT_DIR", format!("{}", project_root().display())), - ("WASMER_CAPI_CONFIG", engine.to_string()), - ]; - - // run capi test - start_test( - &[ - "test", - "--manifest-path", - &format!("{}/lib/c-api/Cargo.toml", project_root().display()), - "--release", - "--no-default-features", - "--features", - "wat,compiler,wasi,middlewares,webc_runner", - "--features", - &capi_compiler_features.join(","), - "--", - "--nocapture", - ], - envs, - ); - - // run integration tests - - // cargo test --manifest-path="lib/c-api/tests/wasmer-c-api-test-runner/Cargo.toml" - start_test( - &[ - "test", - "--manifest-path", - &format!( - "{}/lib/c-api/tests/wasmer-c-api-test-runner/Cargo.toml", - project_root().display() - ), - "--", - "--nocapture", - ], - envs, - ); - - // cargo test --manifest-path="lib/c-api/examples/wasmer-capi-examples-runner/Cargo.toml" - start_test( - &[ - "test", - "--manifest-path", - &format!( - "{}/lib/c-api/examples/wasmer-capi-examples-runner/Cargo.toml", - project_root().display() - ), - "--", - "--nocapture", - ], - envs, - ); - } -} diff --git a/xtask/xtask-test-integration/Cargo.toml b/xtask/xtask-test-integration/Cargo.toml deleted file mode 100644 index 5bb8f9883a2..00000000000 --- a/xtask/xtask-test-integration/Cargo.toml +++ /dev/null @@ -1,9 +0,0 @@ -[package] -name = "xtask-test-integration" -version = "0.1.0" -edition = "2021" - -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - -[dependencies] -wasmer-registry = { version = "3.0.1", path = "../../lib/registry" } \ No newline at end of file diff --git a/xtask/xtask-test-integration/src/main.rs b/xtask/xtask-test-integration/src/main.rs deleted file mode 100644 index 38d08e5f833..00000000000 --- a/xtask/xtask-test-integration/src/main.rs +++ /dev/null @@ -1,81 +0,0 @@ -use std::env; -use std::path::{Path, PathBuf}; -use std::process::{Command, Stdio}; - -fn project_root() -> PathBuf { - Path::new(&env!("CARGO_MANIFEST_DIR")) - .ancestors() - .nth(2) - .unwrap() - .to_path_buf() -} - -fn start_test(args: &[&str], env_vars: &[(&str, String)]) { - let args = args.iter().map(|s| s.to_string()).collect::>(); - let cargo = env::var("CARGO").unwrap_or_else(|_| "cargo".to_string()); - let compilers = env::var("COMPILERS").unwrap_or_else(|_| "cranelift".to_string()); - - let mut cmd = Command::new(&cargo); - cmd.current_dir(project_root()); - cmd.stdin(Stdio::null()); - cmd.stdout(Stdio::inherit()); - cmd.stderr(Stdio::inherit()); - cmd.args(args); - for (k, v) in env_vars { - cmd.env(k, v); - } - - if let Ok(target) = std::env::var("CARGO_TARGET") { - cmd.args(&["--target", &target]); - } - - println!("running {cmd:?}"); - - let cmd = cmd.output().unwrap(); - - if !cmd.status.success() { - println!("test capi paniced with status {}", cmd.status); - println!("stdout: {}", String::from_utf8_lossy(&cmd.stdout)); - println!("stderr: {}", String::from_utf8_lossy(&cmd.stdout)); - panic!("test capi failed"); - } - - println!("{cmd:?} succeeded, compilers = {compilers}"); -} - -fn main() { - std::fs::create_dir_all(project_root().join("package")).expect("could not create package dir"); - - wasmer_registry::try_unpack_targz( - project_root().join("build-capi.tar.gz"), - project_root().join("package"), - false, - ) - .expect("could not unpack build-capi.tar.gz, run cargo build-capi first!"); - - std::fs::create_dir_all(project_root().join("package")).expect("could not create package dir"); - - wasmer_registry::try_unpack_targz( - project_root().join("build-wasmer.tar.gz"), - project_root().join("package"), - false, - ) - .expect("could not unpack build-wasmer.tar.gz, run cargo build-wasmer first!"); - - start_test( - &[ - "test", - "--features", - "webc_runner", - "--no-fail-fast", - "-p", - "wasmer-integration-tests-cli", - "--", - "--nocapture", - ], - &[( - "WASMER_DIR", - format!("{}", project_root().join("package").display()), - )], - ); -} diff --git a/xtask/xtask-test-js-core/Cargo.toml b/xtask/xtask-test-js-core/Cargo.toml deleted file mode 100644 index 042209687f0..00000000000 --- a/xtask/xtask-test-js-core/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "xtask-test-js-core" -version = "0.1.0" -edition = "2021" - -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - -[dependencies] diff --git a/xtask/xtask-test-js-core/src/main.rs b/xtask/xtask-test-js-core/src/main.rs deleted file mode 100644 index 3a17dcb2bd1..00000000000 --- a/xtask/xtask-test-js-core/src/main.rs +++ /dev/null @@ -1,13 +0,0 @@ -use std::path::{Path, PathBuf}; - -fn project_root() -> PathBuf { - Path::new(&env!("CARGO_MANIFEST_DIR")) - .ancestors() - .nth(2) - .unwrap() - .to_path_buf() -} - -fn main() { - println!("Hello, world! root = {}", project_root().display()); -} diff --git a/xtask/xtask-test-js/Cargo.toml b/xtask/xtask-test-js/Cargo.toml deleted file mode 100644 index e2a151f2ce5..00000000000 --- a/xtask/xtask-test-js/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "xtask-test-js" -version = "0.1.0" -edition = "2021" - -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - -[dependencies] diff --git a/xtask/xtask-test-js/src/main.rs b/xtask/xtask-test-js/src/main.rs deleted file mode 100644 index 3a17dcb2bd1..00000000000 --- a/xtask/xtask-test-js/src/main.rs +++ /dev/null @@ -1,13 +0,0 @@ -use std::path::{Path, PathBuf}; - -fn project_root() -> PathBuf { - Path::new(&env!("CARGO_MANIFEST_DIR")) - .ancestors() - .nth(2) - .unwrap() - .to_path_buf() -} - -fn main() { - println!("Hello, world! root = {}", project_root().display()); -} diff --git a/xtask/xtask-test-wasmer/Cargo.toml b/xtask/xtask-test-wasmer/Cargo.toml deleted file mode 100644 index 7751d1c7253..00000000000 --- a/xtask/xtask-test-wasmer/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "xtask-test-wasmer" -version = "0.1.0" -edition = "2021" - -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - -[dependencies] diff --git a/xtask/xtask-test-wasmer/src/main.rs b/xtask/xtask-test-wasmer/src/main.rs deleted file mode 100644 index 7b38eb367d5..00000000000 --- a/xtask/xtask-test-wasmer/src/main.rs +++ /dev/null @@ -1,152 +0,0 @@ -use std::env; -use std::path::{Path, PathBuf}; -use std::process::{Command, Stdio}; - -fn project_root() -> PathBuf { - Path::new(&env!("CARGO_MANIFEST_DIR")) - .ancestors() - .nth(2) - .unwrap() - .to_path_buf() -} - -fn start_test(args: &[&str]) { - let args = args.iter().map(|s| s.to_string()).collect::>(); - let cargo = env::var("CARGO").unwrap_or_else(|_| "cargo".to_string()); - let compilers = env::var("COMPILERS").unwrap_or_else(|_| "cranelift".to_string()); - - let mut cmd = Command::new(&cargo); - cmd.current_dir(project_root()); - cmd.stdin(Stdio::null()); - cmd.stdout(Stdio::inherit()); - cmd.stderr(Stdio::inherit()); - cmd.args(args); - - println!("running {cmd:?}"); - - let cmd = cmd.output().unwrap(); - - if !cmd.status.success() { - println!("test wasmer paniced with status {}", cmd.status); - println!("stdout: {}", String::from_utf8_lossy(&cmd.stdout)); - println!("stderr: {}", String::from_utf8_lossy(&cmd.stdout)); - panic!("test wasmer failed"); - } - - println!("{cmd:?} succeeded, compilers = {compilers}"); -} - -fn main() { - let compilers = env::var("COMPILERS").unwrap_or_else(|_| "cranelift".to_string()); - let stage = env::var("STAGE").unwrap_or_else(|_| "all".to_string()); - - let mut compiler_features = compilers - .replace(' ', ",") - .split(',') - .collect::>() - .join(","); - - if !compiler_features.is_empty() { - compiler_features.push(','); - }; - - let mut exclude_tests = vec![ - "wasmer-c-api", - "wasmer-cli", - "wasmer-compiler-cli", - "wasmer-wasi-experimental-io-devices", - "wasmer-integration-tests-ios", - ]; - - if !compiler_features.contains("llvm") { - exclude_tests.push("wasmer-compiler-llvm"); - } - - let exclude_tests = exclude_tests.join(" --exclude "); - - // cargo test --release --tests --features cranelift,singlepass, - // wasmer-artifact-create,static-artifact-create,wasmer-artifact-load,static-artifact-load - if stage == "1" || stage == "all" { - start_test(&[ - "test", - "--release", - "--tests", - "--features", - &format!("{compiler_features},wasmer-artifact-create,static-artifact-create,wasmer-artifact-load,static-artifact-load"), - ]); - } - - if stage == "2" || stage == "all" { - // cargo test --all --release --exclude wasmer-c-api --exclude wasmer-cli --exclude wasmer-compiler-cli --exclude wasmer-wasi-experimental-io-devices --exclude wasmer-integration-tests-cli - // --exclude wasmer-integration-tests-ios --exclude wasmer-compiler-llvm - let f = format!("{compiler_features},wasmer-artifact-create,static-artifact-create,wasmer-artifact-load,static-artifact-load"); - let mut args = vec!["test", "--all", "--features", &f, "--release"]; - for i in exclude_tests.split_whitespace() { - args.push(i); - } - start_test(&args); - } - - if stage == "3" || stage == "all" { - // cargo test --manifest-path lib/compiler-cranelift/Cargo.toml --release --no-default-features --features=std - // cargo test --manifest-path lib/compiler-singlepass/Cargo.toml --release --no-default-features --features=std - for compiler in compilers.split(',') { - start_test(&[ - "test", - "--manifest-path", - &format!("lib/compiler-{compiler}/Cargo.toml"), - "--release", - "--no-default-features", - "--features=std", - ]); - } - } - - // cargo test --manifest-path lib/cli/Cargo.toml --features cranelift,singlepass,wasmer-artifact-create,static-artifact-create,wasmer-artifact-load,static-artifact-load --release - if stage == "4" || stage == "all" { - start_test(&[ - "test", - "--manifest-path", - "lib/cli/Cargo.toml", - "--features", - &format!("{compiler_features},wasmer-artifact-create,static-artifact-create,wasmer-artifact-load,static-artifact-load"), - "--features", - "wasi", - "--examples", - ]); - } - - if stage == "5" || stage == "all" { - // cargo test --features cranelift,singlepass,wasmer-artifact-create,static-artifact-create,wasmer-artifact-load,static-artifact-load --features wasi --examples - start_test(&[ - "test", - "--features", - &format!("{compiler_features},wasmer-artifact-create,static-artifact-create,wasmer-artifact-load,static-artifact-load"), - "--features", - "wasi", - "--examples", - ]); - } - - if stage == "6" || stage == "all" { - // cargo test --release --features cranelift,singlepass,wasmer-artifact-create,static-artifact-create,wasmer-artifact-load,static-artifact-load --features wasi --examples - start_test(&[ - "test", - &format!("{compiler_features},wasmer-artifact-create,static-artifact-create,wasmer-artifact-load,static-artifact-load"), - "--features", - "wasi", - "--examples", - "--release", // <- - ]); - } - - if stage == "7" || stage == "all" { - start_test(&[ - "test", - "--doc", - "--all", - "--features", - &format!("{compiler_features},wasmer-artifact-create,static-artifact-create,wasmer-artifact-load,static-artifact-load"), - ]); - } -} From c4211ee4b61e599326dda25e4adcf5339f9b0514 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Fri, 25 Nov 2022 12:27:27 +0100 Subject: [PATCH 043/226] Remove .cargo/config --- .cargo/config | 9 --------- 1 file changed, 9 deletions(-) delete mode 100644 .cargo/config diff --git a/.cargo/config b/.cargo/config deleted file mode 100644 index e67efdd8e1f..00000000000 --- a/.cargo/config +++ /dev/null @@ -1,9 +0,0 @@ -[alias] -build-wasmer = "run --package xtask-build-wasmer --" -build-capi = "run --package xtask-build-capi --" -test-wasmer = "run --package xtask-test-wasmer --" -test-capi = "run --package xtask-test-capi --" -test-integration = "run --package xtask-test-integration --" -test-js = "run --package xtask-test-js --" -test-js-core = "run --package xtask-test-js-core --" -integration-tests = "run --package xtask-test-integration --" From 639a2ca0d83ba211cb76fc7c8fec841d855a1d5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Fri, 25 Nov 2022 12:27:46 +0100 Subject: [PATCH 044/226] Remove xtasks --- Cargo.lock | 42 ------------------------------------------ Cargo.toml | 7 ------- 2 files changed, 49 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index aeec8c01e4f..65436293f0c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4971,48 +4971,6 @@ version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d2d7d3948613f75c98fd9328cfdcc45acc4d360655289d0a7d4ec931392200a3" -[[package]] -name = "xtask-build-capi" -version = "0.1.0" -dependencies = [ - "flate2", - "tar", -] - -[[package]] -name = "xtask-build-wasmer" -version = "0.1.0" -dependencies = [ - "flate2", - "tar", -] - -[[package]] -name = "xtask-test-capi" -version = "0.1.0" -dependencies = [ - "wasmer-registry", -] - -[[package]] -name = "xtask-test-integration" -version = "0.1.0" -dependencies = [ - "wasmer-registry", -] - -[[package]] -name = "xtask-test-js" -version = "0.1.0" - -[[package]] -name = "xtask-test-js-core" -version = "0.1.0" - -[[package]] -name = "xtask-test-wasmer" -version = "0.1.0" - [[package]] name = "yaml-rust" version = "0.4.5" diff --git a/Cargo.toml b/Cargo.toml index f96484a5aa9..cf1b064397b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -26,13 +26,6 @@ cfg-if = "1.0" [workspace] members = [ - "xtask/xtask-test-js", - "xtask/xtask-test-js-core", - "xtask/xtask-build-capi", - "xtask/xtask-build-wasmer", - "xtask/xtask-test-capi", - "xtask/xtask-test-integration", - "xtask/xtask-test-wasmer", "lib/api", "lib/cache", "lib/c-api", From 4cb7010270d95d1abfcb5399b0d5ca7f8e8ccede Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Fri, 25 Nov 2022 12:33:12 +0100 Subject: [PATCH 045/226] cargo -> make --- .github/workflows/test.yaml | 110 ++++++++++++++++++------------------ 1 file changed, 55 insertions(+), 55 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 7676acbec6e..a087a1cc2a8 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -84,12 +84,12 @@ jobs: - name: Install wasm-pack run: | curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh - - name: cargo xtask test-js + - name: make test-js run: | - cargo test-js-core - - name: cargo xtask build-wasmer + make test-js + - name: make test-js-core run: | - cargo test-js-core + make test-js-core test_wasm_build: name: Test wasm build @@ -126,9 +126,9 @@ jobs: env: LLVM_DIR: .llvm LLVM_URL: https://github.com/wasmerio/llvm-custom-builds/releases/download/13.x/llvm-linux-amd64.tar.xz - - name: cargo xtask build-wasmer + - name: make build-wasmer run: | - cargo build-wasmer + make build-wasmer env: COMPILERS: cranelift,llvm,singlepass LLVM_SYS_120_PREFIX: ${{ env.LLVM_SYS_120_PREFIX }} @@ -153,9 +153,9 @@ jobs: uses: dtolnay/rust-toolchain@stable with: toolchain: 1.63 - - name: cargo xtask build-wasmer + - name: make build-wasmer run: | - cargo build-wasmer + make build-wasmer env: COMPILERS: cranelift,singlepass # no llvm - name: Archive production artifacts @@ -192,9 +192,9 @@ jobs: env: LLVM_DIR: .llvm LLVM_URL: https://github.com/wasmerio/llvm-custom-builds/releases/download/13.x/llvm-darwin-amd64.tar.xz - - name: cargo xtask build-wasmer + - name: make build-wasmer run: | - cargo build-wasmer + make build-wasmer env: COMPILERS: cranelift,llvm,singlepass LLVM_SYS_120_PREFIX: ${{ env.LLVM_SYS_120_PREFIX }} @@ -229,9 +229,9 @@ jobs: LLVM_DIR=$(brew --cellar llvm) echo "${LLVM_DIR}/13.0.0/bin" >> $GITHUB_PATH echo "LLVM_SYS_120_PREFIX=${LLVM_DIR}" >> $GITHUB_ENV - - name: cargo xtask build-wasmer + - name: make build-wasmer run: | - cargo build-wasmer + make build-wasmer env: COMPILERS: cranelift,llvm,singlepass CARGO_TARGET: aarch64-apple-darwin @@ -264,9 +264,9 @@ jobs: env: LLVM_DIR: .llvm LLVM_URL: https://github.com/wasmerio/llvm-custom-builds/releases/download/13.x/llvm-windows-amd64.tar.xz - - name: cargo xtask build-wasmer + - name: make build-wasmer run: | - cargo build-wasmer + make build-wasmer env: COMPILERS: cranelift,llvm,singlepass LLVM_SYS_120_PREFIX: ${{ env.LLVM_SYS_120_PREFIX }} @@ -297,9 +297,9 @@ jobs: uses: dtolnay/rust-toolchain@stable with: toolchain: 1.63 - - name: cargo xtask build-capi + - name: make build-capi run: | - cargo build-capi + make build-capi env: COMPILERS: cranelift,singlepass - name: Archive production artifacts @@ -323,9 +323,9 @@ jobs: uses: dtolnay/rust-toolchain@stable with: toolchain: 1.63 - - name: cargo xtask build-capi + - name: make build-capi run: | - cargo build-capi + make build-capi env: COMPILERS: cranelift,singlepass - name: Archive production artifacts @@ -345,9 +345,9 @@ jobs: uses: dtolnay/rust-toolchain@stable with: toolchain: 1.63 - - name: cargo xtask build-capi + - name: make build-capi run: | - cargo build-capi + make build-capi env: COMPILERS: cranelift,singlepass - name: Archive production artifacts @@ -374,9 +374,9 @@ jobs: with: toolchain: 1.63 target: aarch64-apple-darwin - - name: cargo xtask build-capi + - name: make build-capi run: | - cargo build-capi + make build-capi env: COMPILERS: cranelift,singlepass CARGO_TARGET: aarch64-apple-darwin @@ -397,9 +397,9 @@ jobs: uses: dtolnay/rust-toolchain@stable with: toolchain: 1.63 - - name: cargo xtask build-capi + - name: make build-capi run: | - cargo build-capi + make build-capi env: COMPILERS: cranelift,singlepass - name: Archive production artifacts @@ -410,7 +410,7 @@ jobs: if-no-files-found: error retention-days: 2 - # test-wasmer: run unit tests for wasmer, depends on build-wasmer step + # make test: run unit tests for wasmer, depends on build-wasmer step # (can run in parallel with build-capi step) # NOTE: testing is decoupled from building because when we do a release @@ -445,9 +445,9 @@ jobs: env: LLVM_DIR: .llvm LLVM_URL: https://github.com/wasmerio/llvm-custom-builds/releases/download/13.x/llvm-linux-amd64.tar.xz - - name: cargo xtask test-wasmer + - name: make test run: | - cargo test-wasmer + make test env: COMPILERS: cranelift,llvm,singlepass STAGE: ${{ matrix.stage }} @@ -470,9 +470,9 @@ jobs: uses: dtolnay/rust-toolchain@stable with: toolchain: 1.63 - - name: cargo xtask test-wasmer + - name: make test run: | - cargo test-wasmer + make test env: COMPILERS: cranelift,singlepass # no llvm STAGE: ${{ matrix.stage }} @@ -501,9 +501,9 @@ jobs: env: LLVM_DIR: .llvm LLVM_URL: https://github.com/wasmerio/llvm-custom-builds/releases/download/13.x/llvm-darwin-amd64.tar.xz - - name: cargo xtask test-wasmer + - name: make test run: | - cargo test-wasmer + make test env: COMPILERS: cranelift,llvm,singlepass STAGE: ${{ matrix.stage }} @@ -530,9 +530,9 @@ jobs: LLVM_DIR=$(brew --cellar llvm) echo "${LLVM_DIR}/13.0.0/bin" >> $GITHUB_PATH echo "LLVM_SYS_120_PREFIX=${LLVM_DIR}" >> $GITHUB_ENV - - name: cargo xtask test-wasmer + - name: make test run: | - cargo test-wasmer + make test env: COMPILERS: cranelift,llvm,singlepass STAGE: ${{ matrix.stage }} @@ -562,9 +562,9 @@ jobs: env: LLVM_DIR: .llvm LLVM_URL: https://github.com/wasmerio/llvm-custom-builds/releases/download/13.x/llvm-windows-amd64.tar.xz - - name: cargo xtask test-wasmer + - name: make test run: | - cargo test-wasmer + make test env: COMPILERS: cranelift,llvm,singlepass STAGE: ${{ matrix.stage }} @@ -590,9 +590,9 @@ jobs: - uses: actions/download-artifact@v3 with: name: capi-x86_64-unknown-linux-gnu - - name: cargo xtask test-capi + - name: make test-capi run: | - cargo test-capi + make test-capi env: COMPILERS: cranelift,singlepass @@ -613,9 +613,9 @@ jobs: - uses: actions/download-artifact@v3 with: name: capi-x86_64-unknown-linux-musl - - name: cargo xtask test-capi + - name: make test-capi run: | - cargo test-capi + make test-capi env: COMPILERS: cranelift,singlepass @@ -632,9 +632,9 @@ jobs: - uses: actions/download-artifact@v3 with: name: capi-x86_64-apple-darwin - - name: cargo xtask test-capi + - name: make test-capi run: | - cargo test-capi + make test-capi env: COMPILERS: cranelift,singlepass @@ -652,9 +652,9 @@ jobs: - uses: actions/download-artifact@v3 with: name: capi-aarch64-apple-darwin - - name: cargo xtask test-capi + - name: make test-capi run: | - cargo test-capi + make test-capi env: COMPILERS: cranelift,singlepass @@ -671,9 +671,9 @@ jobs: - uses: actions/download-artifact@v3 with: name: capi-x86_64-pc-windows-msvc - - name: cargo xtask test-capi + - name: make test-capi run: | - cargo test-capi + make test-capi env: COMPILERS: cranelift,singlepass @@ -699,9 +699,9 @@ jobs: - uses: actions/download-artifact@v3 with: name: wasmer-cli-x86_64-unknown-linux-gnu - - name: cargo xtask test-integration + - name: make test-integration-cli run: | - cargo test-integration + make test-integration-cli test_integration_linux_musl: name: integration tests on linux-x86_64-musl @@ -723,9 +723,9 @@ jobs: - uses: actions/download-artifact@v3 with: name: wasmer-cli-x86_64-unknown-linux-musl - - name: cargo xtask test-integration + - name: make test-integration-cli run: | - cargo test-integration + make test-integration-cli test_integration_macos_x86: name: integration tests on macos-x86 @@ -743,9 +743,9 @@ jobs: - uses: actions/download-artifact@v3 with: name: wasmer-cli-x86_64-apple-darwin - - name: cargo xtask test-integration + - name: make test-integration-cli run: | - cargo test-integration + make test-integration-cli test_integration_macos_arm: name: integration tests on macos-arm @@ -764,9 +764,9 @@ jobs: - uses: actions/download-artifact@v3 with: name: wasmer-cli-aarch64-apple-darwin - - name: cargo xtask test-integration + - name: make test-integration-cli run: | - cargo test-integration + make test-integration-cli env: CARGO_TARGET: aarch64-apple-darwin @@ -786,6 +786,6 @@ jobs: - uses: actions/download-artifact@v3 with: name: wasmer-cli-x86_64-pc-windows-msvc - - name: cargo xtask test-integration + - name: make test-integration-cli run: | - cargo test-integration + make test-integration-cli From 1d5991d7264e1f80b7cb29aefdd9d626031dd43e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Fri, 25 Nov 2022 12:43:30 +0100 Subject: [PATCH 046/226] Add new matrices for testing --- .github/workflows/test.yaml | 240 ++++++++++++++++++++++++++++++++++++ 1 file changed, 240 insertions(+) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index a087a1cc2a8..1255b5e5497 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -101,6 +101,246 @@ jobs: make build-wasmer-wasm # build-wasmer: run build-wasmer and build-capi for every OS in parallel + build_wasmer: + name: Build wasmer on ${{ matrix.build }} + runs-on: ${{ matrix.os }} + needs: setup + strategy: + fail-fast: false + matrix: + include: + - build: linux-x64 + os: ubuntu-18.04 + target: x86_64-unknown-linux-gnu + llvm_url: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz' + run_test: true + run_test_capi: true + run_integration_tests: true + run_build_docs: true + use_sccache: true + - build: macos-x64 + os: macos-11 + target: x86_64-apple-darwin + llvm_url: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-apple-darwin.tar.xz' + run_test: true + run_test_capi: true + use_sccache: true + run_integration_tests: true + run_ios_tests: true + run_build_docs: false + - build: macos-arm64 + os: macos-11.0 + target: aarch64-apple-darwin + use_sccache: true + run_test: false + run_test_capi: false + run_build_docs: false + - build: windows-x64 + os: windows-2019 + #target: x86_64-pc-windows-msvc commented because of bug in rust setup action + # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/12.x/windows-amd64.tar.gz' + llvm_choco_version: 13.0.0 + run_integration_tests: true + use_sccache: true + run_test: true + run_test_capi: false # We can't run yet the capi tests on Windows + run_build_docs: false + - build: linux-musl-x64 + target: x86_64-unknown-linux-musl + os: ubuntu-latest + container: alpine:latest + run_test: true + run_test_capi: false # It can't run the capi tests because of a cc linker issue (`wasm_engine_new` is redefined) + run_integration_tests: false + run_build_docs: false + use_sccache: false + container: ${{ matrix.container }} + env: + SCCACHE_AZURE_BLOB_CONTAINER: wasmerstoragesccacheblob + SCCACHE_AZURE_CONNECTION_STRING: ${{ secrets.SCCACHE_AZURE_CONNECTION_STRING }} + steps: + - uses: actions/checkout@v3 + + build_capi: + name: Build wasmer on ${{ matrix.build }} + runs-on: ${{ matrix.os }} + needs: setup + strategy: + fail-fast: false + matrix: + include: + - build: linux-x64 + os: ubuntu-18.04 + target: x86_64-unknown-linux-gnu + llvm_url: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz' + run_test: true + run_test_capi: true + run_integration_tests: true + run_build_docs: true + use_sccache: true + - build: macos-x64 + os: macos-11 + target: x86_64-apple-darwin + llvm_url: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-apple-darwin.tar.xz' + run_test: true + run_test_capi: true + use_sccache: true + run_integration_tests: true + run_ios_tests: true + run_build_docs: false + - build: macos-arm64 + os: macos-11.0 + target: aarch64-apple-darwin + use_sccache: true + run_test: false + run_test_capi: false + run_build_docs: false + - build: windows-x64 + os: windows-2019 + #target: x86_64-pc-windows-msvc commented because of bug in rust setup action + # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/12.x/windows-amd64.tar.gz' + llvm_choco_version: 13.0.0 + run_integration_tests: true + use_sccache: true + run_test: true + run_test_capi: false # We can't run yet the capi tests on Windows + run_build_docs: false + - build: linux-musl-x64 + target: x86_64-unknown-linux-musl + os: ubuntu-latest + container: alpine:latest + run_test: true + run_test_capi: false # It can't run the capi tests because of a cc linker issue (`wasm_engine_new` is redefined) + run_integration_tests: false + run_build_docs: false + use_sccache: false + container: ${{ matrix.container }} + env: + SCCACHE_AZURE_BLOB_CONTAINER: wasmerstoragesccacheblob + SCCACHE_AZURE_CONNECTION_STRING: ${{ secrets.SCCACHE_AZURE_CONNECTION_STRING }} + steps: + - uses: actions/checkout@v3 + + test_capi: + name: Build wasmer on ${{ matrix.build }} + runs-on: ${{ matrix.os }} + needs: build_capi + strategy: + fail-fast: false + matrix: + include: + - build: linux-x64 + os: ubuntu-18.04 + target: x86_64-unknown-linux-gnu + llvm_url: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz' + run_test: true + run_test_capi: true + run_integration_tests: true + run_build_docs: true + use_sccache: true + - build: macos-x64 + os: macos-11 + target: x86_64-apple-darwin + llvm_url: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-apple-darwin.tar.xz' + run_test: true + run_test_capi: true + use_sccache: true + run_integration_tests: true + run_ios_tests: true + run_build_docs: false + - build: macos-arm64 + os: macos-11.0 + target: aarch64-apple-darwin + use_sccache: true + run_test: false + run_test_capi: false + run_build_docs: false + - build: windows-x64 + os: windows-2019 + #target: x86_64-pc-windows-msvc commented because of bug in rust setup action + # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/12.x/windows-amd64.tar.gz' + llvm_choco_version: 13.0.0 + run_integration_tests: true + use_sccache: true + run_test: true + run_test_capi: false # We can't run yet the capi tests on Windows + run_build_docs: false + - build: linux-musl-x64 + target: x86_64-unknown-linux-musl + os: ubuntu-latest + container: alpine:latest + run_test: true + run_test_capi: false # It can't run the capi tests because of a cc linker issue (`wasm_engine_new` is redefined) + run_integration_tests: false + run_build_docs: false + use_sccache: false + container: ${{ matrix.container }} + env: + SCCACHE_AZURE_BLOB_CONTAINER: wasmerstoragesccacheblob + SCCACHE_AZURE_CONNECTION_STRING: ${{ secrets.SCCACHE_AZURE_CONNECTION_STRING }} + steps: + - uses: actions/checkout@v3 + + test_integration_cli: + name: Build wasmer on ${{ matrix.build }} + runs-on: ${{ matrix.os }} + needs: [build_capi, build_wasmer] + strategy: + fail-fast: false + matrix: + include: + - build: linux-x64 + os: ubuntu-18.04 + target: x86_64-unknown-linux-gnu + llvm_url: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz' + run_test: true + run_test_capi: true + run_integration_tests: true + run_build_docs: true + use_sccache: true + - build: macos-x64 + os: macos-11 + target: x86_64-apple-darwin + llvm_url: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-apple-darwin.tar.xz' + run_test: true + run_test_capi: true + use_sccache: true + run_integration_tests: true + run_ios_tests: true + run_build_docs: false + - build: macos-arm64 + os: macos-11.0 + target: aarch64-apple-darwin + use_sccache: true + run_test: false + run_test_capi: false + run_build_docs: false + - build: windows-x64 + os: windows-2019 + #target: x86_64-pc-windows-msvc commented because of bug in rust setup action + # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/12.x/windows-amd64.tar.gz' + llvm_choco_version: 13.0.0 + run_integration_tests: true + use_sccache: true + run_test: true + run_test_capi: false # We can't run yet the capi tests on Windows + run_build_docs: false + - build: linux-musl-x64 + target: x86_64-unknown-linux-musl + os: ubuntu-latest + container: alpine:latest + run_test: true + run_test_capi: false # It can't run the capi tests because of a cc linker issue (`wasm_engine_new` is redefined) + run_integration_tests: false + run_build_docs: false + use_sccache: false + container: ${{ matrix.container }} + env: + SCCACHE_AZURE_BLOB_CONTAINER: wasmerstoragesccacheblob + SCCACHE_AZURE_CONNECTION_STRING: ${{ secrets.SCCACHE_AZURE_CONNECTION_STRING }} + steps: + - uses: actions/checkout@v3 + build_wasmer_linux_x64: name: build wasmer on linux-x86_64-gnu runs-on: ubuntu-18.04 From da4c279366876328d5a6802fd85352875db8fc12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Fri, 25 Nov 2022 12:51:21 +0100 Subject: [PATCH 047/226] Fix typo --- .github/workflows/test.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 1255b5e5497..414248dacd7 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -118,7 +118,7 @@ jobs: run_integration_tests: true run_build_docs: true use_sccache: true - - build: macos-x64 + - build: macos-x64 os: macos-11 target: x86_64-apple-darwin llvm_url: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-apple-darwin.tar.xz' @@ -178,7 +178,7 @@ jobs: run_integration_tests: true run_build_docs: true use_sccache: true - - build: macos-x64 + - build: macos-x64 os: macos-11 target: x86_64-apple-darwin llvm_url: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-apple-darwin.tar.xz' @@ -238,7 +238,7 @@ jobs: run_integration_tests: true run_build_docs: true use_sccache: true - - build: macos-x64 + - build: macos-x64 os: macos-11 target: x86_64-apple-darwin llvm_url: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-apple-darwin.tar.xz' @@ -298,7 +298,7 @@ jobs: run_integration_tests: true run_build_docs: true use_sccache: true - - build: macos-x64 + - build: macos-x64 os: macos-11 target: x86_64-apple-darwin llvm_url: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-apple-darwin.tar.xz' From 697d8df6aaa2776a696628f85b31b935eba8ae60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Fri, 25 Nov 2022 12:54:20 +0100 Subject: [PATCH 048/226] Remove unnecessary build steps --- .github/workflows/test.yaml | 685 +----------------------------------- 1 file changed, 3 insertions(+), 682 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 414248dacd7..2d561c11354 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -162,7 +162,7 @@ jobs: - uses: actions/checkout@v3 build_capi: - name: Build wasmer on ${{ matrix.build }} + name: Build C-API on ${{ matrix.build }} runs-on: ${{ matrix.os }} needs: setup strategy: @@ -222,7 +222,7 @@ jobs: - uses: actions/checkout@v3 test_capi: - name: Build wasmer on ${{ matrix.build }} + name: Test C-API on ${{ matrix.build }} runs-on: ${{ matrix.os }} needs: build_capi strategy: @@ -282,7 +282,7 @@ jobs: - uses: actions/checkout@v3 test_integration_cli: - name: Build wasmer on ${{ matrix.build }} + name: Integration tests on ${{ matrix.build }} runs-on: ${{ matrix.os }} needs: [build_capi, build_wasmer] strategy: @@ -341,691 +341,12 @@ jobs: steps: - uses: actions/checkout@v3 - build_wasmer_linux_x64: - name: build wasmer on linux-x86_64-gnu - runs-on: ubuntu-18.04 - steps: - - uses: actions/checkout@v3 - - name: Set up libstdc++ on Linux - run: | - sudo apt-get update -y - sudo apt-get install -y --allow-downgrades libstdc++6=8.4.0-1ubuntu1~18.04 - sudo apt-get install --reinstall g++-8 - - name: Install Rust - uses: dtolnay/rust-toolchain@stable - with: - toolchain: 1.63 - - name: Install LLVM - shell: bash - run: | - LLVM_DIR=$(pwd)/${{ env.LLVM_DIR }} - mkdir -p ${LLVM_DIR} - curl --proto '=https' --tlsv1.2 -sSf "${{ env.LLVM_URL }}" -L -o - | tar xJv -C ${LLVM_DIR} - echo "${LLVM_DIR}/bin" >> $GITHUB_PATH - echo "LLVM_SYS_120_PREFIX=${LLVM_DIR}" >> $GITHUB_ENV - env: - LLVM_DIR: .llvm - LLVM_URL: https://github.com/wasmerio/llvm-custom-builds/releases/download/13.x/llvm-linux-amd64.tar.xz - - name: make build-wasmer - run: | - make build-wasmer - env: - COMPILERS: cranelift,llvm,singlepass - LLVM_SYS_120_PREFIX: ${{ env.LLVM_SYS_120_PREFIX }} - - name: Archive production artifacts - uses: actions/upload-artifact@v3 - with: - name: wasmer-cli-x86_64-unknown-linux-gnu - path: build-wasmer.tar.gz - if-no-files-found: error - retention-days: 2 - - build_wasmer_linux_musl: - name: build wasmer on linux-x86_64-musl - runs-on: ubuntu-latest - container: alpine:latest - steps: - - uses: actions/checkout@v3 - - name: Set up base deps on musl - run: | - apk add build-base bash musl-dev curl make libtool libffi-dev gcc automake autoconf git openssl-dev g++ - - name: Install Rust - uses: dtolnay/rust-toolchain@stable - with: - toolchain: 1.63 - - name: make build-wasmer - run: | - make build-wasmer - env: - COMPILERS: cranelift,singlepass # no llvm - - name: Archive production artifacts - uses: actions/upload-artifact@v3 - with: - name: wasmer-cli-x86_64-unknown-linux-musl - path: build-wasmer.tar.gz - if-no-files-found: error - retention-days: 2 - - build_wasmer_macos_x86: - name: build wasmer on macos-x86 - runs-on: macos-11 - steps: - - uses: actions/checkout@v3 - - 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 - - name: Install Rust - uses: dtolnay/rust-toolchain@stable - with: - toolchain: 1.63 - - name: Install LLVM - shell: bash - run: | - LLVM_DIR=$(pwd)/${{ env.LLVM_DIR }} - mkdir -p ${LLVM_DIR} - curl --proto '=https' --tlsv1.2 -sSf "${{ env.LLVM_URL }}" -L -o - | tar xJv -C ${LLVM_DIR} - echo "${LLVM_DIR}/bin" >> $GITHUB_PATH - echo "LLVM_SYS_120_PREFIX=${LLVM_DIR}" >> $GITHUB_ENV - env: - LLVM_DIR: .llvm - LLVM_URL: https://github.com/wasmerio/llvm-custom-builds/releases/download/13.x/llvm-darwin-amd64.tar.xz - - name: make build-wasmer - run: | - make build-wasmer - env: - COMPILERS: cranelift,llvm,singlepass - LLVM_SYS_120_PREFIX: ${{ env.LLVM_SYS_120_PREFIX }} - - name: Archive production artifacts - uses: actions/upload-artifact@v3 - with: - name: wasmer-cli-x86_64-x86_64-apple-darwin - path: build-wasmer.tar.gz - if-no-files-found: error - retention-days: 2 - - build_wasmer_macos_arm: - name: build wasmer on macos-arm - runs-on: macos-11.0 - steps: - - uses: actions/checkout@v3 - - 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 - - name: Install Rust - uses: dtolnay/rust-toolchain@stable - with: - toolchain: 1.63 - target: aarch64-apple-darwin - - name: Install LLVM - shell: bash - run: | - brew install llvm@13 - LLVM_DIR=$(brew --cellar llvm) - echo "${LLVM_DIR}/13.0.0/bin" >> $GITHUB_PATH - echo "LLVM_SYS_120_PREFIX=${LLVM_DIR}" >> $GITHUB_ENV - - name: make build-wasmer - run: | - make build-wasmer - env: - COMPILERS: cranelift,llvm,singlepass - CARGO_TARGET: aarch64-apple-darwin - LLVM_SYS_120_PREFIX: ${{ env.LLVM_SYS_120_PREFIX }} - - name: Archive production artifacts - uses: actions/upload-artifact@v3 - with: - name: wasmer-cli-aarch64-apple-darwin - path: build-capi.tar.gz - if-no-files-found: error - retention-days: 2 - - build_wasmer_windows_x86: - name: build wasmer on windows-x64 - runs-on: windows-2019 - steps: - - uses: actions/checkout@v3 - - name: Install Rust - uses: dtolnay/rust-toolchain@stable - with: - toolchain: 1.63 - - name: Install LLVM - shell: bash - run: | - LLVM_DIR=$(pwd)/${{ env.LLVM_DIR }} - mkdir -p ${LLVM_DIR} - curl --proto '=https' --tlsv1.2 -sSf "${{ env.LLVM_URL }}" -L -o - | tar xJv -C ${LLVM_DIR} - echo "${LLVM_DIR}/bin" >> $GITHUB_PATH - echo "LLVM_SYS_120_PREFIX=${LLVM_DIR}" >> $GITHUB_ENV - env: - LLVM_DIR: .llvm - LLVM_URL: https://github.com/wasmerio/llvm-custom-builds/releases/download/13.x/llvm-windows-amd64.tar.xz - - name: make build-wasmer - run: | - make build-wasmer - env: - COMPILERS: cranelift,llvm,singlepass - LLVM_SYS_120_PREFIX: ${{ env.LLVM_SYS_120_PREFIX }} - - name: Archive production artifacts - uses: actions/upload-artifact@v3 - with: - name: wasmer-cli-x86_64-pc-windows-msvc - path: build-capi.tar.gz - if-no-files-found: error - retention-days: 2 - # todo: build wasmer headless # build-capi: run build-capi for every OS, does NOT depend on build-wasmer # (can run in parallel with build-wasmer step) - build_capi_linux_x64: - name: build capi on linux-x86_64-gnu - runs-on: ubuntu-18.04 - steps: - - uses: actions/checkout@v3 - - name: Set up libstdc++ on Linux - run: | - sudo apt-get update -y - sudo apt-get install -y --allow-downgrades libstdc++6=8.4.0-1ubuntu1~18.04 - sudo apt-get install --reinstall g++-8 - - name: Install Rust - uses: dtolnay/rust-toolchain@stable - with: - toolchain: 1.63 - - name: make build-capi - run: | - make build-capi - env: - COMPILERS: cranelift,singlepass - - name: Archive production artifacts - uses: actions/upload-artifact@v3 - with: - name: capi-x86_64-unknown-linux-gnu - path: build-capi.tar.gz - if-no-files-found: error - retention-days: 2 - - build_capi_linux_musl: - name: build capi on linux-x86_64-musl - runs-on: ubuntu-latest - container: alpine:latest - steps: - - uses: actions/checkout@v3 - - name: Set up base deps on musl - run: | - apk add build-base bash musl-dev curl make libtool libffi-dev gcc automake autoconf git openssl-dev g++ - - name: Install Rust - uses: dtolnay/rust-toolchain@stable - with: - toolchain: 1.63 - - name: make build-capi - run: | - make build-capi - env: - COMPILERS: cranelift,singlepass - - name: Archive production artifacts - uses: actions/upload-artifact@v3 - with: - name: capi-x86_64-unknown-linux-musl - path: build-capi.tar.gz - if-no-files-found: error - retention-days: 2 - - build_capi_macos_x86: - name: build capi on macos-aarch64 - runs-on: macos-11 - steps: - - uses: actions/checkout@v3 - - name: Install Rust - uses: dtolnay/rust-toolchain@stable - with: - toolchain: 1.63 - - name: make build-capi - run: | - make build-capi - env: - COMPILERS: cranelift,singlepass - - name: Archive production artifacts - uses: actions/upload-artifact@v3 - with: - name: capi-x86_64-apple-darwin - path: build-capi.tar.gz - if-no-files-found: error - retention-days: 2 - - build_capi_macos_arm: - name: build capi on macos-arm - runs-on: macos-11.0 - steps: - - uses: actions/checkout@v3 - - 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 - - name: Install Rust - uses: dtolnay/rust-toolchain@stable - with: - toolchain: 1.63 - target: aarch64-apple-darwin - - name: make build-capi - run: | - make build-capi - env: - COMPILERS: cranelift,singlepass - CARGO_TARGET: aarch64-apple-darwin - - name: Archive production artifacts - uses: actions/upload-artifact@v3 - with: - name: capi-aarch64-apple-darwin - path: build-capi.tar.gz - if-no-files-found: error - retention-days: 2 - - build_capi_windows_x86: - name: build capi on windows-x64 - runs-on: windows-2019 - steps: - - uses: actions/checkout@v3 - - name: Install Rust - uses: dtolnay/rust-toolchain@stable - with: - toolchain: 1.63 - - name: make build-capi - run: | - make build-capi - env: - COMPILERS: cranelift,singlepass - - name: Archive production artifacts - uses: actions/upload-artifact@v3 - with: - name: capi-x86_64-pc-windows-msvc - path: build-capi.tar.gz - if-no-files-found: error - retention-days: 2 - # make test: run unit tests for wasmer, depends on build-wasmer step # (can run in parallel with build-capi step) - # NOTE: testing is decoupled from building because when we do a release - # we don't have to go through the "testing" phase again since we assume - # that master is green - test_wasmer_linux_x64: - name: test wasmer on linux-x86_64-gnu - runs-on: ubuntu-18.04 - strategy: - fail-fast: false - matrix: - stage: [1,2,3,4,5,6,7] - steps: - - uses: actions/checkout@v3 - - name: Set up libstdc++ on Linux - run: | - sudo apt-get update -y - sudo apt-get install -y --allow-downgrades libstdc++6=8.4.0-1ubuntu1~18.04 - sudo apt-get install --reinstall g++-8 - - name: Install Rust - uses: dtolnay/rust-toolchain@stable - with: - toolchain: 1.63 - - name: Install LLVM - shell: bash - run: | - LLVM_DIR=$(pwd)/${{ env.LLVM_DIR }} - mkdir -p ${LLVM_DIR} - curl --proto '=https' --tlsv1.2 -sSf "${{ env.LLVM_URL }}" -L -o - | tar xJv -C ${LLVM_DIR} - echo "${LLVM_DIR}/bin" >> $GITHUB_PATH - echo "LLVM_SYS_120_PREFIX=${LLVM_DIR}" >> $GITHUB_ENV - env: - LLVM_DIR: .llvm - LLVM_URL: https://github.com/wasmerio/llvm-custom-builds/releases/download/13.x/llvm-linux-amd64.tar.xz - - name: make test - run: | - make test - env: - COMPILERS: cranelift,llvm,singlepass - STAGE: ${{ matrix.stage }} - LLVM_SYS_120_PREFIX: ${{ env.LLVM_SYS_120_PREFIX }} - - test_wasmer_linux_musl: - name: test wasmer on linux-x86_64-musl - runs-on: ubuntu-latest - container: alpine:latest - strategy: - fail-fast: false - matrix: - stage: [1,2,3,4,5,6,7] - steps: - - uses: actions/checkout@v3 - - name: Set up base deps on musl - run: | - apk add build-base bash musl-dev curl make libtool libffi-dev gcc automake autoconf git openssl-dev g++ - - name: Install Rust - uses: dtolnay/rust-toolchain@stable - with: - toolchain: 1.63 - - name: make test - run: | - make test - env: - COMPILERS: cranelift,singlepass # no llvm - STAGE: ${{ matrix.stage }} - - test_wasmer_macos_x86: - name: test wasmer on macos-x86 - runs-on: macos-11 - strategy: - fail-fast: false - matrix: - stage: [1,2,3,4,5,6,7] - steps: - - uses: actions/checkout@v3 - - name: Install Rust - uses: dtolnay/rust-toolchain@stable - with: - toolchain: 1.63 - - name: Install LLVM - shell: bash - run: | - LLVM_DIR=$(pwd)/${{ env.LLVM_DIR }} - mkdir -p ${LLVM_DIR} - curl --proto '=https' --tlsv1.2 -sSf "${{ env.LLVM_URL }}" -L -o - | tar xJv -C ${LLVM_DIR} - echo "${LLVM_DIR}/bin" >> $GITHUB_PATH - echo "LLVM_SYS_120_PREFIX=${LLVM_DIR}" >> $GITHUB_ENV - env: - LLVM_DIR: .llvm - LLVM_URL: https://github.com/wasmerio/llvm-custom-builds/releases/download/13.x/llvm-darwin-amd64.tar.xz - - name: make test - run: | - make test - env: - COMPILERS: cranelift,llvm,singlepass - STAGE: ${{ matrix.stage }} - LLVM_SYS_120_PREFIX: ${{ env.LLVM_SYS_120_PREFIX }} - - test_wasmer_macos_arm: - name: test wasmer on macos-x86 - runs-on: macos-11 - strategy: - fail-fast: false - matrix: - stage: [1,2,3,4,5,6,7] - steps: - - uses: actions/checkout@v3 - - name: Install Rust - uses: dtolnay/rust-toolchain@stable - with: - toolchain: 1.63 - target: aarch64-apple-darwin - - name: Install LLVM - shell: bash - run: | - brew install llvm@13 - LLVM_DIR=$(brew --cellar llvm) - echo "${LLVM_DIR}/13.0.0/bin" >> $GITHUB_PATH - echo "LLVM_SYS_120_PREFIX=${LLVM_DIR}" >> $GITHUB_ENV - - name: make test - run: | - make test - env: - COMPILERS: cranelift,llvm,singlepass - STAGE: ${{ matrix.stage }} - LLVM_SYS_120_PREFIX: ${{ env.LLVM_SYS_120_PREFIX }} - - test_wasmer_windows_x86: - name: test wasmer on windows-x64 - runs-on: windows-2019 - strategy: - fail-fast: false - matrix: - stage: [1,2,3,4,5,6,7] - steps: - - uses: actions/checkout@v3 - - name: Install Rust - uses: dtolnay/rust-toolchain@stable - with: - toolchain: 1.63 - - name: Install LLVM - shell: bash - run: | - LLVM_DIR=$(pwd)/${{ env.LLVM_DIR }} - mkdir -p ${LLVM_DIR} - curl --proto '=https' --tlsv1.2 -sSf "${{ env.LLVM_URL }}" -L -o - | tar xJv -C ${LLVM_DIR} - echo "${LLVM_DIR}/bin" >> $GITHUB_PATH - echo "LLVM_SYS_120_PREFIX=${LLVM_DIR}" >> $GITHUB_ENV - env: - LLVM_DIR: .llvm - LLVM_URL: https://github.com/wasmerio/llvm-custom-builds/releases/download/13.x/llvm-windows-amd64.tar.xz - - name: make test - run: | - make test - env: - COMPILERS: cranelift,llvm,singlepass - STAGE: ${{ matrix.stage }} - LLVM_SYS_120_PREFIX: ${{ env.LLVM_SYS_120_PREFIX }} - - # test-capi: run unit test for capi, depends on build-capi step - # (can run in parallel with build-wasmer step) - test_capi_linux_x64: - name: test capi on linux-x86_64-gnu - runs-on: ubuntu-18.04 - needs: [build_capi_linux_x64] - steps: - - uses: actions/checkout@v3 - - name: Set up libstdc++ on Linux - run: | - sudo apt-get update -y - sudo apt-get install -y --allow-downgrades libstdc++6=8.4.0-1ubuntu1~18.04 - sudo apt-get install --reinstall g++-8 - - name: Install Rust - uses: dtolnay/rust-toolchain@stable - with: - toolchain: 1.63 - - uses: actions/download-artifact@v3 - with: - name: capi-x86_64-unknown-linux-gnu - - name: make test-capi - run: | - make test-capi - env: - COMPILERS: cranelift,singlepass - - test_capi_linux_musl: - name: test capi on linux-x86_64-musl - runs-on: ubuntu-latest - needs: [build_capi_linux_musl] - container: alpine:latest - steps: - - uses: actions/checkout@v3 - - name: Set up base deps on musl - run: | - apk add build-base bash musl-dev curl make libtool libffi-dev gcc automake autoconf git openssl-dev g++ - - name: Install Rust - uses: dtolnay/rust-toolchain@stable - with: - toolchain: 1.63 - - uses: actions/download-artifact@v3 - with: - name: capi-x86_64-unknown-linux-musl - - name: make test-capi - run: | - make test-capi - env: - COMPILERS: cranelift,singlepass - - test_capi_macos_x86: - name: test capi on macos-x86 - runs-on: macos-11 - needs: [build_capi_macos_x86] - steps: - - uses: actions/checkout@v3 - - name: Install Rust - uses: dtolnay/rust-toolchain@stable - with: - toolchain: 1.63 - - uses: actions/download-artifact@v3 - with: - name: capi-x86_64-apple-darwin - - name: make test-capi - run: | - make test-capi - env: - COMPILERS: cranelift,singlepass - - test_capi_macos_arm: - name: test capi on macos-arm - runs-on: macos-11.0 - needs: [build_capi_macos_arm] - steps: - - uses: actions/checkout@v3 - - name: Install Rust - uses: dtolnay/rust-toolchain@stable - with: - toolchain: 1.63 - target: aarch64-apple-darwin - - uses: actions/download-artifact@v3 - with: - name: capi-aarch64-apple-darwin - - name: make test-capi - run: | - make test-capi - env: - COMPILERS: cranelift,singlepass - - test_capi_windows_x86: - name: test capi on windows-x64 - runs-on: windows-2019 - needs: [build_capi_windows_x86] - steps: - - uses: actions/checkout@v3 - - name: Install Rust - uses: dtolnay/rust-toolchain@stable - with: - toolchain: 1.63 - - uses: actions/download-artifact@v3 - with: - name: capi-x86_64-pc-windows-msvc - - name: make test-capi - run: | - make test-capi - env: - COMPILERS: cranelift,singlepass - # test-integration-cli: run integration tests for wasmer, depends on build-capi and build-wasmer steps - test_integration_linux_x64: - name: integration tests on linux-x86_64-gnu - runs-on: ubuntu-18.04 - needs: [build_wasmer_linux_x64, build_capi_linux_x64] - steps: - - uses: actions/checkout@v3 - - name: Set up libstdc++ on Linux - run: | - sudo apt-get update -y - sudo apt-get install -y --allow-downgrades libstdc++6=8.4.0-1ubuntu1~18.04 - sudo apt-get install --reinstall g++-8 - - name: Install Rust - uses: dtolnay/rust-toolchain@stable - with: - toolchain: 1.63 - - uses: actions/download-artifact@v3 - with: - name: capi-x86_64-unknown-linux-gnu - - uses: actions/download-artifact@v3 - with: - name: wasmer-cli-x86_64-unknown-linux-gnu - - name: make test-integration-cli - run: | - make test-integration-cli - - test_integration_linux_musl: - name: integration tests on linux-x86_64-musl - runs-on: ubuntu-latest - needs: [build_wasmer_linux_musl, build_capi_linux_musl] - container: alpine:latest - steps: - - uses: actions/checkout@v3 - - name: Set up base deps on musl - run: | - apk add build-base bash musl-dev curl make libtool libffi-dev gcc automake autoconf git openssl-dev g++ - - name: Install Rust - uses: dtolnay/rust-toolchain@stable - with: - toolchain: 1.63 - - uses: actions/download-artifact@v3 - with: - name: capi-x86_64-unknown-linux-musl - - uses: actions/download-artifact@v3 - with: - name: wasmer-cli-x86_64-unknown-linux-musl - - name: make test-integration-cli - run: | - make test-integration-cli - - test_integration_macos_x86: - name: integration tests on macos-x86 - runs-on: macos-11 - needs: [build_wasmer_macos_x86, build_capi_macos_x86] - steps: - - uses: actions/checkout@v3 - - name: Install Rust - uses: dtolnay/rust-toolchain@stable - with: - toolchain: 1.63 - - uses: actions/download-artifact@v3 - with: - name: capi-x86_64-apple-darwin - - uses: actions/download-artifact@v3 - with: - name: wasmer-cli-x86_64-apple-darwin - - name: make test-integration-cli - run: | - make test-integration-cli - - test_integration_macos_arm: - name: integration tests on macos-arm - runs-on: macos-11 - needs: [build_wasmer_macos_arm, build_capi_macos_arm] - steps: - - uses: actions/checkout@v3 - - name: Install Rust - uses: dtolnay/rust-toolchain@stable - with: - toolchain: 1.63 - target: aarch64-apple-darwin - - uses: actions/download-artifact@v3 - with: - name: capi-aarch64-apple-darwin - - uses: actions/download-artifact@v3 - with: - name: wasmer-cli-aarch64-apple-darwin - - name: make test-integration-cli - run: | - make test-integration-cli - env: - CARGO_TARGET: aarch64-apple-darwin - - test_integration_windows_x86: - name: integration tests on windows-x64 - runs-on: windows-2019 - needs: [build_wasmer_windows_x86, build_capi_windows_x86] - steps: - - uses: actions/checkout@v3 - - name: Install Rust - uses: dtolnay/rust-toolchain@stable - with: - toolchain: 1.63 - - uses: actions/download-artifact@v3 - with: - name: capi-x86_64-pc-windows-msvc - - uses: actions/download-artifact@v3 - with: - name: wasmer-cli-x86_64-pc-windows-msvc - - name: make test-integration-cli - run: | - make test-integration-cli From 06de4302e8f27fe4b50f916cd6331b2af899ba80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Fri, 25 Nov 2022 12:59:58 +0100 Subject: [PATCH 049/226] Add test-wasmer step --- .github/workflows/test.yaml | 59 +++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 2d561c11354..a5063875312 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -221,6 +221,65 @@ jobs: steps: - uses: actions/checkout@v3 + test_wasmer: + name: Test Wasmer on ${{ matrix.build }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + include: + - build: linux-x64 + os: ubuntu-18.04 + target: x86_64-unknown-linux-gnu + llvm_url: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz' + run_test: true + run_test_capi: true + run_integration_tests: true + run_build_docs: true + use_sccache: true + - build: macos-x64 + os: macos-11 + target: x86_64-apple-darwin + llvm_url: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-apple-darwin.tar.xz' + run_test: true + run_test_capi: true + use_sccache: true + run_integration_tests: true + run_ios_tests: true + run_build_docs: false + - build: macos-arm64 + os: macos-11.0 + target: aarch64-apple-darwin + use_sccache: true + run_test: false + run_test_capi: false + run_build_docs: false + - build: windows-x64 + os: windows-2019 + #target: x86_64-pc-windows-msvc commented because of bug in rust setup action + # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/12.x/windows-amd64.tar.gz' + llvm_choco_version: 13.0.0 + run_integration_tests: true + use_sccache: true + run_test: true + run_test_capi: false # We can't run yet the capi tests on Windows + run_build_docs: false + - build: linux-musl-x64 + target: x86_64-unknown-linux-musl + os: ubuntu-latest + container: alpine:latest + run_test: true + run_test_capi: false # It can't run the capi tests because of a cc linker issue (`wasm_engine_new` is redefined) + run_integration_tests: false + run_build_docs: false + use_sccache: false + container: ${{ matrix.container }} + env: + SCCACHE_AZURE_BLOB_CONTAINER: wasmerstoragesccacheblob + SCCACHE_AZURE_CONNECTION_STRING: ${{ secrets.SCCACHE_AZURE_CONNECTION_STRING }} + steps: + - uses: actions/checkout@v3 + test_capi: name: Test C-API on ${{ matrix.build }} runs-on: ${{ matrix.os }} From 525f132eb03d654c48a9c1e1ad702396e87d9b24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Fri, 25 Nov 2022 13:52:28 +0100 Subject: [PATCH 050/226] Add downloading / uploading and compilation step --- .github/workflows/test.yaml | 256 ++++++++++++++++++++++++++++++++++-- Makefile | 41 +++++- 2 files changed, 279 insertions(+), 18 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index a5063875312..f5860015fee 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -100,7 +100,6 @@ jobs: rustup target add wasm32-wasi make build-wasmer-wasm - # build-wasmer: run build-wasmer and build-capi for every OS in parallel build_wasmer: name: Build wasmer on ${{ matrix.build }} runs-on: ${{ matrix.os }} @@ -160,6 +159,75 @@ jobs: SCCACHE_AZURE_CONNECTION_STRING: ${{ secrets.SCCACHE_AZURE_CONNECTION_STRING }} steps: - uses: actions/checkout@v3 + - name: Set up libstdc++ on Linux + if: matrix.build == 'linux-x64' + run: | + sudo apt-get update -y + sudo apt-get install -y --allow-downgrades libstdc++6=8.4.0-1ubuntu1~18.04 + sudo apt-get install --reinstall g++-8 + - name: Set up base deps on musl + if: matrix.build == 'linux-musl-x64' + run: | + apk add build-base bash musl-dev curl make libtool libffi-dev gcc automake autoconf git openssl-dev g++ + - name: Install Rust + uses: dtolnay/rust-toolchain@stable + with: + toolchain: 1.63 + target: ${{ matrix.target }} + - name: Install LLVM (Choco - Windows) + if: matrix.llvm_choco_version + shell: bash + run: | + choco install llvm --version ${{ matrix.llvm_choco_version }} --allow-downgrade + cd 'C:\Program Files\LLVM\' + LLVM_DIR=$(pwd) + echo "LLVM_SYS_120_PREFIX=${LLVM_DIR}" >> $GITHUB_ENV + - name: Install LLVM (macOS Apple Silicon) + if: matrix.os == 'macos-11.0' && !matrix.llvm_url + run: | + brew install llvm + - name: Install LLVM + if: matrix.llvm_url + shell: bash + run: | + curl --proto '=https' --tlsv1.2 -sSf ${{ matrix.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_SYS_120_PREFIX=${LLVM_DIR}" >> $GITHUB_ENV + env: + LLVM_DIR: .llvm + - 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.os == 'macos-latest' || matrix.os == 'macos-11.0' + - name: Setup Rust target + run: | + mkdir -p .cargo + cat << EOF > .cargo/config.toml + [build] + target = "${{ matrix.target }}" + EOF + if: matrix.target + - name: Build wasmer-cli + shell: bash + run: | + make build-wasmer && make package-wasmer + - name: Zip artifacts + shell: bash + run: | + make tar-wasmer + - name: Archive production artifacts + uses: actions/upload-artifact@v3 + with: + name: wasmer-cli-${{ matrix.target }} + path: build-wasmer.tar.gz + if-no-files-found: error + retention-days: 2 build_capi: name: Build C-API on ${{ matrix.build }} @@ -220,13 +288,84 @@ jobs: SCCACHE_AZURE_CONNECTION_STRING: ${{ secrets.SCCACHE_AZURE_CONNECTION_STRING }} steps: - uses: actions/checkout@v3 + - name: Set up libstdc++ on Linux + if: matrix.build == 'linux-x64' + run: | + sudo apt-get update -y + sudo apt-get install -y --allow-downgrades libstdc++6=8.4.0-1ubuntu1~18.04 + sudo apt-get install --reinstall g++-8 + - name: Set up base deps on musl + if: matrix.build == 'linux-musl-x64' + run: | + apk add build-base bash musl-dev curl make libtool libffi-dev gcc automake autoconf git openssl-dev g++ + - name: Install Rust + uses: dtolnay/rust-toolchain@stable + with: + toolchain: 1.63 + target: ${{ matrix.target }} + - name: Install LLVM (Choco - Windows) + if: matrix.llvm_choco_version + shell: bash + run: | + choco install llvm --version ${{ matrix.llvm_choco_version }} --allow-downgrade + cd 'C:\Program Files\LLVM\' + LLVM_DIR=$(pwd) + echo "LLVM_SYS_120_PREFIX=${LLVM_DIR}" >> $GITHUB_ENV + - name: Install LLVM (macOS Apple Silicon) + if: matrix.os == 'macos-11.0' && !matrix.llvm_url + run: | + brew install llvm + - name: Install LLVM + if: matrix.llvm_url + shell: bash + run: | + curl --proto '=https' --tlsv1.2 -sSf ${{ matrix.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_SYS_120_PREFIX=${LLVM_DIR}" >> $GITHUB_ENV + env: + LLVM_DIR: .llvm + - 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.os == 'macos-latest' || matrix.os == 'macos-11.0' + - name: Setup Rust target + run: | + mkdir -p .cargo + cat << EOF > .cargo/config.toml + [build] + target = "${{ matrix.target }}" + EOF + if: matrix.target + - name: Build wasmer-cli + shell: bash + run: | + make build-capi && make package-capi + - name: Zip artifacts + shell: bash + run: | + make tar-capi + - name: Archive production artifacts + uses: actions/upload-artifact@v3 + with: + name: capi-${{ matrix.target }} + path: build-capi.tar.gz + if-no-files-found: error + retention-days: 2 test_wasmer: name: Test Wasmer on ${{ matrix.build }} runs-on: ${{ matrix.os }} + needs: setup strategy: fail-fast: false matrix: + stage: [0,1,2,3,4,5,6] include: - build: linux-x64 os: ubuntu-18.04 @@ -279,6 +418,68 @@ jobs: SCCACHE_AZURE_CONNECTION_STRING: ${{ secrets.SCCACHE_AZURE_CONNECTION_STRING }} steps: - uses: actions/checkout@v3 + - name: Set up libstdc++ on Linux + if: matrix.build == 'linux-x64' + run: | + sudo apt-get update -y + sudo apt-get install -y --allow-downgrades libstdc++6=8.4.0-1ubuntu1~18.04 + sudo apt-get install --reinstall g++-8 + - name: Set up base deps on musl + if: matrix.build == 'linux-musl-x64' + run: | + apk add build-base bash musl-dev curl make libtool libffi-dev gcc automake autoconf git openssl-dev g++ + - name: Install Rust + uses: dtolnay/rust-toolchain@stable + with: + toolchain: 1.63 + target: ${{ matrix.target }} + - name: Install LLVM (Choco - Windows) + if: matrix.llvm_choco_version + shell: bash + run: | + choco install llvm --version ${{ matrix.llvm_choco_version }} --allow-downgrade + cd 'C:\Program Files\LLVM\' + LLVM_DIR=$(pwd) + echo "LLVM_SYS_120_PREFIX=${LLVM_DIR}" >> $GITHUB_ENV + - name: Install LLVM (macOS Apple Silicon) + if: matrix.os == 'macos-11.0' && !matrix.llvm_url + run: | + brew install llvm + - name: Install LLVM + if: matrix.llvm_url + shell: bash + run: | + curl --proto '=https' --tlsv1.2 -sSf ${{ matrix.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_SYS_120_PREFIX=${LLVM_DIR}" >> $GITHUB_ENV + env: + LLVM_DIR: .llvm + - 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.os == 'macos-latest' || matrix.os == 'macos-11.0' + - name: Setup Rust target + run: | + mkdir -p .cargo + cat << EOF > .cargo/config.toml + [build] + target = "${{ matrix.target }}" + EOF + if: matrix.target + - name: Test + if: matrix.run_test + run: | + make test-stage-${{ matrix.stage }} + env: + TARGET: ${{ matrix.target }} + TARGET_DIR: target/${{ matrix.target }}/release + CARGO_TARGET: --target ${{ matrix.target }} test_capi: name: Test C-API on ${{ matrix.build }} @@ -339,6 +540,21 @@ jobs: SCCACHE_AZURE_CONNECTION_STRING: ${{ secrets.SCCACHE_AZURE_CONNECTION_STRING }} steps: - uses: actions/checkout@v3 + - uses: actions/download-artifact@v3 + with: + name: capi-${{ matrix.target }} + - name: Unzip Artifacts + shell: bash + run: | + make untar-capi + - name: Test C API + if: matrix.run_test_capi + run: | + make test-capi-ci + env: + TARGET: ${{ matrix.target }} + TARGET_DIR: target/${{ matrix.target }}/release + CARGO_TARGET: --target ${{ matrix.target }} test_integration_cli: name: Integration tests on ${{ matrix.build }} @@ -399,13 +615,31 @@ jobs: SCCACHE_AZURE_CONNECTION_STRING: ${{ secrets.SCCACHE_AZURE_CONNECTION_STRING }} steps: - uses: actions/checkout@v3 - - # todo: build wasmer headless - - # build-capi: run build-capi for every OS, does NOT depend on build-wasmer - # (can run in parallel with build-wasmer step) - - # make test: run unit tests for wasmer, depends on build-wasmer step - # (can run in parallel with build-capi step) - - # test-integration-cli: run integration tests for wasmer, depends on build-capi and build-wasmer steps + - uses: actions/download-artifact@v3 + with: + name: capi-${{ matrix.target }} + - uses: actions/download-artifact@v3 + with: + name: wasmer-cli-${{ matrix.target }} + - name: Unzip Artifacts + shell: bash + run: | + make untar-capi + - name: Unzip Artifacts + shell: bash + run: | + make untar-wasmer + - uses: goto-bus-stop/setup-zig@v2 + with: + version: 0.10.0 + - name: Test integration CLI + if: matrix.run_test && matrix.os != 'windows-2019' + shell: bash + run: | + export WASMER_DIR=`pwd`/package && make test-integration-cli + env: + TARGET: ${{ matrix.target }} + TARGET_DIR: target/${{ matrix.target }}/release + CARGO_TARGET: --target ${{ matrix.target }} + WAPM_DEV_TOKEN: ${{ secrets.WAPM_DEV_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/Makefile b/Makefile index 68821bb4283..60d034ab427 100644 --- a/Makefile +++ b/Makefile @@ -478,17 +478,32 @@ build-capi-headless-ios: capi-setup # ##### -test: test-compilers test-packages test-examples - -test-compilers: +# test compilers +test-stage-0: $(CARGO_BINARY) test $(CARGO_TARGET) --release --tests $(compiler_features) -test-packages: +# test packages +test-stage-1: $(CARGO_BINARY) test $(CARGO_TARGET) --all --release $(exclude_tests) +test-stage-2: $(CARGO_BINARY) test $(CARGO_TARGET) --manifest-path lib/compiler-cranelift/Cargo.toml --release --no-default-features --features=std +test-stage:3: $(CARGO_BINARY) test $(CARGO_TARGET) --manifest-path lib/compiler-singlepass/Cargo.toml --release --no-default-features --features=std +test-stage:4: $(CARGO_BINARY) test $(CARGO_TARGET) --manifest-path lib/cli/Cargo.toml $(compiler_features) --release +# test examples +test-stage-5: + $(CARGO_BINARY) test $(CARGO_TARGET) $(compiler_features) --features wasi --examples +test-stage-6: + $(CARGO_BINARY) test $(CARGO_TARGET) --release $(compiler_features) --features wasi --examples + +test: test-compilers test-packages test-examples + +test-compilers: test-stage-0 + +test-packages: test-stage-1 test-stage-2 test-stage-3 test-stage-4 + test-js: test-js-api test-js-wasi test-js-core: @@ -527,6 +542,8 @@ test-llvm: $(foreach llvm_engine,$(filter llvm-%,$(compilers_engines)),test-$(ll # compilers first test-capi: build-capi package-capi $(foreach compiler_engine,$(capi_compilers_engines),test-capi-crate-$(compiler_engine) test-capi-integration-$(compiler_engine)) +test-capi-ci: $(foreach compiler_engine,$(capi_compilers_engines),test-capi-crate-$(compiler_engine) test-capi-integration-$(compiler_engine)) + test-capi-crate-%: WASMER_CAPI_CONFIG=$(shell echo $@ | sed -e s/test-capi-crate-//) $(CARGO_BINARY) test $(CARGO_TARGET) --manifest-path lib/c-api/Cargo.toml --release \ --no-default-features --features wat,compiler,wasi,middlewares,webc_runner $(capi_compiler_features) -- --nocapture @@ -544,9 +561,7 @@ test-wasi-unit: test-wasi: $(CARGO_BINARY) test $(CARGO_TARGET) --release --tests $(compiler_features) -- wasi::wasitests -test-examples: - $(CARGO_BINARY) test $(CARGO_TARGET) $(compiler_features) --features wasi --examples - $(CARGO_BINARY) test $(CARGO_TARGET) --release $(compiler_features) --features wasi --examples +test-examples: test-stage-5 test-stage-6 test-integration-cli: $(CARGO_BINARY) test $(CARGO_TARGET) --features webc_runner --no-fail-fast -p wasmer-integration-tests-cli -- --nocapture @@ -692,6 +707,18 @@ package-capi-gnu: cp target/x86_64-pc-windows-gnu/release/libwasmer.a package/lib/libwasmer.a ;\ fi +tar-capi: + tar -C package -zcvf build-capi.tar.gz lib include + +untar-capi: + tar -C package -xf build-capi.tar.gz + +tar-wasmer: + tar -C package -zcvf build-wasmer.tar.gz bin + +untar-wasmer: + tar -C package -xf build-wasmer.tar.gz + distribution-gnu: package-gnu cp LICENSE package/LICENSE cp ATTRIBUTIONS.md package/ATTRIBUTIONS From be0562ba022feea589358854919107712761065f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Fri, 25 Nov 2022 14:01:06 +0100 Subject: [PATCH 051/226] Fix typo in Makefile --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 60d034ab427..012375c2198 100644 --- a/Makefile +++ b/Makefile @@ -487,9 +487,9 @@ test-stage-1: $(CARGO_BINARY) test $(CARGO_TARGET) --all --release $(exclude_tests) test-stage-2: $(CARGO_BINARY) test $(CARGO_TARGET) --manifest-path lib/compiler-cranelift/Cargo.toml --release --no-default-features --features=std -test-stage:3: +test-stage-3: $(CARGO_BINARY) test $(CARGO_TARGET) --manifest-path lib/compiler-singlepass/Cargo.toml --release --no-default-features --features=std -test-stage:4: +test-stage-4: $(CARGO_BINARY) test $(CARGO_TARGET) --manifest-path lib/cli/Cargo.toml $(compiler_features) --release # test examples From 9f144081d34d885e754548158405acae0ef9d523 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Fri, 25 Nov 2022 14:10:55 +0100 Subject: [PATCH 052/226] Use choco action on Windows --- .github/workflows/test.yaml | 60 ++++++++++++++++++++++--------------- 1 file changed, 36 insertions(+), 24 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index f5860015fee..0bb58d07f65 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -169,16 +169,27 @@ jobs: if: matrix.build == 'linux-musl-x64' run: | apk add build-base bash musl-dev curl make libtool libffi-dev gcc automake autoconf git openssl-dev g++ + - 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.os == 'macos-latest' || matrix.os == 'macos-11.0' - name: Install Rust uses: dtolnay/rust-toolchain@stable with: toolchain: 1.63 target: ${{ matrix.target }} + - name: Choco install LLVM + uses: crazy-max/ghaction-chocolatey@v2 + if: matrix.llvm_choco_version + with: + args: install llvm --version ${{ matrix.llvm_choco_version }} --allow-downgrade - name: Install LLVM (Choco - Windows) if: matrix.llvm_choco_version shell: bash run: | - choco install llvm --version ${{ matrix.llvm_choco_version }} --allow-downgrade cd 'C:\Program Files\LLVM\' LLVM_DIR=$(pwd) echo "LLVM_SYS_120_PREFIX=${LLVM_DIR}" >> $GITHUB_ENV @@ -198,13 +209,6 @@ jobs: echo "LLVM_SYS_120_PREFIX=${LLVM_DIR}" >> $GITHUB_ENV env: LLVM_DIR: .llvm - - 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.os == 'macos-latest' || matrix.os == 'macos-11.0' - name: Setup Rust target run: | mkdir -p .cargo @@ -298,16 +302,27 @@ jobs: if: matrix.build == 'linux-musl-x64' run: | apk add build-base bash musl-dev curl make libtool libffi-dev gcc automake autoconf git openssl-dev g++ + - 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.os == 'macos-latest' || matrix.os == 'macos-11.0' - name: Install Rust uses: dtolnay/rust-toolchain@stable with: toolchain: 1.63 target: ${{ matrix.target }} + - name: Choco install LLVM + uses: crazy-max/ghaction-chocolatey@v2 + if: matrix.llvm_choco_version + with: + args: install llvm --version ${{ matrix.llvm_choco_version }} --allow-downgrade - name: Install LLVM (Choco - Windows) if: matrix.llvm_choco_version shell: bash run: | - choco install llvm --version ${{ matrix.llvm_choco_version }} --allow-downgrade cd 'C:\Program Files\LLVM\' LLVM_DIR=$(pwd) echo "LLVM_SYS_120_PREFIX=${LLVM_DIR}" >> $GITHUB_ENV @@ -327,13 +342,6 @@ jobs: echo "LLVM_SYS_120_PREFIX=${LLVM_DIR}" >> $GITHUB_ENV env: LLVM_DIR: .llvm - - 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.os == 'macos-latest' || matrix.os == 'macos-11.0' - name: Setup Rust target run: | mkdir -p .cargo @@ -428,16 +436,27 @@ jobs: if: matrix.build == 'linux-musl-x64' run: | apk add build-base bash musl-dev curl make libtool libffi-dev gcc automake autoconf git openssl-dev g++ + - 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.os == 'macos-latest' || matrix.os == 'macos-11.0' - name: Install Rust uses: dtolnay/rust-toolchain@stable with: toolchain: 1.63 target: ${{ matrix.target }} + - name: Choco install LLVM + uses: crazy-max/ghaction-chocolatey@v2 + if: matrix.llvm_choco_version + with: + args: install llvm --version ${{ matrix.llvm_choco_version }} --allow-downgrade - name: Install LLVM (Choco - Windows) if: matrix.llvm_choco_version shell: bash run: | - choco install llvm --version ${{ matrix.llvm_choco_version }} --allow-downgrade cd 'C:\Program Files\LLVM\' LLVM_DIR=$(pwd) echo "LLVM_SYS_120_PREFIX=${LLVM_DIR}" >> $GITHUB_ENV @@ -457,13 +476,6 @@ jobs: echo "LLVM_SYS_120_PREFIX=${LLVM_DIR}" >> $GITHUB_ENV env: LLVM_DIR: .llvm - - 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.os == 'macos-latest' || matrix.os == 'macos-11.0' - name: Setup Rust target run: | mkdir -p .cargo From b054fca65fdd293450cba9e098f132d4a9c60e24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Fri, 25 Nov 2022 14:17:23 +0100 Subject: [PATCH 053/226] Test wasmer test stage 0 working --- .github/workflows/test.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 0bb58d07f65..984d0aa808d 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -373,7 +373,6 @@ jobs: strategy: fail-fast: false matrix: - stage: [0,1,2,3,4,5,6] include: - build: linux-x64 os: ubuntu-18.04 @@ -487,7 +486,7 @@ jobs: - name: Test if: matrix.run_test run: | - make test-stage-${{ matrix.stage }} + make test-stage-0 env: TARGET: ${{ matrix.target }} TARGET_DIR: target/${{ matrix.target }}/release From 0fe386586179374fbe9912a3e0d66a456791c90b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Fri, 25 Nov 2022 14:21:28 +0100 Subject: [PATCH 054/226] Use matrix.build instead of matrix.target as the Artifact ID --- .github/workflows/test.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 984d0aa808d..55e736ca17c 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -228,7 +228,7 @@ jobs: - name: Archive production artifacts uses: actions/upload-artifact@v3 with: - name: wasmer-cli-${{ matrix.target }} + name: wasmer-cli-${{ matrix.build }} path: build-wasmer.tar.gz if-no-files-found: error retention-days: 2 @@ -361,7 +361,7 @@ jobs: - name: Archive production artifacts uses: actions/upload-artifact@v3 with: - name: capi-${{ matrix.target }} + name: capi-${{ matrix.build }} path: build-capi.tar.gz if-no-files-found: error retention-days: 2 @@ -628,10 +628,10 @@ jobs: - uses: actions/checkout@v3 - uses: actions/download-artifact@v3 with: - name: capi-${{ matrix.target }} + name: capi-${{ matrix.build }} - uses: actions/download-artifact@v3 with: - name: wasmer-cli-${{ matrix.target }} + name: wasmer-cli-${{ matrix.build }} - name: Unzip Artifacts shell: bash run: | From 52865104e52b2565cb08122cb559b8a2d79efe2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Fri, 25 Nov 2022 14:24:06 +0100 Subject: [PATCH 055/226] Add matrix.target on Windows back --- .github/workflows/test.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 55e736ca17c..0e20980c628 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -136,7 +136,7 @@ jobs: run_build_docs: false - build: windows-x64 os: windows-2019 - #target: x86_64-pc-windows-msvc commented because of bug in rust setup action + target: x86_64-pc-windows-msvc # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/12.x/windows-amd64.tar.gz' llvm_choco_version: 13.0.0 run_integration_tests: true @@ -269,7 +269,7 @@ jobs: run_build_docs: false - build: windows-x64 os: windows-2019 - #target: x86_64-pc-windows-msvc commented because of bug in rust setup action + target: x86_64-pc-windows-msvc # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/12.x/windows-amd64.tar.gz' llvm_choco_version: 13.0.0 run_integration_tests: true @@ -402,7 +402,7 @@ jobs: run_build_docs: false - build: windows-x64 os: windows-2019 - #target: x86_64-pc-windows-msvc commented because of bug in rust setup action + target: x86_64-pc-windows-msvc # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/12.x/windows-amd64.tar.gz' llvm_choco_version: 13.0.0 run_integration_tests: true @@ -528,7 +528,7 @@ jobs: run_build_docs: false - build: windows-x64 os: windows-2019 - #target: x86_64-pc-windows-msvc commented because of bug in rust setup action + target: x86_64-pc-windows-msvc # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/12.x/windows-amd64.tar.gz' llvm_choco_version: 13.0.0 run_integration_tests: true @@ -603,7 +603,7 @@ jobs: run_build_docs: false - build: windows-x64 os: windows-2019 - #target: x86_64-pc-windows-msvc commented because of bug in rust setup action + target: x86_64-pc-windows-msvc # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/12.x/windows-amd64.tar.gz' llvm_choco_version: 13.0.0 run_integration_tests: true From 717309a25ea5cf92c347ce16c5a5437e0050eea6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Fri, 25 Nov 2022 14:25:43 +0100 Subject: [PATCH 056/226] Remove conditionals, see where compilation fails --- .github/workflows/test.yaml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 0e20980c628..96089de4548 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -484,7 +484,6 @@ jobs: EOF if: matrix.target - name: Test - if: matrix.run_test run: | make test-stage-0 env: @@ -559,7 +558,6 @@ jobs: run: | make untar-capi - name: Test C API - if: matrix.run_test_capi run: | make test-capi-ci env: @@ -644,7 +642,7 @@ jobs: with: version: 0.10.0 - name: Test integration CLI - if: matrix.run_test && matrix.os != 'windows-2019' + if: matrix.os != 'windows-2019' shell: bash run: | export WASMER_DIR=`pwd`/package && make test-integration-cli From 245f5995b4db44bb3125cd32f0e94d946e09a3b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Fri, 25 Nov 2022 14:27:14 +0100 Subject: [PATCH 057/226] Fix test-capi in Makefile --- Makefile | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 012375c2198..e10905e3079 100644 --- a/Makefile +++ b/Makefile @@ -538,11 +538,12 @@ test-cranelift: $(foreach cranelift_engine,$(filter cranelift-%,$(compilers_engi test-llvm: $(foreach llvm_engine,$(filter llvm-%,$(compilers_engines)),test-$(llvm_engine)) +# same as test-capi, but without the build-capi step first +test-capi-ci: $(foreach compiler_engine,$(capi_compilers_engines),test-capi-crate-$(compiler_engine) test-capi-integration-$(compiler_engine)) + # This test requires building the capi with all the available # compilers first -test-capi: build-capi package-capi $(foreach compiler_engine,$(capi_compilers_engines),test-capi-crate-$(compiler_engine) test-capi-integration-$(compiler_engine)) - -test-capi-ci: $(foreach compiler_engine,$(capi_compilers_engines),test-capi-crate-$(compiler_engine) test-capi-integration-$(compiler_engine)) +test-capi: build-capi package-capi test-capi-ci test-capi-crate-%: WASMER_CAPI_CONFIG=$(shell echo $@ | sed -e s/test-capi-crate-//) $(CARGO_BINARY) test $(CARGO_TARGET) --manifest-path lib/c-api/Cargo.toml --release \ From a844bdf759c7792e8c561ff53330b847ef2d94cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Fri, 25 Nov 2022 14:30:48 +0100 Subject: [PATCH 058/226] Use bash on Windows --- .github/workflows/test.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 96089de4548..aea8ba28c39 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -210,6 +210,7 @@ jobs: env: LLVM_DIR: .llvm - name: Setup Rust target + shell: bash run: | mkdir -p .cargo cat << EOF > .cargo/config.toml @@ -343,6 +344,7 @@ jobs: env: LLVM_DIR: .llvm - name: Setup Rust target + shell: bash run: | mkdir -p .cargo cat << EOF > .cargo/config.toml @@ -476,6 +478,7 @@ jobs: env: LLVM_DIR: .llvm - name: Setup Rust target + shell: bash run: | mkdir -p .cargo cat << EOF > .cargo/config.toml From 97ae9cd7ca64197618fff40c41d5ba898bb95f04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Fri, 25 Nov 2022 14:48:50 +0100 Subject: [PATCH 059/226] Fix package-wasmer --- Makefile | 59 ++++++++++++++++++++++++++++++++------------------------ 1 file changed, 34 insertions(+), 25 deletions(-) diff --git a/Makefile b/Makefile index e10905e3079..a5a7c983c86 100644 --- a/Makefile +++ b/Makefile @@ -611,9 +611,19 @@ endif package-wasmer: mkdir -p "package/bin" ifeq ($(IS_WINDOWS), 1) - cp $(TARGET_DIR)/wasmer.exe package/bin/ + if [ -f "$(TARGET_DIR)/wasmer.exe" ]; then \ + cp $(TARGET_DIR)/wasmer.exe package/bin ;\ + fi + if [ -f "target/$(HOST_TARGET)/release/wasmer.exe" ]; then \ + cp "target/$(HOST_TARGET)/release/wasmer.exe package/bin ;\ + fi else - cp $(TARGET_DIR)/wasmer package/bin/ + if [ -f "$(TARGET_DIR)/wasmer" ]; then \ + cp $(TARGET_DIR)/wasmer package/bin ;\ + fi + if [ -f "target/$(HOST_TARGET)/release/wasmer" ]; then \ + cp target/$(HOST_TARGET)/release/wasmer package/bin ;\ + fi ifeq ($(IS_DARWIN), 1) codesign -s - package/bin/wasmer || true endif @@ -649,6 +659,28 @@ package-capi: cp $(TARGET_DIR)/libwasmer.a package/lib/libwasmer.a ;\ fi + if [ -f target/release/wasmer.dll ]; then \ + cp target/release/wasmer.dll package/lib/wasmer.dll ;\ + fi + + if [ -f target/release/wasmer.dll.lib ]; then \ + cp target/release/wasmer.dll.lib package/lib/wasmer.dll.lib ;\ + fi + if [ -f target/release/wasmer.lib ]; then \ + cp target/release/wasmer.lib package/lib/wasmer.lib ;\ + fi + + if [ -f target/release/libwasmer.dylib ]; then \ + cp target/release/libwasmer.dylib package/lib/libwasmer.dylib ;\ + fi + + if [ -f target/release/libwasmer.so ]; then \ + cp target/release/libwasmer.so package/lib/libwasmer.so ;\ + fi + if [ -f target/release/libwasmer.a ]; then \ + cp target/release/libwasmer.a package/lib/libwasmer.a ;\ + fi + package-capi-headless: build-capi-headless mkdir -p "package/include" mkdir -p "package/lib" @@ -685,29 +717,6 @@ package: package-wasmer package-minimal-headless-wasmer package-capi package-gnu: package-capi-gnu -package-capi-gnu: - mkdir -p "package/include" - mkdir -p "package/lib" - cp lib/c-api/wasmer.h* package/include - cp lib/c-api/wasmer_wasm.h* package/include - cp lib/c-api/tests/wasm-c-api/include/wasm.h* package/include - cp lib/c-api/README.md package/include/README.md - if [ -f target/x86_64-pc-windows-gnu/release/wasmer.dll ]; then \ - cp target/x86_64-pc-windows-gnu/release/wasmer.dll package/lib/wasmer.dll ;\ - fi - - if [ -f target/x86_64-pc-windows-gnu/release/wasmer.dll.lib ]; then \ - cp target/x86_64-pc-windows-gnu/release/wasmer.dll.lib package/lib/wasmer.dll.lib ;\ - fi - - if [ -f target/x86_64-pc-windows-gnu/release/wasmer.lib ]; then \ - cp target/x86_64-pc-windows-gnu/release/wasmer.lib package/lib/wasmer.lib ;\ - fi - - if [ -f target/x86_64-pc-windows-gnu/release/libwasmer.a ]; then \ - cp target/x86_64-pc-windows-gnu/release/libwasmer.a package/lib/libwasmer.a ;\ - fi - tar-capi: tar -C package -zcvf build-capi.tar.gz lib include From 810d7882d630c495ad947dd70da1db29d9c6cae1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Fri, 25 Nov 2022 15:01:01 +0100 Subject: [PATCH 060/226] Fix download for test_capi step --- .github/workflows/test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index aea8ba28c39..167fa216c21 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -555,7 +555,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/download-artifact@v3 with: - name: capi-${{ matrix.target }} + name: capi-${{ matrix.build }} - name: Unzip Artifacts shell: bash run: | From 773d3de02a822daf48790e2aa64c5d2c4dde3c7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Fri, 25 Nov 2022 15:13:25 +0100 Subject: [PATCH 061/226] Fix error in Makefile package-capi --- Makefile | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/Makefile b/Makefile index a5a7c983c86..e03b0fd5544 100644 --- a/Makefile +++ b/Makefile @@ -659,26 +659,26 @@ package-capi: cp $(TARGET_DIR)/libwasmer.a package/lib/libwasmer.a ;\ fi - if [ -f target/release/wasmer.dll ]; then \ - cp target/release/wasmer.dll package/lib/wasmer.dll ;\ + if [ -f target/$(HOST_TARGET)/wasmer.dll ]; then \ + cp target/$(HOST_TARGET)/wasmer.dll package/lib/wasmer.dll ;\ fi - if [ -f target/release/wasmer.dll.lib ]; then \ - cp target/release/wasmer.dll.lib package/lib/wasmer.dll.lib ;\ + if [ -f target/$(HOST_TARGET)/wasmer.dll.lib ]; then \ + cp target/$(HOST_TARGET)/wasmer.dll.lib package/lib/wasmer.dll.lib ;\ fi - if [ -f target/release/wasmer.lib ]; then \ - cp target/release/wasmer.lib package/lib/wasmer.lib ;\ + if [ -f target/$(HOST_TARGET)/wasmer.lib ]; then \ + cp target/$(HOST_TARGET)/wasmer.lib package/lib/wasmer.lib ;\ fi - if [ -f target/release/libwasmer.dylib ]; then \ - cp target/release/libwasmer.dylib package/lib/libwasmer.dylib ;\ + if [ -f target/$(HOST_TARGET)/libwasmer.dylib ]; then \ + cp target/$(HOST_TARGET)/libwasmer.dylib package/lib/libwasmer.dylib ;\ fi - if [ -f target/release/libwasmer.so ]; then \ - cp target/release/libwasmer.so package/lib/libwasmer.so ;\ + if [ -f target/$(HOST_TARGET)/libwasmer.so ]; then \ + cp target/$(HOST_TARGET)/libwasmer.so package/lib/libwasmer.so ;\ fi - if [ -f target/release/libwasmer.a ]; then \ - cp target/release/libwasmer.a package/lib/libwasmer.a ;\ + if [ -f target/$(HOST_TARGET)/libwasmer.a ]; then \ + cp target/$(HOST_TARGET)/libwasmer.a package/lib/libwasmer.a ;\ fi package-capi-headless: build-capi-headless From 5872f78a2af30f5a686adc8febc3e223a3122430 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Fri, 25 Nov 2022 15:37:45 +0100 Subject: [PATCH 062/226] Add debugging to CI --- .github/workflows/test.yaml | 30 ++++++++++++++++++++---------- Makefile | 11 +++++++---- 2 files changed, 27 insertions(+), 14 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 167fa216c21..628e44ab10d 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -127,9 +127,9 @@ jobs: run_integration_tests: true run_ios_tests: true run_build_docs: false - - build: macos-arm64 + - build: macos-x86_64 os: macos-11.0 - target: aarch64-apple-darwin + target: x86_64-apple-darwin use_sccache: true run_test: false run_test_capi: false @@ -261,9 +261,9 @@ jobs: run_integration_tests: true run_ios_tests: true run_build_docs: false - - build: macos-arm64 + - build: macos-x86_64 os: macos-11.0 - target: aarch64-apple-darwin + target: x86_64-apple-darwin use_sccache: true run_test: false run_test_capi: false @@ -395,9 +395,9 @@ jobs: run_integration_tests: true run_ios_tests: true run_build_docs: false - - build: macos-arm64 + - build: macos-x86_64 os: macos-11.0 - target: aarch64-apple-darwin + target: x86_64-apple-darwin use_sccache: true run_test: false run_test_capi: false @@ -521,9 +521,9 @@ jobs: run_integration_tests: true run_ios_tests: true run_build_docs: false - - build: macos-arm64 + - build: macos-x86_64 os: macos-11.0 - target: aarch64-apple-darwin + target: x86_64-apple-darwin use_sccache: true run_test: false run_test_capi: false @@ -554,8 +554,13 @@ jobs: steps: - uses: actions/checkout@v3 - uses: actions/download-artifact@v3 + id: download with: name: capi-${{ matrix.build }} + - name: 'Echo download path' + run: echo ${{steps.download.outputs.download-path}} + - name: Display structure of downloaded files + run: ls -R - name: Unzip Artifacts shell: bash run: | @@ -595,9 +600,9 @@ jobs: run_integration_tests: true run_ios_tests: true run_build_docs: false - - build: macos-arm64 + - build: macos-x86_64 os: macos-11.0 - target: aarch64-apple-darwin + target: x86_64-apple-darwin use_sccache: true run_test: false run_test_capi: false @@ -628,11 +633,16 @@ jobs: steps: - uses: actions/checkout@v3 - uses: actions/download-artifact@v3 + id: download with: name: capi-${{ matrix.build }} - uses: actions/download-artifact@v3 with: name: wasmer-cli-${{ matrix.build }} + - name: 'Echo download path' + run: echo ${{steps.download.outputs.download-path}} + - name: Display structure of downloaded files + run: ls -R - name: Unzip Artifacts shell: bash run: | diff --git a/Makefile b/Makefile index e03b0fd5544..de2a2a61286 100644 --- a/Makefile +++ b/Makefile @@ -610,19 +610,20 @@ endif package-wasmer: mkdir -p "package/bin" + ls -R target ifeq ($(IS_WINDOWS), 1) if [ -f "$(TARGET_DIR)/wasmer.exe" ]; then \ - cp $(TARGET_DIR)/wasmer.exe package/bin ;\ + cp "$(TARGET_DIR)/wasmer.exe" package/bin ;\ fi if [ -f "target/$(HOST_TARGET)/release/wasmer.exe" ]; then \ - cp "target/$(HOST_TARGET)/release/wasmer.exe package/bin ;\ + cp "target/$(HOST_TARGET)/release/wasmer.exe" package/bin" ;\ fi else if [ -f "$(TARGET_DIR)/wasmer" ]; then \ cp $(TARGET_DIR)/wasmer package/bin ;\ fi if [ -f "target/$(HOST_TARGET)/release/wasmer" ]; then \ - cp target/$(HOST_TARGET)/release/wasmer package/bin ;\ + cp "target/$(HOST_TARGET)/release/wasmer" package/bin ;\ fi ifeq ($(IS_DARWIN), 1) codesign -s - package/bin/wasmer || true @@ -636,7 +637,7 @@ package-capi: cp lib/c-api/wasmer_wasm.h* package/include cp lib/c-api/tests/wasm-c-api/include/wasm.h* package/include cp lib/c-api/README.md package/include/README.md - + ls -R target if [ -f $(TARGET_DIR)/wasmer.dll ]; then \ cp $(TARGET_DIR)/wasmer.dll package/lib/wasmer.dll ;\ fi @@ -718,12 +719,14 @@ package: package-wasmer package-minimal-headless-wasmer package-capi package-gnu: package-capi-gnu tar-capi: + ls -R package tar -C package -zcvf build-capi.tar.gz lib include untar-capi: tar -C package -xf build-capi.tar.gz tar-wasmer: + ls -R package tar -C package -zcvf build-wasmer.tar.gz bin untar-wasmer: From dd9ba21ae1e3b2faa84ab42ab649ef368fcf63fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Fri, 25 Nov 2022 15:55:59 +0100 Subject: [PATCH 063/226] Fix file paths for package-capi step --- Makefile | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/Makefile b/Makefile index de2a2a61286..143be6cc6f0 100644 --- a/Makefile +++ b/Makefile @@ -660,26 +660,26 @@ package-capi: cp $(TARGET_DIR)/libwasmer.a package/lib/libwasmer.a ;\ fi - if [ -f target/$(HOST_TARGET)/wasmer.dll ]; then \ - cp target/$(HOST_TARGET)/wasmer.dll package/lib/wasmer.dll ;\ + if [ -f target/$(HOST_TARGET)/release/wasmer.dll ]; then \ + cp target/$(HOST_TARGET)/release/wasmer.dll package/lib/wasmer.dll ;\ fi - if [ -f target/$(HOST_TARGET)/wasmer.dll.lib ]; then \ - cp target/$(HOST_TARGET)/wasmer.dll.lib package/lib/wasmer.dll.lib ;\ + if [ -f target/$(HOST_TARGET)/release/wasmer.dll.lib ]; then \ + cp target/$(HOST_TARGET)/release/wasmer.dll.lib package/lib/wasmer.dll.lib ;\ fi - if [ -f target/$(HOST_TARGET)/wasmer.lib ]; then \ - cp target/$(HOST_TARGET)/wasmer.lib package/lib/wasmer.lib ;\ + if [ -f target/$(HOST_TARGET)/release/wasmer.lib ]; then \ + cp target/$(HOST_TARGET)/release/wasmer.lib package/lib/wasmer.lib ;\ fi - if [ -f target/$(HOST_TARGET)/libwasmer.dylib ]; then \ - cp target/$(HOST_TARGET)/libwasmer.dylib package/lib/libwasmer.dylib ;\ + if [ -f target/$(HOST_TARGET)/release/libwasmer.dylib ]; then \ + cp target/$(HOST_TARGET)/release/libwasmer.dylib package/lib/libwasmer.dylib ;\ fi - if [ -f target/$(HOST_TARGET)/libwasmer.so ]; then \ - cp target/$(HOST_TARGET)/libwasmer.so package/lib/libwasmer.so ;\ + if [ -f target/$(HOST_TARGET)/release/libwasmer.so ]; then \ + cp target/$(HOST_TARGET)/release/libwasmer.so package/lib/libwasmer.so ;\ fi - if [ -f target/$(HOST_TARGET)/libwasmer.a ]; then \ - cp target/$(HOST_TARGET)/libwasmer.a package/lib/libwasmer.a ;\ + if [ -f target/$(HOST_TARGET)/release/libwasmer.a ]; then \ + cp target/$(HOST_TARGET)/release/libwasmer.a package/lib/libwasmer.a ;\ fi package-capi-headless: build-capi-headless From 0eb2fd26ba794338fd107cfbd85066c79d710940 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Fri, 25 Nov 2022 16:04:57 +0100 Subject: [PATCH 064/226] Fix typo --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 143be6cc6f0..c30a93a01d6 100644 --- a/Makefile +++ b/Makefile @@ -616,7 +616,7 @@ ifeq ($(IS_WINDOWS), 1) cp "$(TARGET_DIR)/wasmer.exe" package/bin ;\ fi if [ -f "target/$(HOST_TARGET)/release/wasmer.exe" ]; then \ - cp "target/$(HOST_TARGET)/release/wasmer.exe" package/bin" ;\ + cp "target/$(HOST_TARGET)/release/wasmer.exe" package/bin ;\ fi else if [ -f "$(TARGET_DIR)/wasmer" ]; then \ From c7a68ebdc1f83cf31a7a5c8eb4dbb11b0b8fe895 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Fri, 25 Nov 2022 18:40:12 +0100 Subject: [PATCH 065/226] Add all stages to wasmer test --- .github/workflows/test.yaml | 3 ++- Makefile | 5 ++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 628e44ab10d..da2a755b76b 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -375,6 +375,7 @@ jobs: strategy: fail-fast: false matrix: + stage: [0,1,2,3,4,5,6] include: - build: linux-x64 os: ubuntu-18.04 @@ -488,7 +489,7 @@ jobs: if: matrix.target - name: Test run: | - make test-stage-0 + make test-stage-${{ matrix.stage }} env: TARGET: ${{ matrix.target }} TARGET_DIR: target/${{ matrix.target }}/release diff --git a/Makefile b/Makefile index c30a93a01d6..05d4d48256f 100644 --- a/Makefile +++ b/Makefile @@ -637,7 +637,6 @@ package-capi: cp lib/c-api/wasmer_wasm.h* package/include cp lib/c-api/tests/wasm-c-api/include/wasm.h* package/include cp lib/c-api/README.md package/include/README.md - ls -R target if [ -f $(TARGET_DIR)/wasmer.dll ]; then \ cp $(TARGET_DIR)/wasmer.dll package/lib/wasmer.dll ;\ fi @@ -723,14 +722,14 @@ tar-capi: tar -C package -zcvf build-capi.tar.gz lib include untar-capi: - tar -C package -xf build-capi.tar.gz + tar -C package -xf ./build-capi.tar.gz tar-wasmer: ls -R package tar -C package -zcvf build-wasmer.tar.gz bin untar-wasmer: - tar -C package -xf build-wasmer.tar.gz + tar -C package -xf ./build-wasmer.tar.gz distribution-gnu: package-gnu cp LICENSE package/LICENSE From fc2dd7e933dc1eda5ba2de9b6b325caf28466cd6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Fri, 25 Nov 2022 18:58:39 +0100 Subject: [PATCH 066/226] Add more stages to wasmer test --- .github/workflows/test.yaml | 839 ++++++++++++++++++++++++++++++++++-- 1 file changed, 797 insertions(+), 42 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index da2a755b76b..a5d133fc0bd 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -368,14 +368,689 @@ jobs: if-no-files-found: error retention-days: 2 - test_wasmer: - name: Test Wasmer on ${{ matrix.build }} + test_capi: + name: Test C-API on ${{ matrix.build }} + runs-on: ${{ matrix.os }} + needs: build_capi + strategy: + fail-fast: false + matrix: + include: + - build: linux-x64 + os: ubuntu-18.04 + target: x86_64-unknown-linux-gnu + llvm_url: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz' + run_test: true + run_test_capi: true + run_integration_tests: true + run_build_docs: true + use_sccache: true + - build: macos-x64 + os: macos-11 + target: x86_64-apple-darwin + llvm_url: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-apple-darwin.tar.xz' + run_test: true + run_test_capi: true + use_sccache: true + run_integration_tests: true + run_ios_tests: true + run_build_docs: false + - build: macos-x86_64 + os: macos-11.0 + target: x86_64-apple-darwin + use_sccache: true + run_test: false + run_test_capi: false + run_build_docs: false + - build: windows-x64 + os: windows-2019 + target: x86_64-pc-windows-msvc + # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/12.x/windows-amd64.tar.gz' + llvm_choco_version: 13.0.0 + run_integration_tests: true + use_sccache: true + run_test: true + run_test_capi: false # We can't run yet the capi tests on Windows + run_build_docs: false + - build: linux-musl-x64 + target: x86_64-unknown-linux-musl + os: ubuntu-latest + container: alpine:latest + run_test: true + run_test_capi: false # It can't run the capi tests because of a cc linker issue (`wasm_engine_new` is redefined) + run_integration_tests: false + run_build_docs: false + use_sccache: false + container: ${{ matrix.container }} + env: + SCCACHE_AZURE_BLOB_CONTAINER: wasmerstoragesccacheblob + SCCACHE_AZURE_CONNECTION_STRING: ${{ secrets.SCCACHE_AZURE_CONNECTION_STRING }} + steps: + - uses: actions/checkout@v3 + - uses: actions/download-artifact@v3 + id: download + with: + name: capi-${{ matrix.build }} + - name: 'Echo download path' + run: echo ${{steps.download.outputs.download-path}} + - name: Display structure of downloaded files + run: ls -R + - name: Unzip Artifacts + shell: bash + run: | + make untar-capi + - name: Test C API + run: | + make test-capi-ci + env: + TARGET: ${{ matrix.target }} + TARGET_DIR: target/${{ matrix.target }}/release + CARGO_TARGET: --target ${{ matrix.target }} + + test_integration_cli: + name: Integration tests on ${{ matrix.build }} + runs-on: ${{ matrix.os }} + needs: [build_capi, build_wasmer] + strategy: + fail-fast: false + matrix: + include: + - build: linux-x64 + os: ubuntu-18.04 + target: x86_64-unknown-linux-gnu + llvm_url: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz' + run_test: true + run_test_capi: true + run_integration_tests: true + run_build_docs: true + use_sccache: true + - build: macos-x64 + os: macos-11 + target: x86_64-apple-darwin + llvm_url: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-apple-darwin.tar.xz' + run_test: true + run_test_capi: true + use_sccache: true + run_integration_tests: true + run_ios_tests: true + run_build_docs: false + - build: macos-x86_64 + os: macos-11.0 + target: x86_64-apple-darwin + use_sccache: true + run_test: false + run_test_capi: false + run_build_docs: false + - build: windows-x64 + os: windows-2019 + target: x86_64-pc-windows-msvc + # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/12.x/windows-amd64.tar.gz' + llvm_choco_version: 13.0.0 + run_integration_tests: true + use_sccache: true + run_test: true + run_test_capi: false # We can't run yet the capi tests on Windows + run_build_docs: false + - build: linux-musl-x64 + target: x86_64-unknown-linux-musl + os: ubuntu-latest + container: alpine:latest + run_test: true + run_test_capi: false # It can't run the capi tests because of a cc linker issue (`wasm_engine_new` is redefined) + run_integration_tests: false + run_build_docs: false + use_sccache: false + container: ${{ matrix.container }} + env: + SCCACHE_AZURE_BLOB_CONTAINER: wasmerstoragesccacheblob + SCCACHE_AZURE_CONNECTION_STRING: ${{ secrets.SCCACHE_AZURE_CONNECTION_STRING }} + steps: + - uses: actions/checkout@v3 + - uses: actions/download-artifact@v3 + id: download + with: + name: capi-${{ matrix.build }} + - uses: actions/download-artifact@v3 + with: + name: wasmer-cli-${{ matrix.build }} + - name: 'Echo download path' + run: echo ${{steps.download.outputs.download-path}} + - name: Display structure of downloaded files + run: ls -R + - name: Unzip Artifacts + shell: bash + run: | + make untar-capi + - name: Unzip Artifacts + shell: bash + run: | + make untar-wasmer + - uses: goto-bus-stop/setup-zig@v2 + with: + version: 0.10.0 + - name: Test integration CLI + if: matrix.os != 'windows-2019' + shell: bash + run: | + export WASMER_DIR=`pwd`/package && make test-integration-cli + env: + TARGET: ${{ matrix.target }} + TARGET_DIR: target/${{ matrix.target }}/release + CARGO_TARGET: --target ${{ matrix.target }} + WAPM_DEV_TOKEN: ${{ secrets.WAPM_DEV_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + test_wasmer_stage_0: + name: Test Wasmer Stage 0 on ${{ matrix.build }} + runs-on: ${{ matrix.os }} + needs: setup + strategy: + fail-fast: false + matrix: + include: + - build: linux-x64 + os: ubuntu-18.04 + target: x86_64-unknown-linux-gnu + llvm_url: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz' + run_test: true + run_test_capi: true + run_integration_tests: true + run_build_docs: true + use_sccache: true + - build: macos-x64 + os: macos-11 + target: x86_64-apple-darwin + llvm_url: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-apple-darwin.tar.xz' + run_test: true + run_test_capi: true + use_sccache: true + run_integration_tests: true + run_ios_tests: true + run_build_docs: false + - build: macos-x86_64 + os: macos-11.0 + target: x86_64-apple-darwin + use_sccache: true + run_test: false + run_test_capi: false + run_build_docs: false + - build: windows-x64 + os: windows-2019 + target: x86_64-pc-windows-msvc + # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/12.x/windows-amd64.tar.gz' + llvm_choco_version: 13.0.0 + run_integration_tests: true + use_sccache: true + run_test: true + run_test_capi: false # We can't run yet the capi tests on Windows + run_build_docs: false + - build: linux-musl-x64 + target: x86_64-unknown-linux-musl + os: ubuntu-latest + container: alpine:latest + run_test: true + run_test_capi: false # It can't run the capi tests because of a cc linker issue (`wasm_engine_new` is redefined) + run_integration_tests: false + run_build_docs: false + use_sccache: false + container: ${{ matrix.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.build == 'linux-x64' + run: | + sudo apt-get update -y + sudo apt-get install -y --allow-downgrades libstdc++6=8.4.0-1ubuntu1~18.04 + sudo apt-get install --reinstall g++-8 + - name: Set up base deps on musl + if: matrix.build == 'linux-musl-x64' + run: | + apk add build-base bash musl-dev curl make libtool libffi-dev gcc automake autoconf git openssl-dev g++ + - 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.os == 'macos-latest' || matrix.os == 'macos-11.0' + - name: Install Rust + uses: dtolnay/rust-toolchain@stable + with: + toolchain: 1.63 + target: ${{ matrix.target }} + - name: Choco install LLVM + uses: crazy-max/ghaction-chocolatey@v2 + if: matrix.llvm_choco_version + with: + args: install llvm --version ${{ matrix.llvm_choco_version }} --allow-downgrade + - name: Install LLVM (Choco - Windows) + if: matrix.llvm_choco_version + shell: bash + run: | + cd 'C:\Program Files\LLVM\' + LLVM_DIR=$(pwd) + echo "LLVM_SYS_120_PREFIX=${LLVM_DIR}" >> $GITHUB_ENV + - name: Install LLVM (macOS Apple Silicon) + if: matrix.os == 'macos-11.0' && !matrix.llvm_url + run: | + brew install llvm + - name: Install LLVM + if: matrix.llvm_url + shell: bash + run: | + curl --proto '=https' --tlsv1.2 -sSf ${{ matrix.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_SYS_120_PREFIX=${LLVM_DIR}" >> $GITHUB_ENV + env: + LLVM_DIR: .llvm + - name: Setup Rust target + shell: bash + run: | + mkdir -p .cargo + cat << EOF > .cargo/config.toml + [build] + target = "${{ matrix.target }}" + EOF + if: matrix.target + - name: Test + run: | + make test-stage-0 + env: + TARGET: ${{ matrix.target }} + TARGET_DIR: target/${{ matrix.target }}/release + CARGO_TARGET: --target ${{ matrix.target }} + + test_wasmer_stage_1: + name: Test Wasmer Stage 1 on ${{ matrix.build }} + runs-on: ${{ matrix.os }} + needs: setup + strategy: + fail-fast: false + matrix: + include: + - build: linux-x64 + os: ubuntu-18.04 + target: x86_64-unknown-linux-gnu + llvm_url: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz' + run_test: true + run_test_capi: true + run_integration_tests: true + run_build_docs: true + use_sccache: true + - build: macos-x64 + os: macos-11 + target: x86_64-apple-darwin + llvm_url: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-apple-darwin.tar.xz' + run_test: true + run_test_capi: true + use_sccache: true + run_integration_tests: true + run_ios_tests: true + run_build_docs: false + - build: macos-x86_64 + os: macos-11.0 + target: x86_64-apple-darwin + use_sccache: true + run_test: false + run_test_capi: false + run_build_docs: false + - build: windows-x64 + os: windows-2019 + target: x86_64-pc-windows-msvc + # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/12.x/windows-amd64.tar.gz' + llvm_choco_version: 13.0.0 + run_integration_tests: true + use_sccache: true + run_test: true + run_test_capi: false # We can't run yet the capi tests on Windows + run_build_docs: false + - build: linux-musl-x64 + target: x86_64-unknown-linux-musl + os: ubuntu-latest + container: alpine:latest + run_test: true + run_test_capi: false # It can't run the capi tests because of a cc linker issue (`wasm_engine_new` is redefined) + run_integration_tests: false + run_build_docs: false + use_sccache: false + container: ${{ matrix.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.build == 'linux-x64' + run: | + sudo apt-get update -y + sudo apt-get install -y --allow-downgrades libstdc++6=8.4.0-1ubuntu1~18.04 + sudo apt-get install --reinstall g++-8 + - name: Set up base deps on musl + if: matrix.build == 'linux-musl-x64' + run: | + apk add build-base bash musl-dev curl make libtool libffi-dev gcc automake autoconf git openssl-dev g++ + - 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.os == 'macos-latest' || matrix.os == 'macos-11.0' + - name: Install Rust + uses: dtolnay/rust-toolchain@stable + with: + toolchain: 1.63 + target: ${{ matrix.target }} + - name: Choco install LLVM + uses: crazy-max/ghaction-chocolatey@v2 + if: matrix.llvm_choco_version + with: + args: install llvm --version ${{ matrix.llvm_choco_version }} --allow-downgrade + - name: Install LLVM (Choco - Windows) + if: matrix.llvm_choco_version + shell: bash + run: | + cd 'C:\Program Files\LLVM\' + LLVM_DIR=$(pwd) + echo "LLVM_SYS_120_PREFIX=${LLVM_DIR}" >> $GITHUB_ENV + - name: Install LLVM (macOS Apple Silicon) + if: matrix.os == 'macos-11.0' && !matrix.llvm_url + run: | + brew install llvm + - name: Install LLVM + if: matrix.llvm_url + shell: bash + run: | + curl --proto '=https' --tlsv1.2 -sSf ${{ matrix.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_SYS_120_PREFIX=${LLVM_DIR}" >> $GITHUB_ENV + env: + LLVM_DIR: .llvm + - name: Setup Rust target + shell: bash + run: | + mkdir -p .cargo + cat << EOF > .cargo/config.toml + [build] + target = "${{ matrix.target }}" + EOF + if: matrix.target + - name: Test + run: | + make test-stage-1 + env: + TARGET: ${{ matrix.target }} + TARGET_DIR: target/${{ matrix.target }}/release + CARGO_TARGET: --target ${{ matrix.target }} + + test_wasmer_stage_2: + name: Test Wasmer Stage 2 on ${{ matrix.build }} + runs-on: ${{ matrix.os }} + needs: setup + strategy: + fail-fast: false + matrix: + include: + - build: linux-x64 + os: ubuntu-18.04 + target: x86_64-unknown-linux-gnu + llvm_url: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz' + run_test: true + run_test_capi: true + run_integration_tests: true + run_build_docs: true + use_sccache: true + - build: macos-x64 + os: macos-11 + target: x86_64-apple-darwin + llvm_url: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-apple-darwin.tar.xz' + run_test: true + run_test_capi: true + use_sccache: true + run_integration_tests: true + run_ios_tests: true + run_build_docs: false + - build: macos-x86_64 + os: macos-11.0 + target: x86_64-apple-darwin + use_sccache: true + run_test: false + run_test_capi: false + run_build_docs: false + - build: windows-x64 + os: windows-2019 + target: x86_64-pc-windows-msvc + # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/12.x/windows-amd64.tar.gz' + llvm_choco_version: 13.0.0 + run_integration_tests: true + use_sccache: true + run_test: true + run_test_capi: false # We can't run yet the capi tests on Windows + run_build_docs: false + - build: linux-musl-x64 + target: x86_64-unknown-linux-musl + os: ubuntu-latest + container: alpine:latest + run_test: true + run_test_capi: false # It can't run the capi tests because of a cc linker issue (`wasm_engine_new` is redefined) + run_integration_tests: false + run_build_docs: false + use_sccache: false + container: ${{ matrix.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.build == 'linux-x64' + run: | + sudo apt-get update -y + sudo apt-get install -y --allow-downgrades libstdc++6=8.4.0-1ubuntu1~18.04 + sudo apt-get install --reinstall g++-8 + - name: Set up base deps on musl + if: matrix.build == 'linux-musl-x64' + run: | + apk add build-base bash musl-dev curl make libtool libffi-dev gcc automake autoconf git openssl-dev g++ + - 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.os == 'macos-latest' || matrix.os == 'macos-11.0' + - name: Install Rust + uses: dtolnay/rust-toolchain@stable + with: + toolchain: 1.63 + target: ${{ matrix.target }} + - name: Choco install LLVM + uses: crazy-max/ghaction-chocolatey@v2 + if: matrix.llvm_choco_version + with: + args: install llvm --version ${{ matrix.llvm_choco_version }} --allow-downgrade + - name: Install LLVM (Choco - Windows) + if: matrix.llvm_choco_version + shell: bash + run: | + cd 'C:\Program Files\LLVM\' + LLVM_DIR=$(pwd) + echo "LLVM_SYS_120_PREFIX=${LLVM_DIR}" >> $GITHUB_ENV + - name: Install LLVM (macOS Apple Silicon) + if: matrix.os == 'macos-11.0' && !matrix.llvm_url + run: | + brew install llvm + - name: Install LLVM + if: matrix.llvm_url + shell: bash + run: | + curl --proto '=https' --tlsv1.2 -sSf ${{ matrix.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_SYS_120_PREFIX=${LLVM_DIR}" >> $GITHUB_ENV + env: + LLVM_DIR: .llvm + - name: Setup Rust target + shell: bash + run: | + mkdir -p .cargo + cat << EOF > .cargo/config.toml + [build] + target = "${{ matrix.target }}" + EOF + if: matrix.target + - name: Test + run: | + make test-stage-2 + env: + TARGET: ${{ matrix.target }} + TARGET_DIR: target/${{ matrix.target }}/release + CARGO_TARGET: --target ${{ matrix.target }} + + test_wasmer_stage_3: + name: Test Wasmer Stage 3 on ${{ matrix.build }} + runs-on: ${{ matrix.os }} + needs: setup + strategy: + fail-fast: false + matrix: + include: + - build: linux-x64 + os: ubuntu-18.04 + target: x86_64-unknown-linux-gnu + llvm_url: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz' + run_test: true + run_test_capi: true + run_integration_tests: true + run_build_docs: true + use_sccache: true + - build: macos-x64 + os: macos-11 + target: x86_64-apple-darwin + llvm_url: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-apple-darwin.tar.xz' + run_test: true + run_test_capi: true + use_sccache: true + run_integration_tests: true + run_ios_tests: true + run_build_docs: false + - build: macos-x86_64 + os: macos-11.0 + target: x86_64-apple-darwin + use_sccache: true + run_test: false + run_test_capi: false + run_build_docs: false + - build: windows-x64 + os: windows-2019 + target: x86_64-pc-windows-msvc + # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/12.x/windows-amd64.tar.gz' + llvm_choco_version: 13.0.0 + run_integration_tests: true + use_sccache: true + run_test: true + run_test_capi: false # We can't run yet the capi tests on Windows + run_build_docs: false + - build: linux-musl-x64 + target: x86_64-unknown-linux-musl + os: ubuntu-latest + container: alpine:latest + run_test: true + run_test_capi: false # It can't run the capi tests because of a cc linker issue (`wasm_engine_new` is redefined) + run_integration_tests: false + run_build_docs: false + use_sccache: false + container: ${{ matrix.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.build == 'linux-x64' + run: | + sudo apt-get update -y + sudo apt-get install -y --allow-downgrades libstdc++6=8.4.0-1ubuntu1~18.04 + sudo apt-get install --reinstall g++-8 + - name: Set up base deps on musl + if: matrix.build == 'linux-musl-x64' + run: | + apk add build-base bash musl-dev curl make libtool libffi-dev gcc automake autoconf git openssl-dev g++ + - 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.os == 'macos-latest' || matrix.os == 'macos-11.0' + - name: Install Rust + uses: dtolnay/rust-toolchain@stable + with: + toolchain: 1.63 + target: ${{ matrix.target }} + - name: Choco install LLVM + uses: crazy-max/ghaction-chocolatey@v2 + if: matrix.llvm_choco_version + with: + args: install llvm --version ${{ matrix.llvm_choco_version }} --allow-downgrade + - name: Install LLVM (Choco - Windows) + if: matrix.llvm_choco_version + shell: bash + run: | + cd 'C:\Program Files\LLVM\' + LLVM_DIR=$(pwd) + echo "LLVM_SYS_120_PREFIX=${LLVM_DIR}" >> $GITHUB_ENV + - name: Install LLVM (macOS Apple Silicon) + if: matrix.os == 'macos-11.0' && !matrix.llvm_url + run: | + brew install llvm + - name: Install LLVM + if: matrix.llvm_url + shell: bash + run: | + curl --proto '=https' --tlsv1.2 -sSf ${{ matrix.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_SYS_120_PREFIX=${LLVM_DIR}" >> $GITHUB_ENV + env: + LLVM_DIR: .llvm + - name: Setup Rust target + shell: bash + run: | + mkdir -p .cargo + cat << EOF > .cargo/config.toml + [build] + target = "${{ matrix.target }}" + EOF + if: matrix.target + - name: Test + run: | + make test-stage-3 + env: + TARGET: ${{ matrix.target }} + TARGET_DIR: target/${{ matrix.target }}/release + CARGO_TARGET: --target ${{ matrix.target }} + + test_wasmer_stage_4: + name: Test Wasmer Stage 4 on ${{ matrix.build }} runs-on: ${{ matrix.os }} needs: setup strategy: fail-fast: false matrix: - stage: [0,1,2,3,4,5,6] include: - build: linux-x64 os: ubuntu-18.04 @@ -489,16 +1164,16 @@ jobs: if: matrix.target - name: Test run: | - make test-stage-${{ matrix.stage }} + make test-stage-4 env: TARGET: ${{ matrix.target }} TARGET_DIR: target/${{ matrix.target }}/release CARGO_TARGET: --target ${{ matrix.target }} - test_capi: - name: Test C-API on ${{ matrix.build }} + test_wasmer_stage_5: + name: Test Wasmer Stage 5 on ${{ matrix.build }} runs-on: ${{ matrix.os }} - needs: build_capi + needs: setup strategy: fail-fast: false matrix: @@ -554,30 +1229,77 @@ jobs: SCCACHE_AZURE_CONNECTION_STRING: ${{ secrets.SCCACHE_AZURE_CONNECTION_STRING }} steps: - uses: actions/checkout@v3 - - uses: actions/download-artifact@v3 - id: download + - name: Set up libstdc++ on Linux + if: matrix.build == 'linux-x64' + run: | + sudo apt-get update -y + sudo apt-get install -y --allow-downgrades libstdc++6=8.4.0-1ubuntu1~18.04 + sudo apt-get install --reinstall g++-8 + - name: Set up base deps on musl + if: matrix.build == 'linux-musl-x64' + run: | + apk add build-base bash musl-dev curl make libtool libffi-dev gcc automake autoconf git openssl-dev g++ + - 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.os == 'macos-latest' || matrix.os == 'macos-11.0' + - name: Install Rust + uses: dtolnay/rust-toolchain@stable with: - name: capi-${{ matrix.build }} - - name: 'Echo download path' - run: echo ${{steps.download.outputs.download-path}} - - name: Display structure of downloaded files - run: ls -R - - name: Unzip Artifacts + toolchain: 1.63 + target: ${{ matrix.target }} + - name: Choco install LLVM + uses: crazy-max/ghaction-chocolatey@v2 + if: matrix.llvm_choco_version + with: + args: install llvm --version ${{ matrix.llvm_choco_version }} --allow-downgrade + - name: Install LLVM (Choco - Windows) + if: matrix.llvm_choco_version shell: bash run: | - make untar-capi - - name: Test C API + cd 'C:\Program Files\LLVM\' + LLVM_DIR=$(pwd) + echo "LLVM_SYS_120_PREFIX=${LLVM_DIR}" >> $GITHUB_ENV + - name: Install LLVM (macOS Apple Silicon) + if: matrix.os == 'macos-11.0' && !matrix.llvm_url run: | - make test-capi-ci + brew install llvm + - name: Install LLVM + if: matrix.llvm_url + shell: bash + run: | + curl --proto '=https' --tlsv1.2 -sSf ${{ matrix.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_SYS_120_PREFIX=${LLVM_DIR}" >> $GITHUB_ENV + env: + LLVM_DIR: .llvm + - name: Setup Rust target + shell: bash + run: | + mkdir -p .cargo + cat << EOF > .cargo/config.toml + [build] + target = "${{ matrix.target }}" + EOF + if: matrix.target + - name: Test + run: | + make test-stage-5 env: TARGET: ${{ matrix.target }} TARGET_DIR: target/${{ matrix.target }}/release CARGO_TARGET: --target ${{ matrix.target }} - test_integration_cli: - name: Integration tests on ${{ matrix.build }} + test_wasmer_stage_6: + name: Test Wasmer Stage 6 on ${{ matrix.build }} runs-on: ${{ matrix.os }} - needs: [build_capi, build_wasmer] + needs: setup strategy: fail-fast: false matrix: @@ -633,36 +1355,69 @@ jobs: SCCACHE_AZURE_CONNECTION_STRING: ${{ secrets.SCCACHE_AZURE_CONNECTION_STRING }} steps: - uses: actions/checkout@v3 - - uses: actions/download-artifact@v3 - id: download + - name: Set up libstdc++ on Linux + if: matrix.build == 'linux-x64' + run: | + sudo apt-get update -y + sudo apt-get install -y --allow-downgrades libstdc++6=8.4.0-1ubuntu1~18.04 + sudo apt-get install --reinstall g++-8 + - name: Set up base deps on musl + if: matrix.build == 'linux-musl-x64' + run: | + apk add build-base bash musl-dev curl make libtool libffi-dev gcc automake autoconf git openssl-dev g++ + - 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.os == 'macos-latest' || matrix.os == 'macos-11.0' + - name: Install Rust + uses: dtolnay/rust-toolchain@stable with: - name: capi-${{ matrix.build }} - - uses: actions/download-artifact@v3 + toolchain: 1.63 + target: ${{ matrix.target }} + - name: Choco install LLVM + uses: crazy-max/ghaction-chocolatey@v2 + if: matrix.llvm_choco_version with: - name: wasmer-cli-${{ matrix.build }} - - name: 'Echo download path' - run: echo ${{steps.download.outputs.download-path}} - - name: Display structure of downloaded files - run: ls -R - - name: Unzip Artifacts + args: install llvm --version ${{ matrix.llvm_choco_version }} --allow-downgrade + - name: Install LLVM (Choco - Windows) + if: matrix.llvm_choco_version shell: bash run: | - make untar-capi - - name: Unzip Artifacts + cd 'C:\Program Files\LLVM\' + LLVM_DIR=$(pwd) + echo "LLVM_SYS_120_PREFIX=${LLVM_DIR}" >> $GITHUB_ENV + - name: Install LLVM (macOS Apple Silicon) + if: matrix.os == 'macos-11.0' && !matrix.llvm_url + run: | + brew install llvm + - name: Install LLVM + if: matrix.llvm_url shell: bash run: | - make untar-wasmer - - uses: goto-bus-stop/setup-zig@v2 - with: - version: 0.10.0 - - name: Test integration CLI - if: matrix.os != 'windows-2019' + curl --proto '=https' --tlsv1.2 -sSf ${{ matrix.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_SYS_120_PREFIX=${LLVM_DIR}" >> $GITHUB_ENV + env: + LLVM_DIR: .llvm + - name: Setup Rust target shell: bash run: | - export WASMER_DIR=`pwd`/package && make test-integration-cli + mkdir -p .cargo + cat << EOF > .cargo/config.toml + [build] + target = "${{ matrix.target }}" + EOF + if: matrix.target + - name: Test + run: | + make test-stage-6 env: TARGET: ${{ matrix.target }} TARGET_DIR: target/${{ matrix.target }}/release CARGO_TARGET: --target ${{ matrix.target }} - WAPM_DEV_TOKEN: ${{ secrets.WAPM_DEV_TOKEN }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 86519477f14733778da720b071578da3047a9543 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Fri, 25 Nov 2022 19:02:53 +0100 Subject: [PATCH 067/226] Make package directory before unzipping --- Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Makefile b/Makefile index 05d4d48256f..81bbb2dfb0f 100644 --- a/Makefile +++ b/Makefile @@ -722,6 +722,7 @@ tar-capi: tar -C package -zcvf build-capi.tar.gz lib include untar-capi: + mkdir -p package tar -C package -xf ./build-capi.tar.gz tar-wasmer: @@ -729,6 +730,7 @@ tar-wasmer: tar -C package -zcvf build-wasmer.tar.gz bin untar-wasmer: + mkdir -p package tar -C package -xf ./build-wasmer.tar.gz distribution-gnu: package-gnu From b0755fed081135dc6cd429220892db44ad1bdde8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Fri, 25 Nov 2022 19:05:42 +0100 Subject: [PATCH 068/226] Copy untarred files into /target/release --- Makefile | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Makefile b/Makefile index 81bbb2dfb0f..46075fd17b9 100644 --- a/Makefile +++ b/Makefile @@ -723,7 +723,11 @@ tar-capi: untar-capi: mkdir -p package + mkdir -p target/release + mkdir -p target/$(HOST_TARGET)/release tar -C package -xf ./build-capi.tar.gz + cp package/lib/* target/release + cp package/lib/* target/$(HOST_TARGET)/release tar-wasmer: ls -R package @@ -731,7 +735,11 @@ tar-wasmer: untar-wasmer: mkdir -p package + mkdir -p target/release + mkdir -p target/$(HOST_TARGET)/release tar -C package -xf ./build-wasmer.tar.gz + cp package/bin/* target/release + cp package/bin/* target/$(HOST_TARGET)/release distribution-gnu: package-gnu cp LICENSE package/LICENSE From bff9e6536d763616cba7bd9b356461f03ae3d9a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Fri, 25 Nov 2022 19:08:39 +0100 Subject: [PATCH 069/226] Add bash on linux-musl --- .github/workflows/test.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index a5d133fc0bd..abb179bc803 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -431,6 +431,10 @@ jobs: id: download with: name: capi-${{ matrix.build }} + - name: Set up base deps on musl + if: matrix.build == 'linux-musl-x64' + run: | + apk add build-base bash musl-dev curl make libtool libffi-dev gcc automake autoconf git openssl-dev g++ - name: 'Echo download path' run: echo ${{steps.download.outputs.download-path}} - name: Display structure of downloaded files From cfdaefed4a18752cc91d9b986c4ec449da426211 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Sun, 27 Nov 2022 23:10:16 +0100 Subject: [PATCH 070/226] Remove test-sys.yaml file --- .github/workflows/test-sys.yaml | 81 --------------------------------- 1 file changed, 81 deletions(-) delete mode 100644 .github/workflows/test-sys.yaml diff --git a/.github/workflows/test-sys.yaml b/.github/workflows/test-sys.yaml deleted file mode 100644 index 0e2b6f94004..00000000000 --- a/.github/workflows/test-sys.yaml +++ /dev/null @@ -1,81 +0,0 @@ -name: test-sys - -on: - push: - branches: - - '**' - - '!master' - pull_request: - types: [ synchronize ] - -env: - RUST_BACKTRACE: 1 - -jobs: - - check_linux_x64: - name: cargo check on linux-x86_64-gnu - runs-on: ubuntu-18.04 - env: - TARGET: linux-x86_64-gnu - steps: - - uses: actions/checkout@v3 - - name: Set up libstdc++ on Linux - run: | - sudo apt-get update -y - sudo apt-get install -y --allow-downgrades libstdc++6=8.4.0-1ubuntu1~18.04 - sudo apt-get install --reinstall g++-8 - - name: Install Rust - uses: dtolnay/rust-toolchain@stable - with: - toolchain: 1.63 - target: x86_64-unknown-linux-gnu - - name: Install cargo xtask - run: | - cargo install cargo-xtask - - name: cargo xtask build-wasmer - run: | - cargo xtaskci - - check_linux_musl: - name: cargo check on linux-x86_64-musl - runs-on: ubuntu-latest - container: alpine:latest ->>>>>>> 3e578e17a5 (Remove unnecessary CI runs) - env: - TARGET: linux-x86_64-musl - steps: - - uses: actions/checkout@v3 - - name: Set up base deps on musl - run: | - apk add build-base bash musl-dev curl make libtool libffi-dev gcc automake autoconf git openssl-dev g++ - - name: Install Rust - uses: dtolnay/rust-toolchain@stable - with: - toolchain: 1.63 - target: x86_64-unknown-linux-musl - - name: Install cargo xtask - run: | - cargo install cargo-xtask - - name: cargo xtask build-wasmer - run: | - cargo xtaskci - - check_windows: - name: cargo check on windows-x64 - runs-on: windows-2019 - env: - TARGET: windows-x86_64-msvc - steps: - - uses: actions/checkout@v3 - - name: Install Rust - uses: dtolnay/rust-toolchain@stable - with: - toolchain: 1.63 - target: x86_64-unknown-linux-musl - - name: Install cargo xtask - run: | - cargo install cargo-xtask - - name: cargo xtask build-wasmer - run: | - cargo xtaskci \ No newline at end of file From ab5a30cdfd74247561425b916dfe5cbea496feed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Sun, 27 Nov 2022 23:10:52 +0100 Subject: [PATCH 071/226] Add jobs: to coverage.yaml --- .github/workflows/coverage.yaml | 55 +++++++++++++++++---------------- 1 file changed, 28 insertions(+), 27 deletions(-) diff --git a/.github/workflows/coverage.yaml b/.github/workflows/coverage.yaml index a26053c6cc7..d725defb24a 100644 --- a/.github/workflows/coverage.yaml +++ b/.github/workflows/coverage.yaml @@ -20,31 +20,32 @@ on: paths: - 'lib/**' -coverage: - runs-on: ubuntu-latest - env: - CARGO_TERM_COLOR: always - steps: - - uses: actions/checkout@v3 - - name: Install Rust - run: rustup update stable - - name: Install LLVM (Linux) - run: | - curl --proto '=https' --tlsv1.2 -sSf https://github.com/llvm/llvm-project/releases/download/llvmorg-10.0.0/clang+llvm-10.0.0-x86_64-linux-gnu-ubuntu-18.04.tar.xz -L -o llvm.tar.xz - mkdir -p /opt/llvm-10 - tar xf llvm.tar.xz --strip-components=1 -C /opt/llvm-10 - echo '/opt/llvm-10/bin' >> $GITHUB_PATH - echo 'LLVM_SYS_100_PREFIX=/opt/llvm-10' >> $GITHUB_ENV - - name: Install cargo-llvm-cov - uses: taiki-e/install-action@cargo-llvm-cov - - name: Generate code coverage - run: cargo llvm-cov --all-features --workspace --lcov --output-path lcov.info - env: - WAPM_DEV_TOKEN: ${{ secrets.WAPM_DEV_TOKEN }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Upload coverage to Codecov - uses: codecov/codecov-action@v3 - with: - files: lcov.info - fail_ci_if_error: true +jobs: + coverage: + runs-on: ubuntu-latest + env: + CARGO_TERM_COLOR: always + steps: + - uses: actions/checkout@v3 + - name: Install Rust + run: rustup update stable + - name: Install LLVM (Linux) + run: | + curl --proto '=https' --tlsv1.2 -sSf https://github.com/llvm/llvm-project/releases/download/llvmorg-10.0.0/clang+llvm-10.0.0-x86_64-linux-gnu-ubuntu-18.04.tar.xz -L -o llvm.tar.xz + mkdir -p /opt/llvm-10 + tar xf llvm.tar.xz --strip-components=1 -C /opt/llvm-10 + echo '/opt/llvm-10/bin' >> $GITHUB_PATH + echo 'LLVM_SYS_100_PREFIX=/opt/llvm-10' >> $GITHUB_ENV + - name: Install cargo-llvm-cov + uses: taiki-e/install-action@cargo-llvm-cov + - name: Generate code coverage + run: cargo llvm-cov --all-features --workspace --lcov --output-path lcov.info + env: + WAPM_DEV_TOKEN: ${{ secrets.WAPM_DEV_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v3 + with: + files: lcov.info + fail_ci_if_error: true From b0657b1d0f78c96faf2c1e7f6671afcc1969be6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Sun, 27 Nov 2022 23:11:28 +0100 Subject: [PATCH 072/226] Run codecov on every commit --- .github/workflows/coverage.yaml | 51 --------------------------------- .github/workflows/test.yaml | 28 ++++++++++++++++++ 2 files changed, 28 insertions(+), 51 deletions(-) delete mode 100644 .github/workflows/coverage.yaml diff --git a/.github/workflows/coverage.yaml b/.github/workflows/coverage.yaml deleted file mode 100644 index d725defb24a..00000000000 --- a/.github/workflows/coverage.yaml +++ /dev/null @@ -1,51 +0,0 @@ -name: Coverage - -env: - RUST_BACKTRACE: 1 - RUSTFLAGS: "-Ccodegen-units=1 -Clink-dead-code -Coverflow-checks=off" - -on: - workflow_dispatch: - push: - branches: - - 'master' - - 'staging' - - 'trying' - paths: - - 'lib/**' - 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: - paths: - - 'lib/**' - -jobs: - coverage: - runs-on: ubuntu-latest - env: - CARGO_TERM_COLOR: always - steps: - - uses: actions/checkout@v3 - - name: Install Rust - run: rustup update stable - - name: Install LLVM (Linux) - run: | - curl --proto '=https' --tlsv1.2 -sSf https://github.com/llvm/llvm-project/releases/download/llvmorg-10.0.0/clang+llvm-10.0.0-x86_64-linux-gnu-ubuntu-18.04.tar.xz -L -o llvm.tar.xz - mkdir -p /opt/llvm-10 - tar xf llvm.tar.xz --strip-components=1 -C /opt/llvm-10 - echo '/opt/llvm-10/bin' >> $GITHUB_PATH - echo 'LLVM_SYS_100_PREFIX=/opt/llvm-10' >> $GITHUB_ENV - - name: Install cargo-llvm-cov - uses: taiki-e/install-action@cargo-llvm-cov - - name: Generate code coverage - run: cargo llvm-cov --all-features --workspace --lcov --output-path lcov.info - env: - WAPM_DEV_TOKEN: ${{ secrets.WAPM_DEV_TOKEN }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Upload coverage to Codecov - uses: codecov/codecov-action@v3 - with: - files: lcov.info - fail_ci_if_error: true - diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index abb179bc803..260d27a2617 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -61,6 +61,34 @@ jobs: git status ! [[ $(git status -s) ]] + coverage: + runs-on: ubuntu-latest + env: + CARGO_TERM_COLOR: always + steps: + - uses: actions/checkout@v3 + - name: Install Rust + run: rustup update stable + - name: Install LLVM (Linux) + run: | + curl --proto '=https' --tlsv1.2 -sSf https://github.com/llvm/llvm-project/releases/download/llvmorg-10.0.0/clang+llvm-10.0.0-x86_64-linux-gnu-ubuntu-18.04.tar.xz -L -o llvm.tar.xz + mkdir -p /opt/llvm-10 + tar xf llvm.tar.xz --strip-components=1 -C /opt/llvm-10 + echo '/opt/llvm-10/bin' >> $GITHUB_PATH + echo 'LLVM_SYS_100_PREFIX=/opt/llvm-10' >> $GITHUB_ENV + - name: Install cargo-llvm-cov + uses: taiki-e/install-action@cargo-llvm-cov + - name: Generate code coverage + run: cargo llvm-cov --all-features --workspace --lcov --output-path lcov.info + env: + WAPM_DEV_TOKEN: ${{ secrets.WAPM_DEV_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v3 + with: + files: lcov.info + fail_ci_if_error: true + cargo_deny: name: cargo-deny runs-on: ubuntu-latest From 42c73e114f6838e74a257b3b574e04713c8f10af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Sun, 27 Nov 2022 23:12:37 +0100 Subject: [PATCH 073/226] Remove unnecessary ignores from gitignore --- .gitignore | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 49d5005c5c2..0ba88ab63e4 100644 --- a/.gitignore +++ b/.gitignore @@ -14,7 +14,4 @@ api-docs-repo/ .xwin-cache # Generated by tests on Android /avd -/core -out.txt -build-capi.tar.gz -build-wasmer.tar.gz \ No newline at end of file +/core \ No newline at end of file From b7f0e3a95ae8841f8baa5622349ffe417da67a03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Sun, 27 Nov 2022 23:13:09 +0100 Subject: [PATCH 074/226] Fix changes to .gitignore --- .gitignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 0ba88ab63e4..24affcea4df 100644 --- a/.gitignore +++ b/.gitignore @@ -14,4 +14,5 @@ api-docs-repo/ .xwin-cache # Generated by tests on Android /avd -/core \ No newline at end of file +/core +out.txt From 03d24deafc4b37749831a3eaedad892305bf201c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Sun, 27 Nov 2022 23:18:30 +0100 Subject: [PATCH 075/226] Remove useless package-gnu step --- Makefile | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 46075fd17b9..2aff742f2f7 100644 --- a/Makefile +++ b/Makefile @@ -715,8 +715,6 @@ package-docs: build-docs build-docs-capi package: package-wasmer package-minimal-headless-wasmer package-capi -package-gnu: package-capi-gnu - tar-capi: ls -R package tar -C package -zcvf build-capi.tar.gz lib include @@ -741,7 +739,7 @@ untar-wasmer: cp package/bin/* target/release cp package/bin/* target/$(HOST_TARGET)/release -distribution-gnu: package-gnu +distribution-gnu: package-capi cp LICENSE package/LICENSE cp ATTRIBUTIONS.md package/ATTRIBUTIONS mkdir -p dist From 2e06f3b1f52b892e0615dfe508dcd8062b21ce7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Sun, 27 Nov 2022 23:32:40 +0100 Subject: [PATCH 076/226] Re-add Makefiles --- lib/c-api/examples/Makefile | 44 +++++++++++++++++++++++++++++++++++++ lib/c-api/tests/Makefile | 32 +++++++++++++++++++++++++++ 2 files changed, 76 insertions(+) create mode 100644 lib/c-api/examples/Makefile create mode 100644 lib/c-api/tests/Makefile diff --git a/lib/c-api/examples/Makefile b/lib/c-api/examples/Makefile new file mode 100644 index 00000000000..e2c919c60e5 --- /dev/null +++ b/lib/c-api/examples/Makefile @@ -0,0 +1,44 @@ +WASMER_DIR:=$(realpath $(WASMER_DIR)) + +$(info Using provided WASMER_DIR=$(WASMER_DIR)) + +ROOT_DIR:=$(shell dirname $(realpath $(firstword $(MAKEFILE_LIST)))) +ROOT_DIR_PARENT:=$(shell dirname $(ROOT_DIR)) + +MSVC_CFLAGS:="" +MSVC_LDFLAGS:="" +MSVC_LDLIBS:="" + +ifeq (,$(wildcard $(WASMER_DIR)/bin/wasmer)) + CFLAGS = -g -I $(ROOT_DIR)/ -I $(WASMER_DIR)/include + LDFLAGS = -Wl,-rpath,$(WASMER_DIR)/lib + LDLIBS = -L $(WASMER_DIR)/lib -lwasmer + + MSVC_CFLAGS:= /DEBUG /I $(ROOT_DIR)/ /I $(WASMER_DIR)/include + MSVC_LDFLAGS:= "" + MSVC_LDLIBS:= /LIBPATH:$(WASMER_DIR)/lib wasmer.dll.lib +else + CFLAGS = -g -I $(ROOT_DIR)/ -I $(shell $(WASMER_DIR)/bin/wasmer config --includedir) + LDFLAGS = -Wl,-rpath,$(shell $(WASMER_DIR)/bin/wasmer config --libdir) + LDLIBS = $(shell $(WASMER_DIR)/bin/wasmer config --libs) + + MSVC_CFLAGS:= /DEBUG /I $(ROOT_DIR)/ /I $(shell $(WASMER_DIR)/bin/wasmer config --includedir) + MSVC_LDFLAGS:= "" + MSVC_LDLIBS:= /LIBPATH:$(shell $(WASMER_DIR)/bin/wasmer config --libs) wasmer.dll.lib +endif + +$(info * CFLAGS: $(CFLAGS)) +$(info * LDFLAGS: $(LDFLAGS)) +$(info * LDLIBS: $(LDLIBS)) + +ALL = deprecated-header early-exit instance imports-exports exports-function exports-global memory memory2 features wasi + +.PHONY: run +.SILENT: run +run: + WASMER_DIR="$(WASMER_DIR)" ROOT_DIR="$(ROOT_DIR)" CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" LDLIBS="$(LDLIBS)" cargo test --manifest-path="./wasmer-capi-examples-runner/Cargo.toml" -- --nocapture 2>&1 + +.SILENT: clean +.PHONY: clean +clean: + $(foreach file,$(ALL),rm -f $(file).o $(file)) \ No newline at end of file diff --git a/lib/c-api/tests/Makefile b/lib/c-api/tests/Makefile new file mode 100644 index 00000000000..596994e389b --- /dev/null +++ b/lib/c-api/tests/Makefile @@ -0,0 +1,32 @@ +WASMER_DIR:=$(realpath $(WASMER_DIR)) + +$(info Using provided WASMER_DIR=$(WASMER_DIR)) + +ROOT_DIR:=$(shell dirname $(realpath $(firstword $(MAKEFILE_LIST)))) +ROOT_DIR_PARENT:=$(shell dirname $(ROOT_DIR)) + +ifeq (,$(wildcard $(WASMER_DIR)/bin/wasmer)) + CFLAGS = -g -I $(ROOT_DIR) -I $(WASMER_DIR)/include + LDFLAGS = -Wl,-rpath,$(WASMER_DIR)/lib + LDLIBS = -L $(WASMER_DIR)/lib -lwasmer +else + CFLAGS = -g -I $(ROOT_DIR)/wasm-c-api/include/ -I $(shell $(WASMER_DIR)/bin/wasmer config --includedir) + LDFLAGS = -Wl,-rpath,$(shell $(WASMER_DIR)/bin/wasmer config --libdir) + LDLIBS = $(shell $(WASMER_DIR)/bin/wasmer config --libs) +endif + + +$(info * ROOT_DIR: $(ROOT_DIR)) +$(info * WASMER_DIR: $(WASMER_DIR)) +$(info * "") +$(info * CFLAGS: $(CFLAGS)) +$(info * LDFLAGS: $(LDFLAGS)) +$(info * LDLIBS: $(LDLIBS)) + +test: + cargo test --manifest-path="./wasmer-c-api-test-runner/Cargo.toml" -- --nocapture 2>&1 + +.SILENT: clean +.PHONY: clean +clean: + $(foreach file,$(ALL),rm -f $(file).o $(file)) \ No newline at end of file From 38b1668b74c80492ebed4c6209d7875088a3550d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Sun, 27 Nov 2022 23:47:33 +0100 Subject: [PATCH 077/226] Fix wasmer-test-stage-1 --- .github/workflows/test.yaml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 260d27a2617..25192c71717 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -701,7 +701,7 @@ jobs: test_wasmer_stage_1: name: Test Wasmer Stage 1 on ${{ matrix.build }} runs-on: ${{ matrix.os }} - needs: setup + needs: [setup, build_capi] strategy: fail-fast: false matrix: @@ -757,6 +757,14 @@ jobs: SCCACHE_AZURE_CONNECTION_STRING: ${{ secrets.SCCACHE_AZURE_CONNECTION_STRING }} steps: - uses: actions/checkout@v3 + - uses: actions/download-artifact@v3 + id: download + with: + name: capi-${{ matrix.build }} + - name: Unzip Artifacts + shell: bash + run: | + make untar-capi - name: Set up libstdc++ on Linux if: matrix.build == 'linux-x64' run: | From 319b152a7fa2a12aa2ada4ff91f64d311d65b934 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Sun, 27 Nov 2022 23:58:37 +0100 Subject: [PATCH 078/226] Install Rust for test-capi and test-integration step --- .github/workflows/test.yaml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 25192c71717..bbe68ed6082 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -471,6 +471,11 @@ jobs: shell: bash run: | make untar-capi + - name: Install Rust + uses: dtolnay/rust-toolchain@stable + with: + toolchain: 1.63 + target: ${{ matrix.target }} - name: Test C API run: | make test-capi-ci @@ -560,6 +565,11 @@ jobs: - uses: goto-bus-stop/setup-zig@v2 with: version: 0.10.0 + - name: Install Rust + uses: dtolnay/rust-toolchain@stable + with: + toolchain: 1.63 + target: ${{ matrix.target }} - name: Test integration CLI if: matrix.os != 'windows-2019' shell: bash From fc36918bb806f0e507b513dff8ca474a800afe76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Mon, 28 Nov 2022 08:18:41 +0100 Subject: [PATCH 079/226] Fix coverage + build failures on linux-musl --- .github/workflows/test.yaml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index bbe68ed6082..ec73bf3acf9 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -79,7 +79,7 @@ jobs: - name: Install cargo-llvm-cov uses: taiki-e/install-action@cargo-llvm-cov - name: Generate code coverage - run: cargo llvm-cov --all-features --workspace --lcov --output-path lcov.info + run: cargo llvm-cov --workspace --lcov --output-path lcov.info --features cranelift,llvm,singlepass,wasmer-artifact-create,static-artifact-create,wasmer-artifact-load,static-artifact-load,webc_runner env: WAPM_DEV_TOKEN: ${{ secrets.WAPM_DEV_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -455,6 +455,10 @@ jobs: SCCACHE_AZURE_CONNECTION_STRING: ${{ secrets.SCCACHE_AZURE_CONNECTION_STRING }} steps: - uses: actions/checkout@v3 + - name: Set up base deps on musl + if: matrix.build == 'linux-musl-x64' + run: | + apk add build-base bash musl-dev curl make libtool libffi-dev gcc automake autoconf git openssl-dev g++ - uses: actions/download-artifact@v3 id: download with: @@ -543,6 +547,10 @@ jobs: SCCACHE_AZURE_CONNECTION_STRING: ${{ secrets.SCCACHE_AZURE_CONNECTION_STRING }} steps: - uses: actions/checkout@v3 + - name: Set up base deps on musl + if: matrix.build == 'linux-musl-x64' + run: | + apk add build-base bash musl-dev curl make libtool libffi-dev gcc automake autoconf git openssl-dev g++ - uses: actions/download-artifact@v3 id: download with: @@ -767,6 +775,10 @@ jobs: SCCACHE_AZURE_CONNECTION_STRING: ${{ secrets.SCCACHE_AZURE_CONNECTION_STRING }} steps: - uses: actions/checkout@v3 + - name: Set up base deps on musl + if: matrix.build == 'linux-musl-x64' + run: | + apk add build-base bash musl-dev curl make libtool libffi-dev gcc automake autoconf git openssl-dev g++ - uses: actions/download-artifact@v3 id: download with: From 5ecf31501871a5a21e064cb2f2390e62bb21b921 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Mon, 28 Nov 2022 08:46:29 +0100 Subject: [PATCH 080/226] Fix target llvm-cov-target to compile --- lib/c-api/build.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/c-api/build.rs b/lib/c-api/build.rs index 98400014c00..fd4474927c3 100644 --- a/lib/c-api/build.rs +++ b/lib/c-api/build.rs @@ -347,7 +347,9 @@ fn shared_object_dir() -> PathBuf { // We either find `target` or the target triple if cross-compiling. if shared_object_dir.file_name() != Some(OsStr::new("target")) { let target = env::var("TARGET").unwrap(); - assert_eq!(shared_object_dir.file_name(), Some(OsStr::new(&target))); + if shared_object_dir.file_name() != Some(OsStr::new("llvm-cov-target")) { + assert_eq!(shared_object_dir.file_name(), Some(OsStr::new(&target))); + } } shared_object_dir.push(env::var("PROFILE").unwrap()); From 24ba0cdf3b5225fefccd782bbc4fa26d6cb79010 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Mon, 28 Nov 2022 08:52:18 +0100 Subject: [PATCH 081/226] Add rust-cache --- .github/workflows/test.yaml | 44 +++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index ec73bf3acf9..5666948546d 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -246,6 +246,10 @@ jobs: target = "${{ matrix.target }}" EOF if: matrix.target + - uses: Swatinem/rust-cache@v2 + with: + cache-on-failure: true + shared-key: build-wasmer-${{ matrix.build }} - name: Build wasmer-cli shell: bash run: | @@ -380,6 +384,10 @@ jobs: target = "${{ matrix.target }}" EOF if: matrix.target + - uses: Swatinem/rust-cache@v2 + with: + cache-on-failure: true + shared-key: wasmer-${{ matrix.build }} - name: Build wasmer-cli shell: bash run: | @@ -480,6 +488,10 @@ jobs: with: toolchain: 1.63 target: ${{ matrix.target }} + - uses: Swatinem/rust-cache@v2 + with: + cache-on-failure: true + shared-key: wasmer-${{ matrix.build }} - name: Test C API run: | make test-capi-ci @@ -578,6 +590,10 @@ jobs: with: toolchain: 1.63 target: ${{ matrix.target }} + - uses: Swatinem/rust-cache@v2 + with: + cache-on-failure: true + shared-key: wasmer-${{ matrix.build }} - name: Test integration CLI if: matrix.os != 'windows-2019' shell: bash @@ -708,6 +724,10 @@ jobs: target = "${{ matrix.target }}" EOF if: matrix.target + - uses: Swatinem/rust-cache@v2 + with: + cache-on-failure: true + shared-key: wasmer-${{ matrix.build }} - name: Test run: | make test-stage-0 @@ -846,6 +866,10 @@ jobs: target = "${{ matrix.target }}" EOF if: matrix.target + - uses: Swatinem/rust-cache@v2 + with: + cache-on-failure: true + shared-key: wasmer-${{ matrix.build }} - name: Test run: | make test-stage-1 @@ -972,6 +996,10 @@ jobs: target = "${{ matrix.target }}" EOF if: matrix.target + - uses: Swatinem/rust-cache@v2 + with: + cache-on-failure: true + shared-key: wasmer-${{ matrix.build }} - name: Test run: | make test-stage-2 @@ -1098,6 +1126,10 @@ jobs: target = "${{ matrix.target }}" EOF if: matrix.target + - uses: Swatinem/rust-cache@v2 + with: + cache-on-failure: true + shared-key: wasmer-${{ matrix.build }} - name: Test run: | make test-stage-3 @@ -1224,6 +1256,10 @@ jobs: target = "${{ matrix.target }}" EOF if: matrix.target + - uses: Swatinem/rust-cache@v2 + with: + cache-on-failure: true + shared-key: wasmer-${{ matrix.build }} - name: Test run: | make test-stage-4 @@ -1350,6 +1386,10 @@ jobs: target = "${{ matrix.target }}" EOF if: matrix.target + - uses: Swatinem/rust-cache@v2 + with: + cache-on-failure: true + shared-key: wasmer-${{ matrix.build }} - name: Test run: | make test-stage-5 @@ -1476,6 +1516,10 @@ jobs: target = "${{ matrix.target }}" EOF if: matrix.target + - uses: Swatinem/rust-cache@v2 + with: + cache-on-failure: true + shared-key: wasmer-${{ matrix.build }} - name: Test run: | make test-stage-6 From 7ca78c67891bd226137d73924a9cdc754a1dc233 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Mon, 28 Nov 2022 08:56:35 +0100 Subject: [PATCH 082/226] Add caching to make lint, remove duplicate install deps step --- .github/workflows/test.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 5666948546d..2ce36782a80 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -51,6 +51,10 @@ jobs: tar xf /opt/llvm.tar.xz --strip-components=1 -C /opt/llvm-12 echo '/opt/llvm-12/bin' >> $GITHUB_PATH echo 'LLVM_SYS_120_PREFIX=/opt/llvm-12' >> $GITHUB_ENV + - uses: Swatinem/rust-cache@v2 + with: + cache-on-failure: true + shared-key: wasmer-linux-x64 - run: make lint env: ENABLE_CRANELIFT: "1" @@ -471,10 +475,6 @@ jobs: id: download with: name: capi-${{ matrix.build }} - - name: Set up base deps on musl - if: matrix.build == 'linux-musl-x64' - run: | - apk add build-base bash musl-dev curl make libtool libffi-dev gcc automake autoconf git openssl-dev g++ - name: 'Echo download path' run: echo ${{steps.download.outputs.download-path}} - name: Display structure of downloaded files From 6c478f88502624db3602bf80bc6355d947565d27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Mon, 28 Nov 2022 09:15:01 +0100 Subject: [PATCH 083/226] llvm-cov target: set proper shared object directory --- lib/c-api/build.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/c-api/build.rs b/lib/c-api/build.rs index fd4474927c3..b54165dca1b 100644 --- a/lib/c-api/build.rs +++ b/lib/c-api/build.rs @@ -349,6 +349,8 @@ fn shared_object_dir() -> PathBuf { let target = env::var("TARGET").unwrap(); if shared_object_dir.file_name() != Some(OsStr::new("llvm-cov-target")) { assert_eq!(shared_object_dir.file_name(), Some(OsStr::new(&target))); + } else { + shared_object_dir.set_file_name(&target); } } From 9a052165c69f687ffe1818a3e2e695861e69f1d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Mon, 28 Nov 2022 09:21:40 +0100 Subject: [PATCH 084/226] Only cache during build-wasmer step --- .github/workflows/test.yaml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 2ce36782a80..0ac170de562 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -55,6 +55,7 @@ jobs: with: cache-on-failure: true shared-key: wasmer-linux-x64 + save-if: false - run: make lint env: ENABLE_CRANELIFT: "1" @@ -392,7 +393,8 @@ jobs: with: cache-on-failure: true shared-key: wasmer-${{ matrix.build }} - - name: Build wasmer-cli + save-if: false + - name: Build C-API shell: bash run: | make build-capi && make package-capi @@ -492,6 +494,7 @@ jobs: with: cache-on-failure: true shared-key: wasmer-${{ matrix.build }} + save-if: false - name: Test C API run: | make test-capi-ci @@ -594,6 +597,7 @@ jobs: with: cache-on-failure: true shared-key: wasmer-${{ matrix.build }} + save-if: false - name: Test integration CLI if: matrix.os != 'windows-2019' shell: bash @@ -728,6 +732,7 @@ jobs: with: cache-on-failure: true shared-key: wasmer-${{ matrix.build }} + save-if: false - name: Test run: | make test-stage-0 @@ -870,6 +875,7 @@ jobs: with: cache-on-failure: true shared-key: wasmer-${{ matrix.build }} + save-if: false - name: Test run: | make test-stage-1 @@ -1000,6 +1006,7 @@ jobs: with: cache-on-failure: true shared-key: wasmer-${{ matrix.build }} + save-if: false - name: Test run: | make test-stage-2 @@ -1130,6 +1137,7 @@ jobs: with: cache-on-failure: true shared-key: wasmer-${{ matrix.build }} + save-if: false - name: Test run: | make test-stage-3 @@ -1260,6 +1268,7 @@ jobs: with: cache-on-failure: true shared-key: wasmer-${{ matrix.build }} + save-if: false - name: Test run: | make test-stage-4 @@ -1390,6 +1399,7 @@ jobs: with: cache-on-failure: true shared-key: wasmer-${{ matrix.build }} + save-if: false - name: Test run: | make test-stage-5 @@ -1520,6 +1530,7 @@ jobs: with: cache-on-failure: true shared-key: wasmer-${{ matrix.build }} + save-if: false - name: Test run: | make test-stage-6 From 6da4b1639296354e593a465a38775576bdf19c59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Mon, 28 Nov 2022 09:51:09 +0100 Subject: [PATCH 085/226] Fix typon in shared-cache-key --- .github/workflows/test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 0ac170de562..6c68bd892af 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -254,7 +254,7 @@ jobs: - uses: Swatinem/rust-cache@v2 with: cache-on-failure: true - shared-key: build-wasmer-${{ matrix.build }} + shared-key: wasmer-${{ matrix.build }} - name: Build wasmer-cli shell: bash run: | From 623a5fc909e93e5fc93ccdb14f135613fbd983a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Mon, 28 Nov 2022 10:16:44 +0100 Subject: [PATCH 086/226] Add tar to linux-musl dependencies --- .github/workflows/test.yaml | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 6c68bd892af..91e97a729b6 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -201,7 +201,7 @@ jobs: - name: Set up base deps on musl if: matrix.build == 'linux-musl-x64' run: | - apk add build-base bash musl-dev curl make libtool libffi-dev gcc automake autoconf git openssl-dev g++ + apk add build-base bash musl-dev curl tar make libtool libffi-dev gcc automake autoconf git openssl-dev g++ - name: Set up dependencies for Mac OS run: | brew install automake @@ -339,7 +339,7 @@ jobs: - name: Set up base deps on musl if: matrix.build == 'linux-musl-x64' run: | - apk add build-base bash musl-dev curl make libtool libffi-dev gcc automake autoconf git openssl-dev g++ + apk add build-base bash musl-dev curl tar make libtool libffi-dev gcc automake autoconf git openssl-dev g++ - name: Set up dependencies for Mac OS run: | brew install automake @@ -472,7 +472,7 @@ jobs: - name: Set up base deps on musl if: matrix.build == 'linux-musl-x64' run: | - apk add build-base bash musl-dev curl make libtool libffi-dev gcc automake autoconf git openssl-dev g++ + apk add build-base bash musl-dev curl tar make libtool libffi-dev gcc automake autoconf git openssl-dev g++ - uses: actions/download-artifact@v3 id: download with: @@ -565,7 +565,7 @@ jobs: - name: Set up base deps on musl if: matrix.build == 'linux-musl-x64' run: | - apk add build-base bash musl-dev curl make libtool libffi-dev gcc automake autoconf git openssl-dev g++ + apk add build-base bash musl-dev curl tar make libtool libffi-dev gcc automake autoconf git openssl-dev g++ - uses: actions/download-artifact@v3 id: download with: @@ -678,7 +678,7 @@ jobs: - name: Set up base deps on musl if: matrix.build == 'linux-musl-x64' run: | - apk add build-base bash musl-dev curl make libtool libffi-dev gcc automake autoconf git openssl-dev g++ + apk add build-base bash musl-dev curl tar make libtool libffi-dev gcc automake autoconf git openssl-dev g++ - name: Set up dependencies for Mac OS run: | brew install automake @@ -803,7 +803,7 @@ jobs: - name: Set up base deps on musl if: matrix.build == 'linux-musl-x64' run: | - apk add build-base bash musl-dev curl make libtool libffi-dev gcc automake autoconf git openssl-dev g++ + apk add build-base bash musl-dev curl tar make libtool libffi-dev gcc automake autoconf git openssl-dev g++ - uses: actions/download-artifact@v3 id: download with: @@ -821,7 +821,7 @@ jobs: - name: Set up base deps on musl if: matrix.build == 'linux-musl-x64' run: | - apk add build-base bash musl-dev curl make libtool libffi-dev gcc automake autoconf git openssl-dev g++ + apk add build-base bash musl-dev curl tar make libtool libffi-dev gcc automake autoconf git openssl-dev g++ - name: Set up dependencies for Mac OS run: | brew install automake @@ -952,7 +952,7 @@ jobs: - name: Set up base deps on musl if: matrix.build == 'linux-musl-x64' run: | - apk add build-base bash musl-dev curl make libtool libffi-dev gcc automake autoconf git openssl-dev g++ + apk add build-base bash musl-dev curl tar make libtool libffi-dev gcc automake autoconf git openssl-dev g++ - name: Set up dependencies for Mac OS run: | brew install automake @@ -1083,7 +1083,7 @@ jobs: - name: Set up base deps on musl if: matrix.build == 'linux-musl-x64' run: | - apk add build-base bash musl-dev curl make libtool libffi-dev gcc automake autoconf git openssl-dev g++ + apk add build-base bash musl-dev curl tar make libtool libffi-dev gcc automake autoconf git openssl-dev g++ - name: Set up dependencies for Mac OS run: | brew install automake @@ -1214,7 +1214,7 @@ jobs: - name: Set up base deps on musl if: matrix.build == 'linux-musl-x64' run: | - apk add build-base bash musl-dev curl make libtool libffi-dev gcc automake autoconf git openssl-dev g++ + apk add build-base bash musl-dev curl tar make libtool libffi-dev gcc automake autoconf git openssl-dev g++ - name: Set up dependencies for Mac OS run: | brew install automake @@ -1345,7 +1345,7 @@ jobs: - name: Set up base deps on musl if: matrix.build == 'linux-musl-x64' run: | - apk add build-base bash musl-dev curl make libtool libffi-dev gcc automake autoconf git openssl-dev g++ + apk add build-base bash musl-dev curl tar make libtool libffi-dev gcc automake autoconf git openssl-dev g++ - name: Set up dependencies for Mac OS run: | brew install automake @@ -1476,7 +1476,7 @@ jobs: - name: Set up base deps on musl if: matrix.build == 'linux-musl-x64' run: | - apk add build-base bash musl-dev curl make libtool libffi-dev gcc automake autoconf git openssl-dev g++ + apk add build-base bash musl-dev curl tar make libtool libffi-dev gcc automake autoconf git openssl-dev g++ - name: Set up dependencies for Mac OS run: | brew install automake From c566538e425f693db9c66ca2379132aa1293bb3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Mon, 28 Nov 2022 10:19:10 +0100 Subject: [PATCH 087/226] Add debugging to untar-capi step --- Makefile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Makefile b/Makefile index 2aff742f2f7..c839f1bdca8 100644 --- a/Makefile +++ b/Makefile @@ -726,6 +726,8 @@ untar-capi: tar -C package -xf ./build-capi.tar.gz cp package/lib/* target/release cp package/lib/* target/$(HOST_TARGET)/release + echo "untar capi" + ls -R target tar-wasmer: ls -R package @@ -738,6 +740,8 @@ untar-wasmer: tar -C package -xf ./build-wasmer.tar.gz cp package/bin/* target/release cp package/bin/* target/$(HOST_TARGET)/release + echo "untar wasmer" + ls -R target distribution-gnu: package-capi cp LICENSE package/LICENSE From af2e3304a57e3dc0a1800c0911849de1f2ef160b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Mon, 28 Nov 2022 10:35:48 +0100 Subject: [PATCH 088/226] Fix coverage step to use C-API --- .github/workflows/test.yaml | 69 ++++++++++++++++++++++--------------- Makefile | 4 +++ 2 files changed, 45 insertions(+), 28 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 91e97a729b6..9bdb5d4be08 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -66,34 +66,6 @@ jobs: git status ! [[ $(git status -s) ]] - coverage: - runs-on: ubuntu-latest - env: - CARGO_TERM_COLOR: always - steps: - - uses: actions/checkout@v3 - - name: Install Rust - run: rustup update stable - - name: Install LLVM (Linux) - run: | - curl --proto '=https' --tlsv1.2 -sSf https://github.com/llvm/llvm-project/releases/download/llvmorg-10.0.0/clang+llvm-10.0.0-x86_64-linux-gnu-ubuntu-18.04.tar.xz -L -o llvm.tar.xz - mkdir -p /opt/llvm-10 - tar xf llvm.tar.xz --strip-components=1 -C /opt/llvm-10 - echo '/opt/llvm-10/bin' >> $GITHUB_PATH - echo 'LLVM_SYS_100_PREFIX=/opt/llvm-10' >> $GITHUB_ENV - - name: Install cargo-llvm-cov - uses: taiki-e/install-action@cargo-llvm-cov - - name: Generate code coverage - run: cargo llvm-cov --workspace --lcov --output-path lcov.info --features cranelift,llvm,singlepass,wasmer-artifact-create,static-artifact-create,wasmer-artifact-load,static-artifact-load,webc_runner - env: - WAPM_DEV_TOKEN: ${{ secrets.WAPM_DEV_TOKEN }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Upload coverage to Codecov - uses: codecov/codecov-action@v3 - with: - files: lcov.info - fail_ci_if_error: true - cargo_deny: name: cargo-deny runs-on: ubuntu-latest @@ -410,6 +382,47 @@ jobs: if-no-files-found: error retention-days: 2 + coverage: + runs-on: ubuntu-latest + needs: build_capi + env: + CARGO_TERM_COLOR: always + steps: + - uses: actions/checkout@v3 + - uses: actions/download-artifact@v3 + id: download + with: + name: capi-linux-x64 + - name: 'Echo download path' + run: echo ${{steps.download.outputs.download-path}} + - name: Display structure of downloaded files + run: ls -R + - name: Unzip Artifacts + shell: bash + run: | + make untar-capi + - name: Install Rust + run: rustup update stable + - name: Install LLVM (Linux) + run: | + curl --proto '=https' --tlsv1.2 -sSf https://github.com/llvm/llvm-project/releases/download/llvmorg-10.0.0/clang+llvm-10.0.0-x86_64-linux-gnu-ubuntu-18.04.tar.xz -L -o llvm.tar.xz + mkdir -p /opt/llvm-10 + tar xf llvm.tar.xz --strip-components=1 -C /opt/llvm-10 + echo '/opt/llvm-10/bin' >> $GITHUB_PATH + echo 'LLVM_SYS_100_PREFIX=/opt/llvm-10' >> $GITHUB_ENV + - name: Install cargo-llvm-cov + uses: taiki-e/install-action@cargo-llvm-cov + - name: Generate code coverage + run: cargo llvm-cov --workspace --lcov --output-path lcov.info --features cranelift,llvm,singlepass,wasmer-artifact-create,static-artifact-create,wasmer-artifact-load,static-artifact-load,webc_runner + env: + WAPM_DEV_TOKEN: ${{ secrets.WAPM_DEV_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v3 + with: + files: lcov.info + fail_ci_if_error: true + test_capi: name: Test C-API on ${{ matrix.build }} runs-on: ${{ matrix.os }} diff --git a/Makefile b/Makefile index c839f1bdca8..c21bc1236db 100644 --- a/Makefile +++ b/Makefile @@ -728,6 +728,8 @@ untar-capi: cp package/lib/* target/$(HOST_TARGET)/release echo "untar capi" ls -R target + echo "package" + ls -R package tar-wasmer: ls -R package @@ -742,6 +744,8 @@ untar-wasmer: cp package/bin/* target/$(HOST_TARGET)/release echo "untar wasmer" ls -R target + echo "package" + ls -R package distribution-gnu: package-capi cp LICENSE package/LICENSE From 443a43244e2fcce05f66994eb66c3cd07fa61257 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Mon, 28 Nov 2022 10:54:49 +0100 Subject: [PATCH 089/226] Move "untar" step after restoring /target cache directory --- .github/workflows/test.yaml | 55 ++++++++++++++++++------------------- 1 file changed, 27 insertions(+), 28 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 9bdb5d4be08..c96cec63467 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -395,12 +395,6 @@ jobs: name: capi-linux-x64 - name: 'Echo download path' run: echo ${{steps.download.outputs.download-path}} - - name: Display structure of downloaded files - run: ls -R - - name: Unzip Artifacts - shell: bash - run: | - make untar-capi - name: Install Rust run: rustup update stable - name: Install LLVM (Linux) @@ -412,6 +406,15 @@ jobs: echo 'LLVM_SYS_100_PREFIX=/opt/llvm-10' >> $GITHUB_ENV - name: Install cargo-llvm-cov uses: taiki-e/install-action@cargo-llvm-cov + - uses: Swatinem/rust-cache@v2 + with: + cache-on-failure: true + shared-key: wasmer-linux-x64 + save-if: false + - name: Unzip Artifacts + shell: bash + run: | + make untar-capi - name: Generate code coverage run: cargo llvm-cov --workspace --lcov --output-path lcov.info --features cranelift,llvm,singlepass,wasmer-artifact-create,static-artifact-create,wasmer-artifact-load,static-artifact-load,webc_runner env: @@ -490,14 +493,6 @@ jobs: id: download with: name: capi-${{ matrix.build }} - - name: 'Echo download path' - run: echo ${{steps.download.outputs.download-path}} - - name: Display structure of downloaded files - run: ls -R - - name: Unzip Artifacts - shell: bash - run: | - make untar-capi - name: Install Rust uses: dtolnay/rust-toolchain@stable with: @@ -508,6 +503,12 @@ jobs: cache-on-failure: true shared-key: wasmer-${{ matrix.build }} save-if: false + - name: 'Echo download path' + run: echo ${{steps.download.outputs.download-path}} + - name: Unzip Artifacts + shell: bash + run: | + make untar-capi - name: Test C API run: | make test-capi-ci @@ -588,16 +589,6 @@ jobs: name: wasmer-cli-${{ matrix.build }} - name: 'Echo download path' run: echo ${{steps.download.outputs.download-path}} - - name: Display structure of downloaded files - run: ls -R - - name: Unzip Artifacts - shell: bash - run: | - make untar-capi - - name: Unzip Artifacts - shell: bash - run: | - make untar-wasmer - uses: goto-bus-stop/setup-zig@v2 with: version: 0.10.0 @@ -611,6 +602,14 @@ jobs: cache-on-failure: true shared-key: wasmer-${{ matrix.build }} save-if: false + - name: Unzip Artifacts + shell: bash + run: | + make untar-capi + - name: Unzip Artifacts + shell: bash + run: | + make untar-wasmer - name: Test integration CLI if: matrix.os != 'windows-2019' shell: bash @@ -821,10 +820,6 @@ jobs: id: download with: name: capi-${{ matrix.build }} - - name: Unzip Artifacts - shell: bash - run: | - make untar-capi - name: Set up libstdc++ on Linux if: matrix.build == 'linux-x64' run: | @@ -889,6 +884,10 @@ jobs: cache-on-failure: true shared-key: wasmer-${{ matrix.build }} save-if: false + - name: Unzip Artifacts + shell: bash + run: | + make untar-capi - name: Test run: | make test-stage-1 From 5656002243514b488ee222cd947bd769949342ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Mon, 28 Nov 2022 11:24:11 +0100 Subject: [PATCH 090/226] Adjust cache-on-failure --- .github/workflows/test.yaml | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index c96cec63467..d5e80035f5f 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -53,7 +53,7 @@ jobs: echo 'LLVM_SYS_120_PREFIX=/opt/llvm-12' >> $GITHUB_ENV - uses: Swatinem/rust-cache@v2 with: - cache-on-failure: true + cache-on-failure: false shared-key: wasmer-linux-x64 save-if: false - run: make lint @@ -363,7 +363,7 @@ jobs: if: matrix.target - uses: Swatinem/rust-cache@v2 with: - cache-on-failure: true + cache-on-failure: false shared-key: wasmer-${{ matrix.build }} save-if: false - name: Build C-API @@ -408,7 +408,7 @@ jobs: uses: taiki-e/install-action@cargo-llvm-cov - uses: Swatinem/rust-cache@v2 with: - cache-on-failure: true + cache-on-failure: false shared-key: wasmer-linux-x64 save-if: false - name: Unzip Artifacts @@ -500,7 +500,7 @@ jobs: target: ${{ matrix.target }} - uses: Swatinem/rust-cache@v2 with: - cache-on-failure: true + cache-on-failure: false shared-key: wasmer-${{ matrix.build }} save-if: false - name: 'Echo download path' @@ -599,7 +599,7 @@ jobs: target: ${{ matrix.target }} - uses: Swatinem/rust-cache@v2 with: - cache-on-failure: true + cache-on-failure: false shared-key: wasmer-${{ matrix.build }} save-if: false - name: Unzip Artifacts @@ -742,7 +742,7 @@ jobs: if: matrix.target - uses: Swatinem/rust-cache@v2 with: - cache-on-failure: true + cache-on-failure: false shared-key: wasmer-${{ matrix.build }} save-if: false - name: Test @@ -882,8 +882,7 @@ jobs: - uses: Swatinem/rust-cache@v2 with: cache-on-failure: true - shared-key: wasmer-${{ matrix.build }} - save-if: false + shared-key: wasmer-stage-1-${{ matrix.build }} - name: Unzip Artifacts shell: bash run: | @@ -1016,7 +1015,7 @@ jobs: if: matrix.target - uses: Swatinem/rust-cache@v2 with: - cache-on-failure: true + cache-on-failure: false shared-key: wasmer-${{ matrix.build }} save-if: false - name: Test @@ -1147,7 +1146,7 @@ jobs: if: matrix.target - uses: Swatinem/rust-cache@v2 with: - cache-on-failure: true + cache-on-failure: false shared-key: wasmer-${{ matrix.build }} save-if: false - name: Test @@ -1278,7 +1277,7 @@ jobs: if: matrix.target - uses: Swatinem/rust-cache@v2 with: - cache-on-failure: true + cache-on-failure: false shared-key: wasmer-${{ matrix.build }} save-if: false - name: Test @@ -1409,7 +1408,7 @@ jobs: if: matrix.target - uses: Swatinem/rust-cache@v2 with: - cache-on-failure: true + cache-on-failure: false shared-key: wasmer-${{ matrix.build }} save-if: false - name: Test @@ -1540,7 +1539,7 @@ jobs: if: matrix.target - uses: Swatinem/rust-cache@v2 with: - cache-on-failure: true + cache-on-failure: false shared-key: wasmer-${{ matrix.build }} save-if: false - name: Test From d8965dcdb585ecf58666ca7cd28ac0d5ff96ad09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Mon, 28 Nov 2022 12:05:12 +0100 Subject: [PATCH 091/226] Move zig install action to top, copy libraries to /debug --- .github/workflows/test.yaml | 6 +++--- Makefile | 10 ++++++++++ 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index d5e80035f5f..6a145a26f4f 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -576,6 +576,9 @@ jobs: 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-x64' run: | @@ -589,9 +592,6 @@ jobs: name: wasmer-cli-${{ matrix.build }} - name: 'Echo download path' run: echo ${{steps.download.outputs.download-path}} - - uses: goto-bus-stop/setup-zig@v2 - with: - version: 0.10.0 - name: Install Rust uses: dtolnay/rust-toolchain@stable with: diff --git a/Makefile b/Makefile index c21bc1236db..8edf301dc8d 100644 --- a/Makefile +++ b/Makefile @@ -726,6 +726,11 @@ untar-capi: tar -C package -xf ./build-capi.tar.gz cp package/lib/* target/release cp package/lib/* target/$(HOST_TARGET)/release + mkdir -p target/debug + mkdir -p target/$(HOST_TARGET)/debug + tar -C package -xf ./build-capi.tar.gz + cp package/lib/* target/debug + cp package/lib/* target/$(HOST_TARGET)/debug echo "untar capi" ls -R target echo "package" @@ -742,6 +747,11 @@ untar-wasmer: tar -C package -xf ./build-wasmer.tar.gz cp package/bin/* target/release cp package/bin/* target/$(HOST_TARGET)/release + mkdir -p target/debug + mkdir -p target/$(HOST_TARGET)/debug + tar -C package -xf ./build-wasmer.tar.gz + cp package/bin/* target/debug + cp package/bin/* target/$(HOST_TARGET)/debug echo "untar wasmer" ls -R target echo "package" From 852adeb7b19c7eff2d1c68a501a89b1d0d99b2df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Mon, 28 Nov 2022 12:12:38 +0100 Subject: [PATCH 092/226] Disable test-capi for linux-musl because of linker issue This was already present in the old CI, so it's just ported here --- .github/workflows/test.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 6a145a26f4f..2e31ca714fd 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -154,7 +154,7 @@ jobs: os: ubuntu-latest container: alpine:latest run_test: true - run_test_capi: false # It can't run the capi tests because of a cc linker issue (`wasm_engine_new` is redefined) + run_test_capi: false run_integration_tests: false run_build_docs: false use_sccache: false @@ -510,6 +510,8 @@ jobs: run: | make untar-capi - name: Test C API + # musl can't run the capi tests because of a cc linker issue (`wasm_engine_new` is redefined) + if: matrix.build != 'linux-musl-x64' run: | make test-capi-ci env: From 7ad905e7116d74beb22ab6d23ae300efff319444 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Mon, 28 Nov 2022 13:32:36 +0100 Subject: [PATCH 093/226] Address review comments --- .github/workflows/test.yaml | 45 ++++++++++++++++++------------------- 1 file changed, 22 insertions(+), 23 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 2e31ca714fd..d51c2cb237d 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -4,7 +4,6 @@ on: push: branches: - '**' - - '!master' pull_request: types: [ synchronize ] workflow_dispatch: @@ -132,9 +131,9 @@ jobs: run_integration_tests: true run_ios_tests: true run_build_docs: false - - build: macos-x86_64 + - build: macos-arm os: macos-11.0 - target: x86_64-apple-darwin + target: aarch64-apple-darwin use_sccache: true run_test: false run_test_capi: false @@ -270,9 +269,9 @@ jobs: run_integration_tests: true run_ios_tests: true run_build_docs: false - - build: macos-x86_64 + - build: macos-arm os: macos-11.0 - target: x86_64-apple-darwin + target: aarch64-apple-darwin use_sccache: true run_test: false run_test_capi: false @@ -453,9 +452,9 @@ jobs: run_integration_tests: true run_ios_tests: true run_build_docs: false - - build: macos-x86_64 + - build: macos-arm os: macos-11.0 - target: x86_64-apple-darwin + target: aarch64-apple-darwin use_sccache: true run_test: false run_test_capi: false @@ -546,9 +545,9 @@ jobs: run_integration_tests: true run_ios_tests: true run_build_docs: false - - build: macos-x86_64 + - build: macos-arm os: macos-11.0 - target: x86_64-apple-darwin + target: aarch64-apple-darwin use_sccache: true run_test: false run_test_capi: false @@ -651,9 +650,9 @@ jobs: run_integration_tests: true run_ios_tests: true run_build_docs: false - - build: macos-x86_64 + - build: macos-arm os: macos-11.0 - target: x86_64-apple-darwin + target: aarch64-apple-darwin use_sccache: true run_test: false run_test_capi: false @@ -782,9 +781,9 @@ jobs: run_integration_tests: true run_ios_tests: true run_build_docs: false - - build: macos-x86_64 + - build: macos-arm os: macos-11.0 - target: x86_64-apple-darwin + target: aarch64-apple-darwin use_sccache: true run_test: false run_test_capi: false @@ -924,9 +923,9 @@ jobs: run_integration_tests: true run_ios_tests: true run_build_docs: false - - build: macos-x86_64 + - build: macos-arm os: macos-11.0 - target: x86_64-apple-darwin + target: aarch64-apple-darwin use_sccache: true run_test: false run_test_capi: false @@ -1055,9 +1054,9 @@ jobs: run_integration_tests: true run_ios_tests: true run_build_docs: false - - build: macos-x86_64 + - build: macos-arm os: macos-11.0 - target: x86_64-apple-darwin + target: aarch64-apple-darwin use_sccache: true run_test: false run_test_capi: false @@ -1186,9 +1185,9 @@ jobs: run_integration_tests: true run_ios_tests: true run_build_docs: false - - build: macos-x86_64 + - build: macos-arm os: macos-11.0 - target: x86_64-apple-darwin + target: aarch64-apple-darwin use_sccache: true run_test: false run_test_capi: false @@ -1317,9 +1316,9 @@ jobs: run_integration_tests: true run_ios_tests: true run_build_docs: false - - build: macos-x86_64 + - build: macos-arm os: macos-11.0 - target: x86_64-apple-darwin + target: aarch64-apple-darwin use_sccache: true run_test: false run_test_capi: false @@ -1448,9 +1447,9 @@ jobs: run_integration_tests: true run_ios_tests: true run_build_docs: false - - build: macos-x86_64 + - build: macos-arm os: macos-11.0 - target: x86_64-apple-darwin + target: aarch64-apple-darwin use_sccache: true run_test: false run_test_capi: false From a343c74e463086eb86571d0f33a8803dec7265b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Mon, 28 Nov 2022 13:42:16 +0100 Subject: [PATCH 094/226] Add linux-aarch64 and windows-gnu targets --- .github/workflows/test.yaml | 98 +++++++++++++++++++++++++++++++++++++ 1 file changed, 98 insertions(+) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index d51c2cb237d..69dab5269d2 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -242,6 +242,104 @@ jobs: if-no-files-found: error retention-days: 2 + build_wasmer_linux_aarch64: + name: Build wasmer on linux aarch64 + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: dtolnay/rust-toolchain@stable + with: + toolchain: 1.61 + 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: --target aarch64-unknown-linux-gnu + PKG_CONFIG_PATH: /usr/lib/aarch64-linux-gnu/pkgconfig + PKG_CONFIG_ALLOW_CROSS: true + ENABLE_LLVM: 0 + + build_capi_linux_aarch64: + name: Build C-API on linux aarch64 + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: dtolnay/rust-toolchain@stable + with: + toolchain: 1.61 + 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 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: --target aarch64-unknown-linux-gnu + PKG_CONFIG_PATH: /usr/lib/aarch64-linux-gnu/pkgconfig + PKG_CONFIG_ALLOW_CROSS: true + ENABLE_LLVM: 0 + + build_capi_windows_gnu: + name: Windows GNU + runs-on: ubuntu-18.04 + steps: + - uses: actions/checkout@v2 + - name: Install Windows-GNU linker + shell: bash + run: | + sudo apt install -y mingw-w64 + - uses: dtolnay/rust-toolchain@stable + with: + toolchain: 1.61 + target: x86_64-pc-windows-gnu + - name: Install Windows-GNU target + shell: bash + run: | + rustup target add x86_64-pc-windows-gnu + - uses: Swatinem/rust-cache@v2 + with: + cache-on-failure: true + shared-key: wasmer-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: | + cargo build --release --target x86_64-pc-windows-gnu --manifest-path lib/c-api/Cargo.toml --no-default-features --features wat,compiler,wasi,middlewares,webc_runner --features cranelift,singlepass,wasmer-artifact-create,static-artifact-create,wasmer-artifact-load,static-artifact-load + + build_capi: name: Build C-API on ${{ matrix.build }} runs-on: ${{ matrix.os }} From da364fbcb00eae745c3ce65f469dd27a4a4c3828 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Mon, 28 Nov 2022 14:28:05 +0100 Subject: [PATCH 095/226] Use macos-latest M1 runners --- .github/workflows/test.yaml | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 69dab5269d2..2ff7a8f7fff 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -132,7 +132,7 @@ jobs: run_ios_tests: true run_build_docs: false - build: macos-arm - os: macos-11.0 + os: macos-latest target: aarch64-apple-darwin use_sccache: true run_test: false @@ -368,7 +368,7 @@ jobs: run_ios_tests: true run_build_docs: false - build: macos-arm - os: macos-11.0 + os: macos-latest target: aarch64-apple-darwin use_sccache: true run_test: false @@ -551,7 +551,7 @@ jobs: run_ios_tests: true run_build_docs: false - build: macos-arm - os: macos-11.0 + os: macos-latest target: aarch64-apple-darwin use_sccache: true run_test: false @@ -644,7 +644,7 @@ jobs: run_ios_tests: true run_build_docs: false - build: macos-arm - os: macos-11.0 + os: macos-latest target: aarch64-apple-darwin use_sccache: true run_test: false @@ -749,7 +749,7 @@ jobs: run_ios_tests: true run_build_docs: false - build: macos-arm - os: macos-11.0 + os: macos-latest target: aarch64-apple-darwin use_sccache: true run_test: false @@ -880,7 +880,7 @@ jobs: run_ios_tests: true run_build_docs: false - build: macos-arm - os: macos-11.0 + os: macos-latest target: aarch64-apple-darwin use_sccache: true run_test: false @@ -1022,7 +1022,7 @@ jobs: run_ios_tests: true run_build_docs: false - build: macos-arm - os: macos-11.0 + os: macos-latest target: aarch64-apple-darwin use_sccache: true run_test: false @@ -1153,7 +1153,7 @@ jobs: run_ios_tests: true run_build_docs: false - build: macos-arm - os: macos-11.0 + os: macos-latest target: aarch64-apple-darwin use_sccache: true run_test: false @@ -1284,7 +1284,7 @@ jobs: run_ios_tests: true run_build_docs: false - build: macos-arm - os: macos-11.0 + os: macos-latest target: aarch64-apple-darwin use_sccache: true run_test: false @@ -1415,7 +1415,7 @@ jobs: run_ios_tests: true run_build_docs: false - build: macos-arm - os: macos-11.0 + os: macos-latest target: aarch64-apple-darwin use_sccache: true run_test: false @@ -1546,7 +1546,7 @@ jobs: run_ios_tests: true run_build_docs: false - build: macos-arm - os: macos-11.0 + os: macos-latest target: aarch64-apple-darwin use_sccache: true run_test: false From 8ae48189032c847a7527bc5aa5d48031553259a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Mon, 28 Nov 2022 14:48:01 +0100 Subject: [PATCH 096/226] Only build on macos-arm, don't run tests --- .github/workflows/test.yaml | 68 ++----------------------------------- 1 file changed, 2 insertions(+), 66 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 2ff7a8f7fff..163c75f9b7f 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -132,7 +132,7 @@ jobs: run_ios_tests: true run_build_docs: false - build: macos-arm - os: macos-latest + os: macos-11.0 target: aarch64-apple-darwin use_sccache: true run_test: false @@ -339,7 +339,6 @@ jobs: run: | cargo build --release --target x86_64-pc-windows-gnu --manifest-path lib/c-api/Cargo.toml --no-default-features --features wat,compiler,wasi,middlewares,webc_runner --features cranelift,singlepass,wasmer-artifact-create,static-artifact-create,wasmer-artifact-load,static-artifact-load - build_capi: name: Build C-API on ${{ matrix.build }} runs-on: ${{ matrix.os }} @@ -368,7 +367,7 @@ jobs: run_ios_tests: true run_build_docs: false - build: macos-arm - os: macos-latest + os: macos-11.0 target: aarch64-apple-darwin use_sccache: true run_test: false @@ -550,13 +549,6 @@ jobs: run_integration_tests: true run_ios_tests: true run_build_docs: false - - build: macos-arm - os: macos-latest - target: aarch64-apple-darwin - use_sccache: true - run_test: false - run_test_capi: false - run_build_docs: false - build: windows-x64 os: windows-2019 target: x86_64-pc-windows-msvc @@ -643,13 +635,6 @@ jobs: run_integration_tests: true run_ios_tests: true run_build_docs: false - - build: macos-arm - os: macos-latest - target: aarch64-apple-darwin - use_sccache: true - run_test: false - run_test_capi: false - run_build_docs: false - build: windows-x64 os: windows-2019 target: x86_64-pc-windows-msvc @@ -748,13 +733,6 @@ jobs: run_integration_tests: true run_ios_tests: true run_build_docs: false - - build: macos-arm - os: macos-latest - target: aarch64-apple-darwin - use_sccache: true - run_test: false - run_test_capi: false - run_build_docs: false - build: windows-x64 os: windows-2019 target: x86_64-pc-windows-msvc @@ -879,13 +857,6 @@ jobs: run_integration_tests: true run_ios_tests: true run_build_docs: false - - build: macos-arm - os: macos-latest - target: aarch64-apple-darwin - use_sccache: true - run_test: false - run_test_capi: false - run_build_docs: false - build: windows-x64 os: windows-2019 target: x86_64-pc-windows-msvc @@ -1021,13 +992,6 @@ jobs: run_integration_tests: true run_ios_tests: true run_build_docs: false - - build: macos-arm - os: macos-latest - target: aarch64-apple-darwin - use_sccache: true - run_test: false - run_test_capi: false - run_build_docs: false - build: windows-x64 os: windows-2019 target: x86_64-pc-windows-msvc @@ -1152,13 +1116,6 @@ jobs: run_integration_tests: true run_ios_tests: true run_build_docs: false - - build: macos-arm - os: macos-latest - target: aarch64-apple-darwin - use_sccache: true - run_test: false - run_test_capi: false - run_build_docs: false - build: windows-x64 os: windows-2019 target: x86_64-pc-windows-msvc @@ -1283,13 +1240,6 @@ jobs: run_integration_tests: true run_ios_tests: true run_build_docs: false - - build: macos-arm - os: macos-latest - target: aarch64-apple-darwin - use_sccache: true - run_test: false - run_test_capi: false - run_build_docs: false - build: windows-x64 os: windows-2019 target: x86_64-pc-windows-msvc @@ -1414,13 +1364,6 @@ jobs: run_integration_tests: true run_ios_tests: true run_build_docs: false - - build: macos-arm - os: macos-latest - target: aarch64-apple-darwin - use_sccache: true - run_test: false - run_test_capi: false - run_build_docs: false - build: windows-x64 os: windows-2019 target: x86_64-pc-windows-msvc @@ -1545,13 +1488,6 @@ jobs: run_integration_tests: true run_ios_tests: true run_build_docs: false - - build: macos-arm - os: macos-latest - target: aarch64-apple-darwin - use_sccache: true - run_test: false - run_test_capi: false - run_build_docs: false - build: windows-x64 os: windows-2019 target: x86_64-pc-windows-msvc From 9d1d3af213cef49035205e2fce82a4fcab59c95d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Mon, 28 Nov 2022 15:47:48 +0100 Subject: [PATCH 097/226] Fix cargo lcov invocation --- .github/workflows/test.yaml | 2 +- lib/c-api/src/wasm_c_api/engine.rs | 1 + lib/c-api/src/wasm_c_api/externals/global.rs | 2 ++ lib/c-api/src/wasm_c_api/externals/mod.rs | 1 + lib/c-api/src/wasm_c_api/instance.rs | 1 + lib/c-api/src/wasm_c_api/module.rs | 6 ++++++ lib/c-api/src/wasm_c_api/trap.rs | 2 ++ lib/c-api/src/wasm_c_api/wasi/mod.rs | 3 +++ 8 files changed, 17 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 163c75f9b7f..1c107345df9 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -512,7 +512,7 @@ jobs: run: | make untar-capi - name: Generate code coverage - run: cargo llvm-cov --workspace --lcov --output-path lcov.info --features cranelift,llvm,singlepass,wasmer-artifact-create,static-artifact-create,wasmer-artifact-load,static-artifact-load,webc_runner + run: cargo llvm-cov --workspace --lcov --output-path lcov.info --features cranelift,singlepass,wasmer-artifact-create,static-artifact-create,wasmer-artifact-load,static-artifact-load,webc_runner --exclude wasmer-integration-tests-ios env: WAPM_DEV_TOKEN: ${{ secrets.WAPM_DEV_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/lib/c-api/src/wasm_c_api/engine.rs b/lib/c-api/src/wasm_c_api/engine.rs index 67a3c730196..0c69c78db56 100644 --- a/lib/c-api/src/wasm_c_api/engine.rs +++ b/lib/c-api/src/wasm_c_api/engine.rs @@ -445,6 +445,7 @@ mod tests { #[cfg(target_os = "windows")] use wasmer_inline_c::assert_c; + #[cfg_attr(coverage, ignore)] #[test] fn test_engine_new() { (assert_c! { diff --git a/lib/c-api/src/wasm_c_api/externals/global.rs b/lib/c-api/src/wasm_c_api/externals/global.rs index 0c911cf3943..1c1519dcd60 100644 --- a/lib/c-api/src/wasm_c_api/externals/global.rs +++ b/lib/c-api/src/wasm_c_api/externals/global.rs @@ -102,6 +102,7 @@ mod tests { #[cfg(target_os = "windows")] use wasmer_inline_c::assert_c; + #[cfg_attr(coverage, ignore)] #[test] fn test_set_host_global_immutable() { (assert_c! { @@ -134,6 +135,7 @@ mod tests { .success(); } + #[cfg_attr(coverage, ignore)] #[test] fn test_set_guest_global_immutable() { (assert_c! { diff --git a/lib/c-api/src/wasm_c_api/externals/mod.rs b/lib/c-api/src/wasm_c_api/externals/mod.rs index fdd2a419569..78929b8950d 100644 --- a/lib/c-api/src/wasm_c_api/externals/mod.rs +++ b/lib/c-api/src/wasm_c_api/externals/mod.rs @@ -137,6 +137,7 @@ mod tests { #[cfg(target_os = "windows")] use wasmer_inline_c::assert_c; + #[cfg_attr(coverage, ignore)] // run by test-runner in coverage tests #[test] fn test_extern_copy() { (assert_c! { diff --git a/lib/c-api/src/wasm_c_api/instance.rs b/lib/c-api/src/wasm_c_api/instance.rs index 863c736c0f6..a0261c26a62 100644 --- a/lib/c-api/src/wasm_c_api/instance.rs +++ b/lib/c-api/src/wasm_c_api/instance.rs @@ -212,6 +212,7 @@ mod tests { #[cfg(target_os = "windows")] use wasmer_inline_c::assert_c; + #[cfg_attr(coverage, ignore)] #[test] fn test_instance_new() { (assert_c! { diff --git a/lib/c-api/src/wasm_c_api/module.rs b/lib/c-api/src/wasm_c_api/module.rs index 480483962fb..2bc7b1ff3b8 100644 --- a/lib/c-api/src/wasm_c_api/module.rs +++ b/lib/c-api/src/wasm_c_api/module.rs @@ -485,6 +485,7 @@ mod tests { #[cfg(target_os = "windows")] use wasmer_inline_c::assert_c; + #[cfg_attr(coverage, ignore)] #[test] fn test_module_validate() { (assert_c! { @@ -512,6 +513,7 @@ mod tests { .success(); } + #[cfg_attr(coverage, ignore)] #[test] fn test_module_new() { (assert_c! { @@ -541,6 +543,7 @@ mod tests { .success(); } + #[cfg_attr(coverage, ignore)] #[test] fn test_module_exports() { (assert_c! { @@ -649,6 +652,7 @@ mod tests { .success(); } + #[cfg_attr(coverage, ignore)] #[test] fn test_module_imports() { (assert_c! { @@ -767,6 +771,7 @@ mod tests { .success(); } + #[cfg_attr(coverage, ignore)] #[test] fn test_module_serialize() { (assert_c! { @@ -801,6 +806,7 @@ mod tests { .success(); } + #[cfg_attr(coverage, ignore)] #[test] fn test_module_serialize_and_deserialize() { (assert_c! { diff --git a/lib/c-api/src/wasm_c_api/trap.rs b/lib/c-api/src/wasm_c_api/trap.rs index 55ce4211ae1..cbaf6ffe5a1 100644 --- a/lib/c-api/src/wasm_c_api/trap.rs +++ b/lib/c-api/src/wasm_c_api/trap.rs @@ -149,6 +149,7 @@ mod tests { #[cfg(target_os = "windows")] use wasmer_inline_c::assert_c; + #[cfg_attr(coverage, ignore)] #[test] fn test_trap_message_null_terminated() { (assert_c! { @@ -181,6 +182,7 @@ mod tests { .success(); } + #[cfg_attr(coverage, ignore)] #[test] fn test_trap_message_not_null_terminated() { (assert_c! { diff --git a/lib/c-api/src/wasm_c_api/wasi/mod.rs b/lib/c-api/src/wasm_c_api/wasi/mod.rs index 7d59e614144..1f3354d0a77 100644 --- a/lib/c-api/src/wasm_c_api/wasi/mod.rs +++ b/lib/c-api/src/wasm_c_api/wasi/mod.rs @@ -549,6 +549,7 @@ mod tests { #[cfg(target_os = "windows")] use wasmer_inline_c::assert_c; + #[cfg_attr(coverage, ignore)] #[test] fn test_wasi_get_wasi_version_snapshot0() { (assert_c! { @@ -582,6 +583,7 @@ mod tests { .success(); } + #[cfg_attr(coverage, ignore)] #[test] fn test_wasi_get_wasi_version_snapshot1() { (assert_c! { @@ -615,6 +617,7 @@ mod tests { .success(); } + #[cfg_attr(coverage, ignore)] #[test] fn test_wasi_get_wasi_version_invalid() { (assert_c! { From f14a5100c377fdb191614c2d386a181cbeb44b27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Mon, 28 Nov 2022 16:20:48 +0100 Subject: [PATCH 098/226] Add wasmer binary to coverage tests --- .github/workflows/test.yaml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 1c107345df9..a5249b516f5 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -480,7 +480,7 @@ jobs: coverage: runs-on: ubuntu-latest - needs: build_capi + needs: [build_capi, build_wasmer] env: CARGO_TERM_COLOR: always steps: @@ -489,6 +489,9 @@ jobs: id: download with: name: capi-linux-x64 + - uses: actions/download-artifact@v3 + with: + name: wasmer-linux-x64 - name: 'Echo download path' run: echo ${{steps.download.outputs.download-path}} - name: Install Rust @@ -511,6 +514,10 @@ jobs: shell: bash run: | make untar-capi + - name: Unzip Artifacts + shell: bash + run: | + make untar-wasmer - name: Generate code coverage run: cargo llvm-cov --workspace --lcov --output-path lcov.info --features cranelift,singlepass,wasmer-artifact-create,static-artifact-create,wasmer-artifact-load,static-artifact-load,webc_runner --exclude wasmer-integration-tests-ios env: From ae0c1445934c4d99fd0d7fe785d44810374f80c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Mon, 28 Nov 2022 16:56:15 +0100 Subject: [PATCH 099/226] Add sccache for tasks that are long-running --- .github/workflows/test.yaml | 290 +++++++++++++++++++++++++++++++++++- 1 file changed, 289 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index a5249b516f5..8fb2cf28d67 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -226,6 +226,54 @@ jobs: with: cache-on-failure: true shared-key: wasmer-${{ matrix.build }} + - uses: actions/cache@v2 + if: matrix.use_sccache + with: + path: ${{ runner.tool_cache }}/cargo-sccache + key: ${{ matrix.build }}-${{ matrix.target }}-sccache-bin-${{ env.CARGO_SCCACHE_VERSION }}-v1 + - name: Install sccache + if: matrix.use_sccache + run: | + if [ ! -f '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' ]; then + cargo install sccache --no-default-features --features=dist-client,azure --root '${{ runner.tool_cache }}/cargo-sccache' + fi + shell: bash + - name: Setup Rust target + run: | + mkdir -p .cargo + cat << EOF > .cargo/config.toml + [build] + target = "${{ matrix.target }}" + EOF + if: matrix.target + - name: Set sccache port + if: matrix.use_sccache && matrix.random_sccache_port + run: | + netstat -aln | awk ' + $6 == "LISTEN" { + if ($4 ~ "[.:][0-9]+$") { + n = split($4, a, /[:.]/); + port = a[n]; + p[port] = 1 + } + } + END { + for (i = 3000; i < 65000 && p[i]; i++){}; + if (i == 65000) {exit 1}; + print "SCCACHE_SERVER_PORT=" i + } + ' >> $GITHUB_ENV + # echo "SCCACHE_SERVER_PORT=9000" + echo "Setting random sccache port to: $SCCACHE_SERVER_PORT" + shell: bash + - name: Start sccache + if: matrix.use_sccache + run: | + chmod +x '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' + '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' --start-server + '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' -s + echo 'RUSTC_WRAPPER=${{ runner.tool_cache }}/cargo-sccache/bin/sccache' >> $GITHUB_ENV + shell: bash - name: Build wasmer-cli shell: bash run: | @@ -462,6 +510,54 @@ jobs: cache-on-failure: false shared-key: wasmer-${{ matrix.build }} save-if: false + - uses: actions/cache@v2 + if: matrix.use_sccache + with: + path: ${{ runner.tool_cache }}/cargo-sccache + key: capi-${{ matrix.build }}-${{ matrix.target }}-sccache-bin-${{ env.CARGO_SCCACHE_VERSION }}-v1 + - name: Install sccache + if: matrix.use_sccache + run: | + if [ ! -f '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' ]; then + cargo install sccache --no-default-features --features=dist-client,azure --root '${{ runner.tool_cache }}/cargo-sccache' + fi + shell: bash + - name: Setup Rust target + run: | + mkdir -p .cargo + cat << EOF > .cargo/config.toml + [build] + target = "${{ matrix.target }}" + EOF + if: matrix.target + - name: Set sccache port + if: matrix.use_sccache && matrix.random_sccache_port + run: | + netstat -aln | awk ' + $6 == "LISTEN" { + if ($4 ~ "[.:][0-9]+$") { + n = split($4, a, /[:.]/); + port = a[n]; + p[port] = 1 + } + } + END { + for (i = 3000; i < 65000 && p[i]; i++){}; + if (i == 65000) {exit 1}; + print "SCCACHE_SERVER_PORT=" i + } + ' >> $GITHUB_ENV + # echo "SCCACHE_SERVER_PORT=9000" + echo "Setting random sccache port to: $SCCACHE_SERVER_PORT" + shell: bash + - name: Start sccache + if: matrix.use_sccache + run: | + chmod +x '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' + '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' --start-server + '${{ 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 shell: bash run: | @@ -491,7 +587,7 @@ jobs: name: capi-linux-x64 - uses: actions/download-artifact@v3 with: - name: wasmer-linux-x64 + name: wasmer-cli-linux-x64 - name: 'Echo download path' run: echo ${{steps.download.outputs.download-path}} - name: Install Rust @@ -599,6 +695,54 @@ jobs: cache-on-failure: false shared-key: wasmer-${{ matrix.build }} save-if: false + - uses: actions/cache@v2 + if: matrix.use_sccache + with: + path: ${{ runner.tool_cache }}/cargo-sccache + key: test-capi-${{ matrix.build }}-${{ matrix.target }}-sccache-bin-${{ env.CARGO_SCCACHE_VERSION }}-v1 + - name: Install sccache + if: matrix.use_sccache + run: | + if [ ! -f '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' ]; then + cargo install sccache --no-default-features --features=dist-client,azure --root '${{ runner.tool_cache }}/cargo-sccache' + fi + shell: bash + - name: Setup Rust target + run: | + mkdir -p .cargo + cat << EOF > .cargo/config.toml + [build] + target = "${{ matrix.target }}" + EOF + if: matrix.target + - name: Set sccache port + if: matrix.use_sccache && matrix.random_sccache_port + run: | + netstat -aln | awk ' + $6 == "LISTEN" { + if ($4 ~ "[.:][0-9]+$") { + n = split($4, a, /[:.]/); + port = a[n]; + p[port] = 1 + } + } + END { + for (i = 3000; i < 65000 && p[i]; i++){}; + if (i == 65000) {exit 1}; + print "SCCACHE_SERVER_PORT=" i + } + ' >> $GITHUB_ENV + # echo "SCCACHE_SERVER_PORT=9000" + echo "Setting random sccache port to: $SCCACHE_SERVER_PORT" + shell: bash + - name: Start sccache + if: matrix.use_sccache + run: | + chmod +x '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' + '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' --start-server + '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' -s + echo 'RUSTC_WRAPPER=${{ runner.tool_cache }}/cargo-sccache/bin/sccache' >> $GITHUB_ENV + shell: bash - name: 'Echo download path' run: echo ${{steps.download.outputs.download-path}} - name: Unzip Artifacts @@ -693,6 +837,54 @@ jobs: cache-on-failure: false shared-key: wasmer-${{ matrix.build }} save-if: false + - uses: actions/cache@v2 + if: matrix.use_sccache + with: + path: ${{ runner.tool_cache }}/cargo-sccache + key: test-integration-${{ matrix.build }}-${{ matrix.target }}-sccache-bin-${{ env.CARGO_SCCACHE_VERSION }}-v1 + - name: Install sccache + if: matrix.use_sccache + run: | + if [ ! -f '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' ]; then + cargo install sccache --no-default-features --features=dist-client,azure --root '${{ runner.tool_cache }}/cargo-sccache' + fi + shell: bash + - name: Setup Rust target + run: | + mkdir -p .cargo + cat << EOF > .cargo/config.toml + [build] + target = "${{ matrix.target }}" + EOF + if: matrix.target + - name: Set sccache port + if: matrix.use_sccache && matrix.random_sccache_port + run: | + netstat -aln | awk ' + $6 == "LISTEN" { + if ($4 ~ "[.:][0-9]+$") { + n = split($4, a, /[:.]/); + port = a[n]; + p[port] = 1 + } + } + END { + for (i = 3000; i < 65000 && p[i]; i++){}; + if (i == 65000) {exit 1}; + print "SCCACHE_SERVER_PORT=" i + } + ' >> $GITHUB_ENV + # echo "SCCACHE_SERVER_PORT=9000" + echo "Setting random sccache port to: $SCCACHE_SERVER_PORT" + shell: bash + - name: Start sccache + if: matrix.use_sccache + run: | + chmod +x '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' + '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' --start-server + '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' -s + echo 'RUSTC_WRAPPER=${{ runner.tool_cache }}/cargo-sccache/bin/sccache' >> $GITHUB_ENV + shell: bash - name: Unzip Artifacts shell: bash run: | @@ -960,6 +1152,54 @@ jobs: with: cache-on-failure: true shared-key: wasmer-stage-1-${{ matrix.build }} + - uses: actions/cache@v2 + if: matrix.use_sccache + with: + path: ${{ runner.tool_cache }}/cargo-sccache + key: ${{ matrix.build }}-${{ matrix.target }}-sccache-bin-${{ env.CARGO_SCCACHE_VERSION }}-v1 + - name: Install sccache + if: matrix.use_sccache + run: | + if [ ! -f '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' ]; then + cargo install sccache --no-default-features --features=dist-client,azure --root '${{ runner.tool_cache }}/cargo-sccache' + fi + shell: bash + - name: Setup Rust target + run: | + mkdir -p .cargo + cat << EOF > .cargo/config.toml + [build] + target = "${{ matrix.target }}" + EOF + if: matrix.target + - name: Set sccache port + if: matrix.use_sccache && matrix.random_sccache_port + run: | + netstat -aln | awk ' + $6 == "LISTEN" { + if ($4 ~ "[.:][0-9]+$") { + n = split($4, a, /[:.]/); + port = a[n]; + p[port] = 1 + } + } + END { + for (i = 3000; i < 65000 && p[i]; i++){}; + if (i == 65000) {exit 1}; + print "SCCACHE_SERVER_PORT=" i + } + ' >> $GITHUB_ENV + # echo "SCCACHE_SERVER_PORT=9000" + echo "Setting random sccache port to: $SCCACHE_SERVER_PORT" + shell: bash + - name: Start sccache + if: matrix.use_sccache + run: | + chmod +x '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' + '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' --start-server + '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' -s + echo 'RUSTC_WRAPPER=${{ runner.tool_cache }}/cargo-sccache/bin/sccache' >> $GITHUB_ENV + shell: bash - name: Unzip Artifacts shell: bash run: | @@ -1584,6 +1824,54 @@ jobs: cache-on-failure: false shared-key: wasmer-${{ matrix.build }} save-if: false + - uses: actions/cache@v2 + if: matrix.use_sccache + with: + path: ${{ runner.tool_cache }}/cargo-sccache + key: ${{ matrix.build }}-${{ matrix.target }}-sccache-bin-${{ env.CARGO_SCCACHE_VERSION }}-v1 + - name: Install sccache + if: matrix.use_sccache + run: | + if [ ! -f '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' ]; then + cargo install sccache --no-default-features --features=dist-client,azure --root '${{ runner.tool_cache }}/cargo-sccache' + fi + shell: bash + - name: Setup Rust target + run: | + mkdir -p .cargo + cat << EOF > .cargo/config.toml + [build] + target = "${{ matrix.target }}" + EOF + if: matrix.target + - name: Set sccache port + if: matrix.use_sccache && matrix.random_sccache_port + run: | + netstat -aln | awk ' + $6 == "LISTEN" { + if ($4 ~ "[.:][0-9]+$") { + n = split($4, a, /[:.]/); + port = a[n]; + p[port] = 1 + } + } + END { + for (i = 3000; i < 65000 && p[i]; i++){}; + if (i == 65000) {exit 1}; + print "SCCACHE_SERVER_PORT=" i + } + ' >> $GITHUB_ENV + # echo "SCCACHE_SERVER_PORT=9000" + echo "Setting random sccache port to: $SCCACHE_SERVER_PORT" + shell: bash + - name: Start sccache + if: matrix.use_sccache + run: | + chmod +x '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' + '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' --start-server + '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' -s + echo 'RUSTC_WRAPPER=${{ runner.tool_cache }}/cargo-sccache/bin/sccache' >> $GITHUB_ENV + shell: bash - name: Test run: | make test-stage-6 From a170843d41ed654e51ba81f95b4a1bebb40c1f7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Mon, 28 Nov 2022 17:04:48 +0100 Subject: [PATCH 100/226] Add documentation build back to jobs --- .github/workflows/test.yaml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 8fb2cf28d67..b744a55e60c 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -104,6 +104,34 @@ jobs: rustup target add wasm32-wasi make build-wasmer-wasm + documentation: + name: Documentation + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Install Rust + uses: dtolnay/rust-toolchain@stable + with: + toolchain: 1.63 + - name: Install LLVM + shell: bash + run: | + curl --proto '=https' --tlsv1.2 -sSf ${{ env.LLVM_URL }} -L -o llvm.tar.xz + mkdir ${{ env.LLVM_DIR }} + tar xf llvm.tar.xz --strip-components=1 -C ${{ env.LLVM_DIR }} + echo "${{ env.LLVM_DIR }}/bin" >> $GITHUB_PATH + echo "LLVM_SYS_120_PREFIX=${{ env.LLVM_DIR }}" >> $GITHUB_ENV + env: + LLVM_DIR: ${{ github.workspace }}/llvm-13 + LLVM_URL: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz' + - name: Build & package documentation + run: make package-docs + - name: Publish documentation + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./package/docs + build_wasmer: name: Build wasmer on ${{ matrix.build }} runs-on: ${{ matrix.os }} From e80faf13b895640fead12b57fe8190c7c71fa28e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Mon, 28 Nov 2022 17:14:28 +0100 Subject: [PATCH 101/226] Remove sccache and unnecessary config cargo install sccache does not seem to be working right now --- .github/workflows/test.yaml | 527 ------------------------------------ 1 file changed, 527 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index b744a55e60c..b10c32063ee 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -144,47 +144,22 @@ jobs: os: ubuntu-18.04 target: x86_64-unknown-linux-gnu llvm_url: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz' - run_test: true - run_test_capi: true - run_integration_tests: true - run_build_docs: true - use_sccache: true - build: macos-x64 os: macos-11 target: x86_64-apple-darwin llvm_url: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-apple-darwin.tar.xz' - run_test: true - run_test_capi: true - use_sccache: true - run_integration_tests: true - run_ios_tests: true - run_build_docs: false - build: macos-arm os: macos-11.0 target: aarch64-apple-darwin - use_sccache: true - run_test: false - run_test_capi: false - run_build_docs: false - build: windows-x64 os: windows-2019 target: x86_64-pc-windows-msvc # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/12.x/windows-amd64.tar.gz' llvm_choco_version: 13.0.0 - run_integration_tests: true - use_sccache: true - run_test: true - run_test_capi: false # We can't run yet the capi tests on Windows - run_build_docs: false - build: linux-musl-x64 target: x86_64-unknown-linux-musl os: ubuntu-latest container: alpine:latest - run_test: true - run_test_capi: false - run_integration_tests: false - run_build_docs: false - use_sccache: false container: ${{ matrix.container }} env: SCCACHE_AZURE_BLOB_CONTAINER: wasmerstoragesccacheblob @@ -254,54 +229,6 @@ jobs: with: cache-on-failure: true shared-key: wasmer-${{ matrix.build }} - - uses: actions/cache@v2 - if: matrix.use_sccache - with: - path: ${{ runner.tool_cache }}/cargo-sccache - key: ${{ matrix.build }}-${{ matrix.target }}-sccache-bin-${{ env.CARGO_SCCACHE_VERSION }}-v1 - - name: Install sccache - if: matrix.use_sccache - run: | - if [ ! -f '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' ]; then - cargo install sccache --no-default-features --features=dist-client,azure --root '${{ runner.tool_cache }}/cargo-sccache' - fi - shell: bash - - name: Setup Rust target - run: | - mkdir -p .cargo - cat << EOF > .cargo/config.toml - [build] - target = "${{ matrix.target }}" - EOF - if: matrix.target - - name: Set sccache port - if: matrix.use_sccache && matrix.random_sccache_port - run: | - netstat -aln | awk ' - $6 == "LISTEN" { - if ($4 ~ "[.:][0-9]+$") { - n = split($4, a, /[:.]/); - port = a[n]; - p[port] = 1 - } - } - END { - for (i = 3000; i < 65000 && p[i]; i++){}; - if (i == 65000) {exit 1}; - print "SCCACHE_SERVER_PORT=" i - } - ' >> $GITHUB_ENV - # echo "SCCACHE_SERVER_PORT=9000" - echo "Setting random sccache port to: $SCCACHE_SERVER_PORT" - shell: bash - - name: Start sccache - if: matrix.use_sccache - run: | - chmod +x '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' - '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' --start-server - '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' -s - echo 'RUSTC_WRAPPER=${{ runner.tool_cache }}/cargo-sccache/bin/sccache' >> $GITHUB_ENV - shell: bash - name: Build wasmer-cli shell: bash run: | @@ -427,47 +354,22 @@ jobs: os: ubuntu-18.04 target: x86_64-unknown-linux-gnu llvm_url: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz' - run_test: true - run_test_capi: true - run_integration_tests: true - run_build_docs: true - use_sccache: true - build: macos-x64 os: macos-11 target: x86_64-apple-darwin llvm_url: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-apple-darwin.tar.xz' - run_test: true - run_test_capi: true - use_sccache: true - run_integration_tests: true - run_ios_tests: true - run_build_docs: false - build: macos-arm os: macos-11.0 target: aarch64-apple-darwin - use_sccache: true - run_test: false - run_test_capi: false - run_build_docs: false - build: windows-x64 os: windows-2019 target: x86_64-pc-windows-msvc # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/12.x/windows-amd64.tar.gz' llvm_choco_version: 13.0.0 - run_integration_tests: true - use_sccache: true - run_test: true - run_test_capi: false # We can't run yet the capi tests on Windows - run_build_docs: false - build: linux-musl-x64 target: x86_64-unknown-linux-musl os: ubuntu-latest container: alpine:latest - run_test: true - run_test_capi: false # It can't run the capi tests because of a cc linker issue (`wasm_engine_new` is redefined) - run_integration_tests: false - run_build_docs: false - use_sccache: false container: ${{ matrix.container }} env: SCCACHE_AZURE_BLOB_CONTAINER: wasmerstoragesccacheblob @@ -538,54 +440,6 @@ jobs: cache-on-failure: false shared-key: wasmer-${{ matrix.build }} save-if: false - - uses: actions/cache@v2 - if: matrix.use_sccache - with: - path: ${{ runner.tool_cache }}/cargo-sccache - key: capi-${{ matrix.build }}-${{ matrix.target }}-sccache-bin-${{ env.CARGO_SCCACHE_VERSION }}-v1 - - name: Install sccache - if: matrix.use_sccache - run: | - if [ ! -f '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' ]; then - cargo install sccache --no-default-features --features=dist-client,azure --root '${{ runner.tool_cache }}/cargo-sccache' - fi - shell: bash - - name: Setup Rust target - run: | - mkdir -p .cargo - cat << EOF > .cargo/config.toml - [build] - target = "${{ matrix.target }}" - EOF - if: matrix.target - - name: Set sccache port - if: matrix.use_sccache && matrix.random_sccache_port - run: | - netstat -aln | awk ' - $6 == "LISTEN" { - if ($4 ~ "[.:][0-9]+$") { - n = split($4, a, /[:.]/); - port = a[n]; - p[port] = 1 - } - } - END { - for (i = 3000; i < 65000 && p[i]; i++){}; - if (i == 65000) {exit 1}; - print "SCCACHE_SERVER_PORT=" i - } - ' >> $GITHUB_ENV - # echo "SCCACHE_SERVER_PORT=9000" - echo "Setting random sccache port to: $SCCACHE_SERVER_PORT" - shell: bash - - name: Start sccache - if: matrix.use_sccache - run: | - chmod +x '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' - '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' --start-server - '${{ 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 shell: bash run: | @@ -665,40 +519,19 @@ jobs: os: ubuntu-18.04 target: x86_64-unknown-linux-gnu llvm_url: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz' - run_test: true - run_test_capi: true - run_integration_tests: true - run_build_docs: true - use_sccache: true - build: macos-x64 os: macos-11 target: x86_64-apple-darwin llvm_url: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-apple-darwin.tar.xz' - run_test: true - run_test_capi: true - use_sccache: true - run_integration_tests: true - run_ios_tests: true - run_build_docs: false - build: windows-x64 os: windows-2019 target: x86_64-pc-windows-msvc # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/12.x/windows-amd64.tar.gz' llvm_choco_version: 13.0.0 - run_integration_tests: true - use_sccache: true - run_test: true - run_test_capi: false # We can't run yet the capi tests on Windows - run_build_docs: false - build: linux-musl-x64 target: x86_64-unknown-linux-musl os: ubuntu-latest container: alpine:latest - run_test: true - run_test_capi: false # It can't run the capi tests because of a cc linker issue (`wasm_engine_new` is redefined) - run_integration_tests: false - run_build_docs: false - use_sccache: false container: ${{ matrix.container }} env: SCCACHE_AZURE_BLOB_CONTAINER: wasmerstoragesccacheblob @@ -723,54 +556,6 @@ jobs: cache-on-failure: false shared-key: wasmer-${{ matrix.build }} save-if: false - - uses: actions/cache@v2 - if: matrix.use_sccache - with: - path: ${{ runner.tool_cache }}/cargo-sccache - key: test-capi-${{ matrix.build }}-${{ matrix.target }}-sccache-bin-${{ env.CARGO_SCCACHE_VERSION }}-v1 - - name: Install sccache - if: matrix.use_sccache - run: | - if [ ! -f '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' ]; then - cargo install sccache --no-default-features --features=dist-client,azure --root '${{ runner.tool_cache }}/cargo-sccache' - fi - shell: bash - - name: Setup Rust target - run: | - mkdir -p .cargo - cat << EOF > .cargo/config.toml - [build] - target = "${{ matrix.target }}" - EOF - if: matrix.target - - name: Set sccache port - if: matrix.use_sccache && matrix.random_sccache_port - run: | - netstat -aln | awk ' - $6 == "LISTEN" { - if ($4 ~ "[.:][0-9]+$") { - n = split($4, a, /[:.]/); - port = a[n]; - p[port] = 1 - } - } - END { - for (i = 3000; i < 65000 && p[i]; i++){}; - if (i == 65000) {exit 1}; - print "SCCACHE_SERVER_PORT=" i - } - ' >> $GITHUB_ENV - # echo "SCCACHE_SERVER_PORT=9000" - echo "Setting random sccache port to: $SCCACHE_SERVER_PORT" - shell: bash - - name: Start sccache - if: matrix.use_sccache - run: | - chmod +x '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' - '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' --start-server - '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' -s - echo 'RUSTC_WRAPPER=${{ runner.tool_cache }}/cargo-sccache/bin/sccache' >> $GITHUB_ENV - shell: bash - name: 'Echo download path' run: echo ${{steps.download.outputs.download-path}} - name: Unzip Artifacts @@ -799,40 +584,19 @@ jobs: os: ubuntu-18.04 target: x86_64-unknown-linux-gnu llvm_url: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz' - run_test: true - run_test_capi: true - run_integration_tests: true - run_build_docs: true - use_sccache: true - build: macos-x64 os: macos-11 target: x86_64-apple-darwin llvm_url: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-apple-darwin.tar.xz' - run_test: true - run_test_capi: true - use_sccache: true - run_integration_tests: true - run_ios_tests: true - run_build_docs: false - build: windows-x64 os: windows-2019 target: x86_64-pc-windows-msvc # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/12.x/windows-amd64.tar.gz' llvm_choco_version: 13.0.0 - run_integration_tests: true - use_sccache: true - run_test: true - run_test_capi: false # We can't run yet the capi tests on Windows - run_build_docs: false - build: linux-musl-x64 target: x86_64-unknown-linux-musl os: ubuntu-latest container: alpine:latest - run_test: true - run_test_capi: false # It can't run the capi tests because of a cc linker issue (`wasm_engine_new` is redefined) - run_integration_tests: false - run_build_docs: false - use_sccache: false container: ${{ matrix.container }} env: SCCACHE_AZURE_BLOB_CONTAINER: wasmerstoragesccacheblob @@ -865,54 +629,6 @@ jobs: cache-on-failure: false shared-key: wasmer-${{ matrix.build }} save-if: false - - uses: actions/cache@v2 - if: matrix.use_sccache - with: - path: ${{ runner.tool_cache }}/cargo-sccache - key: test-integration-${{ matrix.build }}-${{ matrix.target }}-sccache-bin-${{ env.CARGO_SCCACHE_VERSION }}-v1 - - name: Install sccache - if: matrix.use_sccache - run: | - if [ ! -f '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' ]; then - cargo install sccache --no-default-features --features=dist-client,azure --root '${{ runner.tool_cache }}/cargo-sccache' - fi - shell: bash - - name: Setup Rust target - run: | - mkdir -p .cargo - cat << EOF > .cargo/config.toml - [build] - target = "${{ matrix.target }}" - EOF - if: matrix.target - - name: Set sccache port - if: matrix.use_sccache && matrix.random_sccache_port - run: | - netstat -aln | awk ' - $6 == "LISTEN" { - if ($4 ~ "[.:][0-9]+$") { - n = split($4, a, /[:.]/); - port = a[n]; - p[port] = 1 - } - } - END { - for (i = 3000; i < 65000 && p[i]; i++){}; - if (i == 65000) {exit 1}; - print "SCCACHE_SERVER_PORT=" i - } - ' >> $GITHUB_ENV - # echo "SCCACHE_SERVER_PORT=9000" - echo "Setting random sccache port to: $SCCACHE_SERVER_PORT" - shell: bash - - name: Start sccache - if: matrix.use_sccache - run: | - chmod +x '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' - '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' --start-server - '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' -s - echo 'RUSTC_WRAPPER=${{ runner.tool_cache }}/cargo-sccache/bin/sccache' >> $GITHUB_ENV - shell: bash - name: Unzip Artifacts shell: bash run: | @@ -945,40 +661,19 @@ jobs: os: ubuntu-18.04 target: x86_64-unknown-linux-gnu llvm_url: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz' - run_test: true - run_test_capi: true - run_integration_tests: true - run_build_docs: true - use_sccache: true - build: macos-x64 os: macos-11 target: x86_64-apple-darwin llvm_url: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-apple-darwin.tar.xz' - run_test: true - run_test_capi: true - use_sccache: true - run_integration_tests: true - run_ios_tests: true - run_build_docs: false - build: windows-x64 os: windows-2019 target: x86_64-pc-windows-msvc # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/12.x/windows-amd64.tar.gz' llvm_choco_version: 13.0.0 - run_integration_tests: true - use_sccache: true - run_test: true - run_test_capi: false # We can't run yet the capi tests on Windows - run_build_docs: false - build: linux-musl-x64 target: x86_64-unknown-linux-musl os: ubuntu-latest container: alpine:latest - run_test: true - run_test_capi: false # It can't run the capi tests because of a cc linker issue (`wasm_engine_new` is redefined) - run_integration_tests: false - run_build_docs: false - use_sccache: false container: ${{ matrix.container }} env: SCCACHE_AZURE_BLOB_CONTAINER: wasmerstoragesccacheblob @@ -1069,40 +764,19 @@ jobs: os: ubuntu-18.04 target: x86_64-unknown-linux-gnu llvm_url: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz' - run_test: true - run_test_capi: true - run_integration_tests: true - run_build_docs: true - use_sccache: true - build: macos-x64 os: macos-11 target: x86_64-apple-darwin llvm_url: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-apple-darwin.tar.xz' - run_test: true - run_test_capi: true - use_sccache: true - run_integration_tests: true - run_ios_tests: true - run_build_docs: false - build: windows-x64 os: windows-2019 target: x86_64-pc-windows-msvc # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/12.x/windows-amd64.tar.gz' llvm_choco_version: 13.0.0 - run_integration_tests: true - use_sccache: true - run_test: true - run_test_capi: false # We can't run yet the capi tests on Windows - run_build_docs: false - build: linux-musl-x64 target: x86_64-unknown-linux-musl os: ubuntu-latest container: alpine:latest - run_test: true - run_test_capi: false # It can't run the capi tests because of a cc linker issue (`wasm_engine_new` is redefined) - run_integration_tests: false - run_build_docs: false - use_sccache: false container: ${{ matrix.container }} env: SCCACHE_AZURE_BLOB_CONTAINER: wasmerstoragesccacheblob @@ -1180,54 +854,6 @@ jobs: with: cache-on-failure: true shared-key: wasmer-stage-1-${{ matrix.build }} - - uses: actions/cache@v2 - if: matrix.use_sccache - with: - path: ${{ runner.tool_cache }}/cargo-sccache - key: ${{ matrix.build }}-${{ matrix.target }}-sccache-bin-${{ env.CARGO_SCCACHE_VERSION }}-v1 - - name: Install sccache - if: matrix.use_sccache - run: | - if [ ! -f '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' ]; then - cargo install sccache --no-default-features --features=dist-client,azure --root '${{ runner.tool_cache }}/cargo-sccache' - fi - shell: bash - - name: Setup Rust target - run: | - mkdir -p .cargo - cat << EOF > .cargo/config.toml - [build] - target = "${{ matrix.target }}" - EOF - if: matrix.target - - name: Set sccache port - if: matrix.use_sccache && matrix.random_sccache_port - run: | - netstat -aln | awk ' - $6 == "LISTEN" { - if ($4 ~ "[.:][0-9]+$") { - n = split($4, a, /[:.]/); - port = a[n]; - p[port] = 1 - } - } - END { - for (i = 3000; i < 65000 && p[i]; i++){}; - if (i == 65000) {exit 1}; - print "SCCACHE_SERVER_PORT=" i - } - ' >> $GITHUB_ENV - # echo "SCCACHE_SERVER_PORT=9000" - echo "Setting random sccache port to: $SCCACHE_SERVER_PORT" - shell: bash - - name: Start sccache - if: matrix.use_sccache - run: | - chmod +x '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' - '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' --start-server - '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' -s - echo 'RUSTC_WRAPPER=${{ runner.tool_cache }}/cargo-sccache/bin/sccache' >> $GITHUB_ENV - shell: bash - name: Unzip Artifacts shell: bash run: | @@ -1252,40 +878,19 @@ jobs: os: ubuntu-18.04 target: x86_64-unknown-linux-gnu llvm_url: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz' - run_test: true - run_test_capi: true - run_integration_tests: true - run_build_docs: true - use_sccache: true - build: macos-x64 os: macos-11 target: x86_64-apple-darwin llvm_url: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-apple-darwin.tar.xz' - run_test: true - run_test_capi: true - use_sccache: true - run_integration_tests: true - run_ios_tests: true - run_build_docs: false - build: windows-x64 os: windows-2019 target: x86_64-pc-windows-msvc # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/12.x/windows-amd64.tar.gz' llvm_choco_version: 13.0.0 - run_integration_tests: true - use_sccache: true - run_test: true - run_test_capi: false # We can't run yet the capi tests on Windows - run_build_docs: false - build: linux-musl-x64 target: x86_64-unknown-linux-musl os: ubuntu-latest container: alpine:latest - run_test: true - run_test_capi: false # It can't run the capi tests because of a cc linker issue (`wasm_engine_new` is redefined) - run_integration_tests: false - run_build_docs: false - use_sccache: false container: ${{ matrix.container }} env: SCCACHE_AZURE_BLOB_CONTAINER: wasmerstoragesccacheblob @@ -1376,40 +981,19 @@ jobs: os: ubuntu-18.04 target: x86_64-unknown-linux-gnu llvm_url: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz' - run_test: true - run_test_capi: true - run_integration_tests: true - run_build_docs: true - use_sccache: true - build: macos-x64 os: macos-11 target: x86_64-apple-darwin llvm_url: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-apple-darwin.tar.xz' - run_test: true - run_test_capi: true - use_sccache: true - run_integration_tests: true - run_ios_tests: true - run_build_docs: false - build: windows-x64 os: windows-2019 target: x86_64-pc-windows-msvc # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/12.x/windows-amd64.tar.gz' llvm_choco_version: 13.0.0 - run_integration_tests: true - use_sccache: true - run_test: true - run_test_capi: false # We can't run yet the capi tests on Windows - run_build_docs: false - build: linux-musl-x64 target: x86_64-unknown-linux-musl os: ubuntu-latest container: alpine:latest - run_test: true - run_test_capi: false # It can't run the capi tests because of a cc linker issue (`wasm_engine_new` is redefined) - run_integration_tests: false - run_build_docs: false - use_sccache: false container: ${{ matrix.container }} env: SCCACHE_AZURE_BLOB_CONTAINER: wasmerstoragesccacheblob @@ -1500,40 +1084,19 @@ jobs: os: ubuntu-18.04 target: x86_64-unknown-linux-gnu llvm_url: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz' - run_test: true - run_test_capi: true - run_integration_tests: true - run_build_docs: true - use_sccache: true - build: macos-x64 os: macos-11 target: x86_64-apple-darwin llvm_url: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-apple-darwin.tar.xz' - run_test: true - run_test_capi: true - use_sccache: true - run_integration_tests: true - run_ios_tests: true - run_build_docs: false - build: windows-x64 os: windows-2019 target: x86_64-pc-windows-msvc # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/12.x/windows-amd64.tar.gz' llvm_choco_version: 13.0.0 - run_integration_tests: true - use_sccache: true - run_test: true - run_test_capi: false # We can't run yet the capi tests on Windows - run_build_docs: false - build: linux-musl-x64 target: x86_64-unknown-linux-musl os: ubuntu-latest container: alpine:latest - run_test: true - run_test_capi: false # It can't run the capi tests because of a cc linker issue (`wasm_engine_new` is redefined) - run_integration_tests: false - run_build_docs: false - use_sccache: false container: ${{ matrix.container }} env: SCCACHE_AZURE_BLOB_CONTAINER: wasmerstoragesccacheblob @@ -1624,40 +1187,19 @@ jobs: os: ubuntu-18.04 target: x86_64-unknown-linux-gnu llvm_url: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz' - run_test: true - run_test_capi: true - run_integration_tests: true - run_build_docs: true - use_sccache: true - build: macos-x64 os: macos-11 target: x86_64-apple-darwin llvm_url: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-apple-darwin.tar.xz' - run_test: true - run_test_capi: true - use_sccache: true - run_integration_tests: true - run_ios_tests: true - run_build_docs: false - build: windows-x64 os: windows-2019 target: x86_64-pc-windows-msvc # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/12.x/windows-amd64.tar.gz' llvm_choco_version: 13.0.0 - run_integration_tests: true - use_sccache: true - run_test: true - run_test_capi: false # We can't run yet the capi tests on Windows - run_build_docs: false - build: linux-musl-x64 target: x86_64-unknown-linux-musl os: ubuntu-latest container: alpine:latest - run_test: true - run_test_capi: false # It can't run the capi tests because of a cc linker issue (`wasm_engine_new` is redefined) - run_integration_tests: false - run_build_docs: false - use_sccache: false container: ${{ matrix.container }} env: SCCACHE_AZURE_BLOB_CONTAINER: wasmerstoragesccacheblob @@ -1748,40 +1290,19 @@ jobs: os: ubuntu-18.04 target: x86_64-unknown-linux-gnu llvm_url: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz' - run_test: true - run_test_capi: true - run_integration_tests: true - run_build_docs: true - use_sccache: true - build: macos-x64 os: macos-11 target: x86_64-apple-darwin llvm_url: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-apple-darwin.tar.xz' - run_test: true - run_test_capi: true - use_sccache: true - run_integration_tests: true - run_ios_tests: true - run_build_docs: false - build: windows-x64 os: windows-2019 target: x86_64-pc-windows-msvc # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/12.x/windows-amd64.tar.gz' llvm_choco_version: 13.0.0 - run_integration_tests: true - use_sccache: true - run_test: true - run_test_capi: false # We can't run yet the capi tests on Windows - run_build_docs: false - build: linux-musl-x64 target: x86_64-unknown-linux-musl os: ubuntu-latest container: alpine:latest - run_test: true - run_test_capi: false # It can't run the capi tests because of a cc linker issue (`wasm_engine_new` is redefined) - run_integration_tests: false - run_build_docs: false - use_sccache: false container: ${{ matrix.container }} env: SCCACHE_AZURE_BLOB_CONTAINER: wasmerstoragesccacheblob @@ -1852,54 +1373,6 @@ jobs: cache-on-failure: false shared-key: wasmer-${{ matrix.build }} save-if: false - - uses: actions/cache@v2 - if: matrix.use_sccache - with: - path: ${{ runner.tool_cache }}/cargo-sccache - key: ${{ matrix.build }}-${{ matrix.target }}-sccache-bin-${{ env.CARGO_SCCACHE_VERSION }}-v1 - - name: Install sccache - if: matrix.use_sccache - run: | - if [ ! -f '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' ]; then - cargo install sccache --no-default-features --features=dist-client,azure --root '${{ runner.tool_cache }}/cargo-sccache' - fi - shell: bash - - name: Setup Rust target - run: | - mkdir -p .cargo - cat << EOF > .cargo/config.toml - [build] - target = "${{ matrix.target }}" - EOF - if: matrix.target - - name: Set sccache port - if: matrix.use_sccache && matrix.random_sccache_port - run: | - netstat -aln | awk ' - $6 == "LISTEN" { - if ($4 ~ "[.:][0-9]+$") { - n = split($4, a, /[:.]/); - port = a[n]; - p[port] = 1 - } - } - END { - for (i = 3000; i < 65000 && p[i]; i++){}; - if (i == 65000) {exit 1}; - print "SCCACHE_SERVER_PORT=" i - } - ' >> $GITHUB_ENV - # echo "SCCACHE_SERVER_PORT=9000" - echo "Setting random sccache port to: $SCCACHE_SERVER_PORT" - shell: bash - - name: Start sccache - if: matrix.use_sccache - run: | - chmod +x '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' - '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' --start-server - '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' -s - echo 'RUSTC_WRAPPER=${{ runner.tool_cache }}/cargo-sccache/bin/sccache' >> $GITHUB_ENV - shell: bash - name: Test run: | make test-stage-6 From b6bb189ce0c361f8d90999481d83060d890e219d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Mon, 28 Nov 2022 17:51:43 +0100 Subject: [PATCH 102/226] Configure missing WASMER_DIR --- .github/workflows/test.yaml | 3 +++ lib/c-api/src/wasm_c_api/externals/mod.rs | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index b10c32063ee..9a2ac41f5d4 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -499,6 +499,9 @@ jobs: - name: Generate code coverage run: cargo llvm-cov --workspace --lcov --output-path lcov.info --features cranelift,singlepass,wasmer-artifact-create,static-artifact-create,wasmer-artifact-load,static-artifact-load,webc_runner --exclude wasmer-integration-tests-ios env: + RUST_BACKTRACE: 1 + RUSTFLAGS: "-Ccodegen-units=1 -Clink-dead-code -Coverflow-checks=off" + WASMER_DIR: ./package WAPM_DEV_TOKEN: ${{ secrets.WAPM_DEV_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Upload coverage to Codecov diff --git a/lib/c-api/src/wasm_c_api/externals/mod.rs b/lib/c-api/src/wasm_c_api/externals/mod.rs index 78929b8950d..a6a2e4e851c 100644 --- a/lib/c-api/src/wasm_c_api/externals/mod.rs +++ b/lib/c-api/src/wasm_c_api/externals/mod.rs @@ -137,7 +137,7 @@ mod tests { #[cfg(target_os = "windows")] use wasmer_inline_c::assert_c; - #[cfg_attr(coverage, ignore)] // run by test-runner in coverage tests + #[cfg_attr(coverage, ignore)] #[test] fn test_extern_copy() { (assert_c! { From 7529d98fcee63ce84b69c97b657d3c6ad04f27ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Tue, 29 Nov 2022 11:41:23 +0100 Subject: [PATCH 103/226] Debug why linker invocation doesn't work --- .github/workflows/test.yaml | 2 +- .gitignore | 4 ++++ .../tests/wasmer-c-api-test-runner/src/lib.rs | 21 +++++++++++++++++++ 3 files changed, 26 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 9a2ac41f5d4..7bb326a9798 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -501,7 +501,7 @@ jobs: env: RUST_BACKTRACE: 1 RUSTFLAGS: "-Ccodegen-units=1 -Clink-dead-code -Coverflow-checks=off" - WASMER_DIR: ./package + WASMER_DIR: "" WAPM_DEV_TOKEN: ${{ secrets.WAPM_DEV_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Upload coverage to Codecov diff --git a/.gitignore b/.gitignore index 24affcea4df..82fb23a6485 100644 --- a/.gitignore +++ b/.gitignore @@ -16,3 +16,7 @@ api-docs-repo/ /avd /core out.txt +wapm.toml +build-capi.tar.gz +build-wasmer.tar.gz +lcov.info \ No newline at end of file diff --git a/lib/c-api/tests/wasmer-c-api-test-runner/src/lib.rs b/lib/c-api/tests/wasmer-c-api-test-runner/src/lib.rs index fe82ab0aef1..3ff6e0e50ba 100644 --- a/lib/c-api/tests/wasmer-c-api-test-runner/src/lib.rs +++ b/lib/c-api/tests/wasmer-c-api-test-runner/src/lib.rs @@ -1,5 +1,7 @@ #[cfg(test)] use std::error::Error; +#[cfg(test)] +use std::process::Stdio; #[cfg(test)] static INCLUDE_REGEX: &str = "#include \"(.*)\""; @@ -278,6 +280,9 @@ fn test_ok() { println!("compile: {command:#?}"); // compile let output = command + .stdout(Stdio::inherit()) + .stderr(Stdio::inherit()) + .current_dir(find_wasmer_base_dir()) .output() .expect(&format!("failed to compile {command:#?}")); if !output.status.success() { @@ -317,6 +322,14 @@ fn print_wasmer_root_to_stdout(config: &Config) { use walkdir::WalkDir; + println!( + "wasmer dir: {}", + std::path::Path::new(&config.wasmer_dir) + .canonicalize() + .unwrap() + .display() + ); + for entry in WalkDir::new(&config.wasmer_dir) .into_iter() .filter_map(Result::ok) @@ -325,6 +338,14 @@ fn print_wasmer_root_to_stdout(config: &Config) { println!("{f_name}"); } + println!( + "root dir: {}", + std::path::Path::new(&config.root_dir) + .canonicalize() + .unwrap() + .display() + ); + for entry in WalkDir::new(&config.root_dir) .into_iter() .filter_map(Result::ok) From 28223e9899749cf746a9e37a3c85bc9ddbdcea8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Tue, 29 Nov 2022 11:43:08 +0100 Subject: [PATCH 104/226] Undo merging documentation pass into test.yaml --- .github/workflows/documentation.yaml | 37 ++++++++++++++++++++++++++++ .github/workflows/test.yaml | 28 --------------------- 2 files changed, 37 insertions(+), 28 deletions(-) create mode 100644 .github/workflows/documentation.yaml diff --git a/.github/workflows/documentation.yaml b/.github/workflows/documentation.yaml new file mode 100644 index 00000000000..31db70ee62d --- /dev/null +++ b/.github/workflows/documentation.yaml @@ -0,0 +1,37 @@ +name: Documentation + +on: + push: + branches: + - 'master' + paths: + - 'lib/**' + +jobs: + documentation: + name: Documentation + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Install Rust + uses: dtolnay/rust-toolchain@stable + with: + toolchain: 1.63 + - name: Install LLVM + shell: bash + run: | + curl --proto '=https' --tlsv1.2 -sSf ${{ env.LLVM_URL }} -L -o llvm.tar.xz + mkdir ${{ env.LLVM_DIR }} + tar xf llvm.tar.xz --strip-components=1 -C ${{ env.LLVM_DIR }} + echo "${{ env.LLVM_DIR }}/bin" >> $GITHUB_PATH + echo "LLVM_SYS_120_PREFIX=${{ env.LLVM_DIR }}" >> $GITHUB_ENV + env: + LLVM_DIR: ${{ github.workspace }}/llvm-13 + LLVM_URL: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz' + - name: Build & package documentation + run: make package-docs + - name: Publish documentation + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./package/docs \ No newline at end of file diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 7bb326a9798..5a1c51b5938 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -104,34 +104,6 @@ jobs: rustup target add wasm32-wasi make build-wasmer-wasm - documentation: - name: Documentation - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: Install Rust - uses: dtolnay/rust-toolchain@stable - with: - toolchain: 1.63 - - name: Install LLVM - shell: bash - run: | - curl --proto '=https' --tlsv1.2 -sSf ${{ env.LLVM_URL }} -L -o llvm.tar.xz - mkdir ${{ env.LLVM_DIR }} - tar xf llvm.tar.xz --strip-components=1 -C ${{ env.LLVM_DIR }} - echo "${{ env.LLVM_DIR }}/bin" >> $GITHUB_PATH - echo "LLVM_SYS_120_PREFIX=${{ env.LLVM_DIR }}" >> $GITHUB_ENV - env: - LLVM_DIR: ${{ github.workspace }}/llvm-13 - LLVM_URL: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz' - - name: Build & package documentation - run: make package-docs - - name: Publish documentation - uses: peaceiris/actions-gh-pages@v3 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: ./package/docs - build_wasmer: name: Build wasmer on ${{ matrix.build }} runs-on: ${{ matrix.os }} From a2f1ac50f271b710ea048242e1b6165d3e6bbbaf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Tue, 29 Nov 2022 22:38:52 +0100 Subject: [PATCH 105/226] Remove coverage step from CI --- .github/workflows/test.yaml | 54 ------------------------------------- 1 file changed, 54 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 5a1c51b5938..775d25fca66 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -428,60 +428,6 @@ jobs: if-no-files-found: error retention-days: 2 - coverage: - runs-on: ubuntu-latest - needs: [build_capi, build_wasmer] - env: - CARGO_TERM_COLOR: always - steps: - - uses: actions/checkout@v3 - - uses: actions/download-artifact@v3 - id: download - with: - name: capi-linux-x64 - - uses: actions/download-artifact@v3 - with: - name: wasmer-cli-linux-x64 - - name: 'Echo download path' - run: echo ${{steps.download.outputs.download-path}} - - name: Install Rust - run: rustup update stable - - name: Install LLVM (Linux) - run: | - curl --proto '=https' --tlsv1.2 -sSf https://github.com/llvm/llvm-project/releases/download/llvmorg-10.0.0/clang+llvm-10.0.0-x86_64-linux-gnu-ubuntu-18.04.tar.xz -L -o llvm.tar.xz - mkdir -p /opt/llvm-10 - tar xf llvm.tar.xz --strip-components=1 -C /opt/llvm-10 - echo '/opt/llvm-10/bin' >> $GITHUB_PATH - echo 'LLVM_SYS_100_PREFIX=/opt/llvm-10' >> $GITHUB_ENV - - name: Install cargo-llvm-cov - uses: taiki-e/install-action@cargo-llvm-cov - - uses: Swatinem/rust-cache@v2 - with: - cache-on-failure: false - shared-key: wasmer-linux-x64 - save-if: false - - name: Unzip Artifacts - shell: bash - run: | - make untar-capi - - name: Unzip Artifacts - shell: bash - run: | - make untar-wasmer - - name: Generate code coverage - run: cargo llvm-cov --workspace --lcov --output-path lcov.info --features cranelift,singlepass,wasmer-artifact-create,static-artifact-create,wasmer-artifact-load,static-artifact-load,webc_runner --exclude wasmer-integration-tests-ios - env: - RUST_BACKTRACE: 1 - RUSTFLAGS: "-Ccodegen-units=1 -Clink-dead-code -Coverflow-checks=off" - WASMER_DIR: "" - WAPM_DEV_TOKEN: ${{ secrets.WAPM_DEV_TOKEN }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Upload coverage to Codecov - uses: codecov/codecov-action@v3 - with: - files: lcov.info - fail_ci_if_error: true - test_capi: name: Test C-API on ${{ matrix.build }} runs-on: ${{ matrix.os }} From d8bfa3a12de25b65ec8621a4eae4322b8cabb2f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Tue, 29 Nov 2022 23:38:38 +0100 Subject: [PATCH 106/226] Add sccache to see if timings improve --- .github/workflows/test.yaml | 400 ++++++++++++++++++++++++++++++++++++ 1 file changed, 400 insertions(+) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 775d25fca66..c0ada342836 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -412,6 +412,46 @@ jobs: cache-on-failure: false shared-key: wasmer-${{ matrix.build }} save-if: false + - uses: actions/cache@v2 + if: matrix.use_sccache + with: + path: ${{ runner.tool_cache }}/cargo-sccache + key: ${{ matrix.build }}-${{ matrix.target }}-sccache-bin-${{ env.CARGO_SCCACHE_VERSION }}-v1 + - name: Install sccache + if: matrix.use_sccache + run: | + if [ ! -f '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' ]; then + cargo install sccache --no-default-features --features=dist-client,azure --version 0.2.15 --root '${{ runner.tool_cache }}/cargo-sccache' + fi + shell: bash + - name: Set sccache port + if: matrix.use_sccache && matrix.random_sccache_port + run: | + netstat -aln | awk ' + $6 == "LISTEN" { + if ($4 ~ "[.:][0-9]+$") { + n = split($4, a, /[:.]/); + port = a[n]; + p[port] = 1 + } + } + END { + for (i = 3000; i < 65000 && p[i]; i++){}; + if (i == 65000) {exit 1}; + print "SCCACHE_SERVER_PORT=" i + } + ' >> $GITHUB_ENV + # echo "SCCACHE_SERVER_PORT=9000" + echo "Setting random sccache port to: $SCCACHE_SERVER_PORT" + shell: bash + - name: Start sccache + if: matrix.use_sccache + run: | + chmod +x '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' + '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' --start-server + '${{ 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 shell: bash run: | @@ -477,6 +517,46 @@ jobs: cache-on-failure: false shared-key: wasmer-${{ matrix.build }} save-if: false + - uses: actions/cache@v2 + if: matrix.use_sccache + with: + path: ${{ runner.tool_cache }}/cargo-sccache + key: ${{ matrix.build }}-${{ matrix.target }}-sccache-bin-${{ env.CARGO_SCCACHE_VERSION }}-v1 + - name: Install sccache + if: matrix.use_sccache + run: | + if [ ! -f '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' ]; then + cargo install sccache --no-default-features --features=dist-client,azure --version 0.2.15 --root '${{ runner.tool_cache }}/cargo-sccache' + fi + shell: bash + - name: Set sccache port + if: matrix.use_sccache && matrix.random_sccache_port + run: | + netstat -aln | awk ' + $6 == "LISTEN" { + if ($4 ~ "[.:][0-9]+$") { + n = split($4, a, /[:.]/); + port = a[n]; + p[port] = 1 + } + } + END { + for (i = 3000; i < 65000 && p[i]; i++){}; + if (i == 65000) {exit 1}; + print "SCCACHE_SERVER_PORT=" i + } + ' >> $GITHUB_ENV + # echo "SCCACHE_SERVER_PORT=9000" + echo "Setting random sccache port to: $SCCACHE_SERVER_PORT" + shell: bash + - name: Start sccache + if: matrix.use_sccache + run: | + chmod +x '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' + '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' --start-server + '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' -s + echo 'RUSTC_WRAPPER=${{ runner.tool_cache }}/cargo-sccache/bin/sccache' >> $GITHUB_ENV + shell: bash - name: 'Echo download path' run: echo ${{steps.download.outputs.download-path}} - name: Unzip Artifacts @@ -550,6 +630,46 @@ jobs: cache-on-failure: false shared-key: wasmer-${{ matrix.build }} save-if: false + - uses: actions/cache@v2 + if: matrix.use_sccache + with: + path: ${{ runner.tool_cache }}/cargo-sccache + key: ${{ matrix.build }}-${{ matrix.target }}-sccache-bin-${{ env.CARGO_SCCACHE_VERSION }}-v1 + - name: Install sccache + if: matrix.use_sccache + run: | + if [ ! -f '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' ]; then + cargo install sccache --no-default-features --features=dist-client,azure --version 0.2.15 --root '${{ runner.tool_cache }}/cargo-sccache' + fi + shell: bash + - name: Set sccache port + if: matrix.use_sccache && matrix.random_sccache_port + run: | + netstat -aln | awk ' + $6 == "LISTEN" { + if ($4 ~ "[.:][0-9]+$") { + n = split($4, a, /[:.]/); + port = a[n]; + p[port] = 1 + } + } + END { + for (i = 3000; i < 65000 && p[i]; i++){}; + if (i == 65000) {exit 1}; + print "SCCACHE_SERVER_PORT=" i + } + ' >> $GITHUB_ENV + # echo "SCCACHE_SERVER_PORT=9000" + echo "Setting random sccache port to: $SCCACHE_SERVER_PORT" + shell: bash + - name: Start sccache + if: matrix.use_sccache + run: | + chmod +x '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' + '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' --start-server + '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' -s + echo 'RUSTC_WRAPPER=${{ runner.tool_cache }}/cargo-sccache/bin/sccache' >> $GITHUB_ENV + shell: bash - name: Unzip Artifacts shell: bash run: | @@ -665,6 +785,46 @@ jobs: cache-on-failure: false shared-key: wasmer-${{ matrix.build }} save-if: false + - uses: actions/cache@v2 + if: matrix.use_sccache + with: + path: ${{ runner.tool_cache }}/cargo-sccache + key: ${{ matrix.build }}-${{ matrix.target }}-sccache-bin-${{ env.CARGO_SCCACHE_VERSION }}-v1 + - name: Install sccache + if: matrix.use_sccache + run: | + if [ ! -f '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' ]; then + cargo install sccache --no-default-features --features=dist-client,azure --version 0.2.15 --root '${{ runner.tool_cache }}/cargo-sccache' + fi + shell: bash + - name: Set sccache port + if: matrix.use_sccache && matrix.random_sccache_port + run: | + netstat -aln | awk ' + $6 == "LISTEN" { + if ($4 ~ "[.:][0-9]+$") { + n = split($4, a, /[:.]/); + port = a[n]; + p[port] = 1 + } + } + END { + for (i = 3000; i < 65000 && p[i]; i++){}; + if (i == 65000) {exit 1}; + print "SCCACHE_SERVER_PORT=" i + } + ' >> $GITHUB_ENV + # echo "SCCACHE_SERVER_PORT=9000" + echo "Setting random sccache port to: $SCCACHE_SERVER_PORT" + shell: bash + - name: Start sccache + if: matrix.use_sccache + run: | + chmod +x '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' + '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' --start-server + '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' -s + echo 'RUSTC_WRAPPER=${{ runner.tool_cache }}/cargo-sccache/bin/sccache' >> $GITHUB_ENV + shell: bash - name: Test run: | make test-stage-0 @@ -775,6 +935,46 @@ jobs: with: cache-on-failure: true shared-key: wasmer-stage-1-${{ matrix.build }} + - uses: actions/cache@v2 + if: matrix.use_sccache + with: + path: ${{ runner.tool_cache }}/cargo-sccache + key: ${{ matrix.build }}-${{ matrix.target }}-sccache-bin-${{ env.CARGO_SCCACHE_VERSION }}-v1 + - name: Install sccache + if: matrix.use_sccache + run: | + if [ ! -f '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' ]; then + cargo install sccache --no-default-features --features=dist-client,azure --version 0.2.15 --root '${{ runner.tool_cache }}/cargo-sccache' + fi + shell: bash + - name: Set sccache port + if: matrix.use_sccache && matrix.random_sccache_port + run: | + netstat -aln | awk ' + $6 == "LISTEN" { + if ($4 ~ "[.:][0-9]+$") { + n = split($4, a, /[:.]/); + port = a[n]; + p[port] = 1 + } + } + END { + for (i = 3000; i < 65000 && p[i]; i++){}; + if (i == 65000) {exit 1}; + print "SCCACHE_SERVER_PORT=" i + } + ' >> $GITHUB_ENV + # echo "SCCACHE_SERVER_PORT=9000" + echo "Setting random sccache port to: $SCCACHE_SERVER_PORT" + shell: bash + - name: Start sccache + if: matrix.use_sccache + run: | + chmod +x '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' + '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' --start-server + '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' -s + echo 'RUSTC_WRAPPER=${{ runner.tool_cache }}/cargo-sccache/bin/sccache' >> $GITHUB_ENV + shell: bash - name: Unzip Artifacts shell: bash run: | @@ -882,6 +1082,46 @@ jobs: cache-on-failure: false shared-key: wasmer-${{ matrix.build }} save-if: false + - uses: actions/cache@v2 + if: matrix.use_sccache + with: + path: ${{ runner.tool_cache }}/cargo-sccache + key: ${{ matrix.build }}-${{ matrix.target }}-sccache-bin-${{ env.CARGO_SCCACHE_VERSION }}-v1 + - name: Install sccache + if: matrix.use_sccache + run: | + if [ ! -f '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' ]; then + cargo install sccache --no-default-features --features=dist-client,azure --version 0.2.15 --root '${{ runner.tool_cache }}/cargo-sccache' + fi + shell: bash + - name: Set sccache port + if: matrix.use_sccache && matrix.random_sccache_port + run: | + netstat -aln | awk ' + $6 == "LISTEN" { + if ($4 ~ "[.:][0-9]+$") { + n = split($4, a, /[:.]/); + port = a[n]; + p[port] = 1 + } + } + END { + for (i = 3000; i < 65000 && p[i]; i++){}; + if (i == 65000) {exit 1}; + print "SCCACHE_SERVER_PORT=" i + } + ' >> $GITHUB_ENV + # echo "SCCACHE_SERVER_PORT=9000" + echo "Setting random sccache port to: $SCCACHE_SERVER_PORT" + shell: bash + - name: Start sccache + if: matrix.use_sccache + run: | + chmod +x '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' + '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' --start-server + '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' -s + echo 'RUSTC_WRAPPER=${{ runner.tool_cache }}/cargo-sccache/bin/sccache' >> $GITHUB_ENV + shell: bash - name: Test run: | make test-stage-2 @@ -985,6 +1225,46 @@ jobs: cache-on-failure: false shared-key: wasmer-${{ matrix.build }} save-if: false + - uses: actions/cache@v2 + if: matrix.use_sccache + with: + path: ${{ runner.tool_cache }}/cargo-sccache + key: ${{ matrix.build }}-${{ matrix.target }}-sccache-bin-${{ env.CARGO_SCCACHE_VERSION }}-v1 + - name: Install sccache + if: matrix.use_sccache + run: | + if [ ! -f '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' ]; then + cargo install sccache --no-default-features --features=dist-client,azure --version 0.2.15 --root '${{ runner.tool_cache }}/cargo-sccache' + fi + shell: bash + - name: Set sccache port + if: matrix.use_sccache && matrix.random_sccache_port + run: | + netstat -aln | awk ' + $6 == "LISTEN" { + if ($4 ~ "[.:][0-9]+$") { + n = split($4, a, /[:.]/); + port = a[n]; + p[port] = 1 + } + } + END { + for (i = 3000; i < 65000 && p[i]; i++){}; + if (i == 65000) {exit 1}; + print "SCCACHE_SERVER_PORT=" i + } + ' >> $GITHUB_ENV + # echo "SCCACHE_SERVER_PORT=9000" + echo "Setting random sccache port to: $SCCACHE_SERVER_PORT" + shell: bash + - name: Start sccache + if: matrix.use_sccache + run: | + chmod +x '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' + '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' --start-server + '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' -s + echo 'RUSTC_WRAPPER=${{ runner.tool_cache }}/cargo-sccache/bin/sccache' >> $GITHUB_ENV + shell: bash - name: Test run: | make test-stage-3 @@ -1088,6 +1368,46 @@ jobs: cache-on-failure: false shared-key: wasmer-${{ matrix.build }} save-if: false + - uses: actions/cache@v2 + if: matrix.use_sccache + with: + path: ${{ runner.tool_cache }}/cargo-sccache + key: ${{ matrix.build }}-${{ matrix.target }}-sccache-bin-${{ env.CARGO_SCCACHE_VERSION }}-v1 + - name: Install sccache + if: matrix.use_sccache + run: | + if [ ! -f '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' ]; then + cargo install sccache --no-default-features --features=dist-client,azure --version 0.2.15 --root '${{ runner.tool_cache }}/cargo-sccache' + fi + shell: bash + - name: Set sccache port + if: matrix.use_sccache && matrix.random_sccache_port + run: | + netstat -aln | awk ' + $6 == "LISTEN" { + if ($4 ~ "[.:][0-9]+$") { + n = split($4, a, /[:.]/); + port = a[n]; + p[port] = 1 + } + } + END { + for (i = 3000; i < 65000 && p[i]; i++){}; + if (i == 65000) {exit 1}; + print "SCCACHE_SERVER_PORT=" i + } + ' >> $GITHUB_ENV + # echo "SCCACHE_SERVER_PORT=9000" + echo "Setting random sccache port to: $SCCACHE_SERVER_PORT" + shell: bash + - name: Start sccache + if: matrix.use_sccache + run: | + chmod +x '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' + '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' --start-server + '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' -s + echo 'RUSTC_WRAPPER=${{ runner.tool_cache }}/cargo-sccache/bin/sccache' >> $GITHUB_ENV + shell: bash - name: Test run: | make test-stage-4 @@ -1191,6 +1511,46 @@ jobs: cache-on-failure: false shared-key: wasmer-${{ matrix.build }} save-if: false + - uses: actions/cache@v2 + if: matrix.use_sccache + with: + path: ${{ runner.tool_cache }}/cargo-sccache + key: ${{ matrix.build }}-${{ matrix.target }}-sccache-bin-${{ env.CARGO_SCCACHE_VERSION }}-v1 + - name: Install sccache + if: matrix.use_sccache + run: | + if [ ! -f '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' ]; then + cargo install sccache --no-default-features --features=dist-client,azure --version 0.2.15 --root '${{ runner.tool_cache }}/cargo-sccache' + fi + shell: bash + - name: Set sccache port + if: matrix.use_sccache && matrix.random_sccache_port + run: | + netstat -aln | awk ' + $6 == "LISTEN" { + if ($4 ~ "[.:][0-9]+$") { + n = split($4, a, /[:.]/); + port = a[n]; + p[port] = 1 + } + } + END { + for (i = 3000; i < 65000 && p[i]; i++){}; + if (i == 65000) {exit 1}; + print "SCCACHE_SERVER_PORT=" i + } + ' >> $GITHUB_ENV + # echo "SCCACHE_SERVER_PORT=9000" + echo "Setting random sccache port to: $SCCACHE_SERVER_PORT" + shell: bash + - name: Start sccache + if: matrix.use_sccache + run: | + chmod +x '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' + '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' --start-server + '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' -s + echo 'RUSTC_WRAPPER=${{ runner.tool_cache }}/cargo-sccache/bin/sccache' >> $GITHUB_ENV + shell: bash - name: Test run: | make test-stage-5 @@ -1294,6 +1654,46 @@ jobs: cache-on-failure: false shared-key: wasmer-${{ matrix.build }} save-if: false + - uses: actions/cache@v2 + if: matrix.use_sccache + with: + path: ${{ runner.tool_cache }}/cargo-sccache + key: ${{ matrix.build }}-${{ matrix.target }}-sccache-bin-${{ env.CARGO_SCCACHE_VERSION }}-v1 + - name: Install sccache + if: matrix.use_sccache + run: | + if [ ! -f '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' ]; then + cargo install sccache --no-default-features --features=dist-client,azure --version 0.2.15 --root '${{ runner.tool_cache }}/cargo-sccache' + fi + shell: bash + - name: Set sccache port + if: matrix.use_sccache && matrix.random_sccache_port + run: | + netstat -aln | awk ' + $6 == "LISTEN" { + if ($4 ~ "[.:][0-9]+$") { + n = split($4, a, /[:.]/); + port = a[n]; + p[port] = 1 + } + } + END { + for (i = 3000; i < 65000 && p[i]; i++){}; + if (i == 65000) {exit 1}; + print "SCCACHE_SERVER_PORT=" i + } + ' >> $GITHUB_ENV + # echo "SCCACHE_SERVER_PORT=9000" + echo "Setting random sccache port to: $SCCACHE_SERVER_PORT" + shell: bash + - name: Start sccache + if: matrix.use_sccache + run: | + chmod +x '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' + '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' --start-server + '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' -s + echo 'RUSTC_WRAPPER=${{ runner.tool_cache }}/cargo-sccache/bin/sccache' >> $GITHUB_ENV + shell: bash - name: Test run: | make test-stage-6 From a1e087b8843d0d2f513e02a261da1f44535903e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Tue, 29 Nov 2022 23:42:41 +0100 Subject: [PATCH 107/226] Use largest runners possible to see if timings improve --- .github/workflows/test.yaml | 84 ++++++++++++++++++------------------- 1 file changed, 42 insertions(+), 42 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index c0ada342836..23dc3882365 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -17,7 +17,7 @@ jobs: setup: name: Set up - runs-on: ubuntu-latest + runs-on: ubuntu-latest-8-cores outputs: VERSION: ${{ steps.setup.outputs.VERSION }} DOING_RELEASE: ${{ steps.setup.outputs.DOING_RELEASE }} @@ -35,7 +35,7 @@ jobs: lint: name: Code lint - runs-on: ubuntu-latest + runs-on: ubuntu-latest-8-cores steps: - uses: actions/checkout@v3 - name: Install Rust @@ -67,14 +67,14 @@ jobs: cargo_deny: name: cargo-deny - runs-on: ubuntu-latest + runs-on: ubuntu-latest-8-cores steps: - uses: actions/checkout@v3 - uses: EmbarkStudios/cargo-deny-action@v1 test_nodejs: name: Test on NodeJS - runs-on: ubuntu-latest + runs-on: ubuntu-latest-8-cores steps: - uses: actions/checkout@v3 - name: Install Rust @@ -97,7 +97,7 @@ jobs: test_wasm_build: name: Test wasm build - runs-on: ubuntu-latest + runs-on: ubuntu-latest-8-cores steps: - uses: actions/checkout@v2 - run: | @@ -113,7 +113,7 @@ jobs: matrix: include: - build: linux-x64 - os: ubuntu-18.04 + os: ubuntu-latest-8-cores target: x86_64-unknown-linux-gnu llvm_url: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz' - build: macos-x64 @@ -124,13 +124,13 @@ jobs: os: macos-11.0 target: aarch64-apple-darwin - build: windows-x64 - os: windows-2019 + os: windows-latest-8-cores target: x86_64-pc-windows-msvc # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/12.x/windows-amd64.tar.gz' llvm_choco_version: 13.0.0 - build: linux-musl-x64 target: x86_64-unknown-linux-musl - os: ubuntu-latest + os: ubuntu-latest-8-cores container: alpine:latest container: ${{ matrix.container }} env: @@ -219,7 +219,7 @@ jobs: build_wasmer_linux_aarch64: name: Build wasmer on linux aarch64 - runs-on: ubuntu-latest + runs-on: ubuntu-latest-8-cores steps: - uses: actions/checkout@v2 - uses: dtolnay/rust-toolchain@stable @@ -244,7 +244,7 @@ jobs: build_capi_linux_aarch64: name: Build C-API on linux aarch64 - runs-on: ubuntu-latest + runs-on: ubuntu-latest-8-cores steps: - uses: actions/checkout@v2 - uses: dtolnay/rust-toolchain@stable @@ -269,7 +269,7 @@ jobs: build_capi_windows_gnu: name: Windows GNU - runs-on: ubuntu-18.04 + runs-on: ubuntu-latest-8-cores steps: - uses: actions/checkout@v2 - name: Install Windows-GNU linker @@ -323,7 +323,7 @@ jobs: matrix: include: - build: linux-x64 - os: ubuntu-18.04 + os: ubuntu-latest-8-cores target: x86_64-unknown-linux-gnu llvm_url: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz' - build: macos-x64 @@ -334,13 +334,13 @@ jobs: os: macos-11.0 target: aarch64-apple-darwin - build: windows-x64 - os: windows-2019 + os: windows-latest-8-cores target: x86_64-pc-windows-msvc # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/12.x/windows-amd64.tar.gz' llvm_choco_version: 13.0.0 - build: linux-musl-x64 target: x86_64-unknown-linux-musl - os: ubuntu-latest + os: ubuntu-latest-8-cores container: alpine:latest container: ${{ matrix.container }} env: @@ -477,7 +477,7 @@ jobs: matrix: include: - build: linux-x64 - os: ubuntu-18.04 + os: ubuntu-latest-8-cores target: x86_64-unknown-linux-gnu llvm_url: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz' - build: macos-x64 @@ -485,13 +485,13 @@ jobs: target: x86_64-apple-darwin llvm_url: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-apple-darwin.tar.xz' - build: windows-x64 - os: windows-2019 + os: windows-latest-8-cores target: x86_64-pc-windows-msvc # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/12.x/windows-amd64.tar.gz' llvm_choco_version: 13.0.0 - build: linux-musl-x64 target: x86_64-unknown-linux-musl - os: ubuntu-latest + os: ubuntu-latest-8-cores container: alpine:latest container: ${{ matrix.container }} env: @@ -582,7 +582,7 @@ jobs: matrix: include: - build: linux-x64 - os: ubuntu-18.04 + os: ubuntu-latest-8-cores target: x86_64-unknown-linux-gnu llvm_url: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz' - build: macos-x64 @@ -590,13 +590,13 @@ jobs: target: x86_64-apple-darwin llvm_url: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-apple-darwin.tar.xz' - build: windows-x64 - os: windows-2019 + os: windows-latest-8-cores target: x86_64-pc-windows-msvc # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/12.x/windows-amd64.tar.gz' llvm_choco_version: 13.0.0 - build: linux-musl-x64 target: x86_64-unknown-linux-musl - os: ubuntu-latest + os: ubuntu-latest-8-cores container: alpine:latest container: ${{ matrix.container }} env: @@ -679,7 +679,7 @@ jobs: run: | make untar-wasmer - name: Test integration CLI - if: matrix.os != 'windows-2019' + if: matrix.os != 'windows-latest-8-cores' shell: bash run: | export WASMER_DIR=`pwd`/package && make test-integration-cli @@ -699,7 +699,7 @@ jobs: matrix: include: - build: linux-x64 - os: ubuntu-18.04 + os: ubuntu-latest-8-cores target: x86_64-unknown-linux-gnu llvm_url: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz' - build: macos-x64 @@ -707,13 +707,13 @@ jobs: target: x86_64-apple-darwin llvm_url: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-apple-darwin.tar.xz' - build: windows-x64 - os: windows-2019 + os: windows-latest-8-cores target: x86_64-pc-windows-msvc # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/12.x/windows-amd64.tar.gz' llvm_choco_version: 13.0.0 - build: linux-musl-x64 target: x86_64-unknown-linux-musl - os: ubuntu-latest + os: ubuntu-latest-8-cores container: alpine:latest container: ${{ matrix.container }} env: @@ -842,7 +842,7 @@ jobs: matrix: include: - build: linux-x64 - os: ubuntu-18.04 + os: ubuntu-latest-8-cores target: x86_64-unknown-linux-gnu llvm_url: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz' - build: macos-x64 @@ -850,13 +850,13 @@ jobs: target: x86_64-apple-darwin llvm_url: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-apple-darwin.tar.xz' - build: windows-x64 - os: windows-2019 + os: windows-latest-8-cores target: x86_64-pc-windows-msvc # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/12.x/windows-amd64.tar.gz' llvm_choco_version: 13.0.0 - build: linux-musl-x64 target: x86_64-unknown-linux-musl - os: ubuntu-latest + os: ubuntu-latest-8-cores container: alpine:latest container: ${{ matrix.container }} env: @@ -996,7 +996,7 @@ jobs: matrix: include: - build: linux-x64 - os: ubuntu-18.04 + os: ubuntu-latest-8-cores target: x86_64-unknown-linux-gnu llvm_url: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz' - build: macos-x64 @@ -1004,13 +1004,13 @@ jobs: target: x86_64-apple-darwin llvm_url: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-apple-darwin.tar.xz' - build: windows-x64 - os: windows-2019 + os: windows-latest-8-cores target: x86_64-pc-windows-msvc # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/12.x/windows-amd64.tar.gz' llvm_choco_version: 13.0.0 - build: linux-musl-x64 target: x86_64-unknown-linux-musl - os: ubuntu-latest + os: ubuntu-latest-8-cores container: alpine:latest container: ${{ matrix.container }} env: @@ -1139,7 +1139,7 @@ jobs: matrix: include: - build: linux-x64 - os: ubuntu-18.04 + os: ubuntu-latest-8-cores target: x86_64-unknown-linux-gnu llvm_url: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz' - build: macos-x64 @@ -1147,13 +1147,13 @@ jobs: target: x86_64-apple-darwin llvm_url: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-apple-darwin.tar.xz' - build: windows-x64 - os: windows-2019 + os: windows-latest-8-cores target: x86_64-pc-windows-msvc # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/12.x/windows-amd64.tar.gz' llvm_choco_version: 13.0.0 - build: linux-musl-x64 target: x86_64-unknown-linux-musl - os: ubuntu-latest + os: ubuntu-latest-8-cores container: alpine:latest container: ${{ matrix.container }} env: @@ -1282,7 +1282,7 @@ jobs: matrix: include: - build: linux-x64 - os: ubuntu-18.04 + os: ubuntu-latest-8-cores target: x86_64-unknown-linux-gnu llvm_url: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz' - build: macos-x64 @@ -1290,13 +1290,13 @@ jobs: target: x86_64-apple-darwin llvm_url: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-apple-darwin.tar.xz' - build: windows-x64 - os: windows-2019 + os: windows-latest-8-cores target: x86_64-pc-windows-msvc # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/12.x/windows-amd64.tar.gz' llvm_choco_version: 13.0.0 - build: linux-musl-x64 target: x86_64-unknown-linux-musl - os: ubuntu-latest + os: ubuntu-latest-8-cores container: alpine:latest container: ${{ matrix.container }} env: @@ -1425,7 +1425,7 @@ jobs: matrix: include: - build: linux-x64 - os: ubuntu-18.04 + os: ubuntu-latest-8-cores target: x86_64-unknown-linux-gnu llvm_url: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz' - build: macos-x64 @@ -1433,13 +1433,13 @@ jobs: target: x86_64-apple-darwin llvm_url: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-apple-darwin.tar.xz' - build: windows-x64 - os: windows-2019 + os: windows-latest-8-cores target: x86_64-pc-windows-msvc # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/12.x/windows-amd64.tar.gz' llvm_choco_version: 13.0.0 - build: linux-musl-x64 target: x86_64-unknown-linux-musl - os: ubuntu-latest + os: ubuntu-latest-8-cores container: alpine:latest container: ${{ matrix.container }} env: @@ -1568,7 +1568,7 @@ jobs: matrix: include: - build: linux-x64 - os: ubuntu-18.04 + os: ubuntu-latest-8-cores target: x86_64-unknown-linux-gnu llvm_url: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz' - build: macos-x64 @@ -1576,13 +1576,13 @@ jobs: target: x86_64-apple-darwin llvm_url: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-apple-darwin.tar.xz' - build: windows-x64 - os: windows-2019 + os: windows-latest-8-cores target: x86_64-pc-windows-msvc # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/12.x/windows-amd64.tar.gz' llvm_choco_version: 13.0.0 - build: linux-musl-x64 target: x86_64-unknown-linux-musl - os: ubuntu-latest + os: ubuntu-latest-8-cores container: alpine:latest container: ${{ matrix.container }} env: From 6205900a38eb381c2ddbfad080f1f51c4bacd7ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Tue, 29 Nov 2022 23:46:40 +0100 Subject: [PATCH 108/226] Remove bors to see if timings improve --- bors.toml | 13 ------------- 1 file changed, 13 deletions(-) delete mode 100644 bors.toml diff --git a/bors.toml b/bors.toml deleted file mode 100644 index 26e63002773..00000000000 --- a/bors.toml +++ /dev/null @@ -1,13 +0,0 @@ -status = [ - #"Audit", - "Code lint", - #"Test on linux-x64", - # "Test on linux-musl-x64", - # "Test on linux-aarch64", - #"Test on macos-arm64", - #"Test on macos-x64", - #"Test on windows-x64", -] -required_approvals = 0 -timeout_sec = 7200 -delete_merged_branches = true From 950274a26a8d89e0cefb36074c52584c8f9520d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Wed, 30 Nov 2022 13:30:28 +0100 Subject: [PATCH 109/226] Always enable sccache --- .github/workflows/test.yaml | 30 ------------------------------ 1 file changed, 30 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 23dc3882365..134eb2da8bc 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -413,12 +413,10 @@ jobs: shared-key: wasmer-${{ matrix.build }} save-if: false - uses: actions/cache@v2 - if: matrix.use_sccache with: path: ${{ runner.tool_cache }}/cargo-sccache key: ${{ matrix.build }}-${{ matrix.target }}-sccache-bin-${{ env.CARGO_SCCACHE_VERSION }}-v1 - name: Install sccache - if: matrix.use_sccache run: | if [ ! -f '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' ]; then cargo install sccache --no-default-features --features=dist-client,azure --version 0.2.15 --root '${{ runner.tool_cache }}/cargo-sccache' @@ -445,7 +443,6 @@ jobs: echo "Setting random sccache port to: $SCCACHE_SERVER_PORT" shell: bash - name: Start sccache - if: matrix.use_sccache run: | chmod +x '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' --start-server @@ -518,12 +515,10 @@ jobs: shared-key: wasmer-${{ matrix.build }} save-if: false - uses: actions/cache@v2 - if: matrix.use_sccache with: path: ${{ runner.tool_cache }}/cargo-sccache key: ${{ matrix.build }}-${{ matrix.target }}-sccache-bin-${{ env.CARGO_SCCACHE_VERSION }}-v1 - name: Install sccache - if: matrix.use_sccache run: | if [ ! -f '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' ]; then cargo install sccache --no-default-features --features=dist-client,azure --version 0.2.15 --root '${{ runner.tool_cache }}/cargo-sccache' @@ -550,7 +545,6 @@ jobs: echo "Setting random sccache port to: $SCCACHE_SERVER_PORT" shell: bash - name: Start sccache - if: matrix.use_sccache run: | chmod +x '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' --start-server @@ -631,12 +625,10 @@ jobs: shared-key: wasmer-${{ matrix.build }} save-if: false - uses: actions/cache@v2 - if: matrix.use_sccache with: path: ${{ runner.tool_cache }}/cargo-sccache key: ${{ matrix.build }}-${{ matrix.target }}-sccache-bin-${{ env.CARGO_SCCACHE_VERSION }}-v1 - name: Install sccache - if: matrix.use_sccache run: | if [ ! -f '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' ]; then cargo install sccache --no-default-features --features=dist-client,azure --version 0.2.15 --root '${{ runner.tool_cache }}/cargo-sccache' @@ -663,7 +655,6 @@ jobs: echo "Setting random sccache port to: $SCCACHE_SERVER_PORT" shell: bash - name: Start sccache - if: matrix.use_sccache run: | chmod +x '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' --start-server @@ -786,12 +777,10 @@ jobs: shared-key: wasmer-${{ matrix.build }} save-if: false - uses: actions/cache@v2 - if: matrix.use_sccache with: path: ${{ runner.tool_cache }}/cargo-sccache key: ${{ matrix.build }}-${{ matrix.target }}-sccache-bin-${{ env.CARGO_SCCACHE_VERSION }}-v1 - name: Install sccache - if: matrix.use_sccache run: | if [ ! -f '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' ]; then cargo install sccache --no-default-features --features=dist-client,azure --version 0.2.15 --root '${{ runner.tool_cache }}/cargo-sccache' @@ -818,7 +807,6 @@ jobs: echo "Setting random sccache port to: $SCCACHE_SERVER_PORT" shell: bash - name: Start sccache - if: matrix.use_sccache run: | chmod +x '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' --start-server @@ -936,12 +924,10 @@ jobs: cache-on-failure: true shared-key: wasmer-stage-1-${{ matrix.build }} - uses: actions/cache@v2 - if: matrix.use_sccache with: path: ${{ runner.tool_cache }}/cargo-sccache key: ${{ matrix.build }}-${{ matrix.target }}-sccache-bin-${{ env.CARGO_SCCACHE_VERSION }}-v1 - name: Install sccache - if: matrix.use_sccache run: | if [ ! -f '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' ]; then cargo install sccache --no-default-features --features=dist-client,azure --version 0.2.15 --root '${{ runner.tool_cache }}/cargo-sccache' @@ -968,7 +954,6 @@ jobs: echo "Setting random sccache port to: $SCCACHE_SERVER_PORT" shell: bash - name: Start sccache - if: matrix.use_sccache run: | chmod +x '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' --start-server @@ -1083,12 +1068,10 @@ jobs: shared-key: wasmer-${{ matrix.build }} save-if: false - uses: actions/cache@v2 - if: matrix.use_sccache with: path: ${{ runner.tool_cache }}/cargo-sccache key: ${{ matrix.build }}-${{ matrix.target }}-sccache-bin-${{ env.CARGO_SCCACHE_VERSION }}-v1 - name: Install sccache - if: matrix.use_sccache run: | if [ ! -f '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' ]; then cargo install sccache --no-default-features --features=dist-client,azure --version 0.2.15 --root '${{ runner.tool_cache }}/cargo-sccache' @@ -1115,7 +1098,6 @@ jobs: echo "Setting random sccache port to: $SCCACHE_SERVER_PORT" shell: bash - name: Start sccache - if: matrix.use_sccache run: | chmod +x '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' --start-server @@ -1226,12 +1208,10 @@ jobs: shared-key: wasmer-${{ matrix.build }} save-if: false - uses: actions/cache@v2 - if: matrix.use_sccache with: path: ${{ runner.tool_cache }}/cargo-sccache key: ${{ matrix.build }}-${{ matrix.target }}-sccache-bin-${{ env.CARGO_SCCACHE_VERSION }}-v1 - name: Install sccache - if: matrix.use_sccache run: | if [ ! -f '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' ]; then cargo install sccache --no-default-features --features=dist-client,azure --version 0.2.15 --root '${{ runner.tool_cache }}/cargo-sccache' @@ -1258,7 +1238,6 @@ jobs: echo "Setting random sccache port to: $SCCACHE_SERVER_PORT" shell: bash - name: Start sccache - if: matrix.use_sccache run: | chmod +x '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' --start-server @@ -1369,12 +1348,10 @@ jobs: shared-key: wasmer-${{ matrix.build }} save-if: false - uses: actions/cache@v2 - if: matrix.use_sccache with: path: ${{ runner.tool_cache }}/cargo-sccache key: ${{ matrix.build }}-${{ matrix.target }}-sccache-bin-${{ env.CARGO_SCCACHE_VERSION }}-v1 - name: Install sccache - if: matrix.use_sccache run: | if [ ! -f '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' ]; then cargo install sccache --no-default-features --features=dist-client,azure --version 0.2.15 --root '${{ runner.tool_cache }}/cargo-sccache' @@ -1401,7 +1378,6 @@ jobs: echo "Setting random sccache port to: $SCCACHE_SERVER_PORT" shell: bash - name: Start sccache - if: matrix.use_sccache run: | chmod +x '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' --start-server @@ -1512,12 +1488,10 @@ jobs: shared-key: wasmer-${{ matrix.build }} save-if: false - uses: actions/cache@v2 - if: matrix.use_sccache with: path: ${{ runner.tool_cache }}/cargo-sccache key: ${{ matrix.build }}-${{ matrix.target }}-sccache-bin-${{ env.CARGO_SCCACHE_VERSION }}-v1 - name: Install sccache - if: matrix.use_sccache run: | if [ ! -f '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' ]; then cargo install sccache --no-default-features --features=dist-client,azure --version 0.2.15 --root '${{ runner.tool_cache }}/cargo-sccache' @@ -1544,7 +1518,6 @@ jobs: echo "Setting random sccache port to: $SCCACHE_SERVER_PORT" shell: bash - name: Start sccache - if: matrix.use_sccache run: | chmod +x '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' --start-server @@ -1655,12 +1628,10 @@ jobs: shared-key: wasmer-${{ matrix.build }} save-if: false - uses: actions/cache@v2 - if: matrix.use_sccache with: path: ${{ runner.tool_cache }}/cargo-sccache key: ${{ matrix.build }}-${{ matrix.target }}-sccache-bin-${{ env.CARGO_SCCACHE_VERSION }}-v1 - name: Install sccache - if: matrix.use_sccache run: | if [ ! -f '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' ]; then cargo install sccache --no-default-features --features=dist-client,azure --version 0.2.15 --root '${{ runner.tool_cache }}/cargo-sccache' @@ -1687,7 +1658,6 @@ jobs: echo "Setting random sccache port to: $SCCACHE_SERVER_PORT" shell: bash - name: Start sccache - if: matrix.use_sccache run: | chmod +x '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' --start-server From 8bdff22b777ba272e21959356f6536ea21a15268 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Wed, 30 Nov 2022 13:39:19 +0100 Subject: [PATCH 110/226] Fix libstdc++ not installing on ubuntu-latest --- .github/workflows/test.yaml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 134eb2da8bc..b751c943b40 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -142,7 +142,7 @@ jobs: if: matrix.build == 'linux-x64' run: | sudo apt-get update -y - sudo apt-get install -y --allow-downgrades libstdc++6=8.4.0-1ubuntu1~18.04 + sudo apt-get install -y --allow-downgrades libstdc++6 sudo apt-get install --reinstall g++-8 - name: Set up base deps on musl if: matrix.build == 'linux-musl-x64' @@ -352,7 +352,7 @@ jobs: if: matrix.build == 'linux-x64' run: | sudo apt-get update -y - sudo apt-get install -y --allow-downgrades libstdc++6=8.4.0-1ubuntu1~18.04 + sudo apt-get install -y --allow-downgrades libstdc++6 sudo apt-get install --reinstall g++-8 - name: Set up base deps on musl if: matrix.build == 'linux-musl-x64' @@ -716,7 +716,7 @@ jobs: if: matrix.build == 'linux-x64' run: | sudo apt-get update -y - sudo apt-get install -y --allow-downgrades libstdc++6=8.4.0-1ubuntu1~18.04 + sudo apt-get install -y --allow-downgrades libstdc++6 sudo apt-get install --reinstall g++-8 - name: Set up base deps on musl if: matrix.build == 'linux-musl-x64' @@ -864,7 +864,7 @@ jobs: if: matrix.build == 'linux-x64' run: | sudo apt-get update -y - sudo apt-get install -y --allow-downgrades libstdc++6=8.4.0-1ubuntu1~18.04 + sudo apt-get install -y --allow-downgrades libstdc++6 sudo apt-get install --reinstall g++-8 - name: Set up base deps on musl if: matrix.build == 'linux-musl-x64' @@ -1007,7 +1007,7 @@ jobs: if: matrix.build == 'linux-x64' run: | sudo apt-get update -y - sudo apt-get install -y --allow-downgrades libstdc++6=8.4.0-1ubuntu1~18.04 + sudo apt-get install -y --allow-downgrades libstdc++6 sudo apt-get install --reinstall g++-8 - name: Set up base deps on musl if: matrix.build == 'linux-musl-x64' @@ -1147,7 +1147,7 @@ jobs: if: matrix.build == 'linux-x64' run: | sudo apt-get update -y - sudo apt-get install -y --allow-downgrades libstdc++6=8.4.0-1ubuntu1~18.04 + sudo apt-get install -y --allow-downgrades libstdc++6 sudo apt-get install --reinstall g++-8 - name: Set up base deps on musl if: matrix.build == 'linux-musl-x64' @@ -1287,7 +1287,7 @@ jobs: if: matrix.build == 'linux-x64' run: | sudo apt-get update -y - sudo apt-get install -y --allow-downgrades libstdc++6=8.4.0-1ubuntu1~18.04 + sudo apt-get install -y --allow-downgrades libstdc++6 sudo apt-get install --reinstall g++-8 - name: Set up base deps on musl if: matrix.build == 'linux-musl-x64' @@ -1427,7 +1427,7 @@ jobs: if: matrix.build == 'linux-x64' run: | sudo apt-get update -y - sudo apt-get install -y --allow-downgrades libstdc++6=8.4.0-1ubuntu1~18.04 + sudo apt-get install -y --allow-downgrades libstdc++6 sudo apt-get install --reinstall g++-8 - name: Set up base deps on musl if: matrix.build == 'linux-musl-x64' @@ -1567,7 +1567,7 @@ jobs: if: matrix.build == 'linux-x64' run: | sudo apt-get update -y - sudo apt-get install -y --allow-downgrades libstdc++6=8.4.0-1ubuntu1~18.04 + sudo apt-get install -y --allow-downgrades libstdc++6 sudo apt-get install --reinstall g++-8 - name: Set up base deps on musl if: matrix.build == 'linux-musl-x64' From 4bbc059d9067fd9d3aa05ab223065292f0bdf7a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Wed, 30 Nov 2022 13:54:57 +0100 Subject: [PATCH 111/226] Disable sccache on linux-musl --- .github/workflows/test.yaml | 40 +++++++++++++++++++++++++++---------- 1 file changed, 30 insertions(+), 10 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index b751c943b40..441f2244ea6 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -417,13 +417,14 @@ jobs: path: ${{ runner.tool_cache }}/cargo-sccache key: ${{ matrix.build }}-${{ matrix.target }}-sccache-bin-${{ env.CARGO_SCCACHE_VERSION }}-v1 - name: Install sccache + if: matrix.build != 'linux-musl' run: | if [ ! -f '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' ]; then cargo install sccache --no-default-features --features=dist-client,azure --version 0.2.15 --root '${{ runner.tool_cache }}/cargo-sccache' fi shell: bash - name: Set sccache port - if: matrix.use_sccache && matrix.random_sccache_port + if: matrix.use_sccache && matrix.random_sccache_port && matrix.build != 'linux-musl' run: | netstat -aln | awk ' $6 == "LISTEN" { @@ -443,6 +444,7 @@ jobs: echo "Setting random sccache port to: $SCCACHE_SERVER_PORT" shell: bash - name: Start sccache + if: matrix.build != 'linux-musl' run: | chmod +x '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' --start-server @@ -519,13 +521,14 @@ jobs: path: ${{ runner.tool_cache }}/cargo-sccache key: ${{ matrix.build }}-${{ matrix.target }}-sccache-bin-${{ env.CARGO_SCCACHE_VERSION }}-v1 - name: Install sccache + if: matrix.build != 'linux-musl' run: | if [ ! -f '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' ]; then cargo install sccache --no-default-features --features=dist-client,azure --version 0.2.15 --root '${{ runner.tool_cache }}/cargo-sccache' fi shell: bash - name: Set sccache port - if: matrix.use_sccache && matrix.random_sccache_port + if: matrix.use_sccache && matrix.random_sccache_port && matrix.build != 'linux-musl' run: | netstat -aln | awk ' $6 == "LISTEN" { @@ -545,6 +548,7 @@ jobs: echo "Setting random sccache port to: $SCCACHE_SERVER_PORT" shell: bash - name: Start sccache + if: matrix.build != 'linux-musl' run: | chmod +x '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' --start-server @@ -629,13 +633,14 @@ jobs: path: ${{ runner.tool_cache }}/cargo-sccache key: ${{ matrix.build }}-${{ matrix.target }}-sccache-bin-${{ env.CARGO_SCCACHE_VERSION }}-v1 - name: Install sccache + if: matrix.build != 'linux-musl' run: | if [ ! -f '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' ]; then cargo install sccache --no-default-features --features=dist-client,azure --version 0.2.15 --root '${{ runner.tool_cache }}/cargo-sccache' fi shell: bash - name: Set sccache port - if: matrix.use_sccache && matrix.random_sccache_port + if: matrix.use_sccache && matrix.random_sccache_port && matrix.build != 'linux-musl' run: | netstat -aln | awk ' $6 == "LISTEN" { @@ -655,6 +660,7 @@ jobs: echo "Setting random sccache port to: $SCCACHE_SERVER_PORT" shell: bash - name: Start sccache + if: matrix.build != 'linux-musl' run: | chmod +x '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' --start-server @@ -781,13 +787,14 @@ jobs: path: ${{ runner.tool_cache }}/cargo-sccache key: ${{ matrix.build }}-${{ matrix.target }}-sccache-bin-${{ env.CARGO_SCCACHE_VERSION }}-v1 - name: Install sccache + if: matrix.build != 'linux-musl' run: | if [ ! -f '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' ]; then cargo install sccache --no-default-features --features=dist-client,azure --version 0.2.15 --root '${{ runner.tool_cache }}/cargo-sccache' fi shell: bash - name: Set sccache port - if: matrix.use_sccache && matrix.random_sccache_port + if: matrix.use_sccache && matrix.random_sccache_port && matrix.build != 'linux-musl' run: | netstat -aln | awk ' $6 == "LISTEN" { @@ -807,6 +814,7 @@ jobs: echo "Setting random sccache port to: $SCCACHE_SERVER_PORT" shell: bash - name: Start sccache + if: matrix.build != 'linux-musl' run: | chmod +x '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' --start-server @@ -928,13 +936,14 @@ jobs: path: ${{ runner.tool_cache }}/cargo-sccache key: ${{ matrix.build }}-${{ matrix.target }}-sccache-bin-${{ env.CARGO_SCCACHE_VERSION }}-v1 - name: Install sccache + if: matrix.build != 'linux-musl' run: | if [ ! -f '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' ]; then cargo install sccache --no-default-features --features=dist-client,azure --version 0.2.15 --root '${{ runner.tool_cache }}/cargo-sccache' fi shell: bash - name: Set sccache port - if: matrix.use_sccache && matrix.random_sccache_port + if: matrix.use_sccache && matrix.random_sccache_port && matrix.build != 'linux-musl' run: | netstat -aln | awk ' $6 == "LISTEN" { @@ -954,6 +963,7 @@ jobs: echo "Setting random sccache port to: $SCCACHE_SERVER_PORT" shell: bash - name: Start sccache + if: matrix.build != 'linux-musl' run: | chmod +x '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' --start-server @@ -1072,13 +1082,14 @@ jobs: path: ${{ runner.tool_cache }}/cargo-sccache key: ${{ matrix.build }}-${{ matrix.target }}-sccache-bin-${{ env.CARGO_SCCACHE_VERSION }}-v1 - name: Install sccache + if: matrix.build != 'linux-musl' run: | if [ ! -f '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' ]; then cargo install sccache --no-default-features --features=dist-client,azure --version 0.2.15 --root '${{ runner.tool_cache }}/cargo-sccache' fi shell: bash - name: Set sccache port - if: matrix.use_sccache && matrix.random_sccache_port + if: matrix.use_sccache && matrix.random_sccache_port && matrix.build != 'linux-musl' run: | netstat -aln | awk ' $6 == "LISTEN" { @@ -1098,6 +1109,7 @@ jobs: echo "Setting random sccache port to: $SCCACHE_SERVER_PORT" shell: bash - name: Start sccache + if: matrix.build != 'linux-musl' run: | chmod +x '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' --start-server @@ -1212,13 +1224,14 @@ jobs: path: ${{ runner.tool_cache }}/cargo-sccache key: ${{ matrix.build }}-${{ matrix.target }}-sccache-bin-${{ env.CARGO_SCCACHE_VERSION }}-v1 - name: Install sccache + if: matrix.build != 'linux-musl' run: | if [ ! -f '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' ]; then cargo install sccache --no-default-features --features=dist-client,azure --version 0.2.15 --root '${{ runner.tool_cache }}/cargo-sccache' fi shell: bash - name: Set sccache port - if: matrix.use_sccache && matrix.random_sccache_port + if: matrix.use_sccache && matrix.random_sccache_port && matrix.build != 'linux-musl' run: | netstat -aln | awk ' $6 == "LISTEN" { @@ -1238,6 +1251,7 @@ jobs: echo "Setting random sccache port to: $SCCACHE_SERVER_PORT" shell: bash - name: Start sccache + if: matrix.build != 'linux-musl' run: | chmod +x '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' --start-server @@ -1352,13 +1366,14 @@ jobs: path: ${{ runner.tool_cache }}/cargo-sccache key: ${{ matrix.build }}-${{ matrix.target }}-sccache-bin-${{ env.CARGO_SCCACHE_VERSION }}-v1 - name: Install sccache + if: matrix.build != 'linux-musl' run: | if [ ! -f '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' ]; then cargo install sccache --no-default-features --features=dist-client,azure --version 0.2.15 --root '${{ runner.tool_cache }}/cargo-sccache' fi shell: bash - name: Set sccache port - if: matrix.use_sccache && matrix.random_sccache_port + if: matrix.use_sccache && matrix.random_sccache_port && matrix.build != 'linux-musl' run: | netstat -aln | awk ' $6 == "LISTEN" { @@ -1378,6 +1393,7 @@ jobs: echo "Setting random sccache port to: $SCCACHE_SERVER_PORT" shell: bash - name: Start sccache + if: matrix.build != 'linux-musl' run: | chmod +x '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' --start-server @@ -1492,13 +1508,14 @@ jobs: path: ${{ runner.tool_cache }}/cargo-sccache key: ${{ matrix.build }}-${{ matrix.target }}-sccache-bin-${{ env.CARGO_SCCACHE_VERSION }}-v1 - name: Install sccache + if: matrix.build != 'linux-musl' run: | if [ ! -f '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' ]; then cargo install sccache --no-default-features --features=dist-client,azure --version 0.2.15 --root '${{ runner.tool_cache }}/cargo-sccache' fi shell: bash - name: Set sccache port - if: matrix.use_sccache && matrix.random_sccache_port + if: matrix.use_sccache && matrix.random_sccache_port && matrix.build != 'linux-musl' run: | netstat -aln | awk ' $6 == "LISTEN" { @@ -1518,6 +1535,7 @@ jobs: echo "Setting random sccache port to: $SCCACHE_SERVER_PORT" shell: bash - name: Start sccache + if: matrix.build != 'linux-musl' run: | chmod +x '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' --start-server @@ -1632,13 +1650,14 @@ jobs: path: ${{ runner.tool_cache }}/cargo-sccache key: ${{ matrix.build }}-${{ matrix.target }}-sccache-bin-${{ env.CARGO_SCCACHE_VERSION }}-v1 - name: Install sccache + if: matrix.build != 'linux-musl' run: | if [ ! -f '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' ]; then cargo install sccache --no-default-features --features=dist-client,azure --version 0.2.15 --root '${{ runner.tool_cache }}/cargo-sccache' fi shell: bash - name: Set sccache port - if: matrix.use_sccache && matrix.random_sccache_port + if: matrix.use_sccache && matrix.random_sccache_port && matrix.build != 'linux-musl' run: | netstat -aln | awk ' $6 == "LISTEN" { @@ -1658,6 +1677,7 @@ jobs: echo "Setting random sccache port to: $SCCACHE_SERVER_PORT" shell: bash - name: Start sccache + if: matrix.build != 'linux-musl' run: | chmod +x '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' --start-server From 51091a0b2d996bf97a277581b26cd34a617da446 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Wed, 30 Nov 2022 14:10:42 +0100 Subject: [PATCH 112/226] linux-musl-x64 -> linux-musl --- .github/workflows/test.yaml | 48 ++++++++++++++++++------------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 441f2244ea6..ce32b4c43e1 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -128,7 +128,7 @@ jobs: target: x86_64-pc-windows-msvc # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/12.x/windows-amd64.tar.gz' llvm_choco_version: 13.0.0 - - build: linux-musl-x64 + - build: linux-musl target: x86_64-unknown-linux-musl os: ubuntu-latest-8-cores container: alpine:latest @@ -145,7 +145,7 @@ jobs: sudo apt-get install -y --allow-downgrades libstdc++6 sudo apt-get install --reinstall g++-8 - name: Set up base deps on musl - if: matrix.build == 'linux-musl-x64' + if: matrix.build == 'linux-musl' run: | apk add build-base bash musl-dev curl tar make libtool libffi-dev gcc automake autoconf git openssl-dev g++ - name: Set up dependencies for Mac OS @@ -338,7 +338,7 @@ jobs: target: x86_64-pc-windows-msvc # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/12.x/windows-amd64.tar.gz' llvm_choco_version: 13.0.0 - - build: linux-musl-x64 + - build: linux-musl target: x86_64-unknown-linux-musl os: ubuntu-latest-8-cores container: alpine:latest @@ -355,7 +355,7 @@ jobs: sudo apt-get install -y --allow-downgrades libstdc++6 sudo apt-get install --reinstall g++-8 - name: Set up base deps on musl - if: matrix.build == 'linux-musl-x64' + if: matrix.build == 'linux-musl' run: | apk add build-base bash musl-dev curl tar make libtool libffi-dev gcc automake autoconf git openssl-dev g++ - name: Set up dependencies for Mac OS @@ -488,7 +488,7 @@ jobs: target: x86_64-pc-windows-msvc # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/12.x/windows-amd64.tar.gz' llvm_choco_version: 13.0.0 - - build: linux-musl-x64 + - build: linux-musl target: x86_64-unknown-linux-musl os: ubuntu-latest-8-cores container: alpine:latest @@ -499,7 +499,7 @@ jobs: steps: - uses: actions/checkout@v3 - name: Set up base deps on musl - if: matrix.build == 'linux-musl-x64' + if: matrix.build == 'linux-musl' run: | apk add build-base bash musl-dev curl tar make libtool libffi-dev gcc automake autoconf git openssl-dev g++ - uses: actions/download-artifact@v3 @@ -563,7 +563,7 @@ jobs: make untar-capi - name: Test C API # musl can't run the capi tests because of a cc linker issue (`wasm_engine_new` is redefined) - if: matrix.build != 'linux-musl-x64' + if: matrix.build != 'linux-musl' run: | make test-capi-ci env: @@ -592,7 +592,7 @@ jobs: target: x86_64-pc-windows-msvc # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/12.x/windows-amd64.tar.gz' llvm_choco_version: 13.0.0 - - build: linux-musl-x64 + - build: linux-musl target: x86_64-unknown-linux-musl os: ubuntu-latest-8-cores container: alpine:latest @@ -606,7 +606,7 @@ jobs: with: version: 0.10.0 - name: Set up base deps on musl - if: matrix.build == 'linux-musl-x64' + if: matrix.build == 'linux-musl' run: | apk add build-base bash musl-dev curl tar make libtool libffi-dev gcc automake autoconf git openssl-dev g++ - uses: actions/download-artifact@v3 @@ -708,7 +708,7 @@ jobs: target: x86_64-pc-windows-msvc # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/12.x/windows-amd64.tar.gz' llvm_choco_version: 13.0.0 - - build: linux-musl-x64 + - build: linux-musl target: x86_64-unknown-linux-musl os: ubuntu-latest-8-cores container: alpine:latest @@ -725,7 +725,7 @@ jobs: sudo apt-get install -y --allow-downgrades libstdc++6 sudo apt-get install --reinstall g++-8 - name: Set up base deps on musl - if: matrix.build == 'linux-musl-x64' + if: matrix.build == 'linux-musl' run: | apk add build-base bash musl-dev curl tar make libtool libffi-dev gcc automake autoconf git openssl-dev g++ - name: Set up dependencies for Mac OS @@ -850,7 +850,7 @@ jobs: target: x86_64-pc-windows-msvc # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/12.x/windows-amd64.tar.gz' llvm_choco_version: 13.0.0 - - build: linux-musl-x64 + - build: linux-musl target: x86_64-unknown-linux-musl os: ubuntu-latest-8-cores container: alpine:latest @@ -861,7 +861,7 @@ jobs: steps: - uses: actions/checkout@v3 - name: Set up base deps on musl - if: matrix.build == 'linux-musl-x64' + if: matrix.build == 'linux-musl' run: | apk add build-base bash musl-dev curl tar make libtool libffi-dev gcc automake autoconf git openssl-dev g++ - uses: actions/download-artifact@v3 @@ -875,7 +875,7 @@ jobs: sudo apt-get install -y --allow-downgrades libstdc++6 sudo apt-get install --reinstall g++-8 - name: Set up base deps on musl - if: matrix.build == 'linux-musl-x64' + if: matrix.build == 'linux-musl' run: | apk add build-base bash musl-dev curl tar make libtool libffi-dev gcc automake autoconf git openssl-dev g++ - name: Set up dependencies for Mac OS @@ -1003,7 +1003,7 @@ jobs: target: x86_64-pc-windows-msvc # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/12.x/windows-amd64.tar.gz' llvm_choco_version: 13.0.0 - - build: linux-musl-x64 + - build: linux-musl target: x86_64-unknown-linux-musl os: ubuntu-latest-8-cores container: alpine:latest @@ -1020,7 +1020,7 @@ jobs: sudo apt-get install -y --allow-downgrades libstdc++6 sudo apt-get install --reinstall g++-8 - name: Set up base deps on musl - if: matrix.build == 'linux-musl-x64' + if: matrix.build == 'linux-musl' run: | apk add build-base bash musl-dev curl tar make libtool libffi-dev gcc automake autoconf git openssl-dev g++ - name: Set up dependencies for Mac OS @@ -1145,7 +1145,7 @@ jobs: target: x86_64-pc-windows-msvc # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/12.x/windows-amd64.tar.gz' llvm_choco_version: 13.0.0 - - build: linux-musl-x64 + - build: linux-musl target: x86_64-unknown-linux-musl os: ubuntu-latest-8-cores container: alpine:latest @@ -1162,7 +1162,7 @@ jobs: sudo apt-get install -y --allow-downgrades libstdc++6 sudo apt-get install --reinstall g++-8 - name: Set up base deps on musl - if: matrix.build == 'linux-musl-x64' + if: matrix.build == 'linux-musl' run: | apk add build-base bash musl-dev curl tar make libtool libffi-dev gcc automake autoconf git openssl-dev g++ - name: Set up dependencies for Mac OS @@ -1287,7 +1287,7 @@ jobs: target: x86_64-pc-windows-msvc # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/12.x/windows-amd64.tar.gz' llvm_choco_version: 13.0.0 - - build: linux-musl-x64 + - build: linux-musl target: x86_64-unknown-linux-musl os: ubuntu-latest-8-cores container: alpine:latest @@ -1304,7 +1304,7 @@ jobs: sudo apt-get install -y --allow-downgrades libstdc++6 sudo apt-get install --reinstall g++-8 - name: Set up base deps on musl - if: matrix.build == 'linux-musl-x64' + if: matrix.build == 'linux-musl' run: | apk add build-base bash musl-dev curl tar make libtool libffi-dev gcc automake autoconf git openssl-dev g++ - name: Set up dependencies for Mac OS @@ -1429,7 +1429,7 @@ jobs: target: x86_64-pc-windows-msvc # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/12.x/windows-amd64.tar.gz' llvm_choco_version: 13.0.0 - - build: linux-musl-x64 + - build: linux-musl target: x86_64-unknown-linux-musl os: ubuntu-latest-8-cores container: alpine:latest @@ -1446,7 +1446,7 @@ jobs: sudo apt-get install -y --allow-downgrades libstdc++6 sudo apt-get install --reinstall g++-8 - name: Set up base deps on musl - if: matrix.build == 'linux-musl-x64' + if: matrix.build == 'linux-musl' run: | apk add build-base bash musl-dev curl tar make libtool libffi-dev gcc automake autoconf git openssl-dev g++ - name: Set up dependencies for Mac OS @@ -1571,7 +1571,7 @@ jobs: target: x86_64-pc-windows-msvc # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/12.x/windows-amd64.tar.gz' llvm_choco_version: 13.0.0 - - build: linux-musl-x64 + - build: linux-musl target: x86_64-unknown-linux-musl os: ubuntu-latest-8-cores container: alpine:latest @@ -1588,7 +1588,7 @@ jobs: sudo apt-get install -y --allow-downgrades libstdc++6 sudo apt-get install --reinstall g++-8 - name: Set up base deps on musl - if: matrix.build == 'linux-musl-x64' + if: matrix.build == 'linux-musl' run: | apk add build-base bash musl-dev curl tar make libtool libffi-dev gcc automake autoconf git openssl-dev g++ - name: Set up dependencies for Mac OS From 74d66ad7d966da20a11c67b1576bce3119a34e17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Wed, 30 Nov 2022 14:11:16 +0100 Subject: [PATCH 113/226] Run Wasmer Stage 0 on windows-2019 --- .github/workflows/test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index ce32b4c43e1..8275a2964fd 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -704,7 +704,7 @@ jobs: target: x86_64-apple-darwin llvm_url: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-apple-darwin.tar.xz' - build: windows-x64 - os: windows-latest-8-cores + os: windows-2019 target: x86_64-pc-windows-msvc # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/12.x/windows-amd64.tar.gz' llvm_choco_version: 13.0.0 From f91daef38f0c21fc7087fb5fb020d6677086fc68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Wed, 30 Nov 2022 14:31:26 +0100 Subject: [PATCH 114/226] Downgrade from -8-cores to see difference --- .github/workflows/test.yaml | 82 ++++++++++++++++++------------------- 1 file changed, 41 insertions(+), 41 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 8275a2964fd..68a14b1454e 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -17,7 +17,7 @@ jobs: setup: name: Set up - runs-on: ubuntu-latest-8-cores + runs-on: ubuntu-latest outputs: VERSION: ${{ steps.setup.outputs.VERSION }} DOING_RELEASE: ${{ steps.setup.outputs.DOING_RELEASE }} @@ -35,7 +35,7 @@ jobs: lint: name: Code lint - runs-on: ubuntu-latest-8-cores + runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - name: Install Rust @@ -67,14 +67,14 @@ jobs: cargo_deny: name: cargo-deny - runs-on: ubuntu-latest-8-cores + runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - uses: EmbarkStudios/cargo-deny-action@v1 test_nodejs: name: Test on NodeJS - runs-on: ubuntu-latest-8-cores + runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - name: Install Rust @@ -97,7 +97,7 @@ jobs: test_wasm_build: name: Test wasm build - runs-on: ubuntu-latest-8-cores + runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - run: | @@ -113,7 +113,7 @@ jobs: matrix: include: - build: linux-x64 - os: ubuntu-latest-8-cores + os: ubuntu-latest target: x86_64-unknown-linux-gnu llvm_url: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz' - build: macos-x64 @@ -124,13 +124,13 @@ jobs: os: macos-11.0 target: aarch64-apple-darwin - build: windows-x64 - os: windows-latest-8-cores + os: windows-latest target: x86_64-pc-windows-msvc # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/12.x/windows-amd64.tar.gz' llvm_choco_version: 13.0.0 - build: linux-musl target: x86_64-unknown-linux-musl - os: ubuntu-latest-8-cores + os: ubuntu-latest container: alpine:latest container: ${{ matrix.container }} env: @@ -219,7 +219,7 @@ jobs: build_wasmer_linux_aarch64: name: Build wasmer on linux aarch64 - runs-on: ubuntu-latest-8-cores + runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - uses: dtolnay/rust-toolchain@stable @@ -244,7 +244,7 @@ jobs: build_capi_linux_aarch64: name: Build C-API on linux aarch64 - runs-on: ubuntu-latest-8-cores + runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - uses: dtolnay/rust-toolchain@stable @@ -269,7 +269,7 @@ jobs: build_capi_windows_gnu: name: Windows GNU - runs-on: ubuntu-latest-8-cores + runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - name: Install Windows-GNU linker @@ -323,7 +323,7 @@ jobs: matrix: include: - build: linux-x64 - os: ubuntu-latest-8-cores + os: ubuntu-latest target: x86_64-unknown-linux-gnu llvm_url: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz' - build: macos-x64 @@ -334,13 +334,13 @@ jobs: os: macos-11.0 target: aarch64-apple-darwin - build: windows-x64 - os: windows-latest-8-cores + os: windows-latest target: x86_64-pc-windows-msvc # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/12.x/windows-amd64.tar.gz' llvm_choco_version: 13.0.0 - build: linux-musl target: x86_64-unknown-linux-musl - os: ubuntu-latest-8-cores + os: ubuntu-latest container: alpine:latest container: ${{ matrix.container }} env: @@ -476,7 +476,7 @@ jobs: matrix: include: - build: linux-x64 - os: ubuntu-latest-8-cores + os: ubuntu-latest target: x86_64-unknown-linux-gnu llvm_url: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz' - build: macos-x64 @@ -484,13 +484,13 @@ jobs: target: x86_64-apple-darwin llvm_url: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-apple-darwin.tar.xz' - build: windows-x64 - os: windows-latest-8-cores + os: windows-latest target: x86_64-pc-windows-msvc # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/12.x/windows-amd64.tar.gz' llvm_choco_version: 13.0.0 - build: linux-musl target: x86_64-unknown-linux-musl - os: ubuntu-latest-8-cores + os: ubuntu-latest container: alpine:latest container: ${{ matrix.container }} env: @@ -580,7 +580,7 @@ jobs: matrix: include: - build: linux-x64 - os: ubuntu-latest-8-cores + os: ubuntu-latest target: x86_64-unknown-linux-gnu llvm_url: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz' - build: macos-x64 @@ -588,13 +588,13 @@ jobs: target: x86_64-apple-darwin llvm_url: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-apple-darwin.tar.xz' - build: windows-x64 - os: windows-latest-8-cores + os: windows-latest target: x86_64-pc-windows-msvc # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/12.x/windows-amd64.tar.gz' llvm_choco_version: 13.0.0 - build: linux-musl target: x86_64-unknown-linux-musl - os: ubuntu-latest-8-cores + os: ubuntu-latest container: alpine:latest container: ${{ matrix.container }} env: @@ -676,7 +676,7 @@ jobs: run: | make untar-wasmer - name: Test integration CLI - if: matrix.os != 'windows-latest-8-cores' + if: matrix.os != 'windows-latest' shell: bash run: | export WASMER_DIR=`pwd`/package && make test-integration-cli @@ -696,7 +696,7 @@ jobs: matrix: include: - build: linux-x64 - os: ubuntu-latest-8-cores + os: ubuntu-latest target: x86_64-unknown-linux-gnu llvm_url: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz' - build: macos-x64 @@ -710,7 +710,7 @@ jobs: llvm_choco_version: 13.0.0 - build: linux-musl target: x86_64-unknown-linux-musl - os: ubuntu-latest-8-cores + os: ubuntu-latest container: alpine:latest container: ${{ matrix.container }} env: @@ -838,7 +838,7 @@ jobs: matrix: include: - build: linux-x64 - os: ubuntu-latest-8-cores + os: ubuntu-latest target: x86_64-unknown-linux-gnu llvm_url: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz' - build: macos-x64 @@ -846,13 +846,13 @@ jobs: target: x86_64-apple-darwin llvm_url: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-apple-darwin.tar.xz' - build: windows-x64 - os: windows-latest-8-cores + os: windows-latest target: x86_64-pc-windows-msvc # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/12.x/windows-amd64.tar.gz' llvm_choco_version: 13.0.0 - build: linux-musl target: x86_64-unknown-linux-musl - os: ubuntu-latest-8-cores + os: ubuntu-latest container: alpine:latest container: ${{ matrix.container }} env: @@ -991,7 +991,7 @@ jobs: matrix: include: - build: linux-x64 - os: ubuntu-latest-8-cores + os: ubuntu-latest target: x86_64-unknown-linux-gnu llvm_url: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz' - build: macos-x64 @@ -999,13 +999,13 @@ jobs: target: x86_64-apple-darwin llvm_url: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-apple-darwin.tar.xz' - build: windows-x64 - os: windows-latest-8-cores + os: windows-latest target: x86_64-pc-windows-msvc # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/12.x/windows-amd64.tar.gz' llvm_choco_version: 13.0.0 - build: linux-musl target: x86_64-unknown-linux-musl - os: ubuntu-latest-8-cores + os: ubuntu-latest container: alpine:latest container: ${{ matrix.container }} env: @@ -1133,7 +1133,7 @@ jobs: matrix: include: - build: linux-x64 - os: ubuntu-latest-8-cores + os: ubuntu-latest target: x86_64-unknown-linux-gnu llvm_url: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz' - build: macos-x64 @@ -1141,13 +1141,13 @@ jobs: target: x86_64-apple-darwin llvm_url: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-apple-darwin.tar.xz' - build: windows-x64 - os: windows-latest-8-cores + os: windows-latest target: x86_64-pc-windows-msvc # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/12.x/windows-amd64.tar.gz' llvm_choco_version: 13.0.0 - build: linux-musl target: x86_64-unknown-linux-musl - os: ubuntu-latest-8-cores + os: ubuntu-latest container: alpine:latest container: ${{ matrix.container }} env: @@ -1275,7 +1275,7 @@ jobs: matrix: include: - build: linux-x64 - os: ubuntu-latest-8-cores + os: ubuntu-latest target: x86_64-unknown-linux-gnu llvm_url: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz' - build: macos-x64 @@ -1283,13 +1283,13 @@ jobs: target: x86_64-apple-darwin llvm_url: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-apple-darwin.tar.xz' - build: windows-x64 - os: windows-latest-8-cores + os: windows-latest target: x86_64-pc-windows-msvc # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/12.x/windows-amd64.tar.gz' llvm_choco_version: 13.0.0 - build: linux-musl target: x86_64-unknown-linux-musl - os: ubuntu-latest-8-cores + os: ubuntu-latest container: alpine:latest container: ${{ matrix.container }} env: @@ -1417,7 +1417,7 @@ jobs: matrix: include: - build: linux-x64 - os: ubuntu-latest-8-cores + os: ubuntu-latest target: x86_64-unknown-linux-gnu llvm_url: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz' - build: macos-x64 @@ -1425,13 +1425,13 @@ jobs: target: x86_64-apple-darwin llvm_url: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-apple-darwin.tar.xz' - build: windows-x64 - os: windows-latest-8-cores + os: windows-latest target: x86_64-pc-windows-msvc # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/12.x/windows-amd64.tar.gz' llvm_choco_version: 13.0.0 - build: linux-musl target: x86_64-unknown-linux-musl - os: ubuntu-latest-8-cores + os: ubuntu-latest container: alpine:latest container: ${{ matrix.container }} env: @@ -1559,7 +1559,7 @@ jobs: matrix: include: - build: linux-x64 - os: ubuntu-latest-8-cores + os: ubuntu-latest target: x86_64-unknown-linux-gnu llvm_url: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz' - build: macos-x64 @@ -1567,13 +1567,13 @@ jobs: target: x86_64-apple-darwin llvm_url: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-apple-darwin.tar.xz' - build: windows-x64 - os: windows-latest-8-cores + os: windows-latest target: x86_64-pc-windows-msvc # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/12.x/windows-amd64.tar.gz' llvm_choco_version: 13.0.0 - build: linux-musl target: x86_64-unknown-linux-musl - os: ubuntu-latest-8-cores + os: ubuntu-latest container: alpine:latest container: ${{ matrix.container }} env: From acaffd8d5ccac5a22eca90cbebc52f1b72e715b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Thu, 1 Dec 2022 12:47:23 +0100 Subject: [PATCH 115/226] Test if sccache runs now --- .github/workflows/test.yaml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 68a14b1454e..3f0131a440e 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -424,7 +424,7 @@ jobs: fi shell: bash - name: Set sccache port - if: matrix.use_sccache && matrix.random_sccache_port && matrix.build != 'linux-musl' + if: matrix.build != 'linux-musl' run: | netstat -aln | awk ' $6 == "LISTEN" { @@ -528,7 +528,7 @@ jobs: fi shell: bash - name: Set sccache port - if: matrix.use_sccache && matrix.random_sccache_port && matrix.build != 'linux-musl' + if: matrix.build != 'linux-musl' run: | netstat -aln | awk ' $6 == "LISTEN" { @@ -640,7 +640,7 @@ jobs: fi shell: bash - name: Set sccache port - if: matrix.use_sccache && matrix.random_sccache_port && matrix.build != 'linux-musl' + if: matrix.build != 'linux-musl' run: | netstat -aln | awk ' $6 == "LISTEN" { @@ -794,7 +794,7 @@ jobs: fi shell: bash - name: Set sccache port - if: matrix.use_sccache && matrix.random_sccache_port && matrix.build != 'linux-musl' + if: matrix.build != 'linux-musl' run: | netstat -aln | awk ' $6 == "LISTEN" { @@ -943,7 +943,7 @@ jobs: fi shell: bash - name: Set sccache port - if: matrix.use_sccache && matrix.random_sccache_port && matrix.build != 'linux-musl' + if: matrix.build != 'linux-musl' run: | netstat -aln | awk ' $6 == "LISTEN" { @@ -1089,7 +1089,7 @@ jobs: fi shell: bash - name: Set sccache port - if: matrix.use_sccache && matrix.random_sccache_port && matrix.build != 'linux-musl' + if: matrix.build != 'linux-musl' run: | netstat -aln | awk ' $6 == "LISTEN" { @@ -1231,7 +1231,7 @@ jobs: fi shell: bash - name: Set sccache port - if: matrix.use_sccache && matrix.random_sccache_port && matrix.build != 'linux-musl' + if: matrix.build != 'linux-musl' run: | netstat -aln | awk ' $6 == "LISTEN" { @@ -1373,7 +1373,7 @@ jobs: fi shell: bash - name: Set sccache port - if: matrix.use_sccache && matrix.random_sccache_port && matrix.build != 'linux-musl' + if: matrix.build != 'linux-musl' run: | netstat -aln | awk ' $6 == "LISTEN" { @@ -1515,7 +1515,7 @@ jobs: fi shell: bash - name: Set sccache port - if: matrix.use_sccache && matrix.random_sccache_port && matrix.build != 'linux-musl' + if: matrix.build != 'linux-musl' run: | netstat -aln | awk ' $6 == "LISTEN" { @@ -1657,7 +1657,7 @@ jobs: fi shell: bash - name: Set sccache port - if: matrix.use_sccache && matrix.random_sccache_port && matrix.build != 'linux-musl' + if: matrix.build != 'linux-musl' run: | netstat -aln | awk ' $6 == "LISTEN" { From a602a45267f2af6cf82d1a19628869fa949db987 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Thu, 1 Dec 2022 12:50:59 +0100 Subject: [PATCH 116/226] Downgrade to ubuntu-18.04 to lock dependencies --- .github/workflows/test.yaml | 60 ++++++++++++++++++------------------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 3f0131a440e..8385a88ff8b 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -17,7 +17,7 @@ jobs: setup: name: Set up - runs-on: ubuntu-latest + runs-on: ubuntu-18.04 outputs: VERSION: ${{ steps.setup.outputs.VERSION }} DOING_RELEASE: ${{ steps.setup.outputs.DOING_RELEASE }} @@ -35,7 +35,7 @@ jobs: lint: name: Code lint - runs-on: ubuntu-latest + runs-on: ubuntu-18.04 steps: - uses: actions/checkout@v3 - name: Install Rust @@ -67,14 +67,14 @@ jobs: cargo_deny: name: cargo-deny - runs-on: ubuntu-latest + runs-on: ubuntu-18.04 steps: - uses: actions/checkout@v3 - uses: EmbarkStudios/cargo-deny-action@v1 test_nodejs: name: Test on NodeJS - runs-on: ubuntu-latest + runs-on: ubuntu-18.04 steps: - uses: actions/checkout@v3 - name: Install Rust @@ -97,7 +97,7 @@ jobs: test_wasm_build: name: Test wasm build - runs-on: ubuntu-latest + runs-on: ubuntu-18.04 steps: - uses: actions/checkout@v2 - run: | @@ -113,7 +113,7 @@ jobs: matrix: include: - build: linux-x64 - os: ubuntu-latest + os: ubuntu-18.04 target: x86_64-unknown-linux-gnu llvm_url: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz' - build: macos-x64 @@ -130,7 +130,7 @@ jobs: llvm_choco_version: 13.0.0 - build: linux-musl target: x86_64-unknown-linux-musl - os: ubuntu-latest + os: ubuntu-18.04 container: alpine:latest container: ${{ matrix.container }} env: @@ -219,7 +219,7 @@ jobs: build_wasmer_linux_aarch64: name: Build wasmer on linux aarch64 - runs-on: ubuntu-latest + runs-on: ubuntu-18.04 steps: - uses: actions/checkout@v2 - uses: dtolnay/rust-toolchain@stable @@ -244,7 +244,7 @@ jobs: build_capi_linux_aarch64: name: Build C-API on linux aarch64 - runs-on: ubuntu-latest + runs-on: ubuntu-18.04 steps: - uses: actions/checkout@v2 - uses: dtolnay/rust-toolchain@stable @@ -269,7 +269,7 @@ jobs: build_capi_windows_gnu: name: Windows GNU - runs-on: ubuntu-latest + runs-on: ubuntu-18.04 steps: - uses: actions/checkout@v2 - name: Install Windows-GNU linker @@ -323,7 +323,7 @@ jobs: matrix: include: - build: linux-x64 - os: ubuntu-latest + os: ubuntu-18.04 target: x86_64-unknown-linux-gnu llvm_url: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz' - build: macos-x64 @@ -340,7 +340,7 @@ jobs: llvm_choco_version: 13.0.0 - build: linux-musl target: x86_64-unknown-linux-musl - os: ubuntu-latest + os: ubuntu-18.04 container: alpine:latest container: ${{ matrix.container }} env: @@ -476,7 +476,7 @@ jobs: matrix: include: - build: linux-x64 - os: ubuntu-latest + os: ubuntu-18.04 target: x86_64-unknown-linux-gnu llvm_url: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz' - build: macos-x64 @@ -490,7 +490,7 @@ jobs: llvm_choco_version: 13.0.0 - build: linux-musl target: x86_64-unknown-linux-musl - os: ubuntu-latest + os: ubuntu-18.04 container: alpine:latest container: ${{ matrix.container }} env: @@ -580,7 +580,7 @@ jobs: matrix: include: - build: linux-x64 - os: ubuntu-latest + os: ubuntu-18.04 target: x86_64-unknown-linux-gnu llvm_url: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz' - build: macos-x64 @@ -594,7 +594,7 @@ jobs: llvm_choco_version: 13.0.0 - build: linux-musl target: x86_64-unknown-linux-musl - os: ubuntu-latest + os: ubuntu-18.04 container: alpine:latest container: ${{ matrix.container }} env: @@ -696,7 +696,7 @@ jobs: matrix: include: - build: linux-x64 - os: ubuntu-latest + os: ubuntu-18.04 target: x86_64-unknown-linux-gnu llvm_url: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz' - build: macos-x64 @@ -710,7 +710,7 @@ jobs: llvm_choco_version: 13.0.0 - build: linux-musl target: x86_64-unknown-linux-musl - os: ubuntu-latest + os: ubuntu-18.04 container: alpine:latest container: ${{ matrix.container }} env: @@ -838,7 +838,7 @@ jobs: matrix: include: - build: linux-x64 - os: ubuntu-latest + os: ubuntu-18.04 target: x86_64-unknown-linux-gnu llvm_url: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz' - build: macos-x64 @@ -852,7 +852,7 @@ jobs: llvm_choco_version: 13.0.0 - build: linux-musl target: x86_64-unknown-linux-musl - os: ubuntu-latest + os: ubuntu-18.04 container: alpine:latest container: ${{ matrix.container }} env: @@ -991,7 +991,7 @@ jobs: matrix: include: - build: linux-x64 - os: ubuntu-latest + os: ubuntu-18.04 target: x86_64-unknown-linux-gnu llvm_url: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz' - build: macos-x64 @@ -1005,7 +1005,7 @@ jobs: llvm_choco_version: 13.0.0 - build: linux-musl target: x86_64-unknown-linux-musl - os: ubuntu-latest + os: ubuntu-18.04 container: alpine:latest container: ${{ matrix.container }} env: @@ -1133,7 +1133,7 @@ jobs: matrix: include: - build: linux-x64 - os: ubuntu-latest + os: ubuntu-18.04 target: x86_64-unknown-linux-gnu llvm_url: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz' - build: macos-x64 @@ -1147,7 +1147,7 @@ jobs: llvm_choco_version: 13.0.0 - build: linux-musl target: x86_64-unknown-linux-musl - os: ubuntu-latest + os: ubuntu-18.04 container: alpine:latest container: ${{ matrix.container }} env: @@ -1275,7 +1275,7 @@ jobs: matrix: include: - build: linux-x64 - os: ubuntu-latest + os: ubuntu-18.04 target: x86_64-unknown-linux-gnu llvm_url: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz' - build: macos-x64 @@ -1289,7 +1289,7 @@ jobs: llvm_choco_version: 13.0.0 - build: linux-musl target: x86_64-unknown-linux-musl - os: ubuntu-latest + os: ubuntu-18.04 container: alpine:latest container: ${{ matrix.container }} env: @@ -1417,7 +1417,7 @@ jobs: matrix: include: - build: linux-x64 - os: ubuntu-latest + os: ubuntu-18.04 target: x86_64-unknown-linux-gnu llvm_url: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz' - build: macos-x64 @@ -1431,7 +1431,7 @@ jobs: llvm_choco_version: 13.0.0 - build: linux-musl target: x86_64-unknown-linux-musl - os: ubuntu-latest + os: ubuntu-18.04 container: alpine:latest container: ${{ matrix.container }} env: @@ -1559,7 +1559,7 @@ jobs: matrix: include: - build: linux-x64 - os: ubuntu-latest + os: ubuntu-18.04 target: x86_64-unknown-linux-gnu llvm_url: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz' - build: macos-x64 @@ -1573,7 +1573,7 @@ jobs: llvm_choco_version: 13.0.0 - build: linux-musl target: x86_64-unknown-linux-musl - os: ubuntu-latest + os: ubuntu-18.04 container: alpine:latest container: ${{ matrix.container }} env: From a2052f789331a9fd15e018226b2cb33b1573e9f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Wed, 7 Dec 2022 15:04:42 +0100 Subject: [PATCH 117/226] Remove sccache again --- .github/workflows/test.yaml | 352 +----------------------------------- 1 file changed, 1 insertion(+), 351 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 8385a88ff8b..43efbb84a6c 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -416,41 +416,6 @@ jobs: with: path: ${{ runner.tool_cache }}/cargo-sccache key: ${{ matrix.build }}-${{ matrix.target }}-sccache-bin-${{ env.CARGO_SCCACHE_VERSION }}-v1 - - name: Install sccache - if: matrix.build != 'linux-musl' - run: | - if [ ! -f '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' ]; then - cargo install sccache --no-default-features --features=dist-client,azure --version 0.2.15 --root '${{ runner.tool_cache }}/cargo-sccache' - fi - shell: bash - - name: Set sccache port - if: matrix.build != 'linux-musl' - run: | - netstat -aln | awk ' - $6 == "LISTEN" { - if ($4 ~ "[.:][0-9]+$") { - n = split($4, a, /[:.]/); - port = a[n]; - p[port] = 1 - } - } - END { - for (i = 3000; i < 65000 && p[i]; i++){}; - if (i == 65000) {exit 1}; - print "SCCACHE_SERVER_PORT=" i - } - ' >> $GITHUB_ENV - # echo "SCCACHE_SERVER_PORT=9000" - echo "Setting random sccache port to: $SCCACHE_SERVER_PORT" - shell: bash - - name: Start sccache - if: matrix.build != 'linux-musl' - run: | - chmod +x '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' - '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' --start-server - '${{ 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 shell: bash run: | @@ -520,41 +485,6 @@ jobs: with: path: ${{ runner.tool_cache }}/cargo-sccache key: ${{ matrix.build }}-${{ matrix.target }}-sccache-bin-${{ env.CARGO_SCCACHE_VERSION }}-v1 - - name: Install sccache - if: matrix.build != 'linux-musl' - run: | - if [ ! -f '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' ]; then - cargo install sccache --no-default-features --features=dist-client,azure --version 0.2.15 --root '${{ runner.tool_cache }}/cargo-sccache' - fi - shell: bash - - name: Set sccache port - if: matrix.build != 'linux-musl' - run: | - netstat -aln | awk ' - $6 == "LISTEN" { - if ($4 ~ "[.:][0-9]+$") { - n = split($4, a, /[:.]/); - port = a[n]; - p[port] = 1 - } - } - END { - for (i = 3000; i < 65000 && p[i]; i++){}; - if (i == 65000) {exit 1}; - print "SCCACHE_SERVER_PORT=" i - } - ' >> $GITHUB_ENV - # echo "SCCACHE_SERVER_PORT=9000" - echo "Setting random sccache port to: $SCCACHE_SERVER_PORT" - shell: bash - - name: Start sccache - if: matrix.build != 'linux-musl' - run: | - chmod +x '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' - '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' --start-server - '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' -s - echo 'RUSTC_WRAPPER=${{ runner.tool_cache }}/cargo-sccache/bin/sccache' >> $GITHUB_ENV - shell: bash - name: 'Echo download path' run: echo ${{steps.download.outputs.download-path}} - name: Unzip Artifacts @@ -632,41 +562,6 @@ jobs: with: path: ${{ runner.tool_cache }}/cargo-sccache key: ${{ matrix.build }}-${{ matrix.target }}-sccache-bin-${{ env.CARGO_SCCACHE_VERSION }}-v1 - - name: Install sccache - if: matrix.build != 'linux-musl' - run: | - if [ ! -f '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' ]; then - cargo install sccache --no-default-features --features=dist-client,azure --version 0.2.15 --root '${{ runner.tool_cache }}/cargo-sccache' - fi - shell: bash - - name: Set sccache port - if: matrix.build != 'linux-musl' - run: | - netstat -aln | awk ' - $6 == "LISTEN" { - if ($4 ~ "[.:][0-9]+$") { - n = split($4, a, /[:.]/); - port = a[n]; - p[port] = 1 - } - } - END { - for (i = 3000; i < 65000 && p[i]; i++){}; - if (i == 65000) {exit 1}; - print "SCCACHE_SERVER_PORT=" i - } - ' >> $GITHUB_ENV - # echo "SCCACHE_SERVER_PORT=9000" - echo "Setting random sccache port to: $SCCACHE_SERVER_PORT" - shell: bash - - name: Start sccache - if: matrix.build != 'linux-musl' - run: | - chmod +x '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' - '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' --start-server - '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' -s - echo 'RUSTC_WRAPPER=${{ runner.tool_cache }}/cargo-sccache/bin/sccache' >> $GITHUB_ENV - shell: bash - name: Unzip Artifacts shell: bash run: | @@ -786,41 +681,6 @@ jobs: with: path: ${{ runner.tool_cache }}/cargo-sccache key: ${{ matrix.build }}-${{ matrix.target }}-sccache-bin-${{ env.CARGO_SCCACHE_VERSION }}-v1 - - name: Install sccache - if: matrix.build != 'linux-musl' - run: | - if [ ! -f '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' ]; then - cargo install sccache --no-default-features --features=dist-client,azure --version 0.2.15 --root '${{ runner.tool_cache }}/cargo-sccache' - fi - shell: bash - - name: Set sccache port - if: matrix.build != 'linux-musl' - run: | - netstat -aln | awk ' - $6 == "LISTEN" { - if ($4 ~ "[.:][0-9]+$") { - n = split($4, a, /[:.]/); - port = a[n]; - p[port] = 1 - } - } - END { - for (i = 3000; i < 65000 && p[i]; i++){}; - if (i == 65000) {exit 1}; - print "SCCACHE_SERVER_PORT=" i - } - ' >> $GITHUB_ENV - # echo "SCCACHE_SERVER_PORT=9000" - echo "Setting random sccache port to: $SCCACHE_SERVER_PORT" - shell: bash - - name: Start sccache - if: matrix.build != 'linux-musl' - run: | - chmod +x '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' - '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' --start-server - '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' -s - echo 'RUSTC_WRAPPER=${{ runner.tool_cache }}/cargo-sccache/bin/sccache' >> $GITHUB_ENV - shell: bash - name: Test run: | make test-stage-0 @@ -935,41 +795,6 @@ jobs: with: path: ${{ runner.tool_cache }}/cargo-sccache key: ${{ matrix.build }}-${{ matrix.target }}-sccache-bin-${{ env.CARGO_SCCACHE_VERSION }}-v1 - - name: Install sccache - if: matrix.build != 'linux-musl' - run: | - if [ ! -f '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' ]; then - cargo install sccache --no-default-features --features=dist-client,azure --version 0.2.15 --root '${{ runner.tool_cache }}/cargo-sccache' - fi - shell: bash - - name: Set sccache port - if: matrix.build != 'linux-musl' - run: | - netstat -aln | awk ' - $6 == "LISTEN" { - if ($4 ~ "[.:][0-9]+$") { - n = split($4, a, /[:.]/); - port = a[n]; - p[port] = 1 - } - } - END { - for (i = 3000; i < 65000 && p[i]; i++){}; - if (i == 65000) {exit 1}; - print "SCCACHE_SERVER_PORT=" i - } - ' >> $GITHUB_ENV - # echo "SCCACHE_SERVER_PORT=9000" - echo "Setting random sccache port to: $SCCACHE_SERVER_PORT" - shell: bash - - name: Start sccache - if: matrix.build != 'linux-musl' - run: | - chmod +x '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' - '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' --start-server - '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' -s - echo 'RUSTC_WRAPPER=${{ runner.tool_cache }}/cargo-sccache/bin/sccache' >> $GITHUB_ENV - shell: bash - name: Unzip Artifacts shell: bash run: | @@ -1081,42 +906,7 @@ jobs: with: path: ${{ runner.tool_cache }}/cargo-sccache key: ${{ matrix.build }}-${{ matrix.target }}-sccache-bin-${{ env.CARGO_SCCACHE_VERSION }}-v1 - - name: Install sccache - if: matrix.build != 'linux-musl' - run: | - if [ ! -f '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' ]; then - cargo install sccache --no-default-features --features=dist-client,azure --version 0.2.15 --root '${{ runner.tool_cache }}/cargo-sccache' - fi - shell: bash - - name: Set sccache port - if: matrix.build != 'linux-musl' - run: | - netstat -aln | awk ' - $6 == "LISTEN" { - if ($4 ~ "[.:][0-9]+$") { - n = split($4, a, /[:.]/); - port = a[n]; - p[port] = 1 - } - } - END { - for (i = 3000; i < 65000 && p[i]; i++){}; - if (i == 65000) {exit 1}; - print "SCCACHE_SERVER_PORT=" i - } - ' >> $GITHUB_ENV - # echo "SCCACHE_SERVER_PORT=9000" - echo "Setting random sccache port to: $SCCACHE_SERVER_PORT" - shell: bash - - name: Start sccache - if: matrix.build != 'linux-musl' - run: | - chmod +x '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' - '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' --start-server - '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' -s - echo 'RUSTC_WRAPPER=${{ runner.tool_cache }}/cargo-sccache/bin/sccache' >> $GITHUB_ENV - shell: bash - - name: Test + - name: Test run: | make test-stage-2 env: @@ -1223,41 +1013,6 @@ jobs: with: path: ${{ runner.tool_cache }}/cargo-sccache key: ${{ matrix.build }}-${{ matrix.target }}-sccache-bin-${{ env.CARGO_SCCACHE_VERSION }}-v1 - - name: Install sccache - if: matrix.build != 'linux-musl' - run: | - if [ ! -f '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' ]; then - cargo install sccache --no-default-features --features=dist-client,azure --version 0.2.15 --root '${{ runner.tool_cache }}/cargo-sccache' - fi - shell: bash - - name: Set sccache port - if: matrix.build != 'linux-musl' - run: | - netstat -aln | awk ' - $6 == "LISTEN" { - if ($4 ~ "[.:][0-9]+$") { - n = split($4, a, /[:.]/); - port = a[n]; - p[port] = 1 - } - } - END { - for (i = 3000; i < 65000 && p[i]; i++){}; - if (i == 65000) {exit 1}; - print "SCCACHE_SERVER_PORT=" i - } - ' >> $GITHUB_ENV - # echo "SCCACHE_SERVER_PORT=9000" - echo "Setting random sccache port to: $SCCACHE_SERVER_PORT" - shell: bash - - name: Start sccache - if: matrix.build != 'linux-musl' - run: | - chmod +x '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' - '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' --start-server - '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' -s - echo 'RUSTC_WRAPPER=${{ runner.tool_cache }}/cargo-sccache/bin/sccache' >> $GITHUB_ENV - shell: bash - name: Test run: | make test-stage-3 @@ -1365,41 +1120,6 @@ jobs: with: path: ${{ runner.tool_cache }}/cargo-sccache key: ${{ matrix.build }}-${{ matrix.target }}-sccache-bin-${{ env.CARGO_SCCACHE_VERSION }}-v1 - - name: Install sccache - if: matrix.build != 'linux-musl' - run: | - if [ ! -f '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' ]; then - cargo install sccache --no-default-features --features=dist-client,azure --version 0.2.15 --root '${{ runner.tool_cache }}/cargo-sccache' - fi - shell: bash - - name: Set sccache port - if: matrix.build != 'linux-musl' - run: | - netstat -aln | awk ' - $6 == "LISTEN" { - if ($4 ~ "[.:][0-9]+$") { - n = split($4, a, /[:.]/); - port = a[n]; - p[port] = 1 - } - } - END { - for (i = 3000; i < 65000 && p[i]; i++){}; - if (i == 65000) {exit 1}; - print "SCCACHE_SERVER_PORT=" i - } - ' >> $GITHUB_ENV - # echo "SCCACHE_SERVER_PORT=9000" - echo "Setting random sccache port to: $SCCACHE_SERVER_PORT" - shell: bash - - name: Start sccache - if: matrix.build != 'linux-musl' - run: | - chmod +x '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' - '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' --start-server - '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' -s - echo 'RUSTC_WRAPPER=${{ runner.tool_cache }}/cargo-sccache/bin/sccache' >> $GITHUB_ENV - shell: bash - name: Test run: | make test-stage-4 @@ -1507,41 +1227,6 @@ jobs: with: path: ${{ runner.tool_cache }}/cargo-sccache key: ${{ matrix.build }}-${{ matrix.target }}-sccache-bin-${{ env.CARGO_SCCACHE_VERSION }}-v1 - - name: Install sccache - if: matrix.build != 'linux-musl' - run: | - if [ ! -f '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' ]; then - cargo install sccache --no-default-features --features=dist-client,azure --version 0.2.15 --root '${{ runner.tool_cache }}/cargo-sccache' - fi - shell: bash - - name: Set sccache port - if: matrix.build != 'linux-musl' - run: | - netstat -aln | awk ' - $6 == "LISTEN" { - if ($4 ~ "[.:][0-9]+$") { - n = split($4, a, /[:.]/); - port = a[n]; - p[port] = 1 - } - } - END { - for (i = 3000; i < 65000 && p[i]; i++){}; - if (i == 65000) {exit 1}; - print "SCCACHE_SERVER_PORT=" i - } - ' >> $GITHUB_ENV - # echo "SCCACHE_SERVER_PORT=9000" - echo "Setting random sccache port to: $SCCACHE_SERVER_PORT" - shell: bash - - name: Start sccache - if: matrix.build != 'linux-musl' - run: | - chmod +x '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' - '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' --start-server - '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' -s - echo 'RUSTC_WRAPPER=${{ runner.tool_cache }}/cargo-sccache/bin/sccache' >> $GITHUB_ENV - shell: bash - name: Test run: | make test-stage-5 @@ -1649,41 +1334,6 @@ jobs: with: path: ${{ runner.tool_cache }}/cargo-sccache key: ${{ matrix.build }}-${{ matrix.target }}-sccache-bin-${{ env.CARGO_SCCACHE_VERSION }}-v1 - - name: Install sccache - if: matrix.build != 'linux-musl' - run: | - if [ ! -f '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' ]; then - cargo install sccache --no-default-features --features=dist-client,azure --version 0.2.15 --root '${{ runner.tool_cache }}/cargo-sccache' - fi - shell: bash - - name: Set sccache port - if: matrix.build != 'linux-musl' - run: | - netstat -aln | awk ' - $6 == "LISTEN" { - if ($4 ~ "[.:][0-9]+$") { - n = split($4, a, /[:.]/); - port = a[n]; - p[port] = 1 - } - } - END { - for (i = 3000; i < 65000 && p[i]; i++){}; - if (i == 65000) {exit 1}; - print "SCCACHE_SERVER_PORT=" i - } - ' >> $GITHUB_ENV - # echo "SCCACHE_SERVER_PORT=9000" - echo "Setting random sccache port to: $SCCACHE_SERVER_PORT" - shell: bash - - name: Start sccache - if: matrix.build != 'linux-musl' - run: | - chmod +x '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' - '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' --start-server - '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' -s - echo 'RUSTC_WRAPPER=${{ runner.tool_cache }}/cargo-sccache/bin/sccache' >> $GITHUB_ENV - shell: bash - name: Test run: | make test-stage-6 From 56ba74cbb29e2568052be23f58297e7053f30e5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Wed, 7 Dec 2022 15:35:40 +0100 Subject: [PATCH 118/226] Add action-s3-cache to make test-stage-4 --- .github/workflows/test.yaml | 62 +++++++++++++------------------------ Makefile | 6 ++-- 2 files changed, 25 insertions(+), 43 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 43efbb84a6c..041b79c30b0 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -412,10 +412,6 @@ jobs: cache-on-failure: false shared-key: wasmer-${{ matrix.build }} save-if: false - - uses: actions/cache@v2 - with: - path: ${{ runner.tool_cache }}/cargo-sccache - key: ${{ matrix.build }}-${{ matrix.target }}-sccache-bin-${{ env.CARGO_SCCACHE_VERSION }}-v1 - name: Build C-API shell: bash run: | @@ -481,10 +477,6 @@ jobs: cache-on-failure: false shared-key: wasmer-${{ matrix.build }} save-if: false - - uses: actions/cache@v2 - with: - path: ${{ runner.tool_cache }}/cargo-sccache - key: ${{ matrix.build }}-${{ matrix.target }}-sccache-bin-${{ env.CARGO_SCCACHE_VERSION }}-v1 - name: 'Echo download path' run: echo ${{steps.download.outputs.download-path}} - name: Unzip Artifacts @@ -558,10 +550,6 @@ jobs: cache-on-failure: false shared-key: wasmer-${{ matrix.build }} save-if: false - - uses: actions/cache@v2 - with: - path: ${{ runner.tool_cache }}/cargo-sccache - key: ${{ matrix.build }}-${{ matrix.target }}-sccache-bin-${{ env.CARGO_SCCACHE_VERSION }}-v1 - name: Unzip Artifacts shell: bash run: | @@ -677,10 +665,6 @@ jobs: cache-on-failure: false shared-key: wasmer-${{ matrix.build }} save-if: false - - uses: actions/cache@v2 - with: - path: ${{ runner.tool_cache }}/cargo-sccache - key: ${{ matrix.build }}-${{ matrix.target }}-sccache-bin-${{ env.CARGO_SCCACHE_VERSION }}-v1 - name: Test run: | make test-stage-0 @@ -791,10 +775,6 @@ jobs: with: cache-on-failure: true shared-key: wasmer-stage-1-${{ matrix.build }} - - uses: actions/cache@v2 - with: - path: ${{ runner.tool_cache }}/cargo-sccache - key: ${{ matrix.build }}-${{ matrix.target }}-sccache-bin-${{ env.CARGO_SCCACHE_VERSION }}-v1 - name: Unzip Artifacts shell: bash run: | @@ -902,10 +882,6 @@ jobs: cache-on-failure: false shared-key: wasmer-${{ matrix.build }} save-if: false - - uses: actions/cache@v2 - with: - path: ${{ runner.tool_cache }}/cargo-sccache - key: ${{ matrix.build }}-${{ matrix.target }}-sccache-bin-${{ env.CARGO_SCCACHE_VERSION }}-v1 - name: Test run: | make test-stage-2 @@ -1009,10 +985,6 @@ jobs: cache-on-failure: false shared-key: wasmer-${{ matrix.build }} save-if: false - - uses: actions/cache@v2 - with: - path: ${{ runner.tool_cache }}/cargo-sccache - key: ${{ matrix.build }}-${{ matrix.target }}-sccache-bin-${{ env.CARGO_SCCACHE_VERSION }}-v1 - name: Test run: | make test-stage-3 @@ -1111,15 +1083,15 @@ jobs: target = "${{ matrix.target }}" EOF if: matrix.target - - uses: Swatinem/rust-cache@v2 - with: - cache-on-failure: false - shared-key: wasmer-${{ matrix.build }} - save-if: false - - uses: actions/cache@v2 + - name: Retrieve cache + uses: nipeharefa/action-s3-cache@3a78206 with: - path: ${{ runner.tool_cache }}/cargo-sccache - key: ${{ matrix.build }}-${{ matrix.target }}-sccache-bin-${{ env.CARGO_SCCACHE_VERSION }}-v1 + action: get + aws-access-key-id: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_TOKEN }} + aws-secret-access-key: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_KEY }} + bucket: wasmer-rust-artifacts-cache + key: wasmer-test-stage-4-${{ matrix.build }} + endpoint: https://1541b1e8a3fc6ad155ce67ef38899700.r2.cloudflarestorage.com - name: Test run: | make test-stage-4 @@ -1127,6 +1099,20 @@ jobs: TARGET: ${{ matrix.target }} TARGET_DIR: target/${{ matrix.target }}/release CARGO_TARGET: --target ${{ matrix.target }} + - name: Upload cache + uses: nipeharefa/action-s3-cache@3a78206 + with: + with: + action: put + aws-access-key-id: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_TOKEN }} + aws-secret-access-key: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_KEY }} + bucket: wasmer-rust-artifacts-cache + s3-class: STANDARD_IA + key: wasmer-test-stage-4-${{ matrix.build }} + artifacts: | + ~/.cargo/* + ./target/* + endpoint: https://1541b1e8a3fc6ad155ce67ef38899700.r2.cloudflarestorage.com test_wasmer_stage_5: name: Test Wasmer Stage 5 on ${{ matrix.build }} @@ -1330,10 +1316,6 @@ jobs: cache-on-failure: false shared-key: wasmer-${{ matrix.build }} save-if: false - - uses: actions/cache@v2 - with: - path: ${{ runner.tool_cache }}/cargo-sccache - key: ${{ matrix.build }}-${{ matrix.target }}-sccache-bin-${{ env.CARGO_SCCACHE_VERSION }}-v1 - name: Test run: | make test-stage-6 diff --git a/Makefile b/Makefile index 8edf301dc8d..075a17e3996 100644 --- a/Makefile +++ b/Makefile @@ -367,7 +367,7 @@ check-capi: capi-setup --no-default-features --features wat,compiler,wasi,middlewares $(capi_compiler_features) build-wasmer: - $(CARGO_BINARY) build $(CARGO_TARGET) --release --manifest-path lib/cli/Cargo.toml $(compiler_features) --features="webc_runner" --bin wasmer + $(CARGO_BINARY) build $(CARGO_TARGET) --release --manifest-path lib/cli/Cargo.toml --features singlepass,cranelift --features="webc_runner" --bin wasmer build-wasmer-debug: $(CARGO_BINARY) build $(CARGO_TARGET) --manifest-path lib/cli/Cargo.toml $(compiler_features) --features "webc_runner,debug" --bin wasmer @@ -836,8 +836,8 @@ update-testsuite: lint-packages: RUSTFLAGS += -D dead-code -D nonstandard-style -D unused-imports -D unused-mut -D unused-variables -D unused-unsafe -D unreachable-patterns -D bad-style -D improper-ctypes -D unused-allocation -D unused-comparisons -D while-true -D unconditional-recursion -D bare-trait-objects -D function_item_references # TODO: add `-D missing-docs` lint-packages: RUSTFLAGS="${RUSTFLAGS}" cargo clippy --all --exclude wasmer-cli -- -D clippy::all - RUSTFLAGS="${RUSTFLAGS}" cargo clippy --manifest-path lib/cli/Cargo.toml $(compiler_features) -- -D clippy::all - RUSTFLAGS="${RUSTFLAGS}" cargo clippy --manifest-path fuzz/Cargo.toml $(compiler_features) -- -D clippy::all + RUSTFLAGS="${RUSTFLAGS}" cargo clippy --manifest-path lib/cli/Cargo.toml --features cranelift,singlepass -- -D clippy::all + RUSTFLAGS="${RUSTFLAGS}" cargo clippy --manifest-path fuzz/Cargo.toml --features cranelift,singlepass -- -D clippy::all lint-formatting: cargo fmt --all -- --check From 5bb3fc789603323231279ea0eacf04f5b5e7c66e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Fri, 9 Dec 2022 15:02:12 +0100 Subject: [PATCH 119/226] Fix syntax error --- .github/workflows/test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 041b79c30b0..b6d3873f1b4 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -882,7 +882,7 @@ jobs: cache-on-failure: false shared-key: wasmer-${{ matrix.build }} save-if: false - - name: Test + - name: Test run: | make test-stage-2 env: From 09aea088f007dd30d4f029740d1978c1136dd1e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Fri, 9 Dec 2022 15:04:38 +0100 Subject: [PATCH 120/226] Fix indentation error --- .github/workflows/test.yaml | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index b6d3873f1b4..0ba84b4157c 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -1102,17 +1102,16 @@ jobs: - name: Upload cache uses: nipeharefa/action-s3-cache@3a78206 with: - with: - action: put - aws-access-key-id: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_TOKEN }} - aws-secret-access-key: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_KEY }} - bucket: wasmer-rust-artifacts-cache - s3-class: STANDARD_IA - key: wasmer-test-stage-4-${{ matrix.build }} - artifacts: | - ~/.cargo/* - ./target/* - endpoint: https://1541b1e8a3fc6ad155ce67ef38899700.r2.cloudflarestorage.com + action: put + aws-access-key-id: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_TOKEN }} + aws-secret-access-key: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_KEY }} + bucket: wasmer-rust-artifacts-cache + s3-class: STANDARD_IA + key: wasmer-test-stage-4-${{ matrix.build }} + artifacts: | + ~/.cargo/* + ./target/* + endpoint: https://1541b1e8a3fc6ad155ce67ef38899700.r2.cloudflarestorage.com test_wasmer_stage_5: name: Test Wasmer Stage 5 on ${{ matrix.build }} From 6ab2446dba3c93389e1c9a5fba51a01d781c87e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Fri, 9 Dec 2022 15:05:20 +0100 Subject: [PATCH 121/226] Fix indentation error again --- .github/workflows/test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 0ba84b4157c..5ffbaa02aac 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -1111,7 +1111,7 @@ jobs: artifacts: | ~/.cargo/* ./target/* - endpoint: https://1541b1e8a3fc6ad155ce67ef38899700.r2.cloudflarestorage.com + endpoint: https://1541b1e8a3fc6ad155ce67ef38899700.r2.cloudflarestorage.com test_wasmer_stage_5: name: Test Wasmer Stage 5 on ${{ matrix.build }} From 3447893fc245d8efb8f00aceaa73656b32672616 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Fri, 9 Dec 2022 15:09:21 +0100 Subject: [PATCH 122/226] Add caching to all test stages --- .github/workflows/test.yaml | 153 +++++++++++++++++++++++++++++------- 1 file changed, 126 insertions(+), 27 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 5ffbaa02aac..cba65337fd3 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -660,11 +660,15 @@ jobs: target = "${{ matrix.target }}" EOF if: matrix.target - - uses: Swatinem/rust-cache@v2 + - name: Retrieve cache + uses: nipeharefa/action-s3-cache@3a78206 with: - cache-on-failure: false - shared-key: wasmer-${{ matrix.build }} - save-if: false + action: get + aws-access-key-id: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_TOKEN }} + aws-secret-access-key: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_KEY }} + bucket: wasmer-rust-artifacts-cache + key: wasmer-test-stage-0-${{ matrix.build }} + endpoint: https://1541b1e8a3fc6ad155ce67ef38899700.r2.cloudflarestorage.com - name: Test run: | make test-stage-0 @@ -672,6 +676,19 @@ jobs: TARGET: ${{ matrix.target }} TARGET_DIR: target/${{ matrix.target }}/release CARGO_TARGET: --target ${{ matrix.target }} + - name: Upload cache + uses: nipeharefa/action-s3-cache@3a78206 + with: + action: put + aws-access-key-id: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_TOKEN }} + aws-secret-access-key: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_KEY }} + bucket: wasmer-rust-artifacts-cache + s3-class: STANDARD_IA + key: wasmer-test-stage-0-${{ matrix.build }} + artifacts: | + ~/.cargo/* + ./target/* + endpoint: https://1541b1e8a3fc6ad155ce67ef38899700.r2.cloudflarestorage.com test_wasmer_stage_1: name: Test Wasmer Stage 1 on ${{ matrix.build }} @@ -771,10 +788,15 @@ jobs: target = "${{ matrix.target }}" EOF if: matrix.target - - uses: Swatinem/rust-cache@v2 + - name: Retrieve cache + uses: nipeharefa/action-s3-cache@3a78206 with: - cache-on-failure: true - shared-key: wasmer-stage-1-${{ matrix.build }} + action: get + aws-access-key-id: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_TOKEN }} + aws-secret-access-key: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_KEY }} + bucket: wasmer-rust-artifacts-cache + key: wasmer-test-stage-1-${{ matrix.build }} + endpoint: https://1541b1e8a3fc6ad155ce67ef38899700.r2.cloudflarestorage.com - name: Unzip Artifacts shell: bash run: | @@ -786,6 +808,19 @@ jobs: TARGET: ${{ matrix.target }} TARGET_DIR: target/${{ matrix.target }}/release CARGO_TARGET: --target ${{ matrix.target }} + - name: Upload cache + uses: nipeharefa/action-s3-cache@3a78206 + with: + action: put + aws-access-key-id: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_TOKEN }} + aws-secret-access-key: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_KEY }} + bucket: wasmer-rust-artifacts-cache + s3-class: STANDARD_IA + key: wasmer-test-stage-1-${{ matrix.build }} + artifacts: | + ~/.cargo/* + ./target/* + endpoint: https://1541b1e8a3fc6ad155ce67ef38899700.r2.cloudflarestorage.com test_wasmer_stage_2: name: Test Wasmer Stage 2 on ${{ matrix.build }} @@ -877,11 +912,15 @@ jobs: target = "${{ matrix.target }}" EOF if: matrix.target - - uses: Swatinem/rust-cache@v2 + - name: Retrieve cache + uses: nipeharefa/action-s3-cache@3a78206 with: - cache-on-failure: false - shared-key: wasmer-${{ matrix.build }} - save-if: false + action: get + aws-access-key-id: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_TOKEN }} + aws-secret-access-key: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_KEY }} + bucket: wasmer-rust-artifacts-cache + key: wasmer-test-stage-2-${{ matrix.build }} + endpoint: https://1541b1e8a3fc6ad155ce67ef38899700.r2.cloudflarestorage.com - name: Test run: | make test-stage-2 @@ -889,6 +928,19 @@ jobs: TARGET: ${{ matrix.target }} TARGET_DIR: target/${{ matrix.target }}/release CARGO_TARGET: --target ${{ matrix.target }} + - name: Upload cache + uses: nipeharefa/action-s3-cache@3a78206 + with: + action: put + aws-access-key-id: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_TOKEN }} + aws-secret-access-key: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_KEY }} + bucket: wasmer-rust-artifacts-cache + s3-class: STANDARD_IA + key: wasmer-test-stage-2-${{ matrix.build }} + artifacts: | + ~/.cargo/* + ./target/* + endpoint: https://1541b1e8a3fc6ad155ce67ef38899700.r2.cloudflarestorage.com test_wasmer_stage_3: name: Test Wasmer Stage 3 on ${{ matrix.build }} @@ -980,11 +1032,15 @@ jobs: target = "${{ matrix.target }}" EOF if: matrix.target - - uses: Swatinem/rust-cache@v2 + - name: Retrieve cache + uses: nipeharefa/action-s3-cache@3a78206 with: - cache-on-failure: false - shared-key: wasmer-${{ matrix.build }} - save-if: false + action: get + aws-access-key-id: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_TOKEN }} + aws-secret-access-key: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_KEY }} + bucket: wasmer-rust-artifacts-cache + key: wasmer-test-stage-3-${{ matrix.build }} + endpoint: https://1541b1e8a3fc6ad155ce67ef38899700.r2.cloudflarestorage.com - name: Test run: | make test-stage-3 @@ -992,6 +1048,19 @@ jobs: TARGET: ${{ matrix.target }} TARGET_DIR: target/${{ matrix.target }}/release CARGO_TARGET: --target ${{ matrix.target }} + - name: Upload cache + uses: nipeharefa/action-s3-cache@3a78206 + with: + action: put + aws-access-key-id: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_TOKEN }} + aws-secret-access-key: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_KEY }} + bucket: wasmer-rust-artifacts-cache + s3-class: STANDARD_IA + key: wasmer-test-stage-3-${{ matrix.build }} + artifacts: | + ~/.cargo/* + ./target/* + endpoint: https://1541b1e8a3fc6ad155ce67ef38899700.r2.cloudflarestorage.com test_wasmer_stage_4: name: Test Wasmer Stage 4 on ${{ matrix.build }} @@ -1203,15 +1272,15 @@ jobs: target = "${{ matrix.target }}" EOF if: matrix.target - - uses: Swatinem/rust-cache@v2 - with: - cache-on-failure: false - shared-key: wasmer-${{ matrix.build }} - save-if: false - - uses: actions/cache@v2 + - name: Retrieve cache + uses: nipeharefa/action-s3-cache@3a78206 with: - path: ${{ runner.tool_cache }}/cargo-sccache - key: ${{ matrix.build }}-${{ matrix.target }}-sccache-bin-${{ env.CARGO_SCCACHE_VERSION }}-v1 + action: get + aws-access-key-id: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_TOKEN }} + aws-secret-access-key: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_KEY }} + bucket: wasmer-rust-artifacts-cache + key: wasmer-test-stage-5-${{ matrix.build }} + endpoint: https://1541b1e8a3fc6ad155ce67ef38899700.r2.cloudflarestorage.com - name: Test run: | make test-stage-5 @@ -1219,6 +1288,19 @@ jobs: TARGET: ${{ matrix.target }} TARGET_DIR: target/${{ matrix.target }}/release CARGO_TARGET: --target ${{ matrix.target }} + - name: Upload cache + uses: nipeharefa/action-s3-cache@3a78206 + with: + action: put + aws-access-key-id: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_TOKEN }} + aws-secret-access-key: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_KEY }} + bucket: wasmer-rust-artifacts-cache + s3-class: STANDARD_IA + key: wasmer-test-stage-5-${{ matrix.build }} + artifacts: | + ~/.cargo/* + ./target/* + endpoint: https://1541b1e8a3fc6ad155ce67ef38899700.r2.cloudflarestorage.com test_wasmer_stage_6: name: Test Wasmer Stage 6 on ${{ matrix.build }} @@ -1310,11 +1392,15 @@ jobs: target = "${{ matrix.target }}" EOF if: matrix.target - - uses: Swatinem/rust-cache@v2 + - name: Retrieve cache + uses: nipeharefa/action-s3-cache@3a78206 with: - cache-on-failure: false - shared-key: wasmer-${{ matrix.build }} - save-if: false + action: get + aws-access-key-id: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_TOKEN }} + aws-secret-access-key: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_KEY }} + bucket: wasmer-rust-artifacts-cache + key: wasmer-test-stage-6-${{ matrix.build }} + endpoint: https://1541b1e8a3fc6ad155ce67ef38899700.r2.cloudflarestorage.com - name: Test run: | make test-stage-6 @@ -1322,3 +1408,16 @@ jobs: TARGET: ${{ matrix.target }} TARGET_DIR: target/${{ matrix.target }}/release CARGO_TARGET: --target ${{ matrix.target }} + - name: Upload cache + uses: nipeharefa/action-s3-cache@3a78206 + with: + action: put + aws-access-key-id: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_TOKEN }} + aws-secret-access-key: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_KEY }} + bucket: wasmer-rust-artifacts-cache + s3-class: STANDARD_IA + key: wasmer-test-stage-6-${{ matrix.build }} + artifacts: | + ~/.cargo/* + ./target/* + endpoint: https://1541b1e8a3fc6ad155ce67ef38899700.r2.cloudflarestorage.com From 5fb889ce3ab1f167a987690e85dc824d048d6355 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Fri, 9 Dec 2022 15:13:54 +0100 Subject: [PATCH 123/226] Remove rust-cache in favor of S3 cache --- .github/workflows/test.yaml | 72 ++++++++++++++++++++++++++++++++----- 1 file changed, 64 insertions(+), 8 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index cba65337fd3..5e5498f2d50 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -412,6 +412,15 @@ jobs: cache-on-failure: false shared-key: wasmer-${{ matrix.build }} save-if: false + - name: Retrieve cache + uses: nipeharefa/action-s3-cache@3a78206 + with: + action: get + aws-access-key-id: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_TOKEN }} + aws-secret-access-key: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_KEY }} + bucket: wasmer-rust-artifacts-cache + key: wasmer-build-capi-${{ matrix.build }} + endpoint: https://1541b1e8a3fc6ad155ce67ef38899700.r2.cloudflarestorage.com - name: Build C-API shell: bash run: | @@ -427,6 +436,19 @@ jobs: path: build-capi.tar.gz if-no-files-found: error retention-days: 2 + - name: Upload cache + uses: nipeharefa/action-s3-cache@3a78206 + with: + action: put + aws-access-key-id: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_TOKEN }} + aws-secret-access-key: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_KEY }} + bucket: wasmer-rust-artifacts-cache + s3-class: STANDARD_IA + key: wasmer-build-capi-${{ matrix.build }} + artifacts: | + ~/.cargo/* + ./target/* + endpoint: https://1541b1e8a3fc6ad155ce67ef38899700.r2.cloudflarestorage.com test_capi: name: Test C-API on ${{ matrix.build }} @@ -472,11 +494,15 @@ jobs: with: toolchain: 1.63 target: ${{ matrix.target }} - - uses: Swatinem/rust-cache@v2 + - name: Retrieve cache + uses: nipeharefa/action-s3-cache@3a78206 with: - cache-on-failure: false - shared-key: wasmer-${{ matrix.build }} - save-if: false + action: get + aws-access-key-id: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_TOKEN }} + aws-secret-access-key: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_KEY }} + bucket: wasmer-rust-artifacts-cache + key: wasmer-test-capi-${{ matrix.build }} + endpoint: https://1541b1e8a3fc6ad155ce67ef38899700.r2.cloudflarestorage.com - name: 'Echo download path' run: echo ${{steps.download.outputs.download-path}} - name: Unzip Artifacts @@ -492,6 +518,19 @@ jobs: TARGET: ${{ matrix.target }} TARGET_DIR: target/${{ matrix.target }}/release CARGO_TARGET: --target ${{ matrix.target }} + - name: Upload cache + uses: nipeharefa/action-s3-cache@3a78206 + with: + action: put + aws-access-key-id: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_TOKEN }} + aws-secret-access-key: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_KEY }} + bucket: wasmer-rust-artifacts-cache + s3-class: STANDARD_IA + key: wasmer-test-capi-${{ matrix.build }} + artifacts: | + ~/.cargo/* + ./target/* + endpoint: https://1541b1e8a3fc6ad155ce67ef38899700.r2.cloudflarestorage.com test_integration_cli: name: Integration tests on ${{ matrix.build }} @@ -545,11 +584,15 @@ jobs: with: toolchain: 1.63 target: ${{ matrix.target }} - - uses: Swatinem/rust-cache@v2 + - name: Retrieve cache + uses: nipeharefa/action-s3-cache@3a78206 with: - cache-on-failure: false - shared-key: wasmer-${{ matrix.build }} - save-if: false + action: get + aws-access-key-id: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_TOKEN }} + aws-secret-access-key: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_KEY }} + bucket: wasmer-rust-artifacts-cache + key: wasmer-test-integration-cli-${{ matrix.build }} + endpoint: https://1541b1e8a3fc6ad155ce67ef38899700.r2.cloudflarestorage.com - name: Unzip Artifacts shell: bash run: | @@ -569,6 +612,19 @@ jobs: CARGO_TARGET: --target ${{ matrix.target }} WAPM_DEV_TOKEN: ${{ secrets.WAPM_DEV_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Upload cache + uses: nipeharefa/action-s3-cache@3a78206 + with: + action: put + aws-access-key-id: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_TOKEN }} + aws-secret-access-key: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_KEY }} + bucket: wasmer-rust-artifacts-cache + s3-class: STANDARD_IA + key: wasmer-test-integration-cli-${{ matrix.build }} + artifacts: | + ~/.cargo/* + ./target/* + endpoint: https://1541b1e8a3fc6ad155ce67ef38899700.r2.cloudflarestorage.com test_wasmer_stage_0: name: Test Wasmer Stage 0 on ${{ matrix.build }} From 6e2eea57aa69a8f816df7a6ba0bb889a8f84dd53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Fri, 9 Dec 2022 15:19:06 +0100 Subject: [PATCH 124/226] Remove rust-cache completely --- .github/workflows/test.yaml | 73 ++++++++++++++++++++++++++++++++----- 1 file changed, 63 insertions(+), 10 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 5e5498f2d50..bc2bd3bb4b2 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -50,11 +50,15 @@ jobs: tar xf /opt/llvm.tar.xz --strip-components=1 -C /opt/llvm-12 echo '/opt/llvm-12/bin' >> $GITHUB_PATH echo 'LLVM_SYS_120_PREFIX=/opt/llvm-12' >> $GITHUB_ENV - - uses: Swatinem/rust-cache@v2 + - name: Retrieve cache + uses: nipeharefa/action-s3-cache@3a78206 with: - cache-on-failure: false - shared-key: wasmer-linux-x64 - save-if: false + action: get + aws-access-key-id: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_TOKEN }} + aws-secret-access-key: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_KEY }} + bucket: wasmer-rust-artifacts-cache + key: wasmer-make-lint-linux-x64 + endpoint: https://1541b1e8a3fc6ad155ce67ef38899700.r2.cloudflarestorage.com - run: make lint env: ENABLE_CRANELIFT: "1" @@ -64,6 +68,19 @@ jobs: run: | git status ! [[ $(git status -s) ]] + - name: Upload cache + uses: nipeharefa/action-s3-cache@3a78206 + with: + action: put + aws-access-key-id: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_TOKEN }} + aws-secret-access-key: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_KEY }} + bucket: wasmer-rust-artifacts-cache + s3-class: STANDARD_IA + key: wasmer-make-lint-linux-x64 + artifacts: | + ~/.cargo/* + ./target/* + endpoint: https://1541b1e8a3fc6ad155ce67ef38899700.r2.cloudflarestorage.com cargo_deny: name: cargo-deny @@ -197,10 +214,15 @@ jobs: target = "${{ matrix.target }}" EOF if: matrix.target - - uses: Swatinem/rust-cache@v2 + - name: Retrieve cache + uses: nipeharefa/action-s3-cache@3a78206 with: - cache-on-failure: true - shared-key: wasmer-${{ matrix.build }} + action: get + aws-access-key-id: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_TOKEN }} + aws-secret-access-key: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_KEY }} + bucket: wasmer-rust-artifacts-cache + key: wasmer-build-wasmer-${{ matrix.build }} + endpoint: https://1541b1e8a3fc6ad155ce67ef38899700.r2.cloudflarestorage.com - name: Build wasmer-cli shell: bash run: | @@ -216,6 +238,19 @@ jobs: path: build-wasmer.tar.gz if-no-files-found: error retention-days: 2 + - name: Upload cache + uses: nipeharefa/action-s3-cache@3a78206 + with: + action: put + aws-access-key-id: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_TOKEN }} + aws-secret-access-key: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_KEY }} + bucket: wasmer-rust-artifacts-cache + s3-class: STANDARD_IA + key: wasmer-build-wasmer-${{ matrix.build }} + artifacts: | + ~/.cargo/* + ./target/* + endpoint: https://1541b1e8a3fc6ad155ce67ef38899700.r2.cloudflarestorage.com build_wasmer_linux_aarch64: name: Build wasmer on linux aarch64 @@ -284,10 +319,15 @@ jobs: shell: bash run: | rustup target add x86_64-pc-windows-gnu - - uses: Swatinem/rust-cache@v2 + - name: Retrieve cache + uses: nipeharefa/action-s3-cache@3a78206 with: - cache-on-failure: true - shared-key: wasmer-windows-gnu + action: get + aws-access-key-id: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_TOKEN }} + aws-secret-access-key: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_KEY }} + bucket: wasmer-rust-artifacts-cache + key: wasmer-build-wasmer-windows-gnu + endpoint: https://1541b1e8a3fc6ad155ce67ef38899700.r2.cloudflarestorage.com - name: Install Windows 10 SDK with xwin shell: bash run: | @@ -313,6 +353,19 @@ jobs: shell: bash run: | cargo build --release --target x86_64-pc-windows-gnu --manifest-path lib/c-api/Cargo.toml --no-default-features --features wat,compiler,wasi,middlewares,webc_runner --features cranelift,singlepass,wasmer-artifact-create,static-artifact-create,wasmer-artifact-load,static-artifact-load + - name: Upload cache + uses: nipeharefa/action-s3-cache@3a78206 + with: + action: put + aws-access-key-id: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_TOKEN }} + aws-secret-access-key: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_KEY }} + bucket: wasmer-rust-artifacts-cache + s3-class: STANDARD_IA + key: wasmer-build-wasmer-windows-gnu + artifacts: | + ~/.cargo/* + ./target/* + endpoint: https://1541b1e8a3fc6ad155ce67ef38899700.r2.cloudflarestorage.com build_capi: name: Build C-API on ${{ matrix.build }} From 8f3674d76f2b4106185c7b4ab1f610414e12a19a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Fri, 9 Dec 2022 15:20:20 +0100 Subject: [PATCH 125/226] Use proper SHA hash for GitHub action --- .github/workflows/test.yaml | 52 ++++++++++++++++++------------------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index bc2bd3bb4b2..7038fba4b56 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -51,7 +51,7 @@ jobs: echo '/opt/llvm-12/bin' >> $GITHUB_PATH echo 'LLVM_SYS_120_PREFIX=/opt/llvm-12' >> $GITHUB_ENV - name: Retrieve cache - uses: nipeharefa/action-s3-cache@3a78206 + uses: nipeharefa/action-s3-cache@3a7820623d50d36656b0ba7705c0208f2257028a with: action: get aws-access-key-id: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_TOKEN }} @@ -69,7 +69,7 @@ jobs: git status ! [[ $(git status -s) ]] - name: Upload cache - uses: nipeharefa/action-s3-cache@3a78206 + uses: nipeharefa/action-s3-cache@3a7820623d50d36656b0ba7705c0208f2257028a with: action: put aws-access-key-id: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_TOKEN }} @@ -215,7 +215,7 @@ jobs: EOF if: matrix.target - name: Retrieve cache - uses: nipeharefa/action-s3-cache@3a78206 + uses: nipeharefa/action-s3-cache@3a7820623d50d36656b0ba7705c0208f2257028a with: action: get aws-access-key-id: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_TOKEN }} @@ -239,7 +239,7 @@ jobs: if-no-files-found: error retention-days: 2 - name: Upload cache - uses: nipeharefa/action-s3-cache@3a78206 + uses: nipeharefa/action-s3-cache@3a7820623d50d36656b0ba7705c0208f2257028a with: action: put aws-access-key-id: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_TOKEN }} @@ -320,7 +320,7 @@ jobs: run: | rustup target add x86_64-pc-windows-gnu - name: Retrieve cache - uses: nipeharefa/action-s3-cache@3a78206 + uses: nipeharefa/action-s3-cache@3a7820623d50d36656b0ba7705c0208f2257028a with: action: get aws-access-key-id: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_TOKEN }} @@ -354,7 +354,7 @@ jobs: run: | cargo build --release --target x86_64-pc-windows-gnu --manifest-path lib/c-api/Cargo.toml --no-default-features --features wat,compiler,wasi,middlewares,webc_runner --features cranelift,singlepass,wasmer-artifact-create,static-artifact-create,wasmer-artifact-load,static-artifact-load - name: Upload cache - uses: nipeharefa/action-s3-cache@3a78206 + uses: nipeharefa/action-s3-cache@3a7820623d50d36656b0ba7705c0208f2257028a with: action: put aws-access-key-id: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_TOKEN }} @@ -466,7 +466,7 @@ jobs: shared-key: wasmer-${{ matrix.build }} save-if: false - name: Retrieve cache - uses: nipeharefa/action-s3-cache@3a78206 + uses: nipeharefa/action-s3-cache@3a7820623d50d36656b0ba7705c0208f2257028a with: action: get aws-access-key-id: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_TOKEN }} @@ -490,7 +490,7 @@ jobs: if-no-files-found: error retention-days: 2 - name: Upload cache - uses: nipeharefa/action-s3-cache@3a78206 + uses: nipeharefa/action-s3-cache@3a7820623d50d36656b0ba7705c0208f2257028a with: action: put aws-access-key-id: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_TOKEN }} @@ -548,7 +548,7 @@ jobs: toolchain: 1.63 target: ${{ matrix.target }} - name: Retrieve cache - uses: nipeharefa/action-s3-cache@3a78206 + uses: nipeharefa/action-s3-cache@3a7820623d50d36656b0ba7705c0208f2257028a with: action: get aws-access-key-id: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_TOKEN }} @@ -572,7 +572,7 @@ jobs: TARGET_DIR: target/${{ matrix.target }}/release CARGO_TARGET: --target ${{ matrix.target }} - name: Upload cache - uses: nipeharefa/action-s3-cache@3a78206 + uses: nipeharefa/action-s3-cache@3a7820623d50d36656b0ba7705c0208f2257028a with: action: put aws-access-key-id: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_TOKEN }} @@ -638,7 +638,7 @@ jobs: toolchain: 1.63 target: ${{ matrix.target }} - name: Retrieve cache - uses: nipeharefa/action-s3-cache@3a78206 + uses: nipeharefa/action-s3-cache@3a7820623d50d36656b0ba7705c0208f2257028a with: action: get aws-access-key-id: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_TOKEN }} @@ -666,7 +666,7 @@ jobs: WAPM_DEV_TOKEN: ${{ secrets.WAPM_DEV_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Upload cache - uses: nipeharefa/action-s3-cache@3a78206 + uses: nipeharefa/action-s3-cache@3a7820623d50d36656b0ba7705c0208f2257028a with: action: put aws-access-key-id: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_TOKEN }} @@ -770,7 +770,7 @@ jobs: EOF if: matrix.target - name: Retrieve cache - uses: nipeharefa/action-s3-cache@3a78206 + uses: nipeharefa/action-s3-cache@3a7820623d50d36656b0ba7705c0208f2257028a with: action: get aws-access-key-id: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_TOKEN }} @@ -786,7 +786,7 @@ jobs: TARGET_DIR: target/${{ matrix.target }}/release CARGO_TARGET: --target ${{ matrix.target }} - name: Upload cache - uses: nipeharefa/action-s3-cache@3a78206 + uses: nipeharefa/action-s3-cache@3a7820623d50d36656b0ba7705c0208f2257028a with: action: put aws-access-key-id: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_TOKEN }} @@ -898,7 +898,7 @@ jobs: EOF if: matrix.target - name: Retrieve cache - uses: nipeharefa/action-s3-cache@3a78206 + uses: nipeharefa/action-s3-cache@3a7820623d50d36656b0ba7705c0208f2257028a with: action: get aws-access-key-id: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_TOKEN }} @@ -918,7 +918,7 @@ jobs: TARGET_DIR: target/${{ matrix.target }}/release CARGO_TARGET: --target ${{ matrix.target }} - name: Upload cache - uses: nipeharefa/action-s3-cache@3a78206 + uses: nipeharefa/action-s3-cache@3a7820623d50d36656b0ba7705c0208f2257028a with: action: put aws-access-key-id: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_TOKEN }} @@ -1022,7 +1022,7 @@ jobs: EOF if: matrix.target - name: Retrieve cache - uses: nipeharefa/action-s3-cache@3a78206 + uses: nipeharefa/action-s3-cache@3a7820623d50d36656b0ba7705c0208f2257028a with: action: get aws-access-key-id: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_TOKEN }} @@ -1038,7 +1038,7 @@ jobs: TARGET_DIR: target/${{ matrix.target }}/release CARGO_TARGET: --target ${{ matrix.target }} - name: Upload cache - uses: nipeharefa/action-s3-cache@3a78206 + uses: nipeharefa/action-s3-cache@3a7820623d50d36656b0ba7705c0208f2257028a with: action: put aws-access-key-id: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_TOKEN }} @@ -1142,7 +1142,7 @@ jobs: EOF if: matrix.target - name: Retrieve cache - uses: nipeharefa/action-s3-cache@3a78206 + uses: nipeharefa/action-s3-cache@3a7820623d50d36656b0ba7705c0208f2257028a with: action: get aws-access-key-id: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_TOKEN }} @@ -1158,7 +1158,7 @@ jobs: TARGET_DIR: target/${{ matrix.target }}/release CARGO_TARGET: --target ${{ matrix.target }} - name: Upload cache - uses: nipeharefa/action-s3-cache@3a78206 + uses: nipeharefa/action-s3-cache@3a7820623d50d36656b0ba7705c0208f2257028a with: action: put aws-access-key-id: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_TOKEN }} @@ -1262,7 +1262,7 @@ jobs: EOF if: matrix.target - name: Retrieve cache - uses: nipeharefa/action-s3-cache@3a78206 + uses: nipeharefa/action-s3-cache@3a7820623d50d36656b0ba7705c0208f2257028a with: action: get aws-access-key-id: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_TOKEN }} @@ -1278,7 +1278,7 @@ jobs: TARGET_DIR: target/${{ matrix.target }}/release CARGO_TARGET: --target ${{ matrix.target }} - name: Upload cache - uses: nipeharefa/action-s3-cache@3a78206 + uses: nipeharefa/action-s3-cache@3a7820623d50d36656b0ba7705c0208f2257028a with: action: put aws-access-key-id: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_TOKEN }} @@ -1382,7 +1382,7 @@ jobs: EOF if: matrix.target - name: Retrieve cache - uses: nipeharefa/action-s3-cache@3a78206 + uses: nipeharefa/action-s3-cache@3a7820623d50d36656b0ba7705c0208f2257028a with: action: get aws-access-key-id: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_TOKEN }} @@ -1398,7 +1398,7 @@ jobs: TARGET_DIR: target/${{ matrix.target }}/release CARGO_TARGET: --target ${{ matrix.target }} - name: Upload cache - uses: nipeharefa/action-s3-cache@3a78206 + uses: nipeharefa/action-s3-cache@3a7820623d50d36656b0ba7705c0208f2257028a with: action: put aws-access-key-id: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_TOKEN }} @@ -1502,7 +1502,7 @@ jobs: EOF if: matrix.target - name: Retrieve cache - uses: nipeharefa/action-s3-cache@3a78206 + uses: nipeharefa/action-s3-cache@3a7820623d50d36656b0ba7705c0208f2257028a with: action: get aws-access-key-id: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_TOKEN }} @@ -1518,7 +1518,7 @@ jobs: TARGET_DIR: target/${{ matrix.target }}/release CARGO_TARGET: --target ${{ matrix.target }} - name: Upload cache - uses: nipeharefa/action-s3-cache@3a78206 + uses: nipeharefa/action-s3-cache@3a7820623d50d36656b0ba7705c0208f2257028a with: action: put aws-access-key-id: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_TOKEN }} From bb0df255edf049905a5d23b03e59a0c240d9723c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Fri, 9 Dec 2022 15:30:04 +0100 Subject: [PATCH 126/226] Use actions-cache for make lint --- .github/workflows/test.yaml | 29 ++++++++++------------------- 1 file changed, 10 insertions(+), 19 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 7038fba4b56..b1d02000f26 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -50,15 +50,19 @@ jobs: tar xf /opt/llvm.tar.xz --strip-components=1 -C /opt/llvm-12 echo '/opt/llvm-12/bin' >> $GITHUB_PATH echo 'LLVM_SYS_120_PREFIX=/opt/llvm-12' >> $GITHUB_ENV - - name: Retrieve cache - uses: nipeharefa/action-s3-cache@3a7820623d50d36656b0ba7705c0208f2257028a + - name: Cache + uses: whywaita/actions-cache-s3@v2 with: - action: get + path: | + ~/.cargo/* + ./target/* + key: ${{ github.repository }}-${{ runner.os }}-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 }} - bucket: wasmer-rust-artifacts-cache - key: wasmer-make-lint-linux-x64 - endpoint: https://1541b1e8a3fc6ad155ce67ef38899700.r2.cloudflarestorage.com + aws-endpoint: https://1541b1e8a3fc6ad155ce67ef38899700.r2.cloudflarestorage.com + aws-s3-bucket-endpoint: true + aws-s3-force-path-style: true - run: make lint env: ENABLE_CRANELIFT: "1" @@ -68,19 +72,6 @@ jobs: run: | git status ! [[ $(git status -s) ]] - - name: Upload cache - uses: nipeharefa/action-s3-cache@3a7820623d50d36656b0ba7705c0208f2257028a - with: - action: put - aws-access-key-id: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_TOKEN }} - aws-secret-access-key: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_KEY }} - bucket: wasmer-rust-artifacts-cache - s3-class: STANDARD_IA - key: wasmer-make-lint-linux-x64 - artifacts: | - ~/.cargo/* - ./target/* - endpoint: https://1541b1e8a3fc6ad155ce67ef38899700.r2.cloudflarestorage.com cargo_deny: name: cargo-deny From 7a619e1456ce87fc23aa95df9c9c59e52f8f23e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Fri, 9 Dec 2022 16:12:14 +0100 Subject: [PATCH 127/226] Use aws-region: auto --- .github/workflows/test.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index b1d02000f26..5e23592ef72 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -60,6 +60,7 @@ jobs: 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: true aws-s3-force-path-style: true From 25cca8213546802a627cff2206c7362fc5d264df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Fri, 9 Dec 2022 16:27:04 +0100 Subject: [PATCH 128/226] Use aws-s3-bucket-endpoint: false --- .github/workflows/test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 5e23592ef72..2c5b99c7a82 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -62,7 +62,7 @@ jobs: aws-secret-access-key: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_KEY }} aws-region: auto aws-endpoint: https://1541b1e8a3fc6ad155ce67ef38899700.r2.cloudflarestorage.com - aws-s3-bucket-endpoint: true + aws-s3-bucket-endpoint: false aws-s3-force-path-style: true - run: make lint env: From c87ea2cd9a0b8577c569f81db6378b815e6a8eaa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Mon, 12 Dec 2022 11:31:58 +0100 Subject: [PATCH 129/226] Use S3 caching everywhere, test if cache hit works --- .github/workflows/test.yaml | 360 +++++++++++++----------------------- 1 file changed, 132 insertions(+), 228 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 2c5b99c7a82..bdafbf20664 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -206,15 +206,20 @@ jobs: target = "${{ matrix.target }}" EOF if: matrix.target - - name: Retrieve cache - uses: nipeharefa/action-s3-cache@3a7820623d50d36656b0ba7705c0208f2257028a + - name: Cache + uses: whywaita/actions-cache-s3@v2 with: - action: get + path: | + ~/.cargo/* + ./target/* + key: ${{ github.repository }}-${{ runner.os }}-wasmer-make-build-wasmer-${{ 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 }} - bucket: wasmer-rust-artifacts-cache - key: wasmer-build-wasmer-${{ matrix.build }} - endpoint: https://1541b1e8a3fc6ad155ce67ef38899700.r2.cloudflarestorage.com + aws-region: auto + aws-endpoint: https://1541b1e8a3fc6ad155ce67ef38899700.r2.cloudflarestorage.com + aws-s3-bucket-endpoint: false + aws-s3-force-path-style: true - name: Build wasmer-cli shell: bash run: | @@ -230,19 +235,6 @@ jobs: path: build-wasmer.tar.gz if-no-files-found: error retention-days: 2 - - name: Upload cache - uses: nipeharefa/action-s3-cache@3a7820623d50d36656b0ba7705c0208f2257028a - with: - action: put - aws-access-key-id: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_TOKEN }} - aws-secret-access-key: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_KEY }} - bucket: wasmer-rust-artifacts-cache - s3-class: STANDARD_IA - key: wasmer-build-wasmer-${{ matrix.build }} - artifacts: | - ~/.cargo/* - ./target/* - endpoint: https://1541b1e8a3fc6ad155ce67ef38899700.r2.cloudflarestorage.com build_wasmer_linux_aarch64: name: Build wasmer on linux aarch64 @@ -311,15 +303,20 @@ jobs: shell: bash run: | rustup target add x86_64-pc-windows-gnu - - name: Retrieve cache - uses: nipeharefa/action-s3-cache@3a7820623d50d36656b0ba7705c0208f2257028a + - name: Cache + uses: whywaita/actions-cache-s3@v2 with: - action: get + path: | + ~/.cargo/* + ./target/* + key: ${{ github.repository }}-${{ runner.os }}-wasmer-make-build-capi-windows-gnu + 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 }} - bucket: wasmer-rust-artifacts-cache - key: wasmer-build-wasmer-windows-gnu - endpoint: https://1541b1e8a3fc6ad155ce67ef38899700.r2.cloudflarestorage.com + aws-region: auto + aws-endpoint: https://1541b1e8a3fc6ad155ce67ef38899700.r2.cloudflarestorage.com + aws-s3-bucket-endpoint: false + aws-s3-force-path-style: true - name: Install Windows 10 SDK with xwin shell: bash run: | @@ -345,19 +342,6 @@ jobs: shell: bash run: | cargo build --release --target x86_64-pc-windows-gnu --manifest-path lib/c-api/Cargo.toml --no-default-features --features wat,compiler,wasi,middlewares,webc_runner --features cranelift,singlepass,wasmer-artifact-create,static-artifact-create,wasmer-artifact-load,static-artifact-load - - name: Upload cache - uses: nipeharefa/action-s3-cache@3a7820623d50d36656b0ba7705c0208f2257028a - with: - action: put - aws-access-key-id: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_TOKEN }} - aws-secret-access-key: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_KEY }} - bucket: wasmer-rust-artifacts-cache - s3-class: STANDARD_IA - key: wasmer-build-wasmer-windows-gnu - artifacts: | - ~/.cargo/* - ./target/* - endpoint: https://1541b1e8a3fc6ad155ce67ef38899700.r2.cloudflarestorage.com build_capi: name: Build C-API on ${{ matrix.build }} @@ -457,15 +441,20 @@ jobs: cache-on-failure: false shared-key: wasmer-${{ matrix.build }} save-if: false - - name: Retrieve cache - uses: nipeharefa/action-s3-cache@3a7820623d50d36656b0ba7705c0208f2257028a + - name: Cache + uses: whywaita/actions-cache-s3@v2 with: - action: get + path: | + ~/.cargo/* + ./target/* + key: ${{ github.repository }}-${{ runner.os }}-wasmer-make-build-capi-${{ 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 }} - bucket: wasmer-rust-artifacts-cache - key: wasmer-build-capi-${{ matrix.build }} - endpoint: https://1541b1e8a3fc6ad155ce67ef38899700.r2.cloudflarestorage.com + 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: | @@ -481,19 +470,6 @@ jobs: path: build-capi.tar.gz if-no-files-found: error retention-days: 2 - - name: Upload cache - uses: nipeharefa/action-s3-cache@3a7820623d50d36656b0ba7705c0208f2257028a - with: - action: put - aws-access-key-id: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_TOKEN }} - aws-secret-access-key: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_KEY }} - bucket: wasmer-rust-artifacts-cache - s3-class: STANDARD_IA - key: wasmer-build-capi-${{ matrix.build }} - artifacts: | - ~/.cargo/* - ./target/* - endpoint: https://1541b1e8a3fc6ad155ce67ef38899700.r2.cloudflarestorage.com test_capi: name: Test C-API on ${{ matrix.build }} @@ -539,15 +515,20 @@ jobs: with: toolchain: 1.63 target: ${{ matrix.target }} - - name: Retrieve cache - uses: nipeharefa/action-s3-cache@3a7820623d50d36656b0ba7705c0208f2257028a + - name: Cache + uses: whywaita/actions-cache-s3@v2 with: - action: get + path: | + ~/.cargo/* + ./target/* + key: ${{ github.repository }}-${{ runner.os }}-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 }} - bucket: wasmer-rust-artifacts-cache - key: wasmer-test-capi-${{ matrix.build }} - endpoint: https://1541b1e8a3fc6ad155ce67ef38899700.r2.cloudflarestorage.com + aws-region: auto + aws-endpoint: https://1541b1e8a3fc6ad155ce67ef38899700.r2.cloudflarestorage.com + aws-s3-bucket-endpoint: false + aws-s3-force-path-style: true - name: 'Echo download path' run: echo ${{steps.download.outputs.download-path}} - name: Unzip Artifacts @@ -563,19 +544,6 @@ jobs: TARGET: ${{ matrix.target }} TARGET_DIR: target/${{ matrix.target }}/release CARGO_TARGET: --target ${{ matrix.target }} - - name: Upload cache - uses: nipeharefa/action-s3-cache@3a7820623d50d36656b0ba7705c0208f2257028a - with: - action: put - aws-access-key-id: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_TOKEN }} - aws-secret-access-key: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_KEY }} - bucket: wasmer-rust-artifacts-cache - s3-class: STANDARD_IA - key: wasmer-test-capi-${{ matrix.build }} - artifacts: | - ~/.cargo/* - ./target/* - endpoint: https://1541b1e8a3fc6ad155ce67ef38899700.r2.cloudflarestorage.com test_integration_cli: name: Integration tests on ${{ matrix.build }} @@ -629,15 +597,20 @@ jobs: with: toolchain: 1.63 target: ${{ matrix.target }} - - name: Retrieve cache - uses: nipeharefa/action-s3-cache@3a7820623d50d36656b0ba7705c0208f2257028a + - name: Cache + uses: whywaita/actions-cache-s3@v2 with: - action: get + path: | + ~/.cargo/* + ./target/* + key: ${{ github.repository }}-${{ runner.os }}-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 }} - bucket: wasmer-rust-artifacts-cache - key: wasmer-test-integration-cli-${{ matrix.build }} - endpoint: https://1541b1e8a3fc6ad155ce67ef38899700.r2.cloudflarestorage.com + aws-region: auto + aws-endpoint: https://1541b1e8a3fc6ad155ce67ef38899700.r2.cloudflarestorage.com + aws-s3-bucket-endpoint: false + aws-s3-force-path-style: true - name: Unzip Artifacts shell: bash run: | @@ -657,19 +630,6 @@ jobs: CARGO_TARGET: --target ${{ matrix.target }} WAPM_DEV_TOKEN: ${{ secrets.WAPM_DEV_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Upload cache - uses: nipeharefa/action-s3-cache@3a7820623d50d36656b0ba7705c0208f2257028a - with: - action: put - aws-access-key-id: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_TOKEN }} - aws-secret-access-key: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_KEY }} - bucket: wasmer-rust-artifacts-cache - s3-class: STANDARD_IA - key: wasmer-test-integration-cli-${{ matrix.build }} - artifacts: | - ~/.cargo/* - ./target/* - endpoint: https://1541b1e8a3fc6ad155ce67ef38899700.r2.cloudflarestorage.com test_wasmer_stage_0: name: Test Wasmer Stage 0 on ${{ matrix.build }} @@ -761,15 +721,20 @@ jobs: target = "${{ matrix.target }}" EOF if: matrix.target - - name: Retrieve cache - uses: nipeharefa/action-s3-cache@3a7820623d50d36656b0ba7705c0208f2257028a + - name: Cache + uses: whywaita/actions-cache-s3@v2 with: - action: get + path: | + ~/.cargo/* + ./target/* + key: ${{ github.repository }}-${{ runner.os }}-wasmer-make-test-stage-0-${{ 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 }} - bucket: wasmer-rust-artifacts-cache - key: wasmer-test-stage-0-${{ matrix.build }} - endpoint: https://1541b1e8a3fc6ad155ce67ef38899700.r2.cloudflarestorage.com + aws-region: auto + aws-endpoint: https://1541b1e8a3fc6ad155ce67ef38899700.r2.cloudflarestorage.com + aws-s3-bucket-endpoint: false + aws-s3-force-path-style: true - name: Test run: | make test-stage-0 @@ -777,19 +742,6 @@ jobs: TARGET: ${{ matrix.target }} TARGET_DIR: target/${{ matrix.target }}/release CARGO_TARGET: --target ${{ matrix.target }} - - name: Upload cache - uses: nipeharefa/action-s3-cache@3a7820623d50d36656b0ba7705c0208f2257028a - with: - action: put - aws-access-key-id: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_TOKEN }} - aws-secret-access-key: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_KEY }} - bucket: wasmer-rust-artifacts-cache - s3-class: STANDARD_IA - key: wasmer-test-stage-0-${{ matrix.build }} - artifacts: | - ~/.cargo/* - ./target/* - endpoint: https://1541b1e8a3fc6ad155ce67ef38899700.r2.cloudflarestorage.com test_wasmer_stage_1: name: Test Wasmer Stage 1 on ${{ matrix.build }} @@ -889,15 +841,20 @@ jobs: target = "${{ matrix.target }}" EOF if: matrix.target - - name: Retrieve cache - uses: nipeharefa/action-s3-cache@3a7820623d50d36656b0ba7705c0208f2257028a + - name: Cache + uses: whywaita/actions-cache-s3@v2 with: - action: get + path: | + ~/.cargo/* + ./target/* + key: ${{ github.repository }}-${{ runner.os }}-wasmer-make-test-stage-1-${{ 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 }} - bucket: wasmer-rust-artifacts-cache - key: wasmer-test-stage-1-${{ matrix.build }} - endpoint: https://1541b1e8a3fc6ad155ce67ef38899700.r2.cloudflarestorage.com + aws-region: auto + aws-endpoint: https://1541b1e8a3fc6ad155ce67ef38899700.r2.cloudflarestorage.com + aws-s3-bucket-endpoint: false + aws-s3-force-path-style: true - name: Unzip Artifacts shell: bash run: | @@ -909,19 +866,6 @@ jobs: TARGET: ${{ matrix.target }} TARGET_DIR: target/${{ matrix.target }}/release CARGO_TARGET: --target ${{ matrix.target }} - - name: Upload cache - uses: nipeharefa/action-s3-cache@3a7820623d50d36656b0ba7705c0208f2257028a - with: - action: put - aws-access-key-id: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_TOKEN }} - aws-secret-access-key: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_KEY }} - bucket: wasmer-rust-artifacts-cache - s3-class: STANDARD_IA - key: wasmer-test-stage-1-${{ matrix.build }} - artifacts: | - ~/.cargo/* - ./target/* - endpoint: https://1541b1e8a3fc6ad155ce67ef38899700.r2.cloudflarestorage.com test_wasmer_stage_2: name: Test Wasmer Stage 2 on ${{ matrix.build }} @@ -1013,15 +957,20 @@ jobs: target = "${{ matrix.target }}" EOF if: matrix.target - - name: Retrieve cache - uses: nipeharefa/action-s3-cache@3a7820623d50d36656b0ba7705c0208f2257028a + - name: Cache + uses: whywaita/actions-cache-s3@v2 with: - action: get + path: | + ~/.cargo/* + ./target/* + key: ${{ github.repository }}-${{ runner.os }}-wasmer-make-test-stage-2-${{ 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 }} - bucket: wasmer-rust-artifacts-cache - key: wasmer-test-stage-2-${{ matrix.build }} - endpoint: https://1541b1e8a3fc6ad155ce67ef38899700.r2.cloudflarestorage.com + aws-region: auto + aws-endpoint: https://1541b1e8a3fc6ad155ce67ef38899700.r2.cloudflarestorage.com + aws-s3-bucket-endpoint: false + aws-s3-force-path-style: true - name: Test run: | make test-stage-2 @@ -1029,19 +978,6 @@ jobs: TARGET: ${{ matrix.target }} TARGET_DIR: target/${{ matrix.target }}/release CARGO_TARGET: --target ${{ matrix.target }} - - name: Upload cache - uses: nipeharefa/action-s3-cache@3a7820623d50d36656b0ba7705c0208f2257028a - with: - action: put - aws-access-key-id: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_TOKEN }} - aws-secret-access-key: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_KEY }} - bucket: wasmer-rust-artifacts-cache - s3-class: STANDARD_IA - key: wasmer-test-stage-2-${{ matrix.build }} - artifacts: | - ~/.cargo/* - ./target/* - endpoint: https://1541b1e8a3fc6ad155ce67ef38899700.r2.cloudflarestorage.com test_wasmer_stage_3: name: Test Wasmer Stage 3 on ${{ matrix.build }} @@ -1133,15 +1069,20 @@ jobs: target = "${{ matrix.target }}" EOF if: matrix.target - - name: Retrieve cache - uses: nipeharefa/action-s3-cache@3a7820623d50d36656b0ba7705c0208f2257028a + - name: Cache + uses: whywaita/actions-cache-s3@v2 with: - action: get + path: | + ~/.cargo/* + ./target/* + key: ${{ github.repository }}-${{ runner.os }}-wasmer-make-test-stage-3-${{ 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 }} - bucket: wasmer-rust-artifacts-cache - key: wasmer-test-stage-3-${{ matrix.build }} - endpoint: https://1541b1e8a3fc6ad155ce67ef38899700.r2.cloudflarestorage.com + aws-region: auto + aws-endpoint: https://1541b1e8a3fc6ad155ce67ef38899700.r2.cloudflarestorage.com + aws-s3-bucket-endpoint: false + aws-s3-force-path-style: true - name: Test run: | make test-stage-3 @@ -1149,19 +1090,6 @@ jobs: TARGET: ${{ matrix.target }} TARGET_DIR: target/${{ matrix.target }}/release CARGO_TARGET: --target ${{ matrix.target }} - - name: Upload cache - uses: nipeharefa/action-s3-cache@3a7820623d50d36656b0ba7705c0208f2257028a - with: - action: put - aws-access-key-id: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_TOKEN }} - aws-secret-access-key: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_KEY }} - bucket: wasmer-rust-artifacts-cache - s3-class: STANDARD_IA - key: wasmer-test-stage-3-${{ matrix.build }} - artifacts: | - ~/.cargo/* - ./target/* - endpoint: https://1541b1e8a3fc6ad155ce67ef38899700.r2.cloudflarestorage.com test_wasmer_stage_4: name: Test Wasmer Stage 4 on ${{ matrix.build }} @@ -1253,15 +1181,20 @@ jobs: target = "${{ matrix.target }}" EOF if: matrix.target - - name: Retrieve cache - uses: nipeharefa/action-s3-cache@3a7820623d50d36656b0ba7705c0208f2257028a + - name: Cache + uses: whywaita/actions-cache-s3@v2 with: - action: get + path: | + ~/.cargo/* + ./target/* + key: ${{ github.repository }}-${{ runner.os }}-wasmer-make-test-stage-4-${{ 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 }} - bucket: wasmer-rust-artifacts-cache - key: wasmer-test-stage-4-${{ matrix.build }} - endpoint: https://1541b1e8a3fc6ad155ce67ef38899700.r2.cloudflarestorage.com + aws-region: auto + aws-endpoint: https://1541b1e8a3fc6ad155ce67ef38899700.r2.cloudflarestorage.com + aws-s3-bucket-endpoint: false + aws-s3-force-path-style: true - name: Test run: | make test-stage-4 @@ -1269,19 +1202,6 @@ jobs: TARGET: ${{ matrix.target }} TARGET_DIR: target/${{ matrix.target }}/release CARGO_TARGET: --target ${{ matrix.target }} - - name: Upload cache - uses: nipeharefa/action-s3-cache@3a7820623d50d36656b0ba7705c0208f2257028a - with: - action: put - aws-access-key-id: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_TOKEN }} - aws-secret-access-key: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_KEY }} - bucket: wasmer-rust-artifacts-cache - s3-class: STANDARD_IA - key: wasmer-test-stage-4-${{ matrix.build }} - artifacts: | - ~/.cargo/* - ./target/* - endpoint: https://1541b1e8a3fc6ad155ce67ef38899700.r2.cloudflarestorage.com test_wasmer_stage_5: name: Test Wasmer Stage 5 on ${{ matrix.build }} @@ -1373,15 +1293,20 @@ jobs: target = "${{ matrix.target }}" EOF if: matrix.target - - name: Retrieve cache - uses: nipeharefa/action-s3-cache@3a7820623d50d36656b0ba7705c0208f2257028a + - name: Cache + uses: whywaita/actions-cache-s3@v2 with: - action: get + path: | + ~/.cargo/* + ./target/* + key: ${{ github.repository }}-${{ runner.os }}-wasmer-make-test-stage-5-${{ 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 }} - bucket: wasmer-rust-artifacts-cache - key: wasmer-test-stage-5-${{ matrix.build }} - endpoint: https://1541b1e8a3fc6ad155ce67ef38899700.r2.cloudflarestorage.com + aws-region: auto + aws-endpoint: https://1541b1e8a3fc6ad155ce67ef38899700.r2.cloudflarestorage.com + aws-s3-bucket-endpoint: false + aws-s3-force-path-style: true - name: Test run: | make test-stage-5 @@ -1389,19 +1314,6 @@ jobs: TARGET: ${{ matrix.target }} TARGET_DIR: target/${{ matrix.target }}/release CARGO_TARGET: --target ${{ matrix.target }} - - name: Upload cache - uses: nipeharefa/action-s3-cache@3a7820623d50d36656b0ba7705c0208f2257028a - with: - action: put - aws-access-key-id: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_TOKEN }} - aws-secret-access-key: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_KEY }} - bucket: wasmer-rust-artifacts-cache - s3-class: STANDARD_IA - key: wasmer-test-stage-5-${{ matrix.build }} - artifacts: | - ~/.cargo/* - ./target/* - endpoint: https://1541b1e8a3fc6ad155ce67ef38899700.r2.cloudflarestorage.com test_wasmer_stage_6: name: Test Wasmer Stage 6 on ${{ matrix.build }} @@ -1493,15 +1405,20 @@ jobs: target = "${{ matrix.target }}" EOF if: matrix.target - - name: Retrieve cache - uses: nipeharefa/action-s3-cache@3a7820623d50d36656b0ba7705c0208f2257028a + - name: Cache + uses: whywaita/actions-cache-s3@v2 with: - action: get + path: | + ~/.cargo/* + ./target/* + key: ${{ github.repository }}-${{ runner.os }}-wasmer-make-test-stage-6-${{ 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 }} - bucket: wasmer-rust-artifacts-cache - key: wasmer-test-stage-6-${{ matrix.build }} - endpoint: https://1541b1e8a3fc6ad155ce67ef38899700.r2.cloudflarestorage.com + aws-region: auto + aws-endpoint: https://1541b1e8a3fc6ad155ce67ef38899700.r2.cloudflarestorage.com + aws-s3-bucket-endpoint: false + aws-s3-force-path-style: true - name: Test run: | make test-stage-6 @@ -1509,16 +1426,3 @@ jobs: TARGET: ${{ matrix.target }} TARGET_DIR: target/${{ matrix.target }}/release CARGO_TARGET: --target ${{ matrix.target }} - - name: Upload cache - uses: nipeharefa/action-s3-cache@3a7820623d50d36656b0ba7705c0208f2257028a - with: - action: put - aws-access-key-id: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_TOKEN }} - aws-secret-access-key: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_KEY }} - bucket: wasmer-rust-artifacts-cache - s3-class: STANDARD_IA - key: wasmer-test-stage-6-${{ matrix.build }} - artifacts: | - ~/.cargo/* - ./target/* - endpoint: https://1541b1e8a3fc6ad155ce67ef38899700.r2.cloudflarestorage.com From 4ad52176e86f639a7186824342218a66850fd735 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Mon, 12 Dec 2022 12:51:54 +0100 Subject: [PATCH 130/226] Undo messing with feature flags and test speedup --- Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 075a17e3996..8edf301dc8d 100644 --- a/Makefile +++ b/Makefile @@ -367,7 +367,7 @@ check-capi: capi-setup --no-default-features --features wat,compiler,wasi,middlewares $(capi_compiler_features) build-wasmer: - $(CARGO_BINARY) build $(CARGO_TARGET) --release --manifest-path lib/cli/Cargo.toml --features singlepass,cranelift --features="webc_runner" --bin wasmer + $(CARGO_BINARY) build $(CARGO_TARGET) --release --manifest-path lib/cli/Cargo.toml $(compiler_features) --features="webc_runner" --bin wasmer build-wasmer-debug: $(CARGO_BINARY) build $(CARGO_TARGET) --manifest-path lib/cli/Cargo.toml $(compiler_features) --features "webc_runner,debug" --bin wasmer @@ -836,8 +836,8 @@ update-testsuite: lint-packages: RUSTFLAGS += -D dead-code -D nonstandard-style -D unused-imports -D unused-mut -D unused-variables -D unused-unsafe -D unreachable-patterns -D bad-style -D improper-ctypes -D unused-allocation -D unused-comparisons -D while-true -D unconditional-recursion -D bare-trait-objects -D function_item_references # TODO: add `-D missing-docs` lint-packages: RUSTFLAGS="${RUSTFLAGS}" cargo clippy --all --exclude wasmer-cli -- -D clippy::all - RUSTFLAGS="${RUSTFLAGS}" cargo clippy --manifest-path lib/cli/Cargo.toml --features cranelift,singlepass -- -D clippy::all - RUSTFLAGS="${RUSTFLAGS}" cargo clippy --manifest-path fuzz/Cargo.toml --features cranelift,singlepass -- -D clippy::all + RUSTFLAGS="${RUSTFLAGS}" cargo clippy --manifest-path lib/cli/Cargo.toml $(compiler_features) -- -D clippy::all + RUSTFLAGS="${RUSTFLAGS}" cargo clippy --manifest-path fuzz/Cargo.toml $(compiler_features) -- -D clippy::all lint-formatting: cargo fmt --all -- --check From 5da57c255733414f1aa82c6e77832331f1a380c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Mon, 12 Dec 2022 13:13:01 +0100 Subject: [PATCH 131/226] Fix caching for test-capi --- .github/workflows/test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index bdafbf20664..c7ee43e1f0a 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -521,7 +521,7 @@ jobs: path: | ~/.cargo/* ./target/* - key: ${{ github.repository }}-${{ runner.os }}-wasmer-make-lint-linux-x64 + key: ${{ github.repository }}-${{ runner.os }}-wasmer-make-test-capi-${{ 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 }} From 4b0477da43eb58d4b27c8aa121988f8e5f621939 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Mon, 12 Dec 2022 13:42:09 +0100 Subject: [PATCH 132/226] Merge build-capi and test-capi into one step --- .github/workflows/test.yaml | 94 ++++++++----------------------------- 1 file changed, 20 insertions(+), 74 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index c7ee43e1f0a..af4d7e0d1ec 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -285,6 +285,26 @@ jobs: PKG_CONFIG_PATH: /usr/lib/aarch64-linux-gnu/pkgconfig PKG_CONFIG_ALLOW_CROSS: true ENABLE_LLVM: 0 + - name: Package C API + run: | + make package-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: --target aarch64-unknown-linux-gnu + PKG_CONFIG_PATH: /usr/lib/aarch64-linux-gnu/pkgconfig + PKG_CONFIG_ALLOW_CROSS: true + ENABLE_LLVM: 0 + - name: Test C API + run: | + make test-capi-ci + 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: --target aarch64-unknown-linux-gnu + PKG_CONFIG_PATH: /usr/lib/aarch64-linux-gnu/pkgconfig + PKG_CONFIG_ALLOW_CROSS: true + ENABLE_LLVM: 0 build_capi_windows_gnu: name: Windows GNU @@ -471,80 +491,6 @@ jobs: if-no-files-found: error retention-days: 2 - test_capi: - name: Test C-API on ${{ matrix.build }} - runs-on: ${{ matrix.os }} - needs: build_capi - strategy: - fail-fast: false - matrix: - include: - - build: linux-x64 - os: ubuntu-18.04 - target: x86_64-unknown-linux-gnu - llvm_url: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz' - - build: macos-x64 - os: macos-11 - target: x86_64-apple-darwin - llvm_url: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-apple-darwin.tar.xz' - - build: windows-x64 - os: windows-latest - target: x86_64-pc-windows-msvc - # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/12.x/windows-amd64.tar.gz' - llvm_choco_version: 13.0.0 - - build: linux-musl - target: x86_64-unknown-linux-musl - os: ubuntu-18.04 - container: alpine:latest - container: ${{ matrix.container }} - env: - SCCACHE_AZURE_BLOB_CONTAINER: wasmerstoragesccacheblob - SCCACHE_AZURE_CONNECTION_STRING: ${{ secrets.SCCACHE_AZURE_CONNECTION_STRING }} - steps: - - uses: actions/checkout@v3 - - name: Set up base deps on musl - if: matrix.build == 'linux-musl' - run: | - apk add build-base bash musl-dev curl tar make libtool libffi-dev gcc automake autoconf git openssl-dev g++ - - uses: actions/download-artifact@v3 - id: download - with: - name: capi-${{ matrix.build }} - - name: Install Rust - uses: dtolnay/rust-toolchain@stable - with: - toolchain: 1.63 - target: ${{ matrix.target }} - - name: Cache - uses: whywaita/actions-cache-s3@v2 - with: - path: | - ~/.cargo/* - ./target/* - key: ${{ github.repository }}-${{ runner.os }}-wasmer-make-test-capi-${{ 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: 'Echo download path' - run: echo ${{steps.download.outputs.download-path}} - - name: Unzip Artifacts - shell: bash - run: | - make untar-capi - - name: Test C API - # musl can't run the capi tests because of a cc linker issue (`wasm_engine_new` is redefined) - if: matrix.build != 'linux-musl' - run: | - make test-capi-ci - env: - TARGET: ${{ matrix.target }} - TARGET_DIR: target/${{ matrix.target }}/release - CARGO_TARGET: --target ${{ matrix.target }} - test_integration_cli: name: Integration tests on ${{ matrix.build }} runs-on: ${{ matrix.os }} From 77ece3d31f3cbec5b491e2082f4e789ff86f3096 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Mon, 12 Dec 2022 13:44:11 +0100 Subject: [PATCH 133/226] Use hashFiles(Cargo.lock) to bust cache when deps change --- .github/workflows/test.yaml | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index af4d7e0d1ec..c954d7919aa 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -56,7 +56,7 @@ jobs: path: | ~/.cargo/* ./target/* - key: ${{ github.repository }}-${{ runner.os }}-wasmer-make-lint-linux-x64 + key: ${{ 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 }} @@ -212,7 +212,7 @@ jobs: path: | ~/.cargo/* ./target/* - key: ${{ github.repository }}-${{ runner.os }}-wasmer-make-build-wasmer-${{ matrix.build }} + key: ${{ github.repository }}-${{ runner.os }}-${{ hashFiles('Cargo.lock') }}-wasmer-make-build-wasmer-${{ 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 }} @@ -329,7 +329,7 @@ jobs: path: | ~/.cargo/* ./target/* - key: ${{ github.repository }}-${{ runner.os }}-wasmer-make-build-capi-windows-gnu + key: ${{ github.repository }}-${{ runner.os }}-${{ hashFiles('Cargo.lock') }}-wasmer-make-build-capi-windows-gnu 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 }} @@ -467,7 +467,7 @@ jobs: path: | ~/.cargo/* ./target/* - key: ${{ github.repository }}-${{ runner.os }}-wasmer-make-build-capi-${{ matrix.build }} + key: ${{ github.repository }}-${{ runner.os }}-${{ hashFiles('Cargo.lock') }}-wasmer-make-build-capi-${{ 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 }} @@ -549,7 +549,7 @@ jobs: path: | ~/.cargo/* ./target/* - key: ${{ github.repository }}-${{ runner.os }}-wasmer-make-test-integration-cli-${{ matrix.build }} + key: ${{ 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 }} @@ -673,7 +673,7 @@ jobs: path: | ~/.cargo/* ./target/* - key: ${{ github.repository }}-${{ runner.os }}-wasmer-make-test-stage-0-${{ matrix.build }} + key: ${{ github.repository }}-${{ runner.os }}-${{ hashFiles('Cargo.lock') }}-wasmer-make-test-stage-0-${{ 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 }} @@ -793,7 +793,7 @@ jobs: path: | ~/.cargo/* ./target/* - key: ${{ github.repository }}-${{ runner.os }}-wasmer-make-test-stage-1-${{ matrix.build }} + key: ${{ github.repository }}-${{ runner.os }}-${{ hashFiles('Cargo.lock') }}-wasmer-make-test-stage-1-${{ 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 }} @@ -909,7 +909,7 @@ jobs: path: | ~/.cargo/* ./target/* - key: ${{ github.repository }}-${{ runner.os }}-wasmer-make-test-stage-2-${{ matrix.build }} + key: ${{ github.repository }}-${{ runner.os }}-${{ hashFiles('Cargo.lock') }}-wasmer-make-test-stage-2-${{ 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 }} @@ -1021,7 +1021,7 @@ jobs: path: | ~/.cargo/* ./target/* - key: ${{ github.repository }}-${{ runner.os }}-wasmer-make-test-stage-3-${{ matrix.build }} + key: ${{ github.repository }}-${{ runner.os }}-${{ hashFiles('Cargo.lock') }}-wasmer-make-test-stage-3-${{ 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 }} @@ -1133,7 +1133,7 @@ jobs: path: | ~/.cargo/* ./target/* - key: ${{ github.repository }}-${{ runner.os }}-wasmer-make-test-stage-4-${{ matrix.build }} + key: ${{ github.repository }}-${{ runner.os }}-${{ hashFiles('Cargo.lock') }}-wasmer-make-test-stage-4-${{ 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 }} @@ -1245,7 +1245,7 @@ jobs: path: | ~/.cargo/* ./target/* - key: ${{ github.repository }}-${{ runner.os }}-wasmer-make-test-stage-5-${{ matrix.build }} + key: ${{ github.repository }}-${{ runner.os }}-${{ hashFiles('Cargo.lock') }}-wasmer-make-test-stage-5-${{ 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 }} @@ -1357,7 +1357,7 @@ jobs: path: | ~/.cargo/* ./target/* - key: ${{ github.repository }}-${{ runner.os }}-wasmer-make-test-stage-6-${{ matrix.build }} + key: ${{ github.repository }}-${{ runner.os }}-${{ hashFiles('Cargo.lock') }}-wasmer-make-test-stage-6-${{ 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 }} From 72d3f9bf424c851d61faf4b3dff65c45c0e37564 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Mon, 12 Dec 2022 14:21:01 +0100 Subject: [PATCH 134/226] Remove dependency of wasmer-test-stage-1 on build-capi --- .github/workflows/test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index c954d7919aa..76af1341cda 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -692,7 +692,7 @@ jobs: test_wasmer_stage_1: name: Test Wasmer Stage 1 on ${{ matrix.build }} runs-on: ${{ matrix.os }} - needs: [setup, build_capi] + needs: [setup] strategy: fail-fast: false matrix: From 1423f47e6a7848e8e5eb898413d1a8d621bf4160 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Mon, 12 Dec 2022 14:26:45 +0100 Subject: [PATCH 135/226] Fix test-capi step --- .github/workflows/test.yaml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 76af1341cda..fe589d1f4f6 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -456,11 +456,6 @@ jobs: target = "${{ matrix.target }}" EOF if: matrix.target - - uses: Swatinem/rust-cache@v2 - with: - cache-on-failure: false - shared-key: wasmer-${{ matrix.build }} - save-if: false - name: Cache uses: whywaita/actions-cache-s3@v2 with: From 0753c89a56e9d421d07c97e1941aa4047487ac90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Mon, 12 Dec 2022 14:28:17 +0100 Subject: [PATCH 136/226] Fix untar artifacts step in test-stage-1 --- .github/workflows/test.yaml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index fe589d1f4f6..437aed49f0a 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -719,10 +719,6 @@ jobs: if: matrix.build == 'linux-musl' run: | apk add build-base bash musl-dev curl tar make libtool libffi-dev gcc automake autoconf git openssl-dev g++ - - uses: actions/download-artifact@v3 - id: download - with: - name: capi-${{ matrix.build }} - name: Set up libstdc++ on Linux if: matrix.build == 'linux-x64' run: | @@ -796,10 +792,6 @@ jobs: aws-endpoint: https://1541b1e8a3fc6ad155ce67ef38899700.r2.cloudflarestorage.com aws-s3-bucket-endpoint: false aws-s3-force-path-style: true - - name: Unzip Artifacts - shell: bash - run: | - make untar-capi - name: Test run: | make test-stage-1 From b581f22872c85baa546ba0f2c4bcb020eac28020 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Mon, 12 Dec 2022 19:43:35 +0100 Subject: [PATCH 137/226] Merge test stage 0 - 6 to reduce complexity --- .github/workflows/test.yaml | 590 +++--------------------------------- 1 file changed, 36 insertions(+), 554 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 437aed49f0a..fd48ad8b471 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -676,582 +676,60 @@ jobs: aws-endpoint: https://1541b1e8a3fc6ad155ce67ef38899700.r2.cloudflarestorage.com aws-s3-bucket-endpoint: false aws-s3-force-path-style: true - - name: Test - run: | - make test-stage-0 - env: - TARGET: ${{ matrix.target }} - TARGET_DIR: target/${{ matrix.target }}/release - CARGO_TARGET: --target ${{ matrix.target }} - - test_wasmer_stage_1: - name: Test Wasmer Stage 1 on ${{ matrix.build }} - runs-on: ${{ matrix.os }} - needs: [setup] - strategy: - fail-fast: false - matrix: - include: - - build: linux-x64 - os: ubuntu-18.04 - target: x86_64-unknown-linux-gnu - llvm_url: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz' - - build: macos-x64 - os: macos-11 - target: x86_64-apple-darwin - llvm_url: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-apple-darwin.tar.xz' - - build: windows-x64 - os: windows-latest - target: x86_64-pc-windows-msvc - # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/12.x/windows-amd64.tar.gz' - llvm_choco_version: 13.0.0 - - build: linux-musl - target: x86_64-unknown-linux-musl - os: ubuntu-18.04 - container: alpine:latest - container: ${{ matrix.container }} - env: - SCCACHE_AZURE_BLOB_CONTAINER: wasmerstoragesccacheblob - SCCACHE_AZURE_CONNECTION_STRING: ${{ secrets.SCCACHE_AZURE_CONNECTION_STRING }} - steps: - - uses: actions/checkout@v3 - - name: Set up base deps on musl - if: matrix.build == 'linux-musl' - run: | - apk add build-base bash musl-dev curl tar make libtool libffi-dev gcc automake autoconf git openssl-dev g++ - - name: Set up libstdc++ on Linux - if: matrix.build == 'linux-x64' - run: | - sudo apt-get update -y - sudo apt-get install -y --allow-downgrades libstdc++6 - sudo apt-get install --reinstall g++-8 - - name: Set up base deps on musl - if: matrix.build == 'linux-musl' - run: | - apk add build-base bash musl-dev curl tar make libtool libffi-dev gcc automake autoconf git openssl-dev g++ - - 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.os == 'macos-latest' || matrix.os == 'macos-11.0' - - name: Install Rust - uses: dtolnay/rust-toolchain@stable - with: - toolchain: 1.63 - target: ${{ matrix.target }} - - name: Choco install LLVM - uses: crazy-max/ghaction-chocolatey@v2 - if: matrix.llvm_choco_version - with: - args: install llvm --version ${{ matrix.llvm_choco_version }} --allow-downgrade - - name: Install LLVM (Choco - Windows) - if: matrix.llvm_choco_version - shell: bash - run: | - cd 'C:\Program Files\LLVM\' - LLVM_DIR=$(pwd) - echo "LLVM_SYS_120_PREFIX=${LLVM_DIR}" >> $GITHUB_ENV - - name: Install LLVM (macOS Apple Silicon) - if: matrix.os == 'macos-11.0' && !matrix.llvm_url - run: | - brew install llvm - - name: Install LLVM - if: matrix.llvm_url - shell: bash - run: | - curl --proto '=https' --tlsv1.2 -sSf ${{ matrix.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_SYS_120_PREFIX=${LLVM_DIR}" >> $GITHUB_ENV - env: - LLVM_DIR: .llvm - - name: Setup Rust target - shell: bash - run: | - mkdir -p .cargo - cat << EOF > .cargo/config.toml - [build] - target = "${{ matrix.target }}" - EOF - if: matrix.target - - name: Cache - uses: whywaita/actions-cache-s3@v2 - with: - path: | - ~/.cargo/* - ./target/* - key: ${{ github.repository }}-${{ runner.os }}-${{ hashFiles('Cargo.lock') }}-wasmer-make-test-stage-1-${{ 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: Test - run: | - make test-stage-1 - env: - TARGET: ${{ matrix.target }} - TARGET_DIR: target/${{ matrix.target }}/release - CARGO_TARGET: --target ${{ matrix.target }} - - test_wasmer_stage_2: - name: Test Wasmer Stage 2 on ${{ matrix.build }} - runs-on: ${{ matrix.os }} - needs: setup - strategy: - fail-fast: false - matrix: - include: - - build: linux-x64 - os: ubuntu-18.04 - target: x86_64-unknown-linux-gnu - llvm_url: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz' - - build: macos-x64 - os: macos-11 - target: x86_64-apple-darwin - llvm_url: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-apple-darwin.tar.xz' - - build: windows-x64 - os: windows-latest - target: x86_64-pc-windows-msvc - # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/12.x/windows-amd64.tar.gz' - llvm_choco_version: 13.0.0 - - build: linux-musl - target: x86_64-unknown-linux-musl - os: ubuntu-18.04 - container: alpine:latest - container: ${{ matrix.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.build == 'linux-x64' - run: | - sudo apt-get update -y - sudo apt-get install -y --allow-downgrades libstdc++6 - sudo apt-get install --reinstall g++-8 - - name: Set up base deps on musl - if: matrix.build == 'linux-musl' - run: | - apk add build-base bash musl-dev curl tar make libtool libffi-dev gcc automake autoconf git openssl-dev g++ - - 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.os == 'macos-latest' || matrix.os == 'macos-11.0' - - name: Install Rust - uses: dtolnay/rust-toolchain@stable - with: - toolchain: 1.63 - target: ${{ matrix.target }} - - name: Choco install LLVM - uses: crazy-max/ghaction-chocolatey@v2 - if: matrix.llvm_choco_version - with: - args: install llvm --version ${{ matrix.llvm_choco_version }} --allow-downgrade - - name: Install LLVM (Choco - Windows) - if: matrix.llvm_choco_version - shell: bash - run: | - cd 'C:\Program Files\LLVM\' - LLVM_DIR=$(pwd) - echo "LLVM_SYS_120_PREFIX=${LLVM_DIR}" >> $GITHUB_ENV - - name: Install LLVM (macOS Apple Silicon) - if: matrix.os == 'macos-11.0' && !matrix.llvm_url - run: | - brew install llvm - - name: Install LLVM - if: matrix.llvm_url - shell: bash - run: | - curl --proto '=https' --tlsv1.2 -sSf ${{ matrix.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_SYS_120_PREFIX=${LLVM_DIR}" >> $GITHUB_ENV - env: - LLVM_DIR: .llvm - - name: Setup Rust target - shell: bash - run: | - mkdir -p .cargo - cat << EOF > .cargo/config.toml - [build] - target = "${{ matrix.target }}" - EOF - if: matrix.target - - name: Cache - uses: whywaita/actions-cache-s3@v2 - with: - path: | - ~/.cargo/* - ./target/* - key: ${{ github.repository }}-${{ runner.os }}-${{ hashFiles('Cargo.lock') }}-wasmer-make-test-stage-2-${{ 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: Test - run: | - make test-stage-2 - env: - TARGET: ${{ matrix.target }} - TARGET_DIR: target/${{ matrix.target }}/release - CARGO_TARGET: --target ${{ matrix.target }} - - test_wasmer_stage_3: - name: Test Wasmer Stage 3 on ${{ matrix.build }} - runs-on: ${{ matrix.os }} - needs: setup - strategy: - fail-fast: false - matrix: - include: - - build: linux-x64 - os: ubuntu-18.04 - target: x86_64-unknown-linux-gnu - llvm_url: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz' - - build: macos-x64 - os: macos-11 - target: x86_64-apple-darwin - llvm_url: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-apple-darwin.tar.xz' - - build: windows-x64 - os: windows-latest - target: x86_64-pc-windows-msvc - # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/12.x/windows-amd64.tar.gz' - llvm_choco_version: 13.0.0 - - build: linux-musl - target: x86_64-unknown-linux-musl - os: ubuntu-18.04 - container: alpine:latest - container: ${{ matrix.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.build == 'linux-x64' - run: | - sudo apt-get update -y - sudo apt-get install -y --allow-downgrades libstdc++6 - sudo apt-get install --reinstall g++-8 - - name: Set up base deps on musl - if: matrix.build == 'linux-musl' - run: | - apk add build-base bash musl-dev curl tar make libtool libffi-dev gcc automake autoconf git openssl-dev g++ - - 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.os == 'macos-latest' || matrix.os == 'macos-11.0' - - name: Install Rust - uses: dtolnay/rust-toolchain@stable - with: - toolchain: 1.63 - target: ${{ matrix.target }} - - name: Choco install LLVM - uses: crazy-max/ghaction-chocolatey@v2 - if: matrix.llvm_choco_version - with: - args: install llvm --version ${{ matrix.llvm_choco_version }} --allow-downgrade - - name: Install LLVM (Choco - Windows) - if: matrix.llvm_choco_version - shell: bash - run: | - cd 'C:\Program Files\LLVM\' - LLVM_DIR=$(pwd) - echo "LLVM_SYS_120_PREFIX=${LLVM_DIR}" >> $GITHUB_ENV - - name: Install LLVM (macOS Apple Silicon) - if: matrix.os == 'macos-11.0' && !matrix.llvm_url - run: | - brew install llvm - - name: Install LLVM - if: matrix.llvm_url - shell: bash - run: | - curl --proto '=https' --tlsv1.2 -sSf ${{ matrix.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_SYS_120_PREFIX=${LLVM_DIR}" >> $GITHUB_ENV - env: - LLVM_DIR: .llvm - - name: Setup Rust target - shell: bash - run: | - mkdir -p .cargo - cat << EOF > .cargo/config.toml - [build] - target = "${{ matrix.target }}" - EOF - if: matrix.target - - name: Cache - uses: whywaita/actions-cache-s3@v2 - with: - path: | - ~/.cargo/* - ./target/* - key: ${{ github.repository }}-${{ runner.os }}-${{ hashFiles('Cargo.lock') }}-wasmer-make-test-stage-3-${{ 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: Test + - name: Test stage 0 run: | - make test-stage-3 + make test-stage-0 env: TARGET: ${{ matrix.target }} TARGET_DIR: target/${{ matrix.target }}/release CARGO_TARGET: --target ${{ matrix.target }} - - test_wasmer_stage_4: - name: Test Wasmer Stage 4 on ${{ matrix.build }} - runs-on: ${{ matrix.os }} - needs: setup - strategy: - fail-fast: false - matrix: - include: - - build: linux-x64 - os: ubuntu-18.04 - target: x86_64-unknown-linux-gnu - llvm_url: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz' - - build: macos-x64 - os: macos-11 - target: x86_64-apple-darwin - llvm_url: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-apple-darwin.tar.xz' - - build: windows-x64 - os: windows-latest - target: x86_64-pc-windows-msvc - # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/12.x/windows-amd64.tar.gz' - llvm_choco_version: 13.0.0 - - build: linux-musl - target: x86_64-unknown-linux-musl - os: ubuntu-18.04 - container: alpine:latest - container: ${{ matrix.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.build == 'linux-x64' - run: | - sudo apt-get update -y - sudo apt-get install -y --allow-downgrades libstdc++6 - sudo apt-get install --reinstall g++-8 - - name: Set up base deps on musl - if: matrix.build == 'linux-musl' + - name: Test stage 2 run: | - apk add build-base bash musl-dev curl tar make libtool libffi-dev gcc automake autoconf git openssl-dev g++ - - 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.os == 'macos-latest' || matrix.os == 'macos-11.0' - - name: Install Rust - uses: dtolnay/rust-toolchain@stable - with: - toolchain: 1.63 - target: ${{ matrix.target }} - - name: Choco install LLVM - uses: crazy-max/ghaction-chocolatey@v2 - if: matrix.llvm_choco_version - with: - args: install llvm --version ${{ matrix.llvm_choco_version }} --allow-downgrade - - name: Install LLVM (Choco - Windows) - if: matrix.llvm_choco_version - shell: bash - run: | - cd 'C:\Program Files\LLVM\' - LLVM_DIR=$(pwd) - echo "LLVM_SYS_120_PREFIX=${LLVM_DIR}" >> $GITHUB_ENV - - name: Install LLVM (macOS Apple Silicon) - if: matrix.os == 'macos-11.0' && !matrix.llvm_url - run: | - brew install llvm - - name: Install LLVM - if: matrix.llvm_url - shell: bash - run: | - curl --proto '=https' --tlsv1.2 -sSf ${{ matrix.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_SYS_120_PREFIX=${LLVM_DIR}" >> $GITHUB_ENV + make test-stage-2 env: - LLVM_DIR: .llvm - - name: Setup Rust target - shell: bash + TARGET: ${{ matrix.target }} + TARGET_DIR: target/${{ matrix.target }}/release + CARGO_TARGET: --target ${{ matrix.target }} + - name: Test stage 3 run: | - mkdir -p .cargo - cat << EOF > .cargo/config.toml - [build] - target = "${{ matrix.target }}" - EOF - if: matrix.target - - name: Cache - uses: whywaita/actions-cache-s3@v2 - with: - path: | - ~/.cargo/* - ./target/* - key: ${{ github.repository }}-${{ runner.os }}-${{ hashFiles('Cargo.lock') }}-wasmer-make-test-stage-4-${{ 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: Test + make test-stage-3 + env: + TARGET: ${{ matrix.target }} + TARGET_DIR: target/${{ matrix.target }}/release + CARGO_TARGET: --target ${{ matrix.target }} + - name: Test stage 4 run: | make test-stage-4 env: TARGET: ${{ matrix.target }} TARGET_DIR: target/${{ matrix.target }}/release CARGO_TARGET: --target ${{ matrix.target }} - - test_wasmer_stage_5: - name: Test Wasmer Stage 5 on ${{ matrix.build }} - runs-on: ${{ matrix.os }} - needs: setup - strategy: - fail-fast: false - matrix: - include: - - build: linux-x64 - os: ubuntu-18.04 - target: x86_64-unknown-linux-gnu - llvm_url: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz' - - build: macos-x64 - os: macos-11 - target: x86_64-apple-darwin - llvm_url: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-apple-darwin.tar.xz' - - build: windows-x64 - os: windows-latest - target: x86_64-pc-windows-msvc - # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/12.x/windows-amd64.tar.gz' - llvm_choco_version: 13.0.0 - - build: linux-musl - target: x86_64-unknown-linux-musl - os: ubuntu-18.04 - container: alpine:latest - container: ${{ matrix.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.build == 'linux-x64' - run: | - sudo apt-get update -y - sudo apt-get install -y --allow-downgrades libstdc++6 - sudo apt-get install --reinstall g++-8 - - name: Set up base deps on musl - if: matrix.build == 'linux-musl' - run: | - apk add build-base bash musl-dev curl tar make libtool libffi-dev gcc automake autoconf git openssl-dev g++ - - 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.os == 'macos-latest' || matrix.os == 'macos-11.0' - - name: Install Rust - uses: dtolnay/rust-toolchain@stable - with: - toolchain: 1.63 - target: ${{ matrix.target }} - - name: Choco install LLVM - uses: crazy-max/ghaction-chocolatey@v2 - if: matrix.llvm_choco_version - with: - args: install llvm --version ${{ matrix.llvm_choco_version }} --allow-downgrade - - name: Install LLVM (Choco - Windows) - if: matrix.llvm_choco_version - shell: bash - run: | - cd 'C:\Program Files\LLVM\' - LLVM_DIR=$(pwd) - echo "LLVM_SYS_120_PREFIX=${LLVM_DIR}" >> $GITHUB_ENV - - name: Install LLVM (macOS Apple Silicon) - if: matrix.os == 'macos-11.0' && !matrix.llvm_url - run: | - brew install llvm - - name: Install LLVM - if: matrix.llvm_url - shell: bash + - name: Test stage 5 run: | - curl --proto '=https' --tlsv1.2 -sSf ${{ matrix.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_SYS_120_PREFIX=${LLVM_DIR}" >> $GITHUB_ENV + make test-stage-5 env: - LLVM_DIR: .llvm - - name: Setup Rust target - shell: bash + TARGET: ${{ matrix.target }} + TARGET_DIR: target/${{ matrix.target }}/release + CARGO_TARGET: --target ${{ matrix.target }} + - name: Test stage 6 run: | - mkdir -p .cargo - cat << EOF > .cargo/config.toml - [build] - target = "${{ matrix.target }}" - EOF - if: matrix.target - - name: Cache - uses: whywaita/actions-cache-s3@v2 - with: - path: | - ~/.cargo/* - ./target/* - key: ${{ github.repository }}-${{ runner.os }}-${{ hashFiles('Cargo.lock') }}-wasmer-make-test-stage-5-${{ 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: Test + make test-stage-6 + env: + TARGET: ${{ matrix.target }} + TARGET_DIR: target/${{ matrix.target }}/release + CARGO_TARGET: --target ${{ matrix.target }} + - name: Test stage 7 run: | - make test-stage-5 + make test-stage-7 env: TARGET: ${{ matrix.target }} TARGET_DIR: target/${{ matrix.target }}/release CARGO_TARGET: --target ${{ matrix.target }} - test_wasmer_stage_6: - name: Test Wasmer Stage 6 on ${{ matrix.build }} + test_wasmer_stage_1: + name: Test Wasmer Stage 1 on ${{ matrix.build }} runs-on: ${{ matrix.os }} - needs: setup + needs: [setup] strategy: fail-fast: false matrix: @@ -1279,6 +757,10 @@ jobs: SCCACHE_AZURE_CONNECTION_STRING: ${{ secrets.SCCACHE_AZURE_CONNECTION_STRING }} steps: - uses: actions/checkout@v3 + - name: Set up base deps on musl + if: matrix.build == 'linux-musl' + run: | + apk add build-base bash musl-dev curl tar make libtool libffi-dev gcc automake autoconf git openssl-dev g++ - name: Set up libstdc++ on Linux if: matrix.build == 'linux-x64' run: | @@ -1344,7 +826,7 @@ jobs: path: | ~/.cargo/* ./target/* - key: ${{ github.repository }}-${{ runner.os }}-${{ hashFiles('Cargo.lock') }}-wasmer-make-test-stage-6-${{ matrix.build }} + key: ${{ github.repository }}-${{ runner.os }}-${{ hashFiles('Cargo.lock') }}-wasmer-make-test-stage-1-${{ 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 }} @@ -1354,7 +836,7 @@ jobs: aws-s3-force-path-style: true - name: Test run: | - make test-stage-6 + make test-stage-1 env: TARGET: ${{ matrix.target }} TARGET_DIR: target/${{ matrix.target }}/release From c31866a1e37cd4796dcff71682529e3a5b87ec58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Mon, 12 Dec 2022 20:08:49 +0100 Subject: [PATCH 138/226] Fix make test-stage-8 --- .github/workflows/test.yaml | 19 +++++++++++++++---- Makefile | 6 +++++- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index fd48ad8b471..c687fe9ae1e 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -474,6 +474,10 @@ jobs: shell: bash run: | make build-capi && make package-capi + - name: Test C-API + shell: bash + run: | + make test-capi - name: Zip artifacts shell: bash run: | @@ -572,8 +576,8 @@ jobs: WAPM_DEV_TOKEN: ${{ secrets.WAPM_DEV_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - test_wasmer_stage_0: - name: Test Wasmer Stage 0 on ${{ matrix.build }} + test_wasmer_stages: + name: Test Wasmer Stage 8 on ${{ matrix.build }} runs-on: ${{ matrix.os }} needs: setup strategy: @@ -683,6 +687,13 @@ jobs: TARGET: ${{ matrix.target }} TARGET_DIR: target/${{ matrix.target }}/release CARGO_TARGET: --target ${{ matrix.target }} + - name: Test stage 1 + run: | + make test-stage-1 + env: + TARGET: ${{ matrix.target }} + TARGET_DIR: target/${{ matrix.target }}/release + CARGO_TARGET: --target ${{ matrix.target }} - name: Test stage 2 run: | make test-stage-2 @@ -727,7 +738,7 @@ jobs: CARGO_TARGET: --target ${{ matrix.target }} test_wasmer_stage_1: - name: Test Wasmer Stage 1 on ${{ matrix.build }} + name: Test Wasmer Stage 8 on ${{ matrix.build }} runs-on: ${{ matrix.os }} needs: [setup] strategy: @@ -836,7 +847,7 @@ jobs: aws-s3-force-path-style: true - name: Test run: | - make test-stage-1 + make test-stage-8 env: TARGET: ${{ matrix.target }} TARGET_DIR: target/${{ matrix.target }}/release diff --git a/Makefile b/Makefile index 8edf301dc8d..3e7268b0c15 100644 --- a/Makefile +++ b/Makefile @@ -484,7 +484,7 @@ test-stage-0: # test packages test-stage-1: - $(CARGO_BINARY) test $(CARGO_TARGET) --all --release $(exclude_tests) + $(CARGO_BINARY) test $(CARGO_TARGET) --all --release $(exclude_tests) --exclude wasmer-c-api-test-runner --exclude wasmer-capi-examples-runner test-stage-2: $(CARGO_BINARY) test $(CARGO_TARGET) --manifest-path lib/compiler-cranelift/Cargo.toml --release --no-default-features --features=std test-stage-3: @@ -498,6 +498,10 @@ test-stage-5: test-stage-6: $(CARGO_BINARY) test $(CARGO_TARGET) --release $(compiler_features) --features wasi --examples +test-stage-8: build-capi package-capi + $(CARGO_BINARY) test $(CARGO_TARGET) --release --package wasmer-c-api-test-runner + $(CARGO_BINARY) test $(CARGO_TARGET) --release --package wasmer-capi-examples-runner + test: test-compilers test-packages test-examples test-compilers: test-stage-0 From 8e27f9a8ee6505708ad292b64e87900392613def Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Mon, 12 Dec 2022 20:48:09 +0100 Subject: [PATCH 139/226] Add stage-8 to build-capi --- .github/workflows/test.yaml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index c687fe9ae1e..fe4adce5a4a 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -474,10 +474,15 @@ jobs: shell: bash run: | make build-capi && make package-capi + - name: Integration tests + shell: bash + run: | + make test-stage-8 - name: Test C-API shell: bash + if: matrix.build != linux-musl run: | - make test-capi + make test-capi-ci - name: Zip artifacts shell: bash run: | From ae3b31420a6e4e3f1e353e142dd2652e45bd7aba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Mon, 12 Dec 2022 20:48:45 +0100 Subject: [PATCH 140/226] Invert test-capi and build-capi --- .github/workflows/test.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index fe4adce5a4a..e60b0fbdb74 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -470,6 +470,11 @@ jobs: aws-endpoint: https://1541b1e8a3fc6ad155ce67ef38899700.r2.cloudflarestorage.com aws-s3-bucket-endpoint: false aws-s3-force-path-style: true + - name: Test C-API + shell: bash + if: matrix.build != linux-musl + run: | + make test-capi-ci - name: Build C-API shell: bash run: | @@ -478,11 +483,6 @@ jobs: shell: bash run: | make test-stage-8 - - name: Test C-API - shell: bash - if: matrix.build != linux-musl - run: | - make test-capi-ci - name: Zip artifacts shell: bash run: | From c3dc760bbe71c1e55e5ef0d85e56e355418ab94a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Mon, 12 Dec 2022 21:12:10 +0100 Subject: [PATCH 141/226] Fix typo --- .github/workflows/test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index e60b0fbdb74..d8392d2e252 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -472,7 +472,7 @@ jobs: aws-s3-force-path-style: true - name: Test C-API shell: bash - if: matrix.build != linux-musl + if: matrix.build != "linux-musl" run: | make test-capi-ci - name: Build C-API From 198cfb5020e3c4939b63d7d079e5476743abe3bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Mon, 12 Dec 2022 21:39:13 +0100 Subject: [PATCH 142/226] Fix typo --- .github/workflows/test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index d8392d2e252..0202ea50d3a 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -472,7 +472,7 @@ jobs: aws-s3-force-path-style: true - name: Test C-API shell: bash - if: matrix.build != "linux-musl" + if: matrix.os != 'x86_64-unknown-linux-musl' run: | make test-capi-ci - name: Build C-API From 6de4a2ceb509130a0ca0d30f0c2d1902023c27f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Mon, 12 Dec 2022 21:42:07 +0100 Subject: [PATCH 143/226] Remove unnecessary matrix --- .github/workflows/test.yaml | 186 +++++++----------------------------- Makefile | 2 +- 2 files changed, 33 insertions(+), 155 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 0202ea50d3a..97b987136b7 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -482,7 +482,7 @@ jobs: - name: Integration tests shell: bash run: | - make test-stage-8 + make test-stage-7 - name: Zip artifacts shell: bash run: | @@ -495,92 +495,6 @@ jobs: if-no-files-found: error retention-days: 2 - test_integration_cli: - name: Integration tests on ${{ matrix.build }} - runs-on: ${{ matrix.os }} - needs: [build_capi, build_wasmer] - strategy: - fail-fast: false - matrix: - include: - - build: linux-x64 - os: ubuntu-18.04 - target: x86_64-unknown-linux-gnu - llvm_url: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz' - - build: macos-x64 - os: macos-11 - target: x86_64-apple-darwin - llvm_url: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-apple-darwin.tar.xz' - - build: windows-x64 - os: windows-latest - target: x86_64-pc-windows-msvc - # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/12.x/windows-amd64.tar.gz' - llvm_choco_version: 13.0.0 - - build: linux-musl - target: x86_64-unknown-linux-musl - os: ubuntu-18.04 - container: alpine:latest - 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: | - apk add build-base bash musl-dev curl tar make libtool libffi-dev gcc automake autoconf git openssl-dev g++ - - uses: actions/download-artifact@v3 - id: download - with: - name: capi-${{ matrix.build }} - - uses: actions/download-artifact@v3 - 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: 1.63 - target: ${{ matrix.target }} - - name: Cache - uses: whywaita/actions-cache-s3@v2 - with: - path: | - ~/.cargo/* - ./target/* - key: ${{ 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: Unzip Artifacts - shell: bash - run: | - make untar-capi - - name: Unzip Artifacts - shell: bash - run: | - make untar-wasmer - - name: Test integration CLI - if: matrix.os != 'windows-latest' - shell: bash - run: | - export WASMER_DIR=`pwd`/package && make test-integration-cli - env: - TARGET: ${{ matrix.target }} - TARGET_DIR: target/${{ matrix.target }}/release - CARGO_TARGET: --target ${{ matrix.target }} - WAPM_DEV_TOKEN: ${{ secrets.WAPM_DEV_TOKEN }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - test_wasmer_stages: name: Test Wasmer Stage 8 on ${{ matrix.build }} runs-on: ${{ matrix.os }} @@ -734,18 +648,12 @@ jobs: TARGET: ${{ matrix.target }} TARGET_DIR: target/${{ matrix.target }}/release CARGO_TARGET: --target ${{ matrix.target }} - - name: Test stage 7 - run: | - make test-stage-7 - env: - TARGET: ${{ matrix.target }} - TARGET_DIR: target/${{ matrix.target }}/release - CARGO_TARGET: --target ${{ matrix.target }} - test_wasmer_stage_1: - name: Test Wasmer Stage 8 on ${{ matrix.build }} + + test_integration_cli: + name: Integration tests on ${{ matrix.build }} runs-on: ${{ matrix.os }} - needs: [setup] + needs: [build_capi, build_wasmer] strategy: fail-fast: false matrix: @@ -773,76 +681,34 @@ jobs: 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: | apk add build-base bash musl-dev curl tar make libtool libffi-dev gcc automake autoconf git openssl-dev g++ - - name: Set up libstdc++ on Linux - if: matrix.build == 'linux-x64' - run: | - sudo apt-get update -y - sudo apt-get install -y --allow-downgrades libstdc++6 - sudo apt-get install --reinstall g++-8 - - name: Set up base deps on musl - if: matrix.build == 'linux-musl' - run: | - apk add build-base bash musl-dev curl tar make libtool libffi-dev gcc automake autoconf git openssl-dev g++ - - 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.os == 'macos-latest' || matrix.os == 'macos-11.0' + - uses: actions/download-artifact@v3 + id: download + with: + name: capi-${{ matrix.build }} + - uses: actions/download-artifact@v3 + 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: 1.63 target: ${{ matrix.target }} - - name: Choco install LLVM - uses: crazy-max/ghaction-chocolatey@v2 - if: matrix.llvm_choco_version - with: - args: install llvm --version ${{ matrix.llvm_choco_version }} --allow-downgrade - - name: Install LLVM (Choco - Windows) - if: matrix.llvm_choco_version - shell: bash - run: | - cd 'C:\Program Files\LLVM\' - LLVM_DIR=$(pwd) - echo "LLVM_SYS_120_PREFIX=${LLVM_DIR}" >> $GITHUB_ENV - - name: Install LLVM (macOS Apple Silicon) - if: matrix.os == 'macos-11.0' && !matrix.llvm_url - run: | - brew install llvm - - name: Install LLVM - if: matrix.llvm_url - shell: bash - run: | - curl --proto '=https' --tlsv1.2 -sSf ${{ matrix.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_SYS_120_PREFIX=${LLVM_DIR}" >> $GITHUB_ENV - env: - LLVM_DIR: .llvm - - name: Setup Rust target - shell: bash - run: | - mkdir -p .cargo - cat << EOF > .cargo/config.toml - [build] - target = "${{ matrix.target }}" - EOF - if: matrix.target - name: Cache uses: whywaita/actions-cache-s3@v2 with: path: | ~/.cargo/* ./target/* - key: ${{ github.repository }}-${{ runner.os }}-${{ hashFiles('Cargo.lock') }}-wasmer-make-test-stage-1-${{ matrix.build }} + key: ${{ 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 }} @@ -850,10 +716,22 @@ jobs: aws-endpoint: https://1541b1e8a3fc6ad155ce67ef38899700.r2.cloudflarestorage.com aws-s3-bucket-endpoint: false aws-s3-force-path-style: true - - name: Test + - name: Unzip Artifacts + shell: bash + run: | + make untar-capi + - name: Unzip Artifacts + shell: bash run: | - make test-stage-8 + make untar-wasmer + - name: Test integration CLI + if: matrix.os != 'windows-latest' + shell: bash + run: | + export WASMER_DIR=`pwd`/package && make test-integration-cli env: TARGET: ${{ matrix.target }} TARGET_DIR: target/${{ matrix.target }}/release CARGO_TARGET: --target ${{ matrix.target }} + WAPM_DEV_TOKEN: ${{ secrets.WAPM_DEV_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/Makefile b/Makefile index cd4072292bb..6d8945e6b5f 100644 --- a/Makefile +++ b/Makefile @@ -498,7 +498,7 @@ test-stage-5: test-stage-6: $(CARGO_BINARY) test $(CARGO_TARGET) --release $(compiler_features) --features wasi --examples -test-stage-8: build-capi package-capi +test-stage-7: build-capi package-capi $(CARGO_BINARY) test $(CARGO_TARGET) --release --package wasmer-c-api-test-runner $(CARGO_BINARY) test $(CARGO_TARGET) --release --package wasmer-capi-examples-runner From 2e9d5cadbbd9593e29330ec9259374e1063bdda2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Mon, 12 Dec 2022 21:51:52 +0100 Subject: [PATCH 144/226] Reverse build-capi and test-capi again --- .github/workflows/test.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 97b987136b7..c0888e0deec 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -470,11 +470,6 @@ jobs: aws-endpoint: https://1541b1e8a3fc6ad155ce67ef38899700.r2.cloudflarestorage.com aws-s3-bucket-endpoint: false aws-s3-force-path-style: true - - name: Test C-API - shell: bash - if: matrix.os != 'x86_64-unknown-linux-musl' - run: | - make test-capi-ci - name: Build C-API shell: bash run: | @@ -483,6 +478,11 @@ jobs: shell: bash run: | make test-stage-7 + - name: Test C-API + shell: bash + if: matrix.os != 'x86_64-unknown-linux-musl' + run: | + make test-capi-ci - name: Zip artifacts shell: bash run: | From 2716cda090da6e1980a2b1e2b2170272cd25a846 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Mon, 12 Dec 2022 21:55:31 +0100 Subject: [PATCH 145/226] Try parallelizing multi-dimensional matrix --- .github/workflows/test.yaml | 50 ++++--------------------------------- 1 file changed, 5 insertions(+), 45 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index c0888e0deec..84c6b0f1ae6 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -502,6 +502,9 @@ jobs: strategy: fail-fast: false matrix: + max-parallel: 24 + version: [0, 1, 2, 3, 4, 5, 6] + job: [linux-x64, macos-x64, windows-x64, linux-musl] include: - build: linux-x64 os: ubuntu-18.04 @@ -591,7 +594,7 @@ jobs: path: | ~/.cargo/* ./target/* - key: ${{ github.repository }}-${{ runner.os }}-${{ hashFiles('Cargo.lock') }}-wasmer-make-test-stage-0-${{ matrix.build }} + key: ${{ github.repository }}-${{ runner.os }}-${{ hashFiles('Cargo.lock') }}-wasmer-make-test-stage-${{ matrix.stage }}-${{ 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 }} @@ -601,54 +604,11 @@ jobs: aws-s3-force-path-style: true - name: Test stage 0 run: | - make test-stage-0 + make test-stage-${{ matrix.stage }} env: TARGET: ${{ matrix.target }} TARGET_DIR: target/${{ matrix.target }}/release CARGO_TARGET: --target ${{ matrix.target }} - - name: Test stage 1 - run: | - make test-stage-1 - env: - TARGET: ${{ matrix.target }} - TARGET_DIR: target/${{ matrix.target }}/release - CARGO_TARGET: --target ${{ matrix.target }} - - name: Test stage 2 - run: | - make test-stage-2 - env: - TARGET: ${{ matrix.target }} - TARGET_DIR: target/${{ matrix.target }}/release - CARGO_TARGET: --target ${{ matrix.target }} - - name: Test stage 3 - run: | - make test-stage-3 - env: - TARGET: ${{ matrix.target }} - TARGET_DIR: target/${{ matrix.target }}/release - CARGO_TARGET: --target ${{ matrix.target }} - - name: Test stage 4 - run: | - make test-stage-4 - env: - TARGET: ${{ matrix.target }} - TARGET_DIR: target/${{ matrix.target }}/release - CARGO_TARGET: --target ${{ matrix.target }} - - name: Test stage 5 - run: | - make test-stage-5 - env: - TARGET: ${{ matrix.target }} - TARGET_DIR: target/${{ matrix.target }}/release - CARGO_TARGET: --target ${{ matrix.target }} - - name: Test stage 6 - run: | - make test-stage-6 - env: - TARGET: ${{ matrix.target }} - TARGET_DIR: target/${{ matrix.target }}/release - CARGO_TARGET: --target ${{ matrix.target }} - test_integration_cli: name: Integration tests on ${{ matrix.build }} From 869d3b4dbac5ffcdeb66e7b9c44aaf8a324546f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Mon, 12 Dec 2022 21:57:10 +0100 Subject: [PATCH 146/226] Fix max-parallel --- .github/workflows/test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 84c6b0f1ae6..ff98f107a87 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -502,7 +502,7 @@ jobs: strategy: fail-fast: false matrix: - max-parallel: 24 + max-parallel: 32 version: [0, 1, 2, 3, 4, 5, 6] job: [linux-x64, macos-x64, windows-x64, linux-musl] include: From b83d9f74c82058d362d9e06fb6ade90701843cba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Mon, 12 Dec 2022 21:57:51 +0100 Subject: [PATCH 147/226] Remove max-parallel --- .github/workflows/test.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index ff98f107a87..920970bbe07 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -502,7 +502,6 @@ jobs: strategy: fail-fast: false matrix: - max-parallel: 32 version: [0, 1, 2, 3, 4, 5, 6] job: [linux-x64, macos-x64, windows-x64, linux-musl] include: From b30e36747e16717fd16bab7aa3fe01d14c940ee8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Mon, 12 Dec 2022 22:00:28 +0100 Subject: [PATCH 148/226] Update headers --- .github/workflows/test.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 920970bbe07..ce6912e2448 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -496,13 +496,13 @@ jobs: retention-days: 2 test_wasmer_stages: - name: Test Wasmer Stage 8 on ${{ matrix.build }} + name: Test Wasmer Stage ${{ matrix.stage }} on ${{ matrix.job }} runs-on: ${{ matrix.os }} needs: setup strategy: fail-fast: false matrix: - version: [0, 1, 2, 3, 4, 5, 6] + stage: [0, 1, 2, 3, 4, 5, 6] job: [linux-x64, macos-x64, windows-x64, linux-musl] include: - build: linux-x64 From 98ebde4ffe7a741a7d51148b1e14ccf236eb6dd3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Mon, 12 Dec 2022 22:18:57 +0100 Subject: [PATCH 149/226] Add wasm32-wasi --- Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile b/Makefile index 6d8945e6b5f..d6fbeb9a8b1 100644 --- a/Makefile +++ b/Makefile @@ -569,6 +569,7 @@ test-wasi: test-examples: test-stage-5 test-stage-6 test-integration-cli: + rustup target add wasm32-wasi $(CARGO_BINARY) test $(CARGO_TARGET) --features webc_runner --no-fail-fast -p wasmer-integration-tests-cli -- --nocapture --test-threads=1 test-integration-ios: From 74ce33d1b5d262778aec4b589f32d0bfff47c919 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Mon, 12 Dec 2022 22:20:02 +0100 Subject: [PATCH 150/226] Remove wasm32-wasi --- Makefile | 1 - 1 file changed, 1 deletion(-) diff --git a/Makefile b/Makefile index d6fbeb9a8b1..6d8945e6b5f 100644 --- a/Makefile +++ b/Makefile @@ -569,7 +569,6 @@ test-wasi: test-examples: test-stage-5 test-stage-6 test-integration-cli: - rustup target add wasm32-wasi $(CARGO_BINARY) test $(CARGO_TARGET) --features webc_runner --no-fail-fast -p wasmer-integration-tests-cli -- --nocapture --test-threads=1 test-integration-ios: From 7eb444220ed00ed067d930e4da05cda2675f3732 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Tue, 13 Dec 2022 15:12:53 +0100 Subject: [PATCH 151/226] Disable integration tests on linux-musl and mac-arm --- .github/workflows/test.yaml | 9 +++++---- Makefile | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index ce6912e2448..a010a0645b8 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -277,7 +277,7 @@ jobs: CROSS_DOCKER_IN_DOCKER: true - name: Build C API run: | - make build-capi + make build-capi && make package-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 @@ -285,9 +285,9 @@ jobs: PKG_CONFIG_PATH: /usr/lib/aarch64-linux-gnu/pkgconfig PKG_CONFIG_ALLOW_CROSS: true ENABLE_LLVM: 0 - - name: Package C API + - name: C-API Integration tests run: | - make package-capi + make test-stage-7 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 @@ -474,8 +474,9 @@ jobs: shell: bash run: | make build-capi && make package-capi - - name: Integration tests + - name: C-API Integration tests shell: bash + if: matrix.build != 'macos-arm' && matrix.build != 'linux-musl' run: | make test-stage-7 - name: Test C-API diff --git a/Makefile b/Makefile index 6d8945e6b5f..fba0a508683 100644 --- a/Makefile +++ b/Makefile @@ -498,7 +498,7 @@ test-stage-5: test-stage-6: $(CARGO_BINARY) test $(CARGO_TARGET) --release $(compiler_features) --features wasi --examples -test-stage-7: build-capi package-capi +test-stage-7: $(CARGO_BINARY) test $(CARGO_TARGET) --release --package wasmer-c-api-test-runner $(CARGO_BINARY) test $(CARGO_TARGET) --release --package wasmer-capi-examples-runner From fd13604560398ecbeef7d9466a76c97f5d9e470b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Tue, 13 Dec 2022 15:20:02 +0100 Subject: [PATCH 152/226] Fix test_wasmer matrix --- .github/workflows/test.yaml | 82 +++++++++++++++++++++---------------- 1 file changed, 47 insertions(+), 35 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index a010a0645b8..4f7c1f131c4 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -497,46 +497,58 @@ jobs: retention-days: 2 test_wasmer_stages: - name: Test Wasmer Stage ${{ matrix.stage }} on ${{ matrix.job }} - runs-on: ${{ matrix.os }} + name: Test Wasmer Stage ${{ matrix.stage }} on ${{ matrix.metadata.build }} + runs-on: ${{ matrix.metadata.os }} needs: setup strategy: fail-fast: false matrix: stage: [0, 1, 2, 3, 4, 5, 6] - job: [linux-x64, macos-x64, windows-x64, linux-musl] - include: - - build: linux-x64 - os: ubuntu-18.04 + metadata: [ + { + build: linux-x64, + os: ubuntu-18.04, + target: x86_64-unknown-linux-gnu, + llvm_url: https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz + }, + { + build: linux-x64, + os: ubuntu-18.04, target: x86_64-unknown-linux-gnu - llvm_url: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz' - - build: macos-x64 - os: macos-11 - target: x86_64-apple-darwin + }, + { + build: macos-x64, + os: macos-11, + target: x86_64-apple-darwin, llvm_url: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-apple-darwin.tar.xz' - - build: windows-x64 - os: windows-2019 - target: x86_64-pc-windows-msvc - # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/12.x/windows-amd64.tar.gz' + }, + { + build: windows-x64, + os: windows-2019, + target: x86_64-pc-windows-msvc, llvm_choco_version: 13.0.0 - - build: linux-musl - target: x86_64-unknown-linux-musl - os: ubuntu-18.04 + }, + { + build: linux-musl, + target: x86_64-unknown-linux-musl, + os: ubuntu-18.04, container: alpine:latest - container: ${{ matrix.container }} + } + ] + 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.build == 'linux-x64' + 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++-8 - name: Set up base deps on musl - if: matrix.build == 'linux-musl' + if: matrix.metadata.build == 'linux-musl' run: | apk add build-base bash musl-dev curl tar make libtool libffi-dev gcc automake autoconf git openssl-dev g++ - name: Set up dependencies for Mac OS @@ -545,33 +557,33 @@ 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-latest' || matrix.os == 'macos-11.0' + if: matrix.metadata.os == 'macos-latest' || matrix.metadata.os == 'macos-11.0' - name: Install Rust uses: dtolnay/rust-toolchain@stable with: toolchain: 1.63 - target: ${{ matrix.target }} + target: ${{ matrix.metadata.target }} - name: Choco install LLVM uses: crazy-max/ghaction-chocolatey@v2 - if: matrix.llvm_choco_version + if: matrix.metadata.llvm_choco_version with: - args: install llvm --version ${{ matrix.llvm_choco_version }} --allow-downgrade + args: install llvm --version ${{ matrix.metadata.llvm_choco_version }} --allow-downgrade - name: Install LLVM (Choco - Windows) - if: matrix.llvm_choco_version + if: matrix.metadata.llvm_choco_version shell: bash run: | cd 'C:\Program Files\LLVM\' LLVM_DIR=$(pwd) echo "LLVM_SYS_120_PREFIX=${LLVM_DIR}" >> $GITHUB_ENV - name: Install LLVM (macOS Apple Silicon) - if: matrix.os == 'macos-11.0' && !matrix.llvm_url + if: matrix.metadata.os == 'macos-11.0' && !matrix.metadata.llvm_url run: | brew install llvm - name: Install LLVM - if: matrix.llvm_url + if: matrix.metadata.llvm_url shell: bash run: | - curl --proto '=https' --tlsv1.2 -sSf ${{ matrix.llvm_url }} -L -o llvm.tar.xz + 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} @@ -585,16 +597,16 @@ jobs: mkdir -p .cargo cat << EOF > .cargo/config.toml [build] - target = "${{ matrix.target }}" + target = "${{ matrix.metadata.target }}" EOF - if: matrix.target + if: matrix.metadata.target - name: Cache uses: whywaita/actions-cache-s3@v2 with: path: | ~/.cargo/* ./target/* - key: ${{ github.repository }}-${{ runner.os }}-${{ hashFiles('Cargo.lock') }}-wasmer-make-test-stage-${{ matrix.stage }}-${{ matrix.build }} + key: ${{ github.repository }}-${{ runner.os }}-${{ hashFiles('Cargo.lock') }}-wasmer-make-test-stage-${{ matrix.metadata.stage }}-${{ 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 }} @@ -604,11 +616,11 @@ jobs: aws-s3-force-path-style: true - name: Test stage 0 run: | - make test-stage-${{ matrix.stage }} + make test-stage-${{ matrix.metadata.stage }} env: - TARGET: ${{ matrix.target }} - TARGET_DIR: target/${{ matrix.target }}/release - CARGO_TARGET: --target ${{ matrix.target }} + TARGET: ${{ matrix.metadata.target }} + TARGET_DIR: target/${{ matrix.metadata.target }}/release + CARGO_TARGET: --target ${{ matrix.metadata.target }} test_integration_cli: name: Integration tests on ${{ matrix.build }} From 05003cf957bbe8273b2c4f6552f4503e42aba43e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Tue, 13 Dec 2022 15:20:35 +0100 Subject: [PATCH 153/226] Fix missing matrix.metadata.stage --- .github/workflows/test.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 4f7c1f131c4..929b71cc4c6 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -606,7 +606,7 @@ jobs: path: | ~/.cargo/* ./target/* - key: ${{ github.repository }}-${{ runner.os }}-${{ hashFiles('Cargo.lock') }}-wasmer-make-test-stage-${{ matrix.metadata.stage }}-${{ matrix.metadata.build }} + key: ${{ github.repository }}-${{ runner.os }}-${{ hashFiles('Cargo.lock') }}-wasmer-make-test-stage-${{ matrix.stage }}-${{ 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 }} @@ -616,7 +616,7 @@ jobs: aws-s3-force-path-style: true - name: Test stage 0 run: | - make test-stage-${{ matrix.metadata.stage }} + make test-stage-${{ matrix.stage }} env: TARGET: ${{ matrix.metadata.target }} TARGET_DIR: target/${{ matrix.metadata.target }}/release From db81ebf01c93b1ad1fba8f3d47adf3f13f6b4577 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Tue, 13 Dec 2022 15:22:16 +0100 Subject: [PATCH 154/226] Fix typo in test.yaml --- .github/workflows/test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 929b71cc4c6..587a85110d3 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -509,7 +509,7 @@ jobs: build: linux-x64, os: ubuntu-18.04, target: x86_64-unknown-linux-gnu, - llvm_url: https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz + llvm_url: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz' }, { build: linux-x64, From 411a79ed90c7c5b6900f26e2bc5992ecde675994 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Tue, 13 Dec 2022 15:22:48 +0100 Subject: [PATCH 155/226] Fix typo in test.yaml again --- .github/workflows/test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 587a85110d3..cb5b016db63 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -532,7 +532,7 @@ jobs: build: linux-musl, target: x86_64-unknown-linux-musl, os: ubuntu-18.04, - container: alpine:latest + container: 'alpine:latest' } ] container: ${{ matrix.metadata.container }} From 9e3ed6c64b547813ac19c7bcc033c222ad73e957 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Tue, 13 Dec 2022 15:49:03 +0100 Subject: [PATCH 156/226] Merge matrix for capi-linux-aarch64 --- .github/workflows/test.yaml | 310 ++++++++++-------------------------- 1 file changed, 83 insertions(+), 227 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index cb5b016db63..fbc28f24430 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -112,158 +112,21 @@ jobs: - run: | rustup target add wasm32-wasi make build-wasmer-wasm - - build_wasmer: - name: Build wasmer on ${{ matrix.build }} - runs-on: ${{ matrix.os }} - needs: setup - strategy: - fail-fast: false - matrix: - include: - - build: linux-x64 - os: ubuntu-18.04 - target: x86_64-unknown-linux-gnu - llvm_url: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz' - - build: macos-x64 - os: macos-11 - target: x86_64-apple-darwin - llvm_url: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-apple-darwin.tar.xz' - - build: macos-arm - os: macos-11.0 - target: aarch64-apple-darwin - - build: windows-x64 - os: windows-latest - target: x86_64-pc-windows-msvc - # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/12.x/windows-amd64.tar.gz' - llvm_choco_version: 13.0.0 - - build: linux-musl - target: x86_64-unknown-linux-musl - os: ubuntu-18.04 - container: alpine:latest - container: ${{ matrix.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.build == 'linux-x64' - run: | - sudo apt-get update -y - sudo apt-get install -y --allow-downgrades libstdc++6 - sudo apt-get install --reinstall g++-8 - - name: Set up base deps on musl - if: matrix.build == 'linux-musl' - run: | - apk add build-base bash musl-dev curl tar make libtool libffi-dev gcc automake autoconf git openssl-dev g++ - - 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.os == 'macos-latest' || matrix.os == 'macos-11.0' - - name: Install Rust - uses: dtolnay/rust-toolchain@stable - with: - toolchain: 1.63 - target: ${{ matrix.target }} - - name: Choco install LLVM - uses: crazy-max/ghaction-chocolatey@v2 - if: matrix.llvm_choco_version - with: - args: install llvm --version ${{ matrix.llvm_choco_version }} --allow-downgrade - - name: Install LLVM (Choco - Windows) - if: matrix.llvm_choco_version - shell: bash - run: | - cd 'C:\Program Files\LLVM\' - LLVM_DIR=$(pwd) - echo "LLVM_SYS_120_PREFIX=${LLVM_DIR}" >> $GITHUB_ENV - - name: Install LLVM (macOS Apple Silicon) - if: matrix.os == 'macos-11.0' && !matrix.llvm_url - run: | - brew install llvm - - name: Install LLVM - if: matrix.llvm_url - shell: bash - run: | - curl --proto '=https' --tlsv1.2 -sSf ${{ matrix.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_SYS_120_PREFIX=${LLVM_DIR}" >> $GITHUB_ENV - env: - LLVM_DIR: .llvm - - name: Setup Rust target - shell: bash - run: | - mkdir -p .cargo - cat << EOF > .cargo/config.toml - [build] - target = "${{ matrix.target }}" - EOF - if: matrix.target - - name: Cache - uses: whywaita/actions-cache-s3@v2 - with: - path: | - ~/.cargo/* - ./target/* - key: ${{ github.repository }}-${{ runner.os }}-${{ hashFiles('Cargo.lock') }}-wasmer-make-build-wasmer-${{ 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: Build wasmer-cli - shell: bash - run: | - make build-wasmer && make package-wasmer - - name: Zip artifacts - shell: bash - run: | - make tar-wasmer - - name: Archive production artifacts - uses: actions/upload-artifact@v3 - with: - name: wasmer-cli-${{ matrix.build }} - path: build-wasmer.tar.gz - if-no-files-found: error - retention-days: 2 - - build_wasmer_linux_aarch64: - name: Build wasmer on linux aarch64 - runs-on: ubuntu-18.04 - steps: - - uses: actions/checkout@v2 - - uses: dtolnay/rust-toolchain@stable - with: - toolchain: 1.61 - 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: --target aarch64-unknown-linux-gnu - PKG_CONFIG_PATH: /usr/lib/aarch64-linux-gnu/pkgconfig - PKG_CONFIG_ALLOW_CROSS: true - ENABLE_LLVM: 0 - - build_capi_linux_aarch64: - name: Build C-API on linux aarch64 + + build_linux_aarch64: + name: Build wasmer on linux aarch64 (docker) runs-on: ubuntu-18.04 + matrix: + build-what: [ + { + key: capi, + build-cmd: make build-capi && make package-capi && export WASMER_DIR=`pwd`/package && make test-stage-7 && make test-capi-ci && make tar-capi + }, + { + key: wasmer, + build-cmd: make build-wasmer && make package-wasmer && make tar-wasmer + } + ] steps: - uses: actions/checkout@v2 - uses: dtolnay/rust-toolchain@stable @@ -275,29 +138,9 @@ jobs: docker build -t wasmer/aarch64 ${GITHUB_WORKSPACE}/.github/cross-linux-aarch64/ env: CROSS_DOCKER_IN_DOCKER: true - - name: Build C API - run: | - make build-capi && make package-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: --target aarch64-unknown-linux-gnu - PKG_CONFIG_PATH: /usr/lib/aarch64-linux-gnu/pkgconfig - PKG_CONFIG_ALLOW_CROSS: true - ENABLE_LLVM: 0 - - name: C-API Integration tests - run: | - make test-stage-7 - 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: --target aarch64-unknown-linux-gnu - PKG_CONFIG_PATH: /usr/lib/aarch64-linux-gnu/pkgconfig - PKG_CONFIG_ALLOW_CROSS: true - ENABLE_LLVM: 0 - - name: Test C API + - name: Build ${{ matrix.build-what.key }} run: | - make test-capi-ci + ${{ 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 @@ -363,48 +206,68 @@ jobs: run: | cargo build --release --target x86_64-pc-windows-gnu --manifest-path lib/c-api/Cargo.toml --no-default-features --features wat,compiler,wasi,middlewares,webc_runner --features cranelift,singlepass,wasmer-artifact-create,static-artifact-create,wasmer-artifact-load,static-artifact-load - build_capi: - name: Build C-API on ${{ matrix.build }} - runs-on: ${{ matrix.os }} + build: + name: Build wasmer on ${{ matrix.metadata.build }} + runs-on: ${{ matrix.metadata.os }} needs: setup strategy: fail-fast: false matrix: - include: - - build: linux-x64 - os: ubuntu-18.04 - target: x86_64-unknown-linux-gnu + build-what: [ + { + key: capi, + build-cmd: make build-capi && make package-capi && export WASMER_DIR=`pwd`/package && make test-stage-7 && make test-capi-ci && make tar-capi + }, + { + key: wasmer, + build-cmd: make build-wasmer && make package-wasmer && make tar-wasmer + } + ] + metadata: [ + { + build: linux-x64, + os: ubuntu-18.04, + target: x86_64-unknown-linux-gnu, llvm_url: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz' - - build: macos-x64 - os: macos-11 - target: x86_64-apple-darwin + }, + { + build: linux-x64, + os: ubuntu-18.04, + target: x86_64-unknown-linux-gnu + }, + { + build: macos-x64, + os: macos-11, + target: x86_64-apple-darwin, llvm_url: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-apple-darwin.tar.xz' - - build: macos-arm - os: macos-11.0 - target: aarch64-apple-darwin - - build: windows-x64 - os: windows-latest - target: x86_64-pc-windows-msvc - # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/12.x/windows-amd64.tar.gz' + }, + { + build: windows-x64, + os: windows-2019, + target: x86_64-pc-windows-msvc, llvm_choco_version: 13.0.0 - - build: linux-musl - target: x86_64-unknown-linux-musl - os: ubuntu-18.04 - container: alpine:latest - container: ${{ matrix.container }} + }, + { + build: linux-musl, + target: x86_64-unknown-linux-musl, + os: ubuntu-18.04, + 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.build == 'linux-x64' + 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++-8 - name: Set up base deps on musl - if: matrix.build == 'linux-musl' + if: matrix.metadata.build == 'linux-musl' run: | apk add build-base bash musl-dev curl tar make libtool libffi-dev gcc automake autoconf git openssl-dev g++ - name: Set up dependencies for Mac OS @@ -413,7 +276,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-latest' || matrix.os == 'macos-11.0' + if: matrix.metadata.os == 'macos-latest' || matrix.metadata.os == 'macos-11.0' - name: Install Rust uses: dtolnay/rust-toolchain@stable with: @@ -421,25 +284,25 @@ jobs: target: ${{ matrix.target }} - name: Choco install LLVM uses: crazy-max/ghaction-chocolatey@v2 - if: matrix.llvm_choco_version + if: matrix.metadata.llvm_choco_version with: - args: install llvm --version ${{ matrix.llvm_choco_version }} --allow-downgrade + args: install llvm --version ${{ matrix.metadata.llvm_choco_version }} --allow-downgrade - name: Install LLVM (Choco - Windows) - if: matrix.llvm_choco_version + if: matrix.metadata.llvm_choco_version shell: bash run: | cd 'C:\Program Files\LLVM\' LLVM_DIR=$(pwd) echo "LLVM_SYS_120_PREFIX=${LLVM_DIR}" >> $GITHUB_ENV - name: Install LLVM (macOS Apple Silicon) - if: matrix.os == 'macos-11.0' && !matrix.llvm_url + if: matrix.metadata.os == 'macos-11.0' && !matrix.metadata.llvm_url run: | brew install llvm - name: Install LLVM - if: matrix.llvm_url + if: matrix.metadata.llvm_url shell: bash run: | - curl --proto '=https' --tlsv1.2 -sSf ${{ matrix.llvm_url }} -L -o llvm.tar.xz + 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} @@ -453,16 +316,16 @@ jobs: mkdir -p .cargo cat << EOF > .cargo/config.toml [build] - target = "${{ matrix.target }}" + target = "${{ matrix.metadata.target }}" EOF - if: matrix.target + if: matrix.metadata.target - name: Cache uses: whywaita/actions-cache-s3@v2 with: path: | ~/.cargo/* ./target/* - key: ${{ github.repository }}-${{ runner.os }}-${{ hashFiles('Cargo.lock') }}-wasmer-make-build-capi-${{ matrix.build }} + key: ${{ 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 }} @@ -470,33 +333,26 @@ jobs: 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: | - make build-capi && make package-capi - - name: C-API Integration tests - shell: bash - if: matrix.build != 'macos-arm' && matrix.build != 'linux-musl' - run: | - make test-stage-7 - - name: Test C-API - shell: bash - if: matrix.os != 'x86_64-unknown-linux-musl' - run: | - make test-capi-ci - - name: Zip artifacts + - name: Build ${{ matrix.build-what.key }} shell: bash run: | - make tar-capi + ${{ matrix.build-what.build-cmd }} - name: Archive production artifacts uses: actions/upload-artifact@v3 with: - name: capi-${{ matrix.build }} + name: wasmer-cli-${{ matrix.metadata.build }} + path: build-wasmer.tar.gz + if-no-files-found: continue + retention-days: 2 + - name: Archive production artifacts + uses: actions/upload-artifact@v3 + with: + name: capi-${{ matrix.metadata.build }} path: build-capi.tar.gz - if-no-files-found: error + if-no-files-found: continue retention-days: 2 - test_wasmer_stages: + test: name: Test Wasmer Stage ${{ matrix.stage }} on ${{ matrix.metadata.build }} runs-on: ${{ matrix.metadata.os }} needs: setup @@ -625,7 +481,7 @@ jobs: test_integration_cli: name: Integration tests on ${{ matrix.build }} runs-on: ${{ matrix.os }} - needs: [build_capi, build_wasmer] + needs: [build] strategy: fail-fast: false matrix: From ec98d3161a0e9cd7c07f4ed0b40fdf6d9ce76a3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Tue, 13 Dec 2022 15:50:25 +0100 Subject: [PATCH 157/226] Fix missing strategy --- .github/workflows/test.yaml | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index fbc28f24430..53dbd823296 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -116,17 +116,19 @@ jobs: build_linux_aarch64: name: Build wasmer on linux aarch64 (docker) runs-on: ubuntu-18.04 - matrix: - build-what: [ - { - key: capi, - build-cmd: make build-capi && make package-capi && export WASMER_DIR=`pwd`/package && make test-stage-7 && make test-capi-ci && make tar-capi - }, - { - key: wasmer, - build-cmd: make build-wasmer && make package-wasmer && make tar-wasmer - } - ] + strategy: + fail-fast: false + matrix: + build-what: [ + { + key: capi, + build-cmd: make build-capi && make package-capi && export WASMER_DIR=`pwd`/package && make test-stage-7 && make test-capi-ci && make tar-capi + }, + { + key: wasmer, + build-cmd: make build-wasmer && make package-wasmer && make tar-wasmer + } + ] steps: - uses: actions/checkout@v2 - uses: dtolnay/rust-toolchain@stable From e75f3ab3a8c58dc8beacb0dd223b71f56f1b86af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Tue, 13 Dec 2022 16:07:37 +0100 Subject: [PATCH 158/226] Fix if-file-not-found --- .github/workflows/test.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 53dbd823296..a08de59114b 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -344,14 +344,14 @@ jobs: with: name: wasmer-cli-${{ matrix.metadata.build }} path: build-wasmer.tar.gz - if-no-files-found: continue + if-no-files-found: ignore retention-days: 2 - name: Archive production artifacts uses: actions/upload-artifact@v3 with: name: capi-${{ matrix.metadata.build }} path: build-capi.tar.gz - if-no-files-found: continue + if-no-files-found: ignore retention-days: 2 test: From c2065a30b38889947070167eab0efd03de918f7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Tue, 13 Dec 2022 17:06:59 +0100 Subject: [PATCH 159/226] Fix descriptions --- .github/workflows/test.yaml | 53 ++++++++++++++++++++++++++++++------- 1 file changed, 43 insertions(+), 10 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index a08de59114b..66ae5b40e92 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -114,7 +114,7 @@ jobs: make build-wasmer-wasm build_linux_aarch64: - name: Build wasmer on linux aarch64 (docker) + name: ${{ matrix.build-what.name }} on linux-aarch64 runs-on: ubuntu-18.04 strategy: fail-fast: false @@ -122,11 +122,13 @@ jobs: build-what: [ { key: capi, - build-cmd: make build-capi && make package-capi && export WASMER_DIR=`pwd`/package && make test-stage-7 && make test-capi-ci && make tar-capi + build-cmd: 'make build-capi && make package-capi && export WASMER_DIR=`pwd`/package && make test-stage-7 && make test-capi-ci && make tar-capi', + name: 'Build and test C-API' }, { key: wasmer, - build-cmd: make build-wasmer && make package-wasmer && make tar-wasmer + build-cmd: 'make build-wasmer && make package-wasmer && make tar-wasmer', + name: 'Build wasmer-cli' } ] steps: @@ -209,7 +211,7 @@ jobs: cargo build --release --target x86_64-pc-windows-gnu --manifest-path lib/c-api/Cargo.toml --no-default-features --features wat,compiler,wasi,middlewares,webc_runner --features cranelift,singlepass,wasmer-artifact-create,static-artifact-create,wasmer-artifact-load,static-artifact-load build: - name: Build wasmer on ${{ matrix.metadata.build }} + name: ${{ matrix.build-what.name }} on ${{ matrix.metadata.build }} runs-on: ${{ matrix.metadata.os }} needs: setup strategy: @@ -218,11 +220,13 @@ jobs: build-what: [ { key: capi, - build-cmd: make build-capi && make package-capi && export WASMER_DIR=`pwd`/package && make test-stage-7 && make test-capi-ci && make tar-capi + build-cmd: 'make build-capi && make package-capi && export WASMER_DIR=`pwd`/package && make test-stage-7 && make test-capi-ci && make tar-capi', + name: 'Build and test C-API' }, { key: wasmer, - build-cmd: make build-wasmer && make package-wasmer && make tar-wasmer + build-cmd: 'make build-wasmer && make package-wasmer && make tar-wasmer', + name: 'Build wasmer-cli' } ] metadata: [ @@ -355,13 +359,42 @@ jobs: retention-days: 2 test: - name: Test Wasmer Stage ${{ matrix.stage }} on ${{ matrix.metadata.build }} + name: ${{ matrix.stage.description }} on ${{ matrix.metadata.build }} runs-on: ${{ matrix.metadata.os }} needs: setup strategy: fail-fast: false matrix: - stage: [0, 1, 2, 3, 4, 5, 6] + stage: [ + { + stage: 0, + description: 'Test compilers', + }, + { + stage: 1, + description: 'Test packages (cargo test --all)', + }, + { + stage: 2, + description: 'Test packages (test compiler-cranelift)', + }, + { + stage: 3, + description: 'Test packages (test compiler-singlepass)', + }, + { + stage: 4, + description: 'Test packages (test lib/cli)', + }, + { + stage: 5, + description: 'Test examples (debug)', + }, + { + stage: 6, + description: 'Test examples (release)', + } + ] metadata: [ { build: linux-x64, @@ -464,7 +497,7 @@ jobs: path: | ~/.cargo/* ./target/* - key: ${{ github.repository }}-${{ runner.os }}-${{ hashFiles('Cargo.lock') }}-wasmer-make-test-stage-${{ matrix.stage }}-${{ matrix.metadata.build }} + key: ${{ github.repository }}-${{ runner.os }}-${{ hashFiles('Cargo.lock') }}-wasmer-make-test-stage-${{ matrix.stage.stage }}-${{ 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 }} @@ -474,7 +507,7 @@ jobs: aws-s3-force-path-style: true - name: Test stage 0 run: | - make test-stage-${{ matrix.stage }} + make test-stage-${{ matrix.stage.stage }} env: TARGET: ${{ matrix.metadata.target }} TARGET_DIR: target/${{ matrix.metadata.target }}/release From 892ff3bbc80c058221e8a5ca766e7f1242102320 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Tue, 13 Dec 2022 17:08:43 +0100 Subject: [PATCH 160/226] Improve descriptions --- .github/workflows/test.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 66ae5b40e92..e6493a64614 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -372,19 +372,19 @@ jobs: }, { stage: 1, - description: 'Test packages (cargo test --all)', + description: 'cargo test --all', }, { stage: 2, - description: 'Test packages (test compiler-cranelift)', + description: 'Test compiler-cranelift', }, { stage: 3, - description: 'Test packages (test compiler-singlepass)', + description: 'Test compiler-singlepass', }, { stage: 4, - description: 'Test packages (test lib/cli)', + description: 'Test lib/cli', }, { stage: 5, From fd6b4d695d2fdc392cac96733ad3332703a772ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Tue, 13 Dec 2022 18:09:06 +0100 Subject: [PATCH 161/226] Fix build-capi on linux: we weren't running tests before --- .github/workflows/test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index e6493a64614..3966c02786f 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -122,7 +122,7 @@ jobs: build-what: [ { key: capi, - build-cmd: 'make build-capi && make package-capi && export WASMER_DIR=`pwd`/package && make test-stage-7 && make test-capi-ci && make tar-capi', + build-cmd: 'make build-capi', name: 'Build and test C-API' }, { From 6f4fc0c8cbdfc8085f8a6cc9b272e03e863eb1d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Tue, 13 Dec 2022 18:31:01 +0100 Subject: [PATCH 162/226] Fix CI and bust cache --- .github/workflows/test.yaml | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 3966c02786f..52ece78b953 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -56,7 +56,7 @@ jobs: path: | ~/.cargo/* ./target/* - key: ${{ github.repository }}-${{ runner.os }}-${{ hashFiles('Cargo.lock') }}-wasmer-make-lint-linux-x64 + key: cache-${{ 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 }} @@ -176,7 +176,7 @@ jobs: path: | ~/.cargo/* ./target/* - key: ${{ github.repository }}-${{ runner.os }}-${{ hashFiles('Cargo.lock') }}-wasmer-make-build-capi-windows-gnu + key: cache-${{ github.repository }}-${{ runner.os }}-${{ hashFiles('Cargo.lock') }}-wasmer-make-build-capi-windows-gnu 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 }} @@ -331,7 +331,7 @@ jobs: path: | ~/.cargo/* ./target/* - key: ${{ github.repository }}-${{ runner.os }}-${{ hashFiles('Cargo.lock') }}-wasmer-make-build-wasmer-${{ matrix.build-what.key }}-${{ matrix.metadata.build }} + key: cache-${{ 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 }} @@ -341,8 +341,15 @@ jobs: aws-s3-force-path-style: true - name: Build ${{ matrix.build-what.key }} shell: bash + # tests were disabled for linux-musl + if: matrix.build-what == 'capi' && matrix.metadata.build != "linux-musl" run: | ${{ matrix.build-what.build-cmd }} + - name: Build ${{ matrix.build-what.key }} + shell: bash + if: matrix.build-what == 'capi' && matrix.metadata.build == "linux-musl" + run: | + make build-capi && make package-capi && make tar-capi - name: Archive production artifacts uses: actions/upload-artifact@v3 with: @@ -497,7 +504,7 @@ jobs: path: | ~/.cargo/* ./target/* - key: ${{ github.repository }}-${{ runner.os }}-${{ hashFiles('Cargo.lock') }}-wasmer-make-test-stage-${{ matrix.stage.stage }}-${{ matrix.metadata.build }} + key: cache-${{ github.repository }}-${{ runner.os }}-${{ hashFiles('Cargo.lock') }}-wasmer-make-test-stage-${{ matrix.stage.stage }}-${{ 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 }} @@ -571,7 +578,7 @@ jobs: path: | ~/.cargo/* ./target/* - key: ${{ github.repository }}-${{ runner.os }}-${{ hashFiles('Cargo.lock') }}-wasmer-make-test-integration-cli-${{ matrix.build }} + key: cache-${{ 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 }} From 59c11654794326384876100c0d8b589e193d937e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Tue, 13 Dec 2022 19:02:18 +0100 Subject: [PATCH 163/226] Fix typo --- .github/workflows/test.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 52ece78b953..75281fc2e8d 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -342,12 +342,12 @@ jobs: - name: Build ${{ matrix.build-what.key }} shell: bash # tests were disabled for linux-musl - if: matrix.build-what == 'capi' && matrix.metadata.build != "linux-musl" + if: matrix.build-what.key == 'capi' && matrix.metadata.build != 'linux-musl' run: | ${{ matrix.build-what.build-cmd }} - name: Build ${{ matrix.build-what.key }} shell: bash - if: matrix.build-what == 'capi' && matrix.metadata.build == "linux-musl" + if: matrix.build-what.key == 'capi' && matrix.metadata.build == 'linux-musl' run: | make build-capi && make package-capi && make tar-capi - name: Archive production artifacts From 58378708488f04a1a44913d9df1828092025dd79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Tue, 13 Dec 2022 19:09:11 +0100 Subject: [PATCH 164/226] Fix conditional on build-wasmer --- .github/workflows/test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 75281fc2e8d..699bccd7ad3 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -342,7 +342,7 @@ jobs: - name: Build ${{ matrix.build-what.key }} shell: bash # tests were disabled for linux-musl - if: matrix.build-what.key == 'capi' && matrix.metadata.build != 'linux-musl' + if: ${{ !(matrix.build-what.key == 'capi' && matrix.metadata.build == 'linux-musl') }} run: | ${{ matrix.build-what.build-cmd }} - name: Build ${{ matrix.build-what.key }} From 23d0b797ac7adc81bc2d0d6d201fd296847d5db1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Tue, 13 Dec 2022 19:29:44 +0100 Subject: [PATCH 165/226] Bust cache again --- .github/workflows/test.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 699bccd7ad3..f54f1229ab6 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -56,7 +56,7 @@ jobs: path: | ~/.cargo/* ./target/* - key: cache-${{ github.repository }}-${{ runner.os }}-${{ hashFiles('Cargo.lock') }}-wasmer-make-lint-linux-x64 + key: s3-${{ 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 }} @@ -176,7 +176,7 @@ jobs: path: | ~/.cargo/* ./target/* - key: cache-${{ github.repository }}-${{ runner.os }}-${{ hashFiles('Cargo.lock') }}-wasmer-make-build-capi-windows-gnu + key: s3-${{ github.repository }}-${{ runner.os }}-${{ hashFiles('Cargo.lock') }}-wasmer-make-build-capi-windows-gnu 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 }} @@ -331,7 +331,7 @@ jobs: path: | ~/.cargo/* ./target/* - key: cache-${{ github.repository }}-${{ runner.os }}-${{ hashFiles('Cargo.lock') }}-wasmer-make-build-wasmer-${{ matrix.build-what.key }}-${{ matrix.metadata.build }} + key: s3-${{ 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 }} @@ -504,7 +504,7 @@ jobs: path: | ~/.cargo/* ./target/* - key: cache-${{ github.repository }}-${{ runner.os }}-${{ hashFiles('Cargo.lock') }}-wasmer-make-test-stage-${{ matrix.stage.stage }}-${{ matrix.metadata.build }} + key: s3-${{ github.repository }}-${{ runner.os }}-${{ hashFiles('Cargo.lock') }}-wasmer-make-test-stage-${{ matrix.stage.stage }}-${{ 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 }} @@ -578,7 +578,7 @@ jobs: path: | ~/.cargo/* ./target/* - key: cache-${{ github.repository }}-${{ runner.os }}-${{ hashFiles('Cargo.lock') }}-wasmer-make-test-integration-cli-${{ matrix.build }} + key: s3-${{ 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 }} From 72064fcfab274a33d7b8834f3618ed342a0e390c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Wed, 14 Dec 2022 12:11:05 +0100 Subject: [PATCH 166/226] Remove testing examples in release mode --- .github/workflows/test.yaml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index f54f1229ab6..983feb308f1 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -396,10 +396,6 @@ jobs: { stage: 5, description: 'Test examples (debug)', - }, - { - stage: 6, - description: 'Test examples (release)', } ] metadata: [ From bde16511d8346d439bd2fb149fcbd3dd0479869d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Wed, 14 Dec 2022 12:14:23 +0100 Subject: [PATCH 167/226] Merge test stage 2 and 3 with stage 1 --- .github/workflows/test.yaml | 8 -------- Makefile | 4 +--- 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 983feb308f1..02221f62bf5 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -381,14 +381,6 @@ jobs: stage: 1, description: 'cargo test --all', }, - { - stage: 2, - description: 'Test compiler-cranelift', - }, - { - stage: 3, - description: 'Test compiler-singlepass', - }, { stage: 4, description: 'Test lib/cli', diff --git a/Makefile b/Makefile index fba0a508683..661ca450be4 100644 --- a/Makefile +++ b/Makefile @@ -485,9 +485,7 @@ test-stage-0: # test packages test-stage-1: $(CARGO_BINARY) test $(CARGO_TARGET) --all --release $(exclude_tests) --exclude wasmer-c-api-test-runner --exclude wasmer-capi-examples-runner -test-stage-2: $(CARGO_BINARY) test $(CARGO_TARGET) --manifest-path lib/compiler-cranelift/Cargo.toml --release --no-default-features --features=std -test-stage-3: $(CARGO_BINARY) test $(CARGO_TARGET) --manifest-path lib/compiler-singlepass/Cargo.toml --release --no-default-features --features=std test-stage-4: $(CARGO_BINARY) test $(CARGO_TARGET) --manifest-path lib/cli/Cargo.toml $(compiler_features) --release @@ -506,7 +504,7 @@ test: test-compilers test-packages test-examples test-compilers: test-stage-0 -test-packages: test-stage-1 test-stage-2 test-stage-3 test-stage-4 +test-packages: test-stage-1 test-stage-4 test-js: test-js-api test-js-wasi From 5f931a26fb5fe49654ee1438691188ee21a850f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Wed, 14 Dec 2022 12:16:16 +0100 Subject: [PATCH 168/226] Merge test-stage 4 with stage 1 --- .github/workflows/test.yaml | 8 ++------ Makefile | 3 +-- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 02221f62bf5..d276f5dfa88 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -379,15 +379,11 @@ jobs: }, { stage: 1, - description: 'cargo test --all', - }, - { - stage: 4, - description: 'Test lib/cli', + description: 'Test packages', }, { stage: 5, - description: 'Test examples (debug)', + description: 'Test examples', } ] metadata: [ diff --git a/Makefile b/Makefile index 661ca450be4..f4d774d4754 100644 --- a/Makefile +++ b/Makefile @@ -487,7 +487,6 @@ test-stage-1: $(CARGO_BINARY) test $(CARGO_TARGET) --all --release $(exclude_tests) --exclude wasmer-c-api-test-runner --exclude wasmer-capi-examples-runner $(CARGO_BINARY) test $(CARGO_TARGET) --manifest-path lib/compiler-cranelift/Cargo.toml --release --no-default-features --features=std $(CARGO_BINARY) test $(CARGO_TARGET) --manifest-path lib/compiler-singlepass/Cargo.toml --release --no-default-features --features=std -test-stage-4: $(CARGO_BINARY) test $(CARGO_TARGET) --manifest-path lib/cli/Cargo.toml $(compiler_features) --release # test examples @@ -504,7 +503,7 @@ test: test-compilers test-packages test-examples test-compilers: test-stage-0 -test-packages: test-stage-1 test-stage-4 +test-packages: test-stage-1 test-js: test-js-api test-js-wasi From dce7f5a7d874797214e7a02650699df037ad6f61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Wed, 14 Dec 2022 12:29:44 +0100 Subject: [PATCH 169/226] Use same compiler features for all test-packages step --- Makefile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index f4d774d4754..40787c6a0ed 100644 --- a/Makefile +++ b/Makefile @@ -484,10 +484,10 @@ test-stage-0: # test packages test-stage-1: - $(CARGO_BINARY) test $(CARGO_TARGET) --all --release $(exclude_tests) --exclude wasmer-c-api-test-runner --exclude wasmer-capi-examples-runner - $(CARGO_BINARY) test $(CARGO_TARGET) --manifest-path lib/compiler-cranelift/Cargo.toml --release --no-default-features --features=std - $(CARGO_BINARY) test $(CARGO_TARGET) --manifest-path lib/compiler-singlepass/Cargo.toml --release --no-default-features --features=std - $(CARGO_BINARY) test $(CARGO_TARGET) --manifest-path lib/cli/Cargo.toml $(compiler_features) --release + $(CARGO_BINARY) test $(CARGO_TARGET) $(compiler_features) --all --release $(exclude_tests) --exclude wasmer-c-api-test-runner --exclude wasmer-capi-examples-runner + $(CARGO_BINARY) test $(CARGO_TARGET) $(compiler_features) --manifest-path lib/compiler-cranelift/Cargo.toml --release --no-default-features --features=std + $(CARGO_BINARY) test $(CARGO_TARGET) $(compiler_features) --manifest-path lib/compiler-singlepass/Cargo.toml --release --no-default-features --features=std + $(CARGO_BINARY) test $(CARGO_TARGET) $(compiler_features) --manifest-path lib/cli/Cargo.toml --release # test examples test-stage-5: From f6bd3626d712f550d074d6795e23a8ec901cd60a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Wed, 14 Dec 2022 12:53:49 +0100 Subject: [PATCH 170/226] Bust cache again + reorder compiler features to avoid recompilation --- .github/workflows/test.yaml | 10 +++++----- Makefile | 10 ++++------ 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index d276f5dfa88..dbd0ed015fb 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -56,7 +56,7 @@ jobs: path: | ~/.cargo/* ./target/* - key: s3-${{ github.repository }}-${{ runner.os }}-${{ hashFiles('Cargo.lock') }}-wasmer-make-lint-linux-x64 + key: r2-${{ 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 }} @@ -176,7 +176,7 @@ jobs: path: | ~/.cargo/* ./target/* - key: s3-${{ github.repository }}-${{ runner.os }}-${{ hashFiles('Cargo.lock') }}-wasmer-make-build-capi-windows-gnu + key: r2-${{ github.repository }}-${{ runner.os }}-${{ hashFiles('Cargo.lock') }}-wasmer-make-build-capi-windows-gnu 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 }} @@ -331,7 +331,7 @@ jobs: path: | ~/.cargo/* ./target/* - key: s3-${{ github.repository }}-${{ runner.os }}-${{ hashFiles('Cargo.lock') }}-wasmer-make-build-wasmer-${{ matrix.build-what.key }}-${{ matrix.metadata.build }} + key: r2-${{ 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 }} @@ -488,7 +488,7 @@ jobs: path: | ~/.cargo/* ./target/* - key: s3-${{ github.repository }}-${{ runner.os }}-${{ hashFiles('Cargo.lock') }}-wasmer-make-test-stage-${{ matrix.stage.stage }}-${{ matrix.metadata.build }} + key: r2-${{ github.repository }}-${{ runner.os }}-${{ hashFiles('Cargo.lock') }}-wasmer-make-test-stage-${{ matrix.stage.stage }}-${{ 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 }} @@ -562,7 +562,7 @@ jobs: path: | ~/.cargo/* ./target/* - key: s3-${{ github.repository }}-${{ runner.os }}-${{ hashFiles('Cargo.lock') }}-wasmer-make-test-integration-cli-${{ matrix.build }} + key: r2-${{ 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 }} diff --git a/Makefile b/Makefile index 40787c6a0ed..18f632a3f13 100644 --- a/Makefile +++ b/Makefile @@ -484,16 +484,14 @@ test-stage-0: # test packages test-stage-1: - $(CARGO_BINARY) test $(CARGO_TARGET) $(compiler_features) --all --release $(exclude_tests) --exclude wasmer-c-api-test-runner --exclude wasmer-capi-examples-runner - $(CARGO_BINARY) test $(CARGO_TARGET) $(compiler_features) --manifest-path lib/compiler-cranelift/Cargo.toml --release --no-default-features --features=std - $(CARGO_BINARY) test $(CARGO_TARGET) $(compiler_features) --manifest-path lib/compiler-singlepass/Cargo.toml --release --no-default-features --features=std $(CARGO_BINARY) test $(CARGO_TARGET) $(compiler_features) --manifest-path lib/cli/Cargo.toml --release + $(CARGO_BINARY) test $(CARGO_TARGET) $(compiler_features) --all --release $(exclude_tests) --exclude wasmer-c-api-test-runner --exclude wasmer-capi-examples-runner + $(CARGO_BINARY) test $(CARGO_TARGET) --manifest-path lib/compiler-cranelift/Cargo.toml --release --no-default-features --features=std + $(CARGO_BINARY) test $(CARGO_TARGET) --manifest-path lib/compiler-singlepass/Cargo.toml --release --no-default-features --features=std # test examples test-stage-5: $(CARGO_BINARY) test $(CARGO_TARGET) $(compiler_features) --features wasi --examples -test-stage-6: - $(CARGO_BINARY) test $(CARGO_TARGET) --release $(compiler_features) --features wasi --examples test-stage-7: $(CARGO_BINARY) test $(CARGO_TARGET) --release --package wasmer-c-api-test-runner @@ -563,7 +561,7 @@ test-wasi-unit: test-wasi: $(CARGO_BINARY) test $(CARGO_TARGET) --release --tests $(compiler_features) -- wasi::wasitests -test-examples: test-stage-5 test-stage-6 +test-examples: test-stage-5 test-integration-cli: $(CARGO_BINARY) test $(CARGO_TARGET) --features webc_runner --no-fail-fast -p wasmer-integration-tests-cli -- --nocapture --test-threads=1 From 5d044fd9d31a49d2353f28810a813aa904673ef1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Wed, 14 Dec 2022 15:13:57 +0100 Subject: [PATCH 171/226] Revert "Bust cache again + reorder compiler features to avoid recompilation" This reverts commit f6bd3626d712f550d074d6795e23a8ec901cd60a. --- .github/workflows/test.yaml | 10 +++++----- Makefile | 10 ++++++---- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index dbd0ed015fb..d276f5dfa88 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -56,7 +56,7 @@ jobs: path: | ~/.cargo/* ./target/* - key: r2-${{ github.repository }}-${{ runner.os }}-${{ hashFiles('Cargo.lock') }}-wasmer-make-lint-linux-x64 + key: s3-${{ 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 }} @@ -176,7 +176,7 @@ jobs: path: | ~/.cargo/* ./target/* - key: r2-${{ github.repository }}-${{ runner.os }}-${{ hashFiles('Cargo.lock') }}-wasmer-make-build-capi-windows-gnu + key: s3-${{ github.repository }}-${{ runner.os }}-${{ hashFiles('Cargo.lock') }}-wasmer-make-build-capi-windows-gnu 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 }} @@ -331,7 +331,7 @@ jobs: path: | ~/.cargo/* ./target/* - key: r2-${{ github.repository }}-${{ runner.os }}-${{ hashFiles('Cargo.lock') }}-wasmer-make-build-wasmer-${{ matrix.build-what.key }}-${{ matrix.metadata.build }} + key: s3-${{ 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 }} @@ -488,7 +488,7 @@ jobs: path: | ~/.cargo/* ./target/* - key: r2-${{ github.repository }}-${{ runner.os }}-${{ hashFiles('Cargo.lock') }}-wasmer-make-test-stage-${{ matrix.stage.stage }}-${{ matrix.metadata.build }} + key: s3-${{ github.repository }}-${{ runner.os }}-${{ hashFiles('Cargo.lock') }}-wasmer-make-test-stage-${{ matrix.stage.stage }}-${{ 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 }} @@ -562,7 +562,7 @@ jobs: path: | ~/.cargo/* ./target/* - key: r2-${{ github.repository }}-${{ runner.os }}-${{ hashFiles('Cargo.lock') }}-wasmer-make-test-integration-cli-${{ matrix.build }} + key: s3-${{ 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 }} diff --git a/Makefile b/Makefile index 18f632a3f13..40787c6a0ed 100644 --- a/Makefile +++ b/Makefile @@ -484,14 +484,16 @@ test-stage-0: # test packages test-stage-1: - $(CARGO_BINARY) test $(CARGO_TARGET) $(compiler_features) --manifest-path lib/cli/Cargo.toml --release $(CARGO_BINARY) test $(CARGO_TARGET) $(compiler_features) --all --release $(exclude_tests) --exclude wasmer-c-api-test-runner --exclude wasmer-capi-examples-runner - $(CARGO_BINARY) test $(CARGO_TARGET) --manifest-path lib/compiler-cranelift/Cargo.toml --release --no-default-features --features=std - $(CARGO_BINARY) test $(CARGO_TARGET) --manifest-path lib/compiler-singlepass/Cargo.toml --release --no-default-features --features=std + $(CARGO_BINARY) test $(CARGO_TARGET) $(compiler_features) --manifest-path lib/compiler-cranelift/Cargo.toml --release --no-default-features --features=std + $(CARGO_BINARY) test $(CARGO_TARGET) $(compiler_features) --manifest-path lib/compiler-singlepass/Cargo.toml --release --no-default-features --features=std + $(CARGO_BINARY) test $(CARGO_TARGET) $(compiler_features) --manifest-path lib/cli/Cargo.toml --release # test examples test-stage-5: $(CARGO_BINARY) test $(CARGO_TARGET) $(compiler_features) --features wasi --examples +test-stage-6: + $(CARGO_BINARY) test $(CARGO_TARGET) --release $(compiler_features) --features wasi --examples test-stage-7: $(CARGO_BINARY) test $(CARGO_TARGET) --release --package wasmer-c-api-test-runner @@ -561,7 +563,7 @@ test-wasi-unit: test-wasi: $(CARGO_BINARY) test $(CARGO_TARGET) --release --tests $(compiler_features) -- wasi::wasitests -test-examples: test-stage-5 +test-examples: test-stage-5 test-stage-6 test-integration-cli: $(CARGO_BINARY) test $(CARGO_TARGET) --features webc_runner --no-fail-fast -p wasmer-integration-tests-cli -- --nocapture --test-threads=1 From 8c78139b41ad34b34b029a92551736c700691c32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Wed, 14 Dec 2022 15:14:15 +0100 Subject: [PATCH 172/226] Revert "Use same compiler features for all test-packages step" This reverts commit dce7f5a7d874797214e7a02650699df037ad6f61. --- Makefile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 40787c6a0ed..f4d774d4754 100644 --- a/Makefile +++ b/Makefile @@ -484,10 +484,10 @@ test-stage-0: # test packages test-stage-1: - $(CARGO_BINARY) test $(CARGO_TARGET) $(compiler_features) --all --release $(exclude_tests) --exclude wasmer-c-api-test-runner --exclude wasmer-capi-examples-runner - $(CARGO_BINARY) test $(CARGO_TARGET) $(compiler_features) --manifest-path lib/compiler-cranelift/Cargo.toml --release --no-default-features --features=std - $(CARGO_BINARY) test $(CARGO_TARGET) $(compiler_features) --manifest-path lib/compiler-singlepass/Cargo.toml --release --no-default-features --features=std - $(CARGO_BINARY) test $(CARGO_TARGET) $(compiler_features) --manifest-path lib/cli/Cargo.toml --release + $(CARGO_BINARY) test $(CARGO_TARGET) --all --release $(exclude_tests) --exclude wasmer-c-api-test-runner --exclude wasmer-capi-examples-runner + $(CARGO_BINARY) test $(CARGO_TARGET) --manifest-path lib/compiler-cranelift/Cargo.toml --release --no-default-features --features=std + $(CARGO_BINARY) test $(CARGO_TARGET) --manifest-path lib/compiler-singlepass/Cargo.toml --release --no-default-features --features=std + $(CARGO_BINARY) test $(CARGO_TARGET) --manifest-path lib/cli/Cargo.toml $(compiler_features) --release # test examples test-stage-5: From 267b9a9522124ae8f80f06ba1c3059bfebcd1a66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Wed, 14 Dec 2022 15:14:31 +0100 Subject: [PATCH 173/226] Revert "Merge test-stage 4 with stage 1" This reverts commit 5f931a26fb5fe49654ee1438691188ee21a850f7. --- .github/workflows/test.yaml | 8 ++++++-- Makefile | 3 ++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index d276f5dfa88..02221f62bf5 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -379,11 +379,15 @@ jobs: }, { stage: 1, - description: 'Test packages', + description: 'cargo test --all', + }, + { + stage: 4, + description: 'Test lib/cli', }, { stage: 5, - description: 'Test examples', + description: 'Test examples (debug)', } ] metadata: [ diff --git a/Makefile b/Makefile index f4d774d4754..661ca450be4 100644 --- a/Makefile +++ b/Makefile @@ -487,6 +487,7 @@ test-stage-1: $(CARGO_BINARY) test $(CARGO_TARGET) --all --release $(exclude_tests) --exclude wasmer-c-api-test-runner --exclude wasmer-capi-examples-runner $(CARGO_BINARY) test $(CARGO_TARGET) --manifest-path lib/compiler-cranelift/Cargo.toml --release --no-default-features --features=std $(CARGO_BINARY) test $(CARGO_TARGET) --manifest-path lib/compiler-singlepass/Cargo.toml --release --no-default-features --features=std +test-stage-4: $(CARGO_BINARY) test $(CARGO_TARGET) --manifest-path lib/cli/Cargo.toml $(compiler_features) --release # test examples @@ -503,7 +504,7 @@ test: test-compilers test-packages test-examples test-compilers: test-stage-0 -test-packages: test-stage-1 +test-packages: test-stage-1 test-stage-4 test-js: test-js-api test-js-wasi From 55e5bfc19d9cf7f18e9ea15abea857fe90b87fa5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Wed, 14 Dec 2022 15:14:44 +0100 Subject: [PATCH 174/226] Revert "Merge test stage 2 and 3 with stage 1" This reverts commit bde16511d8346d439bd2fb149fcbd3dd0479869d. --- .github/workflows/test.yaml | 8 ++++++++ Makefile | 4 +++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 02221f62bf5..983feb308f1 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -381,6 +381,14 @@ jobs: stage: 1, description: 'cargo test --all', }, + { + stage: 2, + description: 'Test compiler-cranelift', + }, + { + stage: 3, + description: 'Test compiler-singlepass', + }, { stage: 4, description: 'Test lib/cli', diff --git a/Makefile b/Makefile index 661ca450be4..fba0a508683 100644 --- a/Makefile +++ b/Makefile @@ -485,7 +485,9 @@ test-stage-0: # test packages test-stage-1: $(CARGO_BINARY) test $(CARGO_TARGET) --all --release $(exclude_tests) --exclude wasmer-c-api-test-runner --exclude wasmer-capi-examples-runner +test-stage-2: $(CARGO_BINARY) test $(CARGO_TARGET) --manifest-path lib/compiler-cranelift/Cargo.toml --release --no-default-features --features=std +test-stage-3: $(CARGO_BINARY) test $(CARGO_TARGET) --manifest-path lib/compiler-singlepass/Cargo.toml --release --no-default-features --features=std test-stage-4: $(CARGO_BINARY) test $(CARGO_TARGET) --manifest-path lib/cli/Cargo.toml $(compiler_features) --release @@ -504,7 +506,7 @@ test: test-compilers test-packages test-examples test-compilers: test-stage-0 -test-packages: test-stage-1 test-stage-4 +test-packages: test-stage-1 test-stage-2 test-stage-3 test-stage-4 test-js: test-js-api test-js-wasi From f08fab8ee536f8194b19f45812061d3aef0202ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Wed, 14 Dec 2022 15:22:34 +0100 Subject: [PATCH 175/226] Put test-capi into a separate stage for caching --- .github/workflows/test.yaml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 983feb308f1..6e3566c7181 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -220,9 +220,14 @@ jobs: build-what: [ { key: capi, - build-cmd: 'make build-capi && make package-capi && export WASMER_DIR=`pwd`/package && make test-stage-7 && make test-capi-ci && make tar-capi', + build-cmd: 'make build-capi && make package-capi && export WASMER_DIR=`pwd`/package && make test-stage-7 && make tar-capi', name: 'Build and test C-API' }, + { + key: test-capi, + build-cmd: 'make test-capi', + name: 'Test CAPI' + } { key: wasmer, build-cmd: 'make build-wasmer && make package-wasmer && make tar-wasmer', From b33fa9fb6e1004b9f5ed0ded4f68a4b7afe8b44a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Wed, 14 Dec 2022 15:23:39 +0100 Subject: [PATCH 176/226] Fix typo --- .github/workflows/test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 6e3566c7181..372b6bcd44b 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -227,7 +227,7 @@ jobs: key: test-capi, build-cmd: 'make test-capi', name: 'Test CAPI' - } + }, { key: wasmer, build-cmd: 'make build-wasmer && make package-wasmer && make tar-wasmer', From 8ea1afa7a53a17a43f657a7dbb949fc11723112a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Wed, 14 Dec 2022 15:57:19 +0100 Subject: [PATCH 177/226] Remove test-capi on linux-musl --- .github/workflows/test.yaml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 372b6bcd44b..ebab5787062 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -347,14 +347,9 @@ jobs: - name: Build ${{ matrix.build-what.key }} shell: bash # tests were disabled for linux-musl - if: ${{ !(matrix.build-what.key == 'capi' && matrix.metadata.build == 'linux-musl') }} + if: ${{ !(matrix.build-what.key == 'test-capi' && matrix.metadata.build == 'linux-musl') }} run: | ${{ matrix.build-what.build-cmd }} - - name: Build ${{ matrix.build-what.key }} - shell: bash - if: matrix.build-what.key == 'capi' && matrix.metadata.build == 'linux-musl' - run: | - make build-capi && make package-capi && make tar-capi - name: Archive production artifacts uses: actions/upload-artifact@v3 with: From de9b8acd116e4e9fee9a0b85a998371f6a699017 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Thu, 15 Dec 2022 11:56:27 +0100 Subject: [PATCH 178/226] Fix descriptions for CI workflow --- .github/workflows/test.yaml | 89 +++++++++++++++++++------------------ 1 file changed, 45 insertions(+), 44 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index ebab5787062..6032348c818 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -109,9 +109,10 @@ jobs: runs-on: ubuntu-18.04 steps: - uses: actions/checkout@v2 - - run: | - rustup target add wasm32-wasi - make build-wasmer-wasm + - name: rustup target add wasm32-wasi + run: rustup target add wasm32-wasi + - name: make build-wasmer-wasm + run: make build-wasmer-wasm build_linux_aarch64: name: ${{ matrix.build-what.name }} on linux-aarch64 @@ -123,7 +124,7 @@ jobs: { key: capi, build-cmd: 'make build-capi', - name: 'Build and test C-API' + name: 'Build C-API' }, { key: wasmer, @@ -154,7 +155,7 @@ jobs: ENABLE_LLVM: 0 build_capi_windows_gnu: - name: Windows GNU + name: Build C-API on windows-gnu runs-on: ubuntu-18.04 steps: - uses: actions/checkout@v2 @@ -220,13 +221,13 @@ jobs: build-what: [ { key: capi, - build-cmd: 'make build-capi && make package-capi && export WASMER_DIR=`pwd`/package && make test-stage-7 && make tar-capi', - name: 'Build and test C-API' + build-cmd: 'make build-capi && make package-capi && export WASMER_DIR=`pwd`/package && make tar-capi', + name: 'Build C-API + C-API integration tests' }, { key: test-capi, build-cmd: 'make test-capi', - name: 'Test CAPI' + name: 'Test C-API' }, { key: wasmer, @@ -242,9 +243,10 @@ jobs: llvm_url: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz' }, { - build: linux-x64, + build: linux-musl, + target: x86_64-unknown-linux-musl, os: ubuntu-18.04, - target: x86_64-unknown-linux-gnu + container: 'alpine:latest' }, { build: macos-x64, @@ -252,17 +254,16 @@ jobs: target: x86_64-apple-darwin, llvm_url: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-apple-darwin.tar.xz' }, + { + build: macos-arm, + os: macos-11, + target: aarch64-apple-darwin, + }, { build: windows-x64, os: windows-2019, target: x86_64-pc-windows-msvc, llvm_choco_version: 13.0.0 - }, - { - build: linux-musl, - target: x86_64-unknown-linux-musl, - os: ubuntu-18.04, - container: 'alpine:latest' } ] container: ${{ matrix.metadata.container }} @@ -344,12 +345,15 @@ jobs: aws-endpoint: https://1541b1e8a3fc6ad155ce67ef38899700.r2.cloudflarestorage.com aws-s3-bucket-endpoint: false aws-s3-force-path-style: true - - name: Build ${{ matrix.build-what.key }} + - name: ${{ matrix.build-what.name }} shell: bash - # tests were disabled for linux-musl - if: ${{ !(matrix.build-what.key == 'test-capi' && matrix.metadata.build == 'linux-musl') }} - run: | - ${{ matrix.build-what.build-cmd }} + if: ${{ matrix.build-what.key != 'test-capi' }} + run: ${{ matrix.build-what.build-cmd }} + # 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 == 'test-capi' && !(matrix.metadata.build == 'linux-musl' || matrix.metadata.build == 'macos-arm') }} + run: make test-stage-7 - name: Archive production artifacts uses: actions/upload-artifact@v3 with: @@ -374,42 +378,38 @@ jobs: matrix: stage: [ { - stage: 0, description: 'Test compilers', + make: 'make test-stage-0-test-compilers', }, { - stage: 1, - description: 'cargo test --all', + description: 'Unit-test all packages', + make: 'make test-stage-1-test-all', }, { - stage: 2, - description: 'Test compiler-cranelift', + description: 'Unit-test cranelift compiler', + make: 'make test-stage-2-test-compiler-cranelift', }, { - stage: 3, - description: 'Test compiler-singlepass', + description: 'Unit-test singlepass compiler', + make: 'make test-stage-2-test-compiler-singlepass', }, { - stage: 4, - description: 'Test lib/cli', + description: 'Unit-test wasmer-cli', + make: 'make test-stage-4-wasmer-cli', }, { - stage: 5, description: 'Test examples (debug)', + make: '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-18.04, target: x86_64-unknown-linux-gnu, llvm_url: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz' }, - { - build: linux-x64, - os: ubuntu-18.04, - target: x86_64-unknown-linux-gnu - }, { build: macos-x64, os: macos-11, @@ -508,16 +508,15 @@ jobs: aws-endpoint: https://1541b1e8a3fc6ad155ce67ef38899700.r2.cloudflarestorage.com aws-s3-bucket-endpoint: false aws-s3-force-path-style: true - - name: Test stage 0 - run: | - make test-stage-${{ matrix.stage.stage }} + - name: ${{ matrix.stage.description }} + run: ${{ matrix.stage.make }} env: TARGET: ${{ matrix.metadata.target }} TARGET_DIR: target/${{ matrix.metadata.target }}/release CARGO_TARGET: --target ${{ matrix.metadata.target }} test_integration_cli: - name: Integration tests on ${{ matrix.build }} + name: CLI integration tests on ${{ matrix.build }} runs-on: ${{ matrix.os }} needs: [build] strategy: @@ -532,10 +531,13 @@ jobs: os: macos-11 target: x86_64-apple-darwin llvm_url: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-apple-darwin.tar.xz' + # we only build the integration-test CLI, we don't run tests + - build: macos-arm + os: macos-11 + target: aarch64-apple-darwin, - build: windows-x64 os: windows-latest target: x86_64-pc-windows-msvc - # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/12.x/windows-amd64.tar.gz' llvm_choco_version: 13.0.0 - build: linux-musl target: x86_64-unknown-linux-musl @@ -591,10 +593,9 @@ jobs: run: | make untar-wasmer - name: Test integration CLI - if: matrix.os != 'windows-latest' + if: matrix.build != 'macos-arm' shell: bash - run: | - export WASMER_DIR=`pwd`/package && make test-integration-cli + run: export WASMER_DIR=`pwd`/package && make test-integration-cli env: TARGET: ${{ matrix.target }} TARGET_DIR: target/${{ matrix.target }}/release From 4977b6261a7b322fa45280854042bfc945ba1bf9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Thu, 15 Dec 2022 12:08:15 +0100 Subject: [PATCH 179/226] Fix Makefile stage descriptions --- .github/workflows/test.yaml | 4 ++-- Makefile | 24 ++++++++++++------------ 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 6032348c818..cd69da63524 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -353,7 +353,7 @@ jobs: - name: Test C-API integration shell: bash if: ${{ matrix.build-what.key == 'test-capi' && !(matrix.metadata.build == 'linux-musl' || matrix.metadata.build == 'macos-arm') }} - run: make test-stage-7 + run: make test-stage-7-capi-integration-tests - name: Archive production artifacts uses: actions/upload-artifact@v3 with: @@ -391,7 +391,7 @@ jobs: }, { description: 'Unit-test singlepass compiler', - make: 'make test-stage-2-test-compiler-singlepass', + make: 'make test-stage-3-test-compiler-singlepass', }, { description: 'Unit-test wasmer-cli', diff --git a/Makefile b/Makefile index fba0a508683..e46b6040270 100644 --- a/Makefile +++ b/Makefile @@ -479,34 +479,36 @@ build-capi-headless-ios: capi-setup ##### # test compilers -test-stage-0: +test-stage-0-test-compilers: $(CARGO_BINARY) test $(CARGO_TARGET) --release --tests $(compiler_features) # test packages -test-stage-1: +test-stage-1-test-all: $(CARGO_BINARY) test $(CARGO_TARGET) --all --release $(exclude_tests) --exclude wasmer-c-api-test-runner --exclude wasmer-capi-examples-runner -test-stage-2: +test-stage-2-test-compiler-cranelift: $(CARGO_BINARY) test $(CARGO_TARGET) --manifest-path lib/compiler-cranelift/Cargo.toml --release --no-default-features --features=std -test-stage-3: +test-stage-3-test-compiler-singlepass: $(CARGO_BINARY) test $(CARGO_TARGET) --manifest-path lib/compiler-singlepass/Cargo.toml --release --no-default-features --features=std -test-stage-4: +test-stage-4-wasmer-cli: $(CARGO_BINARY) test $(CARGO_TARGET) --manifest-path lib/cli/Cargo.toml $(compiler_features) --release # test examples -test-stage-5: +test-stage-5-test-examples: $(CARGO_BINARY) test $(CARGO_TARGET) $(compiler_features) --features wasi --examples -test-stage-6: +test-stage-6-test-examples-release: $(CARGO_BINARY) test $(CARGO_TARGET) --release $(compiler_features) --features wasi --examples -test-stage-7: +test-stage-7-capi-integration-tests: $(CARGO_BINARY) test $(CARGO_TARGET) --release --package wasmer-c-api-test-runner $(CARGO_BINARY) test $(CARGO_TARGET) --release --package wasmer-capi-examples-runner test: test-compilers test-packages test-examples -test-compilers: test-stage-0 +test-compilers: test-stage-0-test-compilers -test-packages: test-stage-1 test-stage-2 test-stage-3 test-stage-4 +test-packages: test-stage-1-test-all test-stage-2-test-compiler-cranelift test-stage-3-test-compiler-singlepass test-stage-4-wasmer-cli + +test-examples: test-stage-5-test-examples test-stage-6-test-examples-release test-js: test-js-api test-js-wasi @@ -566,8 +568,6 @@ test-wasi-unit: test-wasi: $(CARGO_BINARY) test $(CARGO_TARGET) --release --tests $(compiler_features) -- wasi::wasitests -test-examples: test-stage-5 test-stage-6 - test-integration-cli: $(CARGO_BINARY) test $(CARGO_TARGET) --features webc_runner --no-fail-fast -p wasmer-integration-tests-cli -- --nocapture --test-threads=1 From 2a1f0474b57f7172d7f59c55b7414e97c91e38f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Thu, 15 Dec 2022 12:16:27 +0100 Subject: [PATCH 180/226] Fix test-capi step for windows and linux-musl --- .github/workflows/test.yaml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index cd69da63524..836a83a4df5 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -221,7 +221,7 @@ jobs: build-what: [ { key: capi, - build-cmd: 'make build-capi && make package-capi && export WASMER_DIR=`pwd`/package && make tar-capi', + build-cmd: 'make build-capi && make package-capi && make tar-capi', name: 'Build C-API + C-API integration tests' }, { @@ -347,13 +347,12 @@ jobs: aws-s3-force-path-style: true - name: ${{ matrix.build-what.name }} shell: bash - if: ${{ matrix.build-what.key != 'test-capi' }} run: ${{ matrix.build-what.build-cmd }} # 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 == 'test-capi' && !(matrix.metadata.build == 'linux-musl' || matrix.metadata.build == 'macos-arm') }} - run: make test-stage-7-capi-integration-tests + if: ${{ matrix.build-what.key == 'capi' && !(matrix.metadata.build == 'linux-musl' || matrix.metadata.build == 'macos-arm') }} + run: export WASMER_DIR=`pwd`/package && make test-stage-7-capi-integration-tests - name: Archive production artifacts uses: actions/upload-artifact@v3 with: From ab8f68dc9dfeb412145c87b3784f6cd501ecc983 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Thu, 15 Dec 2022 12:18:49 +0100 Subject: [PATCH 181/226] Fix matrix.target --- .github/workflows/test.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 836a83a4df5..9a62ceb3ef7 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -293,7 +293,7 @@ jobs: uses: dtolnay/rust-toolchain@stable with: toolchain: 1.63 - target: ${{ matrix.target }} + target: ${{ matrix.metadata.target }} - name: Choco install LLVM uses: crazy-max/ghaction-chocolatey@v2 if: matrix.metadata.llvm_choco_version @@ -568,7 +568,7 @@ jobs: uses: dtolnay/rust-toolchain@stable with: toolchain: 1.63 - target: ${{ matrix.target }} + target: ${{ matrix.metadata.target }} - name: Cache uses: whywaita/actions-cache-s3@v2 with: @@ -596,8 +596,8 @@ jobs: shell: bash run: export WASMER_DIR=`pwd`/package && make test-integration-cli env: - TARGET: ${{ matrix.target }} - TARGET_DIR: target/${{ matrix.target }}/release - CARGO_TARGET: --target ${{ matrix.target }} + TARGET: ${{ matrix.metadata.target }} + TARGET_DIR: target/${{ matrix.metadata.target }}/release + CARGO_TARGET: --target ${{ matrix.metadata.target }} WAPM_DEV_TOKEN: ${{ secrets.WAPM_DEV_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 750c9aac9d834c69878c1865321979c2c87cb49c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Thu, 15 Dec 2022 12:22:20 +0100 Subject: [PATCH 182/226] Fix metadata.target again --- .github/workflows/test.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 9a62ceb3ef7..1261cf77509 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -348,6 +348,10 @@ jobs: - name: ${{ matrix.build-what.name }} shell: bash run: ${{ matrix.build-what.build-cmd }} + env: + TARGET: ${{ matrix.metadata.target }} + TARGET_DIR: target/${{ matrix.metadata.target }}/release + CARGO_TARGET: --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 From 7c049b42dd5e513b132dcd538bb50ba778051f70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Thu, 15 Dec 2022 12:27:31 +0100 Subject: [PATCH 183/226] Fix makefile descriptions again --- .github/workflows/test.yaml | 14 +++++++------- Makefile | 4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 1261cf77509..4c7bc40db0d 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -381,27 +381,27 @@ jobs: matrix: stage: [ { - description: 'Test compilers', - make: 'make test-stage-0-test-compilers', + description: 'Run wasi-wast test suite for all compilers', + make: 'make test-stage-0-wasi-wast', }, { - description: 'Unit-test all packages', + description: 'Unit-test packages (cargo test --all)', make: 'make test-stage-1-test-all', }, { - description: 'Unit-test cranelift compiler', + description: 'Unit-test cranelift', make: 'make test-stage-2-test-compiler-cranelift', }, { - description: 'Unit-test singlepass compiler', + description: 'Unit-test singlepass', make: 'make test-stage-3-test-compiler-singlepass', }, { - description: 'Unit-test wasmer-cli', + description: 'Unit-test wasmer-cli (cargo test lib/cli)', make: 'make test-stage-4-wasmer-cli', }, { - description: 'Test examples (debug)', + description: 'Test examples (cargo test --examples)', make: 'make test-stage-5-test-examples', } ] diff --git a/Makefile b/Makefile index e46b6040270..fce540dd306 100644 --- a/Makefile +++ b/Makefile @@ -479,7 +479,7 @@ build-capi-headless-ios: capi-setup ##### # test compilers -test-stage-0-test-compilers: +test-stage-0-wasi-wast: $(CARGO_BINARY) test $(CARGO_TARGET) --release --tests $(compiler_features) # test packages @@ -504,7 +504,7 @@ test-stage-7-capi-integration-tests: test: test-compilers test-packages test-examples -test-compilers: test-stage-0-test-compilers +test-compilers: test-stage-0-wasi-wast test-packages: test-stage-1-test-all test-stage-2-test-compiler-cranelift test-stage-3-test-compiler-singlepass test-stage-4-wasmer-cli From 0bddeccbcb29784e3c67014cec417a92b25bb810 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Thu, 15 Dec 2022 12:40:21 +0100 Subject: [PATCH 184/226] Make descriptions more descriptive --- .github/workflows/test.yaml | 14 +++++++------- Makefile | 6 +++--- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 4c7bc40db0d..39dd9e7d82a 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -385,23 +385,23 @@ jobs: make: 'make test-stage-0-wasi-wast', }, { - description: 'Unit-test packages (cargo test --all)', + description: 'Unit-test packages on std', make: 'make test-stage-1-test-all', }, { - description: 'Unit-test cranelift', - make: 'make test-stage-2-test-compiler-cranelift', + description: 'Unit-test cranelift on no-std', + make: 'make test-stage-2-test-compiler-cranelift-nostd', }, { - description: 'Unit-test singlepass', - make: 'make test-stage-3-test-compiler-singlepass', + description: 'Unit-test singlepass on no-std', + make: 'make test-stage-3-test-compiler-singlepass-nostd', }, { - description: 'Unit-test wasmer-cli (cargo test lib/cli)', + description: 'Unit-test wasmer-cli', make: 'make test-stage-4-wasmer-cli', }, { - description: 'Test examples (cargo test --examples)', + description: 'Unit-test examples', make: 'make test-stage-5-test-examples', } ] diff --git a/Makefile b/Makefile index fce540dd306..e002d23f0f5 100644 --- a/Makefile +++ b/Makefile @@ -485,9 +485,9 @@ test-stage-0-wasi-wast: # test packages test-stage-1-test-all: $(CARGO_BINARY) test $(CARGO_TARGET) --all --release $(exclude_tests) --exclude wasmer-c-api-test-runner --exclude wasmer-capi-examples-runner -test-stage-2-test-compiler-cranelift: +test-stage-2-test-compiler-cranelift-nostd: $(CARGO_BINARY) test $(CARGO_TARGET) --manifest-path lib/compiler-cranelift/Cargo.toml --release --no-default-features --features=std -test-stage-3-test-compiler-singlepass: +test-stage-3-test-compiler-singlepass-nostd: $(CARGO_BINARY) test $(CARGO_TARGET) --manifest-path lib/compiler-singlepass/Cargo.toml --release --no-default-features --features=std test-stage-4-wasmer-cli: $(CARGO_BINARY) test $(CARGO_TARGET) --manifest-path lib/cli/Cargo.toml $(compiler_features) --release @@ -506,7 +506,7 @@ test: test-compilers test-packages test-examples test-compilers: test-stage-0-wasi-wast -test-packages: test-stage-1-test-all test-stage-2-test-compiler-cranelift test-stage-3-test-compiler-singlepass test-stage-4-wasmer-cli +test-packages: test-stage-1-test-all test-stage-2-test-compiler-cranelift-nostd test-stage-3-test-compiler-singlepass-nostd test-stage-4-wasmer-cli test-examples: test-stage-5-test-examples test-stage-6-test-examples-release From 11a2c5ba4957602e2b50c1e9ceba7e9d972a1f3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Thu, 15 Dec 2022 12:42:25 +0100 Subject: [PATCH 185/226] Disable test-capi on macos-arm (can't run) --- .github/workflows/test.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 39dd9e7d82a..5bc5d2a906c 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -347,6 +347,7 @@ jobs: aws-s3-force-path-style: true - name: ${{ matrix.build-what.name }} shell: bash + if: ${{ !(matrix.build-what.key == 'test-capi' && matrix.metadata.build == 'macos-arm') }} run: ${{ matrix.build-what.build-cmd }} env: TARGET: ${{ matrix.metadata.target }} From 0e736136f3455811b5484fbd9d5c5010f1493cb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Thu, 15 Dec 2022 13:46:18 +0100 Subject: [PATCH 186/226] Disable test-capi on linux-musl --- .github/workflows/test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 5bc5d2a906c..5a362e9ef54 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -347,7 +347,7 @@ jobs: aws-s3-force-path-style: true - name: ${{ matrix.build-what.name }} shell: bash - if: ${{ !(matrix.build-what.key == 'test-capi' && matrix.metadata.build == 'macos-arm') }} + if: ${{ !(matrix.build-what.key == 'test-capi' && (matrix.metadata.build == 'linux-musl' || matrix.metadata.build == 'macos-arm')) }} run: ${{ matrix.build-what.build-cmd }} env: TARGET: ${{ matrix.metadata.target }} From 1a1b296e13f692128774bd6df10150c90cdccafc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Thu, 15 Dec 2022 14:24:26 +0100 Subject: [PATCH 187/226] Fix matrix.target for integration tests --- .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 5a362e9ef54..36324c1a2a0 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -601,8 +601,8 @@ jobs: shell: bash run: export WASMER_DIR=`pwd`/package && make test-integration-cli env: - TARGET: ${{ matrix.metadata.target }} - TARGET_DIR: target/${{ matrix.metadata.target }}/release - CARGO_TARGET: --target ${{ matrix.metadata.target }} + TARGET: ${{ matrix.target }} + TARGET_DIR: target/${{ matrix.target }}/release + CARGO_TARGET: --target ${{ matrix.target }} WAPM_DEV_TOKEN: ${{ secrets.WAPM_DEV_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From a479c4b006fc5930d90dab6b579c93b30ffc51bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Thu, 15 Dec 2022 15:33:39 +0100 Subject: [PATCH 188/226] Try to fix integration tests on Windows --- lib/cli/src/commands/create_exe.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/cli/src/commands/create_exe.rs b/lib/cli/src/commands/create_exe.rs index c8f326ba6cf..733884f35f8 100644 --- a/lib/cli/src/commands/create_exe.rs +++ b/lib/cli/src/commands/create_exe.rs @@ -464,7 +464,7 @@ impl CreateExe { let file = files .iter() - .find(|f| f.ends_with("libwasmer.a")).cloned() + .find(|f| f.ends_with("libwasmer.a") || f.ends_with("wasmer.lib")).cloned() .ok_or_else(|| { anyhow!("Could not find libwasmer.a for {} target in the provided tarball path (files = {files:#?})", target) })?; From d2ae0cda4634f992d1fae0891a1a5c5d21b7308b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Thu, 15 Dec 2022 21:59:32 +0100 Subject: [PATCH 189/226] Fix caching --- .github/workflows/test.yaml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 36324c1a2a0..9b8426d994f 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -383,27 +383,27 @@ jobs: stage: [ { description: 'Run wasi-wast test suite for all compilers', - make: 'make test-stage-0-wasi-wast', + make: 'test-stage-0-wasi-wast', }, { description: 'Unit-test packages on std', - make: 'make test-stage-1-test-all', + make: 'test-stage-1-test-all', }, { description: 'Unit-test cranelift on no-std', - make: 'make test-stage-2-test-compiler-cranelift-nostd', + make: 'test-stage-2-test-compiler-cranelift-nostd', }, { description: 'Unit-test singlepass on no-std', - make: 'make test-stage-3-test-compiler-singlepass-nostd', + make: 'test-stage-3-test-compiler-singlepass-nostd', }, { description: 'Unit-test wasmer-cli', - make: 'make test-stage-4-wasmer-cli', + make: 'test-stage-4-wasmer-cli', }, { description: 'Unit-test examples', - make: 'make test-stage-5-test-examples', + make: 'test-stage-5-test-examples', } ] metadata: [ @@ -504,7 +504,7 @@ jobs: path: | ~/.cargo/* ./target/* - key: s3-${{ github.repository }}-${{ runner.os }}-${{ hashFiles('Cargo.lock') }}-wasmer-make-test-stage-${{ matrix.stage.stage }}-${{ matrix.metadata.build }} + key: s3-${{ 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 }} @@ -513,7 +513,7 @@ jobs: aws-s3-bucket-endpoint: false aws-s3-force-path-style: true - name: ${{ matrix.stage.description }} - run: ${{ matrix.stage.make }} + run: make ${{ matrix.stage.make }} env: TARGET: ${{ matrix.metadata.target }} TARGET_DIR: target/${{ matrix.metadata.target }}/release From 26e132e307d49eacdf2f9135a5e82c7a087ccf59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Thu, 15 Dec 2022 22:04:35 +0100 Subject: [PATCH 190/226] Fix wasi-wast name to wast --- .github/workflows/test.yaml | 4 ++-- Makefile | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 9b8426d994f..d9a68d132db 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -382,8 +382,8 @@ jobs: matrix: stage: [ { - description: 'Run wasi-wast test suite for all compilers', - make: 'test-stage-0-wasi-wast', + description: 'Run wast test suite for all compilers', + make: 'test-stage-0-wast', }, { description: 'Unit-test packages on std', diff --git a/Makefile b/Makefile index e002d23f0f5..f5545f0a08d 100644 --- a/Makefile +++ b/Makefile @@ -479,7 +479,7 @@ build-capi-headless-ios: capi-setup ##### # test compilers -test-stage-0-wasi-wast: +test-stage-0-wast: $(CARGO_BINARY) test $(CARGO_TARGET) --release --tests $(compiler_features) # test packages @@ -504,7 +504,7 @@ test-stage-7-capi-integration-tests: test: test-compilers test-packages test-examples -test-compilers: test-stage-0-wasi-wast +test-compilers: test-stage-0-wast test-packages: test-stage-1-test-all test-stage-2-test-compiler-cranelift-nostd test-stage-3-test-compiler-singlepass-nostd test-stage-4-wasmer-cli From 799ca41fa2d26536b98e4bae774f9a9c94166c9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Thu, 15 Dec 2022 22:21:44 +0100 Subject: [PATCH 191/226] Run test-capi in build-capi step --- .github/workflows/test.yaml | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index d9a68d132db..2ea127e9653 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -224,11 +224,6 @@ jobs: build-cmd: 'make build-capi && make package-capi && make tar-capi', name: 'Build C-API + C-API integration tests' }, - { - key: test-capi, - build-cmd: 'make test-capi', - name: 'Test C-API' - }, { key: wasmer, build-cmd: 'make build-wasmer && make package-wasmer && make tar-wasmer', @@ -347,12 +342,15 @@ jobs: aws-s3-force-path-style: true - name: ${{ matrix.build-what.name }} shell: bash - if: ${{ !(matrix.build-what.key == 'test-capi' && (matrix.metadata.build == 'linux-musl' || matrix.metadata.build == 'macos-arm')) }} run: ${{ matrix.build-what.build-cmd }} env: TARGET: ${{ matrix.metadata.target }} TARGET_DIR: target/${{ matrix.metadata.target }}/release CARGO_TARGET: --target ${{ matrix.metadata.target }} + - name: Test C-API + shell: bash + if: ${{ !(matrix.build-what.key == 'capi' && (matrix.metadata.build == 'linux-musl' || matrix.metadata.build == 'macos-arm')) }} + run: make test-capi-ci # C-API tests were disabled for linux-musl and macos-arm (we can't run them) - name: Test C-API integration shell: bash From 9d1a8309a40a91e9779eb0e00da9e1342a7ed71f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Thu, 15 Dec 2022 22:23:40 +0100 Subject: [PATCH 192/226] ubuntu-18.04 -> ubuntu-22.04 --- .github/workflows/test.yaml | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 2ea127e9653..d5c80671c98 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -17,7 +17,7 @@ jobs: setup: name: Set up - runs-on: ubuntu-18.04 + runs-on: ubuntu-22.04 outputs: VERSION: ${{ steps.setup.outputs.VERSION }} DOING_RELEASE: ${{ steps.setup.outputs.DOING_RELEASE }} @@ -35,7 +35,7 @@ jobs: lint: name: Code lint - runs-on: ubuntu-18.04 + runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v3 - name: Install Rust @@ -76,14 +76,14 @@ jobs: cargo_deny: name: cargo-deny - runs-on: ubuntu-18.04 + runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v3 - uses: EmbarkStudios/cargo-deny-action@v1 test_nodejs: name: Test on NodeJS - runs-on: ubuntu-18.04 + runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v3 - name: Install Rust @@ -106,7 +106,7 @@ jobs: test_wasm_build: name: Test wasm build - runs-on: ubuntu-18.04 + runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v2 - name: rustup target add wasm32-wasi @@ -116,7 +116,7 @@ jobs: build_linux_aarch64: name: ${{ matrix.build-what.name }} on linux-aarch64 - runs-on: ubuntu-18.04 + runs-on: ubuntu-22.04 strategy: fail-fast: false matrix: @@ -156,7 +156,7 @@ jobs: build_capi_windows_gnu: name: Build C-API on windows-gnu - runs-on: ubuntu-18.04 + runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v2 - name: Install Windows-GNU linker @@ -233,14 +233,14 @@ jobs: metadata: [ { build: linux-x64, - os: ubuntu-18.04, + os: ubuntu-22.04, target: x86_64-unknown-linux-gnu, llvm_url: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz' }, { build: linux-musl, target: x86_64-unknown-linux-musl, - os: ubuntu-18.04, + os: ubuntu-22.04, container: 'alpine:latest' }, { @@ -408,7 +408,7 @@ jobs: # We cannot test on macos-arm since we don't have ARM runners { build: linux-x64, - os: ubuntu-18.04, + os: ubuntu-22.04, target: x86_64-unknown-linux-gnu, llvm_url: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz' }, @@ -427,7 +427,7 @@ jobs: { build: linux-musl, target: x86_64-unknown-linux-musl, - os: ubuntu-18.04, + os: ubuntu-22.04, container: 'alpine:latest' } ] @@ -526,7 +526,7 @@ jobs: matrix: include: - build: linux-x64 - os: ubuntu-18.04 + os: ubuntu-22.04 target: x86_64-unknown-linux-gnu llvm_url: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz' - build: macos-x64 @@ -543,7 +543,7 @@ jobs: llvm_choco_version: 13.0.0 - build: linux-musl target: x86_64-unknown-linux-musl - os: ubuntu-18.04 + os: ubuntu-22.04 container: alpine:latest container: ${{ matrix.container }} env: From 061ee79f19da74af8f31a39f44c6bff415f43fb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Thu, 15 Dec 2022 22:24:40 +0100 Subject: [PATCH 193/226] Fix label for build-capi --- .github/workflows/test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index d5c80671c98..08d15ede85a 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -222,7 +222,7 @@ jobs: { key: capi, build-cmd: 'make build-capi && make package-capi && make tar-capi', - name: 'Build C-API + C-API integration tests' + name: 'Build and test C-API' }, { key: wasmer, From cf5bacb29b54c440149b7b320abf540a6bad6412 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Thu, 15 Dec 2022 22:25:46 +0100 Subject: [PATCH 194/226] Install g++ --- .github/workflows/test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 08d15ede85a..fc0d786a306 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -272,7 +272,7 @@ jobs: run: | sudo apt-get update -y sudo apt-get install -y --allow-downgrades libstdc++6 - sudo apt-get install --reinstall g++-8 + sudo apt-get install --reinstall g++- - name: Set up base deps on musl if: matrix.metadata.build == 'linux-musl' run: | From 438f388cf3d3d072d914328f0b3bbd787bd703f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Thu, 15 Dec 2022 22:31:54 +0100 Subject: [PATCH 195/226] g++8 -> g++ --- .github/workflows/test.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index fc0d786a306..a30fb66ec1d 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -272,7 +272,7 @@ jobs: run: | sudo apt-get update -y sudo apt-get install -y --allow-downgrades libstdc++6 - sudo apt-get install --reinstall g++- + sudo apt-get install --reinstall g++ - name: Set up base deps on musl if: matrix.metadata.build == 'linux-musl' run: | @@ -442,7 +442,7 @@ jobs: run: | sudo apt-get update -y sudo apt-get install -y --allow-downgrades libstdc++6 - sudo apt-get install --reinstall g++-8 + sudo apt-get install --reinstall g++ - name: Set up base deps on musl if: matrix.metadata.build == 'linux-musl' run: | From 83d71c6c505fa0fa24449d941cdbc1946aa9cc85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Fri, 16 Dec 2022 05:59:25 +0100 Subject: [PATCH 196/226] Correct test "if" for test-capi-ci --- .github/workflows/test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index a30fb66ec1d..0f88a6ae83a 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -349,7 +349,7 @@ jobs: CARGO_TARGET: --target ${{ matrix.metadata.target }} - name: Test C-API shell: bash - if: ${{ !(matrix.build-what.key == 'capi' && (matrix.metadata.build == 'linux-musl' || matrix.metadata.build == 'macos-arm')) }} + if: ${{ matrix.build-what.key == 'capi' && !(matrix.metadata.build == 'linux-musl' || matrix.metadata.build == 'macos-arm') }} run: make test-capi-ci # C-API tests were disabled for linux-musl and macos-arm (we can't run them) - name: Test C-API integration From 148bf80b3b0b1cb0fc1169d7071cc4d4e66464b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Fri, 16 Dec 2022 06:04:05 +0100 Subject: [PATCH 197/226] Use proper TARGET --- .github/workflows/test.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 0f88a6ae83a..013ff82b00b 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -351,11 +351,19 @@ jobs: shell: bash if: ${{ matrix.build-what.key == 'capi' && !(matrix.metadata.build == 'linux-musl' || matrix.metadata.build == 'macos-arm') }} run: make test-capi-ci + env: + TARGET: ${{ matrix.metadata.target }} + TARGET_DIR: target/${{ matrix.metadata.target }}/release + CARGO_TARGET: --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 == 'macos-arm') }} 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: --target ${{ matrix.metadata.target }} - name: Archive production artifacts uses: actions/upload-artifact@v3 with: From b3322d475a5d3fb472a152485ffed0edc9aaeae4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Fri, 16 Dec 2022 06:20:17 +0100 Subject: [PATCH 198/226] Bust cache again --- .github/workflows/test.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 013ff82b00b..fd30ffd4388 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -56,7 +56,7 @@ jobs: path: | ~/.cargo/* ./target/* - key: s3-${{ github.repository }}-${{ runner.os }}-${{ hashFiles('Cargo.lock') }}-wasmer-make-lint-linux-x64 + key: r2-${{ 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 }} @@ -177,7 +177,7 @@ jobs: path: | ~/.cargo/* ./target/* - key: s3-${{ github.repository }}-${{ runner.os }}-${{ hashFiles('Cargo.lock') }}-wasmer-make-build-capi-windows-gnu + key: r2-${{ github.repository }}-${{ runner.os }}-${{ hashFiles('Cargo.lock') }}-wasmer-make-build-capi-windows-gnu 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 }} @@ -332,7 +332,7 @@ jobs: path: | ~/.cargo/* ./target/* - key: s3-${{ github.repository }}-${{ runner.os }}-${{ hashFiles('Cargo.lock') }}-wasmer-make-build-wasmer-${{ matrix.build-what.key }}-${{ matrix.metadata.build }} + key: r2-${{ 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 }} @@ -510,7 +510,7 @@ jobs: path: | ~/.cargo/* ./target/* - key: s3-${{ github.repository }}-${{ runner.os }}-${{ hashFiles('Cargo.lock') }}-wasmer-make-test-stage-${{ matrix.stage.make }}-${{ matrix.metadata.build }} + key: r2-${{ 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 }} @@ -586,7 +586,7 @@ jobs: path: | ~/.cargo/* ./target/* - key: s3-${{ github.repository }}-${{ runner.os }}-${{ hashFiles('Cargo.lock') }}-wasmer-make-test-integration-cli-${{ matrix.build }} + key: r2-${{ 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 }} From 07b286a603b732f62d258ea4645f05e93059ef04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Fri, 16 Dec 2022 09:11:05 +0100 Subject: [PATCH 199/226] Trigger CI again to test timing --- Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile b/Makefile index f5545f0a08d..7459c36b50c 100644 --- a/Makefile +++ b/Makefile @@ -551,6 +551,7 @@ test-capi-ci: $(foreach compiler_engine,$(capi_compilers_engines),test-capi-crat # compilers first test-capi: build-capi package-capi test-capi-ci + test-capi-crate-%: WASMER_CAPI_CONFIG=$(shell echo $@ | sed -e s/test-capi-crate-//) $(CARGO_BINARY) test $(CARGO_TARGET) --manifest-path lib/c-api/Cargo.toml --release \ --no-default-features --features wat,compiler,wasi,middlewares,webc_runner $(capi_compiler_features) -- --nocapture From 87413b81519ed22ca2087db03fbd6d175b311f92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Fri, 16 Dec 2022 09:40:08 +0100 Subject: [PATCH 200/226] Update titles in CI steps --- .github/workflows/test.yaml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index fd30ffd4388..37425774a87 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -340,9 +340,18 @@ jobs: aws-endpoint: https://1541b1e8a3fc6ad155ce67ef38899700.r2.cloudflarestorage.com aws-s3-bucket-endpoint: false aws-s3-force-path-style: true - - name: ${{ matrix.build-what.name }} + - 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: --target ${{ matrix.metadata.target }} + - name: Build Wasmer + shell: bash + if: ${{ matrix.build-what.key == 'wasmer' }} + run: ${{ matrix.build-what.build-cmd }} env: TARGET: ${{ matrix.metadata.target }} TARGET_DIR: target/${{ matrix.metadata.target }}/release From bf31746efb8430e7c1fb9a615d425ba7ec4d1515 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Fri, 16 Dec 2022 19:59:45 +0100 Subject: [PATCH 201/226] Add libtinfo5 on make lint --- .github/workflows/test.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 37425774a87..594b9d0f4e8 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -43,6 +43,10 @@ jobs: with: toolchain: 1.63 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/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz -L -o /opt/llvm.tar.xz From 645b886cc60de367afe95e667c46c2b5bd5a2f6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Fri, 16 Dec 2022 17:50:44 +0100 Subject: [PATCH 202/226] Remove failing windows-x64 test --- .github/workflows/test.yaml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 594b9d0f4e8..8bb2698c175 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -558,10 +558,6 @@ jobs: - build: macos-arm os: macos-11 target: aarch64-apple-darwin, - - build: windows-x64 - os: windows-latest - target: x86_64-pc-windows-msvc - llvm_choco_version: 13.0.0 - build: linux-musl target: x86_64-unknown-linux-musl os: ubuntu-22.04 From 2a707ea9f90993bf18d0737cb31d32224a49860c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Fri, 16 Dec 2022 17:51:21 +0100 Subject: [PATCH 203/226] Bust cache --- .github/workflows/test.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 8bb2698c175..cf523f7b7c0 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -60,7 +60,7 @@ jobs: path: | ~/.cargo/* ./target/* - key: r2-${{ github.repository }}-${{ runner.os }}-${{ hashFiles('Cargo.lock') }}-wasmer-make-lint-linux-x64 + key: s32-${{ 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 }} @@ -181,7 +181,7 @@ jobs: path: | ~/.cargo/* ./target/* - key: r2-${{ github.repository }}-${{ runner.os }}-${{ hashFiles('Cargo.lock') }}-wasmer-make-build-capi-windows-gnu + key: s32-${{ github.repository }}-${{ runner.os }}-${{ hashFiles('Cargo.lock') }}-wasmer-make-build-capi-windows-gnu 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 }} @@ -336,7 +336,7 @@ jobs: path: | ~/.cargo/* ./target/* - key: r2-${{ github.repository }}-${{ runner.os }}-${{ hashFiles('Cargo.lock') }}-wasmer-make-build-wasmer-${{ matrix.build-what.key }}-${{ matrix.metadata.build }} + key: s32-${{ 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 }} @@ -523,7 +523,7 @@ jobs: path: | ~/.cargo/* ./target/* - key: r2-${{ github.repository }}-${{ runner.os }}-${{ hashFiles('Cargo.lock') }}-wasmer-make-test-stage-${{ matrix.stage.make }}-${{ matrix.metadata.build }} + key: s32-${{ 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 }} @@ -595,7 +595,7 @@ jobs: path: | ~/.cargo/* ./target/* - key: r2-${{ github.repository }}-${{ runner.os }}-${{ hashFiles('Cargo.lock') }}-wasmer-make-test-integration-cli-${{ matrix.build }} + key: s32-${{ 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 }} From f65d0a526c4df4645417218164fb6e5e26eef04f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Fri, 16 Dec 2022 22:21:58 +0100 Subject: [PATCH 204/226] Run test-integration-cli in multithreaded mode --- Makefile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Makefile b/Makefile index ba5c46948aa..3ac42173287 100644 --- a/Makefile +++ b/Makefile @@ -573,6 +573,9 @@ test-integration-cli: rustup target add wasm32-wasi $(CARGO_BINARY) test $(CARGO_TARGET) --features webc_runner --no-fail-fast -p wasmer-integration-tests-cli -- --nocapture --test-threads=1 +test-integration-cli-ci: + $(CARGO_BINARY) test $(CARGO_TARGET) --features webc_runner -p wasmer-integration-tests-cli -- --nocapture || $(CARGO_BINARY) test $(CARGO_TARGET) --features webc_runner --no-fail-fast -p wasmer-integration-tests-cli -- --nocapture --test-threads=1 + test-integration-ios: $(CARGO_BINARY) test $(CARGO_TARGET) --features webc_runner -p wasmer-integration-tests-ios From 5ecc32bca884d3fda39b1617340ffda97ef5cb04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Fri, 16 Dec 2022 22:23:20 +0100 Subject: [PATCH 205/226] Add make test-integration-cli-ci step to CI --- .github/workflows/test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index cf523f7b7c0..fb7e81f8149 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -614,7 +614,7 @@ jobs: - name: Test integration CLI if: matrix.build != 'macos-arm' shell: bash - run: export WASMER_DIR=`pwd`/package && make test-integration-cli + run: export WASMER_DIR=`pwd`/package && make test-integration-cli-ci env: TARGET: ${{ matrix.target }} TARGET_DIR: target/${{ matrix.target }}/release From 5c85b9e7ca5c21d7332970105c06940004b32934 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Fri, 16 Dec 2022 23:27:27 +0100 Subject: [PATCH 206/226] Add wasm32-wasi for test-integration-cli-ci --- Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile b/Makefile index 3ac42173287..7bf6de3a046 100644 --- a/Makefile +++ b/Makefile @@ -574,6 +574,7 @@ test-integration-cli: $(CARGO_BINARY) test $(CARGO_TARGET) --features webc_runner --no-fail-fast -p wasmer-integration-tests-cli -- --nocapture --test-threads=1 test-integration-cli-ci: + rustup target add wasm32-wasi $(CARGO_BINARY) test $(CARGO_TARGET) --features webc_runner -p wasmer-integration-tests-cli -- --nocapture || $(CARGO_BINARY) test $(CARGO_TARGET) --features webc_runner --no-fail-fast -p wasmer-integration-tests-cli -- --nocapture --test-threads=1 test-integration-ios: From 58b541dd14df311c80ce28d770b24f1e810e09f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Mon, 19 Dec 2022 08:25:18 +0100 Subject: [PATCH 207/226] Try debugging why caching on Windows-CAPI doesn't work --- .github/workflows/test.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index fb7e81f8149..420a7e48ccf 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -330,12 +330,16 @@ jobs: target = "${{ matrix.metadata.target }}" EOF if: matrix.metadata.target + - name: List root dir + if: ${{ matrix.build-what.key == 'capi' && matrix.metadata.build == 'windows-x64' }} + run: ls -R /Users/runner/work - name: Cache uses: whywaita/actions-cache-s3@v2 with: path: | ~/.cargo/* ./target/* + /Users/runner/work/.cargo key: s32-${{ 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 }} From 63e9d6ba701203ad7bcdb824c55bcb87e9bbe402 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Mon, 19 Dec 2022 08:43:01 +0100 Subject: [PATCH 208/226] Print cargo dir --- .github/workflows/test.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 420a7e48ccf..3fc68f7809c 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -330,6 +330,9 @@ jobs: 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: List root dir if: ${{ matrix.build-what.key == 'capi' && matrix.metadata.build == 'windows-x64' }} run: ls -R /Users/runner/work From 2d27ce0b38a96be43c45d809084ded79d1cfa4c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Mon, 19 Dec 2022 11:35:43 +0100 Subject: [PATCH 209/226] Add debugging to Windows-Test-C-API CI --- .github/workflows/test.yaml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 3fc68f7809c..38f40b90922 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -334,8 +334,9 @@ jobs: if: ${{ matrix.build-what.key == 'capi' && matrix.metadata.build == 'windows-x64' }} run: which cargo - name: List root dir + shell: bash if: ${{ matrix.build-what.key == 'capi' && matrix.metadata.build == 'windows-x64' }} - run: ls -R /Users/runner/work + run: ls -R $( basedir $( basedir $( which cargo ) ) ) - name: Cache uses: whywaita/actions-cache-s3@v2 with: @@ -384,6 +385,10 @@ jobs: TARGET: ${{ matrix.metadata.target }} TARGET_DIR: target/${{ matrix.metadata.target }}/release CARGO_TARGET: --target ${{ matrix.metadata.target }} + - name: List root dir again + shell: bash + if: ${{ matrix.build-what.key == 'capi' && matrix.metadata.build == 'windows-x64' }} + run: ls -R $( basedir $( basedir $( which cargo ) ) ) - name: Archive production artifacts uses: actions/upload-artifact@v3 with: From c15a98a076b8116f1f7a603c81f83e7e5ebec336 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Mon, 19 Dec 2022 12:02:19 +0100 Subject: [PATCH 210/226] basedir -> dirname --- .github/workflows/test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 38f40b90922..2b1d901b3bc 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -336,7 +336,7 @@ jobs: - name: List root dir shell: bash if: ${{ matrix.build-what.key == 'capi' && matrix.metadata.build == 'windows-x64' }} - run: ls -R $( basedir $( basedir $( which cargo ) ) ) + run: ls -R $( dirname $( dirname $( which cargo ) ) ) - name: Cache uses: whywaita/actions-cache-s3@v2 with: From 473b8fe9c7df1615b9d99e51556865df6bb7d414 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Mon, 19 Dec 2022 13:02:02 +0100 Subject: [PATCH 211/226] Cache cargo dir on Windows, update caches --- .github/workflows/test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 2b1d901b3bc..4fe83b523de 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -388,7 +388,7 @@ jobs: - name: List root dir again shell: bash if: ${{ matrix.build-what.key == 'capi' && matrix.metadata.build == 'windows-x64' }} - run: ls -R $( basedir $( basedir $( which cargo ) ) ) + run: ls -R $( dirname $( dirname $( which cargo ) ) ) - name: Archive production artifacts uses: actions/upload-artifact@v3 with: From f5ff5dab70f977cf5448a6b9406f1efeae845cfd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Mon, 19 Dec 2022 13:05:15 +0100 Subject: [PATCH 212/226] Invalidate cache --- .github/workflows/test.yaml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 4fe83b523de..e24b9d865e3 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -60,7 +60,7 @@ jobs: path: | ~/.cargo/* ./target/* - key: s32-${{ github.repository }}-${{ runner.os }}-${{ hashFiles('Cargo.lock') }}-wasmer-make-lint-linux-x64 + 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 }} @@ -181,7 +181,7 @@ jobs: path: | ~/.cargo/* ./target/* - key: s32-${{ github.repository }}-${{ runner.os }}-${{ hashFiles('Cargo.lock') }}-wasmer-make-build-capi-windows-gnu + key: r22-${{ github.repository }}-${{ runner.os }}-${{ hashFiles('Cargo.lock') }}-wasmer-make-build-capi-windows-gnu 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 }} @@ -343,8 +343,8 @@ jobs: path: | ~/.cargo/* ./target/* - /Users/runner/work/.cargo - key: s32-${{ github.repository }}-${{ runner.os }}-${{ hashFiles('Cargo.lock') }}-wasmer-make-build-wasmer-${{ matrix.build-what.key }}-${{ matrix.metadata.build }} + ${{ $(dirname $(dirname $(which cargo))) }} + 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 }} @@ -535,7 +535,7 @@ jobs: path: | ~/.cargo/* ./target/* - key: s32-${{ github.repository }}-${{ runner.os }}-${{ hashFiles('Cargo.lock') }}-wasmer-make-test-stage-${{ matrix.stage.make }}-${{ matrix.metadata.build }} + 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 }} @@ -607,7 +607,7 @@ jobs: path: | ~/.cargo/* ./target/* - key: s32-${{ github.repository }}-${{ runner.os }}-${{ hashFiles('Cargo.lock') }}-wasmer-make-test-integration-cli-${{ matrix.build }} + 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 }} From e2a9322647f269039460fd4ccf50eeddefdafa3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Mon, 19 Dec 2022 13:11:34 +0100 Subject: [PATCH 213/226] Fix caching --- .github/workflows/test.yaml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index e24b9d865e3..76406575517 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -333,17 +333,19 @@ jobs: - 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 $( dirname $( dirname $( which cargo ) ) ) + run: ls -R $CARGO_ROOT_DIR - name: Cache uses: whywaita/actions-cache-s3@v2 with: path: | ~/.cargo/* ./target/* - ${{ $(dirname $(dirname $(which cargo))) }} + $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 }} From c2718db47da95c201ed9e523fa034522b4ad777c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Mon, 19 Dec 2022 14:49:49 +0100 Subject: [PATCH 214/226] Trigger CI again to test if caching improved --- Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile b/Makefile index 4c6927591a6..6b9e15f133b 100644 --- a/Makefile +++ b/Makefile @@ -366,6 +366,7 @@ check-capi: capi-setup RUSTFLAGS="${RUSTFLAGS}" $(CARGO_BINARY) check $(CARGO_TARGET) --manifest-path lib/c-api/Cargo.toml \ --no-default-features --features wat,compiler,wasi,middlewares $(capi_compiler_features) + build-wasmer: $(CARGO_BINARY) build $(CARGO_TARGET) --release --manifest-path lib/cli/Cargo.toml $(compiler_features) --features="webc_runner" --bin wasmer From 8cd83d5063e317bc6a00b29391329bc139eaa371 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Tue, 20 Dec 2022 09:40:40 +0100 Subject: [PATCH 215/226] Add windows-gnu workflow to build step --- .github/workflows/test.yaml | 104 ++++++++++++++---------------------- 1 file changed, 40 insertions(+), 64 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 76406575517..8e6c2118339 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -158,63 +158,6 @@ jobs: PKG_CONFIG_ALLOW_CROSS: true ENABLE_LLVM: 0 - build_capi_windows_gnu: - name: Build C-API on windows-gnu - runs-on: ubuntu-22.04 - steps: - - uses: actions/checkout@v2 - - name: Install Windows-GNU linker - shell: bash - run: | - sudo apt install -y mingw-w64 - - uses: dtolnay/rust-toolchain@stable - with: - toolchain: 1.61 - target: x86_64-pc-windows-gnu - - name: Install Windows-GNU target - shell: bash - run: | - rustup target add x86_64-pc-windows-gnu - - name: Cache - uses: whywaita/actions-cache-s3@v2 - with: - path: | - ~/.cargo/* - ./target/* - key: r22-${{ github.repository }}-${{ runner.os }}-${{ hashFiles('Cargo.lock') }}-wasmer-make-build-capi-windows-gnu - 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: 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: | - cargo build --release --target x86_64-pc-windows-gnu --manifest-path lib/c-api/Cargo.toml --no-default-features --features wat,compiler,wasi,middlewares,webc_runner --features cranelift,singlepass,wasmer-artifact-create,static-artifact-create,wasmer-artifact-load,static-artifact-load - build: name: ${{ matrix.build-what.name }} on ${{ matrix.metadata.build }} runs-on: ${{ matrix.metadata.os }} @@ -263,6 +206,11 @@ jobs: os: windows-2019, target: x86_64-pc-windows-msvc, llvm_choco_version: 13.0.0 + }, + { + build: windows-gnu, + target: x86_64-pc-windows-gnu, + os: ubuntu-22.04, } ] container: ${{ matrix.metadata.container }} @@ -293,6 +241,38 @@ jobs: with: toolchain: 1.63 target: ${{ matrix.metadata.target }} + - 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: Choco install LLVM uses: crazy-max/ghaction-chocolatey@v2 if: matrix.metadata.llvm_choco_version @@ -364,7 +344,7 @@ jobs: CARGO_TARGET: --target ${{ matrix.metadata.target }} - name: Build Wasmer shell: bash - if: ${{ matrix.build-what.key == 'wasmer' }} + if: ${{ matrix.build-what.key == 'wasmer' && matrix.metadata.build != 'windows-gnu' }} run: ${{ matrix.build-what.build-cmd }} env: TARGET: ${{ matrix.metadata.target }} @@ -372,7 +352,7 @@ jobs: CARGO_TARGET: --target ${{ matrix.metadata.target }} - name: Test C-API shell: bash - if: ${{ matrix.build-what.key == 'capi' && !(matrix.metadata.build == 'linux-musl' || matrix.metadata.build == 'macos-arm') }} + if: ${{ matrix.build-what.key == 'capi' && !(matrix.metadata.build == 'linux-musl' || matrix.metadata.build == 'macos-arm' || matrix.metadata.build == 'windows-gnu') }} run: make test-capi-ci env: TARGET: ${{ matrix.metadata.target }} @@ -381,16 +361,12 @@ jobs: # 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 == 'macos-arm') }} + if: ${{ matrix.build-what.key == 'capi' && !(matrix.metadata.build == 'linux-musl' || matrix.metadata.build == 'macos-arm' || 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: --target ${{ matrix.metadata.target }} - - name: List root dir again - shell: bash - if: ${{ matrix.build-what.key == 'capi' && matrix.metadata.build == 'windows-x64' }} - run: ls -R $( dirname $( dirname $( which cargo ) ) ) - name: Archive production artifacts uses: actions/upload-artifact@v3 with: From 55a9e1a6abf8bad36e96d44ff39a821b5fbeb3a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Tue, 20 Dec 2022 09:45:12 +0100 Subject: [PATCH 216/226] Update RUSTFLAGS in Makefile --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 6b9e15f133b..453575d71bd 100644 --- a/Makefile +++ b/Makefile @@ -546,11 +546,11 @@ test-cranelift: $(foreach cranelift_engine,$(filter cranelift-%,$(compilers_engi test-llvm: $(foreach llvm_engine,$(filter llvm-%,$(compilers_engines)),test-$(llvm_engine)) # same as test-capi, but without the build-capi step first -test-capi-ci: $(foreach compiler_engine,$(capi_compilers_engines),test-capi-crate-$(compiler_engine) test-capi-integration-$(compiler_engine)) +test-capi-ci: capi-setup $(foreach compiler_engine,$(capi_compilers_engines),test-capi-crate-$(compiler_engine) test-capi-integration-$(compiler_engine)) # This test requires building the capi with all the available # compilers first -test-capi: build-capi package-capi test-capi-ci +test-capi: capi-setup build-capi package-capi test-capi-ci test-capi-crate-%: From 9d90b8ccb46403038f1666b0150a26effa8b518a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Tue, 20 Dec 2022 11:42:28 +0100 Subject: [PATCH 217/226] Revert "Update RUSTFLAGS in Makefile" This reverts commit 55a9e1a6abf8bad36e96d44ff39a821b5fbeb3a7. --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 453575d71bd..6b9e15f133b 100644 --- a/Makefile +++ b/Makefile @@ -546,11 +546,11 @@ test-cranelift: $(foreach cranelift_engine,$(filter cranelift-%,$(compilers_engi test-llvm: $(foreach llvm_engine,$(filter llvm-%,$(compilers_engines)),test-$(llvm_engine)) # same as test-capi, but without the build-capi step first -test-capi-ci: capi-setup $(foreach compiler_engine,$(capi_compilers_engines),test-capi-crate-$(compiler_engine) test-capi-integration-$(compiler_engine)) +test-capi-ci: $(foreach compiler_engine,$(capi_compilers_engines),test-capi-crate-$(compiler_engine) test-capi-integration-$(compiler_engine)) # This test requires building the capi with all the available # compilers first -test-capi: capi-setup build-capi package-capi test-capi-ci +test-capi: build-capi package-capi test-capi-ci test-capi-crate-%: From 3b106f965f2439288c9bcc7c67663b2b8d3aa500 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Tue, 20 Dec 2022 11:43:41 +0100 Subject: [PATCH 218/226] Add make capi-setup in test.yaml instead of Makefile --- .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 8e6c2118339..7c4b17c846d 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -127,7 +127,7 @@ jobs: build-what: [ { key: capi, - build-cmd: 'make build-capi', + build-cmd: 'make capi-setup && make build-capi', name: 'Build C-API' }, { @@ -168,7 +168,7 @@ jobs: build-what: [ { key: capi, - build-cmd: 'make build-capi && make package-capi && make tar-capi', + build-cmd: 'make capi-setup && make build-capi && make package-capi && make tar-capi', name: 'Build and test C-API' }, { @@ -353,7 +353,7 @@ jobs: - name: Test C-API shell: bash if: ${{ matrix.build-what.key == 'capi' && !(matrix.metadata.build == 'linux-musl' || matrix.metadata.build == 'macos-arm' || matrix.metadata.build == 'windows-gnu') }} - run: make test-capi-ci + run: make capi-setup && make test-capi-ci env: TARGET: ${{ matrix.metadata.target }} TARGET_DIR: target/${{ matrix.metadata.target }}/release From 83eb8fc993baec5974740dac3d6480d75cd298be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Tue, 20 Dec 2022 12:32:31 +0100 Subject: [PATCH 219/226] Add RUSTFLAGS to Makefile --- Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 6b9e15f133b..009da9b1fe6 100644 --- a/Makefile +++ b/Makefile @@ -554,15 +554,15 @@ test-capi: build-capi package-capi test-capi-ci test-capi-crate-%: - WASMER_CAPI_CONFIG=$(shell echo $@ | sed -e s/test-capi-crate-//) $(CARGO_BINARY) test $(CARGO_TARGET) --manifest-path lib/c-api/Cargo.toml --release \ + RUSTFLAGS="${RUSTFLAGS}" WASMER_CAPI_CONFIG=$(shell echo $@ | sed -e s/test-capi-crate-//) $(CARGO_BINARY) test $(CARGO_TARGET) --manifest-path lib/c-api/Cargo.toml --release \ --no-default-features --features wat,compiler,wasi,middlewares,webc_runner $(capi_compiler_features) -- --nocapture test-capi-integration-%: # note: you need to do make build-capi and make package-capi first! # Test the Wasmer C API tests for C - cd lib/c-api/tests; WASMER_CAPI_CONFIG=$(shell echo $@ | sed -e s/test-capi-integration-//) WASMER_DIR=`pwd`/../../../package make test + cd lib/c-api/tests; RUSTFLAGS="${RUSTFLAGS}" WASMER_CAPI_CONFIG=$(shell echo $@ | sed -e s/test-capi-integration-//) WASMER_DIR=`pwd`/../../../package make test # Test the Wasmer C API examples - cd lib/c-api/examples; WASMER_CAPI_CONFIG=$(shell echo $@ | sed -e s/test-capi-integration-//) WASMER_DIR=`pwd`/../../../package make run + cd lib/c-api/examples; RUSTFLAGS="${RUSTFLAGS}" WASMER_CAPI_CONFIG=$(shell echo $@ | sed -e s/test-capi-integration-//) WASMER_DIR=`pwd`/../../../package make run test-wasi-unit: $(CARGO_BINARY) test $(CARGO_TARGET) --manifest-path lib/wasi/Cargo.toml --release From b0733b1f5c5a7d06083b5fb3038038b0fd72492e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Tue, 20 Dec 2022 13:56:20 +0100 Subject: [PATCH 220/226] Remove WASMER_CAPI_CONFIG to see where the tests fail --- Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 009da9b1fe6..d5e2d5a9556 100644 --- a/Makefile +++ b/Makefile @@ -554,15 +554,15 @@ test-capi: build-capi package-capi test-capi-ci test-capi-crate-%: - RUSTFLAGS="${RUSTFLAGS}" WASMER_CAPI_CONFIG=$(shell echo $@ | sed -e s/test-capi-crate-//) $(CARGO_BINARY) test $(CARGO_TARGET) --manifest-path lib/c-api/Cargo.toml --release \ + RUSTFLAGS="${RUSTFLAGS}" $(CARGO_BINARY) test $(CARGO_TARGET) --manifest-path lib/c-api/Cargo.toml --release \ --no-default-features --features wat,compiler,wasi,middlewares,webc_runner $(capi_compiler_features) -- --nocapture test-capi-integration-%: # note: you need to do make build-capi and make package-capi first! # Test the Wasmer C API tests for C - cd lib/c-api/tests; RUSTFLAGS="${RUSTFLAGS}" WASMER_CAPI_CONFIG=$(shell echo $@ | sed -e s/test-capi-integration-//) WASMER_DIR=`pwd`/../../../package make test + cd lib/c-api/tests; RUSTFLAGS="${RUSTFLAGS}" WASMER_DIR=`pwd`/../../../package make test # Test the Wasmer C API examples - cd lib/c-api/examples; RUSTFLAGS="${RUSTFLAGS}" WASMER_CAPI_CONFIG=$(shell echo $@ | sed -e s/test-capi-integration-//) WASMER_DIR=`pwd`/../../../package make run + cd lib/c-api/examples; RUSTFLAGS="${RUSTFLAGS}" WASMER_DIR=`pwd`/../../../package make run test-wasi-unit: $(CARGO_BINARY) test $(CARGO_TARGET) --manifest-path lib/wasi/Cargo.toml --release From bd0ecab0fc079391c18256ee243d3bc5387e08a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Tue, 20 Dec 2022 14:36:42 +0100 Subject: [PATCH 221/226] Remove build-capi step --- Makefile | 33 ++++++++++++++------------------- 1 file changed, 14 insertions(+), 19 deletions(-) diff --git a/Makefile b/Makefile index d5e2d5a9556..d99c9d0f49e 100644 --- a/Makefile +++ b/Makefile @@ -362,7 +362,7 @@ check-wasmer: check-wasmer-wasm: $(CARGO_BINARY) check --manifest-path lib/cli-compiler/Cargo.toml --target wasm32-wasi --features singlepass,cranelift --bin wasmer-compiler -check-capi: capi-setup +check-capi: RUSTFLAGS="${RUSTFLAGS}" $(CARGO_BINARY) check $(CARGO_TARGET) --manifest-path lib/c-api/Cargo.toml \ --no-default-features --features wat,compiler,wasi,middlewares $(capi_compiler_features) @@ -417,12 +417,7 @@ endif build-docs: $(CARGO_BINARY) doc $(CARGO_TARGET) --release $(compiler_features) --document-private-items --no-deps --workspace --exclude wasmer-c-api -capi-setup: -ifeq ($(IS_WINDOWS), 1) - RUSTFLAGS += -C target-feature=+crt-static -endif - -build-docs-capi: capi-setup +build-docs-capi: # `wasmer-c-api` lib's name is `wasmer`. To avoid a conflict # when generating the documentation, we rename it to its # crate's name. Then we restore the lib's name. @@ -430,37 +425,37 @@ build-docs-capi: capi-setup RUSTFLAGS="${RUSTFLAGS}" $(CARGO_BINARY) doc $(CARGO_TARGET) --manifest-path lib/c-api/Cargo.toml --no-deps --features wat,compiler,cranelift,wasi sed "$(SEDI)" -e 's/name = "wasmer_c_api" # ##lib.name##/name = "wasmer" # ##lib.name##/' lib/c-api/Cargo.toml -build-capi: capi-setup +build-capi: RUSTFLAGS="${RUSTFLAGS}" $(CARGO_BINARY) build $(CARGO_TARGET) --manifest-path lib/c-api/Cargo.toml --release \ --no-default-features --features wat,compiler,wasi,middlewares,webc_runner $(capi_compiler_features) -build-capi-singlepass: capi-setup +build-capi-singlepass: RUSTFLAGS="${RUSTFLAGS}" $(CARGO_BINARY) build $(CARGO_TARGET) --manifest-path lib/c-api/Cargo.toml --release \ --no-default-features --features wat,compiler,singlepass,wasi,middlewares,webc_runner -build-capi-singlepass-universal: capi-setup +build-capi-singlepass-universal: RUSTFLAGS="${RUSTFLAGS}" $(CARGO_BINARY) build $(CARGO_TARGET) --manifest-path lib/c-api/Cargo.toml --release \ --no-default-features --features wat,compiler,singlepass,wasi,middlewares,webc_runner -build-capi-cranelift: capi-setup +build-capi-cranelift: RUSTFLAGS="${RUSTFLAGS}" $(CARGO_BINARY) build $(CARGO_TARGET) --manifest-path lib/c-api/Cargo.toml --release \ --no-default-features --features wat,compiler,cranelift,wasi,middlewares,webc_runner -build-capi-cranelift-universal: capi-setup +build-capi-cranelift-universal: RUSTFLAGS="${RUSTFLAGS}" $(CARGO_BINARY) build $(CARGO_TARGET) --manifest-path lib/c-api/Cargo.toml --release \ --no-default-features --features wat,compiler,cranelift,wasi,middlewares,webc_runner -build-capi-llvm: capi-setup +build-capi-llvm: RUSTFLAGS="${RUSTFLAGS}" $(CARGO_BINARY) build $(CARGO_TARGET) --manifest-path lib/c-api/Cargo.toml --release \ --no-default-features --features wat,compiler,llvm,wasi,middlewares,webc_runner -build-capi-llvm-universal: capi-setup +build-capi-llvm-universal: RUSTFLAGS="${RUSTFLAGS}" $(CARGO_BINARY) build $(CARGO_TARGET) --manifest-path lib/c-api/Cargo.toml --release \ --no-default-features --features wat,compiler,llvm,wasi,middlewares,webc_runner # Headless (we include the minimal to be able to run) -build-capi-headless: capi-setup +build-capi-headless: ifeq ($(CARGO_TARGET),) RUSTFLAGS="${RUSTFLAGS} -C panic=abort -C link-dead-code -C lto -O -C embed-bitcode=yes" $(CARGO_BINARY) build --target $(HOST_TARGET) --manifest-path lib/c-api/Cargo.toml --release \ --no-default-features --features compiler-headless,wasi @@ -469,7 +464,7 @@ else --no-default-features --features compiler-headless,wasi endif -build-capi-headless-ios: capi-setup +build-capi-headless-ios: RUSTFLAGS="${RUSTFLAGS} -C panic=abort" cargo lipo --manifest-path lib/c-api/Cargo.toml --release \ --no-default-features --features compiler-headless,wasi @@ -554,15 +549,15 @@ test-capi: build-capi package-capi test-capi-ci test-capi-crate-%: - RUSTFLAGS="${RUSTFLAGS}" $(CARGO_BINARY) test $(CARGO_TARGET) --manifest-path lib/c-api/Cargo.toml --release \ + WASMER_CAPI_CONFIG=$(shell echo $@ | sed -e s/test-capi-crate-//) $(CARGO_BINARY) test $(CARGO_TARGET) --manifest-path lib/c-api/Cargo.toml --release \ --no-default-features --features wat,compiler,wasi,middlewares,webc_runner $(capi_compiler_features) -- --nocapture test-capi-integration-%: # note: you need to do make build-capi and make package-capi first! # Test the Wasmer C API tests for C - cd lib/c-api/tests; RUSTFLAGS="${RUSTFLAGS}" WASMER_DIR=`pwd`/../../../package make test + cd lib/c-api/tests; WASMER_CAPI_CONFIG=$(shell echo $@ | sed -e s/test-capi-integration-//) WASMER_DIR=`pwd`/../../../package make test # Test the Wasmer C API examples - cd lib/c-api/examples; RUSTFLAGS="${RUSTFLAGS}" WASMER_DIR=`pwd`/../../../package make run + cd lib/c-api/examples; WASMER_CAPI_CONFIG=$(shell echo $@ | sed -e s/test-capi-integration-//) WASMER_DIR=`pwd`/../../../package make run test-wasi-unit: $(CARGO_BINARY) test $(CARGO_TARGET) --manifest-path lib/wasi/Cargo.toml --release From 9bb667a63a388cd1e7b4a0ff294bd0d15d47cce4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Tue, 20 Dec 2022 14:41:19 +0100 Subject: [PATCH 222/226] Remove make capi-setup from test.yaml --- .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 7c4b17c846d..8e6c2118339 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -127,7 +127,7 @@ jobs: build-what: [ { key: capi, - build-cmd: 'make capi-setup && make build-capi', + build-cmd: 'make build-capi', name: 'Build C-API' }, { @@ -168,7 +168,7 @@ jobs: build-what: [ { key: capi, - build-cmd: 'make capi-setup && make build-capi && make package-capi && make tar-capi', + build-cmd: 'make build-capi && make package-capi && make tar-capi', name: 'Build and test C-API' }, { @@ -353,7 +353,7 @@ jobs: - name: Test C-API shell: bash if: ${{ matrix.build-what.key == 'capi' && !(matrix.metadata.build == 'linux-musl' || matrix.metadata.build == 'macos-arm' || matrix.metadata.build == 'windows-gnu') }} - run: make capi-setup && make test-capi-ci + run: make test-capi-ci env: TARGET: ${{ matrix.metadata.target }} TARGET_DIR: target/${{ matrix.metadata.target }}/release From f4081dabae0f6480876081e05d568e0d74b9e206 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Fri, 30 Dec 2022 13:19:31 +0100 Subject: [PATCH 223/226] Migrate to GCS --- .github/workflows/test.yaml | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 8e6c2118339..a6be7757ad1 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -61,11 +61,11 @@ jobs: ~/.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-s3-bucket: wasmer-github-ci-cache + aws-access-key-id: ${{ secrets.GOOGLE_CACHE_ID }} + aws-secret-access-key: ${{ secrets.GOOGLE_CACHE_SECRET }} aws-region: auto - aws-endpoint: https://1541b1e8a3fc6ad155ce67ef38899700.r2.cloudflarestorage.com + aws-endpoint: https://storage.googleapis.com aws-s3-bucket-endpoint: false aws-s3-force-path-style: true - run: make lint @@ -327,11 +327,11 @@ jobs: ./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-s3-bucket: wasmer-github-ci-cache + aws-access-key-id: ${{ secrets.GOOGLE_CACHE_ID }} + aws-secret-access-key: ${{ secrets.GOOGLE_CACHE_SECRET }} aws-region: auto - aws-endpoint: https://1541b1e8a3fc6ad155ce67ef38899700.r2.cloudflarestorage.com + aws-endpoint: https://storage.googleapis.com aws-s3-bucket-endpoint: false aws-s3-force-path-style: true - name: Build C-API @@ -514,11 +514,11 @@ jobs: ~/.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-s3-bucket: wasmer-github-ci-cache + aws-access-key-id: ${{ secrets.GOOGLE_CACHE_ID }} + aws-secret-access-key: ${{ secrets.GOOGLE_CACHE_SECRET }} aws-region: auto - aws-endpoint: https://1541b1e8a3fc6ad155ce67ef38899700.r2.cloudflarestorage.com + aws-endpoint: https://storage.googleapis.com aws-s3-bucket-endpoint: false aws-s3-force-path-style: true - name: ${{ matrix.stage.description }} @@ -586,11 +586,11 @@ jobs: ~/.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-s3-bucket: wasmer-github-ci-cache + aws-access-key-id: ${{ secrets.GOOGLE_CACHE_ID }} + aws-secret-access-key: ${{ secrets.GOOGLE_CACHE_SECRET }} aws-region: auto - aws-endpoint: https://1541b1e8a3fc6ad155ce67ef38899700.r2.cloudflarestorage.com + aws-endpoint: https://storage.googleapis.com aws-s3-bucket-endpoint: false aws-s3-force-path-style: true - name: Unzip Artifacts From 3d20e6a112148aa56d9f638d59371acc5720529c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= <12084016+fschutt@users.noreply.github.com> Date: Fri, 30 Dec 2022 13:22:32 +0100 Subject: [PATCH 224/226] Fix error message for wasmer.lib not being found Co-authored-by: Syrus Akbary --- lib/cli/src/commands/create_exe.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/cli/src/commands/create_exe.rs b/lib/cli/src/commands/create_exe.rs index 733884f35f8..5c59c347ba4 100644 --- a/lib/cli/src/commands/create_exe.rs +++ b/lib/cli/src/commands/create_exe.rs @@ -466,7 +466,7 @@ impl CreateExe { .iter() .find(|f| f.ends_with("libwasmer.a") || f.ends_with("wasmer.lib")).cloned() .ok_or_else(|| { - anyhow!("Could not find libwasmer.a for {} target in the provided tarball path (files = {files:#?})", target) + anyhow!("Could not find libwasmer.a / wasmer.lib for {} target in the provided tarball path (files = {files:#?})", target) })?; Ok((file, tarball_dir)) From ec0d510ad26ae113d6ee0d9c5da738d81800ae55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Fri, 30 Dec 2022 13:22:54 +0100 Subject: [PATCH 225/226] cargo fmt --- lib/cache/src/cache.rs | 8 ++++++-- lib/cache/src/filesystem.rs | 8 ++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/lib/cache/src/cache.rs b/lib/cache/src/cache.rs index a2b4f5ec58a..340163db956 100644 --- a/lib/cache/src/cache.rs +++ b/lib/cache/src/cache.rs @@ -4,7 +4,7 @@ use crate::hash::Hash; use std::error::Error; -use wasmer::{Module, AsEngineRef}; +use wasmer::{AsEngineRef, Module}; /// A generic cache for storing and loading compiled wasm modules. pub trait Cache { @@ -17,7 +17,11 @@ pub trait Cache { /// /// # Safety /// This function is unsafe as the cache store could be tampered with. - unsafe fn load(&self, engine: &impl AsEngineRef, key: Hash) -> Result; + unsafe fn load( + &self, + engine: &impl AsEngineRef, + key: Hash, + ) -> Result; /// Store a [`Module`] into the cache with the given [`Hash`]. fn store(&mut self, key: Hash, module: &Module) -> Result<(), Self::SerializeError>; diff --git a/lib/cache/src/filesystem.rs b/lib/cache/src/filesystem.rs index ed592d392b5..8d326b64c8d 100644 --- a/lib/cache/src/filesystem.rs +++ b/lib/cache/src/filesystem.rs @@ -4,7 +4,7 @@ use crate::hash::Hash; use std::fs::{create_dir_all, File}; use std::io::{self, Write}; use std::path::PathBuf; -use wasmer::{DeserializeError, Module, SerializeError, AsEngineRef}; +use wasmer::{AsEngineRef, DeserializeError, Module, SerializeError}; /// Representation of a directory that contains compiled wasm artifacts. /// @@ -91,7 +91,11 @@ impl Cache for FileSystemCache { type DeserializeError = DeserializeError; type SerializeError = SerializeError; - unsafe fn load(&self, engine: &impl AsEngineRef, key: Hash) -> Result { + unsafe fn load( + &self, + engine: &impl AsEngineRef, + key: Hash, + ) -> Result { let filename = if let Some(ref ext) = self.ext { format!("{}.{}", key.to_string(), ext) } else { From 3b362d965d14bbe04732bfa38710dcb2b47ade35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Fri, 30 Dec 2022 14:26:58 +0100 Subject: [PATCH 226/226] Trigger CI again to test caching --- Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile b/Makefile index ab0fbab46bc..f93f51d01dd 100644 --- a/Makefile +++ b/Makefile @@ -38,6 +38,7 @@ SHELL=/usr/bin/env bash ##### + IS_DARWIN := 0 IS_LINUX := 0 IS_FREEBSD := 0