From 686e1a35f67d260dda49bca7a3b00041a7eec0e8 Mon Sep 17 00:00:00 2001 From: "M.Amin Rayej" Date: Thu, 24 Oct 2024 14:51:54 +0330 Subject: [PATCH 01/39] disable all except windows --- .github/workflows/build.yml | 776 ++++----- .github/workflows/test.yaml | 2176 +++++++++++++------------- .github/workflows/wasmer-config.yaml | 98 +- 3 files changed, 1527 insertions(+), 1523 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d493f7e8b28..5f94527ce83 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -12,6 +12,9 @@ on: tags: # this is _not_ a regex, see: https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#filter-pattern-cheat-sheet - '[0-9]+.[0-9]+.[0-9]+*' + pull_request: # TODO: MUST BE REMOVED! ONLY FOR TESTING + branches: + - 'main' # Run jobs on PRs targeting the 'main' branch workflow_dispatch: inputs: release: @@ -43,106 +46,106 @@ jobs: fail-fast: false matrix: include: - - build: linux-x64 - os: ubuntu-22.04 - artifact_name: 'wasmer-linux-amd64' - llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-amd64.tar.xz' - cross_compilation_artifact_name: 'cross_compiled_from_linux' - use_sccache: false - use_llvm: true - build_wasm: true - - build: linux-x64-v8 - os: ubuntu-22.04 - artifact_name: 'wasmer-v8-linux-amd64' - llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-amd64.tar.xz' - cross_compilation_artifact_name: 'cross_compiled_from_linux' - use_sccache: false - use_llvm: true - build_wasm: true - - build: linux-x64-wamr - os: ubuntu-22.04 - artifact_name: 'wasmer-wamr-linux-amd64' - llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-amd64.tar.xz' - cross_compilation_artifact_name: 'cross_compiled_from_linux' - use_sccache: false - use_llvm: true - build_wasm: true - - build: linux-x64-wasmi - os: ubuntu-22.04 - artifact_name: 'wasmer-wasmi-linux-amd64' - llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-amd64.tar.xz' - cross_compilation_artifact_name: 'cross_compiled_from_linux' - use_sccache: false - use_llvm: true - build_wasm: true - - build: macos-x64 - os: macos-13 - llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-amd64.tar.xz' - artifact_name: 'wasmer-darwin-amd64' - cross_compilation_artifact_name: 'cross_compiled_from_mac' - use_sccache: false - use_llvm: true - build_wasm: false - - build: macos-x64-v8 - os: macos-13 - llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-amd64.tar.xz' - artifact_name: 'wasmer-v8-darwin-amd64' - cross_compilation_artifact_name: 'cross_compiled_from_mac' - use_sccache: false - use_llvm: true - build_wasm: false - - build: macos-x64-wamr - os: macos-13 - llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-amd64.tar.xz' - artifact_name: 'wasmer-wamr-darwin-amd64' - cross_compilation_artifact_name: 'cross_compiled_from_mac' - use_sccache: false - use_llvm: true - build_wasm: false - - build: macos-x64-wasmi - os: macos-13 - llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-amd64.tar.xz' - artifact_name: 'wasmer-wasmi-darwin-amd64' - cross_compilation_artifact_name: 'cross_compiled_from_mac' - use_sccache: false - use_llvm: true - build_wasm: false - - build: macos-arm64 - os: macos-14 - target: aarch64-apple-darwin - artifact_name: 'wasmer-darwin-arm64' - use_sccache: false - use_llvm: false - build_wasm: false - # [todo] xdoardo: Reinstate when the code we generate for aarch64 is working correctly. - llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-aarch64.tar.xz' - - build: macos-arm64-v8 - os: macos-14 - target: aarch64-apple-darwin - artifact_name: 'wasmer-v8-darwin-arm64' - use_sccache: false - use_llvm: false - build_wasm: false - # [todo] xdoardo: Reinstate when the code we generate for aarch64 is working correctly. - llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-aarch64.tar.xz' - - build: macos-arm64-wamr - os: macos-14 - target: aarch64-apple-darwin - artifact_name: 'wasmer-wamr-darwin-arm64' - use_sccache: false - use_llvm: false - build_wasm: false - # [todo] xdoardo: Reinstate when the code we generate for aarch64 is working correctly. - llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-aarch64.tar.xz' - - build: macos-arm64-wasmi - os: macos-14 - target: aarch64-apple-darwin - artifact_name: 'wasmer-wasmi-darwin-arm64' - use_sccache: false - use_llvm: false - build_wasm: false - # [todo] xdoardo: Reinstate when the code we generate for aarch64 is working correctly. - llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-aarch64.tar.xz' + # - build: linux-x64 + # os: ubuntu-22.04 + # artifact_name: 'wasmer-linux-amd64' + # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-amd64.tar.xz' + # cross_compilation_artifact_name: 'cross_compiled_from_linux' + # use_sccache: false + # use_llvm: true + # build_wasm: true + # - build: linux-x64-v8 + # os: ubuntu-22.04 + # artifact_name: 'wasmer-v8-linux-amd64' + # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-amd64.tar.xz' + # cross_compilation_artifact_name: 'cross_compiled_from_linux' + # use_sccache: false + # use_llvm: true + # build_wasm: true + # - build: linux-x64-wamr + # os: ubuntu-22.04 + # artifact_name: 'wasmer-wamr-linux-amd64' + # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-amd64.tar.xz' + # cross_compilation_artifact_name: 'cross_compiled_from_linux' + # use_sccache: false + # use_llvm: true + # build_wasm: true + # - build: linux-x64-wasmi + # os: ubuntu-22.04 + # artifact_name: 'wasmer-wasmi-linux-amd64' + # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-amd64.tar.xz' + # cross_compilation_artifact_name: 'cross_compiled_from_linux' + # use_sccache: false + # use_llvm: true + # build_wasm: true + # - build: macos-x64 + # os: macos-13 + # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-amd64.tar.xz' + # artifact_name: 'wasmer-darwin-amd64' + # cross_compilation_artifact_name: 'cross_compiled_from_mac' + # use_sccache: false + # use_llvm: true + # build_wasm: false + # - build: macos-x64-v8 + # os: macos-13 + # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-amd64.tar.xz' + # artifact_name: 'wasmer-v8-darwin-amd64' + # cross_compilation_artifact_name: 'cross_compiled_from_mac' + # use_sccache: false + # use_llvm: true + # build_wasm: false + # - build: macos-x64-wamr + # os: macos-13 + # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-amd64.tar.xz' + # artifact_name: 'wasmer-wamr-darwin-amd64' + # cross_compilation_artifact_name: 'cross_compiled_from_mac' + # use_sccache: false + # use_llvm: true + # build_wasm: false + # - build: macos-x64-wasmi + # os: macos-13 + # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-amd64.tar.xz' + # artifact_name: 'wasmer-wasmi-darwin-amd64' + # cross_compilation_artifact_name: 'cross_compiled_from_mac' + # use_sccache: false + # use_llvm: true + # build_wasm: false + # - build: macos-arm64 + # os: macos-14 + # target: aarch64-apple-darwin + # artifact_name: 'wasmer-darwin-arm64' + # use_sccache: false + # use_llvm: false + # build_wasm: false + # # [todo] xdoardo: Reinstate when the code we generate for aarch64 is working correctly. + # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-aarch64.tar.xz' + # - build: macos-arm64-v8 + # os: macos-14 + # target: aarch64-apple-darwin + # artifact_name: 'wasmer-v8-darwin-arm64' + # use_sccache: false + # use_llvm: false + # build_wasm: false + # # [todo] xdoardo: Reinstate when the code we generate for aarch64 is working correctly. + # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-aarch64.tar.xz' + # - build: macos-arm64-wamr + # os: macos-14 + # target: aarch64-apple-darwin + # artifact_name: 'wasmer-wamr-darwin-arm64' + # use_sccache: false + # use_llvm: false + # build_wasm: false + # # [todo] xdoardo: Reinstate when the code we generate for aarch64 is working correctly. + # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-aarch64.tar.xz' + # - build: macos-arm64-wasmi + # os: macos-14 + # target: aarch64-apple-darwin + # artifact_name: 'wasmer-wasmi-darwin-arm64' + # use_sccache: false + # use_llvm: false + # build_wasm: false + # # [todo] xdoardo: Reinstate when the code we generate for aarch64 is working correctly. + # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-aarch64.tar.xz' - build: windows-x64 os: windows-2022 artifact_name: 'wasmer-windows-amd64' @@ -151,37 +154,37 @@ jobs: use_sccache: false use_llvm: true build_wasm: false - - build: windows-x64-v8 - os: windows-2022 - artifact_name: 'wasmer-v8-windows-amd64' - llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-windows-amd64.tar.xz' - cross_compilation_artifact_name: 'cross_compiled_from_win' - use_sccache: false - use_llvm: true - build_wasm: false - - build: windows-x64-wamr - os: windows-2022 - artifact_name: 'wasmer-wamr-windows-amd64' - llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-windows-amd64.tar.xz' - cross_compilation_artifact_name: 'cross_compiled_from_win' - use_sccache: false - use_llvm: true - build_wasm: false - - build: windows-x64-wasmi - os: windows-2022 - artifact_name: 'wasmer-wasmi-windows-amd64' - llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-windows-amd64.tar.xz' - cross_compilation_artifact_name: 'cross_compiled_from_win' - use_sccache: false - use_llvm: true - build_wasm: false - - build: linux-musl-x64 - os: ubuntu-latest - artifact_name: 'wasmer-linux-musl-amd64' - container: alpine:latest - use_sccache: false - use_llvm: false - build_wasm: true + # - build: windows-x64-v8 + # os: windows-2022 + # artifact_name: 'wasmer-v8-windows-amd64' + # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-windows-amd64.tar.xz' + # cross_compilation_artifact_name: 'cross_compiled_from_win' + # use_sccache: false + # use_llvm: true + # build_wasm: false + # - build: windows-x64-wamr + # os: windows-2022 + # artifact_name: 'wasmer-wamr-windows-amd64' + # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-windows-amd64.tar.xz' + # cross_compilation_artifact_name: 'cross_compiled_from_win' + # use_sccache: false + # use_llvm: true + # build_wasm: false + # - build: windows-x64-wasmi + # os: windows-2022 + # artifact_name: 'wasmer-wasmi-windows-amd64' + # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-windows-amd64.tar.xz' + # cross_compilation_artifact_name: 'cross_compiled_from_win' + # use_sccache: false + # use_llvm: true + # build_wasm: false + # - build: linux-musl-x64 + # os: ubuntu-latest + # artifact_name: 'wasmer-linux-musl-amd64' + # container: alpine:latest + # use_sccache: false + # use_llvm: false + # build_wasm: true container: ${{ matrix.container }} env: SCCACHE_AZURE_BLOB_CONTAINER: wasmerstoragesccacheblob @@ -393,268 +396,269 @@ jobs: if-no-files-found: error retention-days: 2 - windows_gnu: - name: Windows GNU - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: Install Windows-GNU linker - shell: bash - run: | - sudo apt install -y mingw-w64 - - uses: dtolnay/rust-toolchain@stable - with: - target: x86_64-pc-windows-gnu - - name: Install Windows-GNU target - shell: bash - run: | - rustup target add x86_64-pc-windows-gnu - - name: Install Windows 10 SDK with xwin - shell: bash - run: | - mkdir -p /tmp/xwin - mkdir -p /tmp/xwindownload - mkdir -p /tmp/xwincache - git clone https://github.com/wasmerio/xwin --depth=1 /tmp/xwin - cargo build --release --manifest-path=/tmp/xwin/Cargo.toml - /tmp/xwin/target/release/xwin --accept-license --cache-dir /tmp/xwincache splat --output /tmp/xwindownload - mkdir -p /tmp/winsdk - cp /tmp/xwindownload/sdk/lib/10.0.20348/um/x86_64/WS2_32.lib /tmp/winsdk/ - cp /tmp/xwindownload/sdk/lib/10.0.20348/um/x86_64/KERNEL32.lib /tmp/winsdk/ - cp /tmp/xwindownload/sdk/lib/10.0.20348/um/x86_64/BCRYPT.lib /tmp/winsdk/ - cp /tmp/xwindownload/sdk/lib/10.0.20348/um/x86_64/ADVAPI32.lib /tmp/winsdk/ - cp /tmp/xwindownload/sdk/lib/10.0.20348/um/x86_64/USERENV.lib /tmp/winsdk/ - echo "WinSDK files:" - ls -laH /tmp/winsdk - echo "" - mkdir -p package - mkdir -p package/winsdk - cp -r /tmp/winsdk/* package/winsdk - - name: Build Wasmer C-API without LLVM - shell: bash - run: | - make build-capi - env: - RUSTFLAGS: -Cpanic=abort - CARGO_TARGET: x86_64-pc-windows-gnu - ENABLE_LLVM: 0 - - name: Build Wasmer C-API headless without LLVM - shell: bash - run: | - make build-capi-headless - env: - RUSTFLAGS: -Cpanic=abort - CARGO_TARGET: x86_64-pc-windows-gnu - ENABLE_LLVM: 0 - - name: Dist - run: | - make distribution-gnu - env: - CARGO_TARGET: x86_64-pc-windows-gnu - TARGET_DIR: target/x86_64-pc-windows-gnu/release - - name: Upload Artifacts - uses: actions/upload-artifact@v4 - with: - name: 'wasmer-windows-gnu64' - path: dist - if-no-files-found: error - retention-days: 2 + # windows_gnu: + # name: Windows GNU + # runs-on: ubuntu-latest + # steps: + # - uses: actions/checkout@v3 + # - name: Install Windows-GNU linker + # shell: bash + # run: | + # sudo apt install -y mingw-w64 + # - uses: dtolnay/rust-toolchain@stable + # with: + # target: x86_64-pc-windows-gnu + # - name: Install Windows-GNU target + # shell: bash + # run: | + # rustup target add x86_64-pc-windows-gnu + # - name: Install Windows 10 SDK with xwin + # shell: bash + # run: | + # mkdir -p /tmp/xwin + # mkdir -p /tmp/xwindownload + # mkdir -p /tmp/xwincache + # git clone https://github.com/wasmerio/xwin --depth=1 /tmp/xwin + # cargo build --release --manifest-path=/tmp/xwin/Cargo.toml + # /tmp/xwin/target/release/xwin --accept-license --cache-dir /tmp/xwincache splat --output /tmp/xwindownload + # mkdir -p /tmp/winsdk + # cp /tmp/xwindownload/sdk/lib/10.0.20348/um/x86_64/WS2_32.lib /tmp/winsdk/ + # cp /tmp/xwindownload/sdk/lib/10.0.20348/um/x86_64/KERNEL32.lib /tmp/winsdk/ + # cp /tmp/xwindownload/sdk/lib/10.0.20348/um/x86_64/BCRYPT.lib /tmp/winsdk/ + # cp /tmp/xwindownload/sdk/lib/10.0.20348/um/x86_64/ADVAPI32.lib /tmp/winsdk/ + # cp /tmp/xwindownload/sdk/lib/10.0.20348/um/x86_64/USERENV.lib /tmp/winsdk/ + # echo "WinSDK files:" + # ls -laH /tmp/winsdk + # echo "" + # mkdir -p package + # mkdir -p package/winsdk + # cp -r /tmp/winsdk/* package/winsdk + # - name: Build Wasmer C-API without LLVM + # shell: bash + # run: | + # make build-capi + # env: + # RUSTFLAGS: -Cpanic=abort + # CARGO_TARGET: x86_64-pc-windows-gnu + # ENABLE_LLVM: 0 + # - name: Build Wasmer C-API headless without LLVM + # shell: bash + # run: | + # make build-capi-headless + # env: + # RUSTFLAGS: -Cpanic=abort + # CARGO_TARGET: x86_64-pc-windows-gnu + # ENABLE_LLVM: 0 + # - name: Dist + # run: | + # make distribution-gnu + # env: + # CARGO_TARGET: x86_64-pc-windows-gnu + # TARGET_DIR: target/x86_64-pc-windows-gnu/release + # - name: Upload Artifacts + # uses: actions/upload-artifact@v4 + # with: + # name: 'wasmer-windows-gnu64' + # path: dist + # if-no-files-found: error + # retention-days: 2 - darwin_aarch64_jsc: - name: macOS aarch64 (JSC) - runs-on: macos-12 - steps: - - uses: actions/checkout@v3 - - uses: dtolnay/rust-toolchain@stable - with: - target: aarch64-apple-darwin - - name: Install Darwin-aarch64 target - shell: bash - run: | - rustup target add aarch64-apple-darwin - - name: Build Wasmer C-API (JSC) - shell: bash - run: | - make build-capi-jsc - env: - RUSTFLAGS: -Cpanic=abort - CARGO_TARGET: aarch64-apple-darwin - - name: Dist - run: | - make distribution - env: - CARGO_TARGET: aarch64-apple-darwin - TARGET_DIR: target/aarch64-apple-darwin/release - - name: Upload Artifacts - uses: actions/upload-artifact@v4 - with: - name: 'aarch64-apple-darwin-jsc' - path: dist - if-no-files-found: error - retention-days: 2 + # darwin_aarch64_jsc: + # name: macOS aarch64 (JSC) + # runs-on: macos-12 + # steps: + # - uses: actions/checkout@v3 + # - uses: dtolnay/rust-toolchain@stable + # with: + # target: aarch64-apple-darwin + # - name: Install Darwin-aarch64 target + # shell: bash + # run: | + # rustup target add aarch64-apple-darwin + # - name: Build Wasmer C-API (JSC) + # shell: bash + # run: | + # make build-capi-jsc + # env: + # RUSTFLAGS: -Cpanic=abort + # CARGO_TARGET: aarch64-apple-darwin + # - name: Dist + # run: | + # make distribution + # env: + # CARGO_TARGET: aarch64-apple-darwin + # TARGET_DIR: target/aarch64-apple-darwin/release + # - name: Upload Artifacts + # uses: actions/upload-artifact@v4 + # with: + # name: 'aarch64-apple-darwin-jsc' + # path: dist + # if-no-files-found: error + # retention-days: 2 - darwin_x86_64_jsc: - name: macOS x86_64 (JSC) - runs-on: macos-12 - steps: - - uses: actions/checkout@v3 - - uses: dtolnay/rust-toolchain@stable - with: - target: x86_64-apple-darwin - - name: Build Wasmer C-API (JSC) - shell: bash - run: | - make build-capi-jsc - env: - RUSTFLAGS: -Cpanic=abort - CARGO_TARGET: x86_64-apple-darwin - - name: Dist - run: | - make distribution - env: - CARGO_TARGET: x86_64-apple-darwin - TARGET_DIR: target/x86_64-apple-darwin/release - - name: Upload Artifacts - uses: actions/upload-artifact@v4 - with: - name: 'x86_64-apple-darwin-jsc' - path: dist - if-no-files-found: error - retention-days: 2 + # darwin_x86_64_jsc: + # name: macOS x86_64 (JSC) + # runs-on: macos-12 + # steps: + # - uses: actions/checkout@v3 + # - uses: dtolnay/rust-toolchain@stable + # with: + # target: x86_64-apple-darwin + # - name: Build Wasmer C-API (JSC) + # shell: bash + # run: | + # make build-capi-jsc + # env: + # RUSTFLAGS: -Cpanic=abort + # CARGO_TARGET: x86_64-apple-darwin + # - name: Dist + # run: | + # make distribution + # env: + # CARGO_TARGET: x86_64-apple-darwin + # TARGET_DIR: target/x86_64-apple-darwin/release + # - name: Upload Artifacts + # uses: actions/upload-artifact@v4 + # with: + # name: 'x86_64-apple-darwin-jsc' + # path: dist + # if-no-files-found: error + # retention-days: 2 - linux_aarch64: - name: Linux aarch64 - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: dtolnay/rust-toolchain@stable - with: - target: aarch64-unknown-linux-gnu - - name: Build cross image - run: | - docker build -t wasmer/aarch64 ${GITHUB_WORKSPACE}/.github/cross-linux-aarch64/ - env: - CROSS_DOCKER_IN_DOCKER: true - - name: Build Wasmer binary - run: | - make build-wasmer - env: - CARGO_BINARY: docker run -v /var/run/docker.sock:/var/run/docker.sock -v ${GITHUB_WORKSPACE}:/project -w /project wasmer/aarch64 cross - CROSS_DOCKER_IN_DOCKER: true - CARGO_TARGET: aarch64-unknown-linux-gnu - PKG_CONFIG_PATH: /usr/lib/aarch64-linux-gnu/pkgconfig - PKG_CONFIG_ALLOW_CROSS: true - ENABLE_LLVM: 0 - - name: Build C API headless - shell: bash - run: | - make package-capi-headless - env: - CARGO_BINARY: docker run -v /var/run/docker.sock:/var/run/docker.sock -v ${GITHUB_WORKSPACE}:/project -w /project wasmer/aarch64 cross - CROSS_DOCKER_IN_DOCKER: true - CARGO_TARGET: aarch64-unknown-linux-gnu - PKG_CONFIG_PATH: /usr/lib/aarch64-linux-gnu/pkgconfig - PKG_CONFIG_ALLOW_CROSS: true - ENABLE_LLVM: 0 - TARGET: aarch64-unknown-linux-gnu - TARGET_DIR: target/aarch64-unknown-linux-gnu/release - - name: Build C API - run: | - make build-capi - env: - CARGO_BINARY: docker run -v /var/run/docker.sock:/var/run/docker.sock -v ${GITHUB_WORKSPACE}:/project -w /project wasmer/aarch64 cross - CROSS_DOCKER_IN_DOCKER: true - CARGO_TARGET: aarch64-unknown-linux-gnu - PKG_CONFIG_PATH: /usr/lib/aarch64-linux-gnu/pkgconfig - PKG_CONFIG_ALLOW_CROSS: true - ENABLE_LLVM: 0 - - name: Dist - run: | - make distribution - env: - CARGO_BINARY: docker run -v /var/run/docker.sock:/var/run/docker.sock -v ${GITHUB_WORKSPACE}:/project -w /project wasmer/aarch64 cross - CROSS_DOCKER_IN_DOCKER: true - CARGO_TARGET: aarch64-unknown-linux-gnu - PKG_CONFIG_PATH: /usr/lib/aarch64-linux-gnu/pkgconfig - PKG_CONFIG_ALLOW_CROSS: true - TARGET: aarch64-unknown-linux-gnu - TARGET_DIR: target/aarch64-unknown-linux-gnu/release - - name: Upload Artifacts - uses: actions/upload-artifact@v4 - with: - name: wasmer-linux-aarch64 - path: dist - if-no-files-found: error - retention-days: 2 + # linux_aarch64: + # name: Linux aarch64 + # runs-on: ubuntu-latest + # steps: + # - uses: actions/checkout@v3 + # - uses: dtolnay/rust-toolchain@stable + # with: + # target: aarch64-unknown-linux-gnu + # - name: Build cross image + # run: | + # docker build -t wasmer/aarch64 ${GITHUB_WORKSPACE}/.github/cross-linux-aarch64/ + # env: + # CROSS_DOCKER_IN_DOCKER: true + # - name: Build Wasmer binary + # run: | + # make build-wasmer + # env: + # CARGO_BINARY: docker run -v /var/run/docker.sock:/var/run/docker.sock -v ${GITHUB_WORKSPACE}:/project -w /project wasmer/aarch64 cross + # CROSS_DOCKER_IN_DOCKER: true + # CARGO_TARGET: aarch64-unknown-linux-gnu + # PKG_CONFIG_PATH: /usr/lib/aarch64-linux-gnu/pkgconfig + # PKG_CONFIG_ALLOW_CROSS: true + # ENABLE_LLVM: 0 + # - name: Build C API headless + # shell: bash + # run: | + # make package-capi-headless + # env: + # CARGO_BINARY: docker run -v /var/run/docker.sock:/var/run/docker.sock -v ${GITHUB_WORKSPACE}:/project -w /project wasmer/aarch64 cross + # CROSS_DOCKER_IN_DOCKER: true + # CARGO_TARGET: aarch64-unknown-linux-gnu + # PKG_CONFIG_PATH: /usr/lib/aarch64-linux-gnu/pkgconfig + # PKG_CONFIG_ALLOW_CROSS: true + # ENABLE_LLVM: 0 + # TARGET: aarch64-unknown-linux-gnu + # TARGET_DIR: target/aarch64-unknown-linux-gnu/release + # - name: Build C API + # run: | + # make build-capi + # env: + # CARGO_BINARY: docker run -v /var/run/docker.sock:/var/run/docker.sock -v ${GITHUB_WORKSPACE}:/project -w /project wasmer/aarch64 cross + # CROSS_DOCKER_IN_DOCKER: true + # CARGO_TARGET: aarch64-unknown-linux-gnu + # PKG_CONFIG_PATH: /usr/lib/aarch64-linux-gnu/pkgconfig + # PKG_CONFIG_ALLOW_CROSS: true + # ENABLE_LLVM: 0 + # - name: Dist + # run: | + # make distribution + # env: + # CARGO_BINARY: docker run -v /var/run/docker.sock:/var/run/docker.sock -v ${GITHUB_WORKSPACE}:/project -w /project wasmer/aarch64 cross + # CROSS_DOCKER_IN_DOCKER: true + # CARGO_TARGET: aarch64-unknown-linux-gnu + # PKG_CONFIG_PATH: /usr/lib/aarch64-linux-gnu/pkgconfig + # PKG_CONFIG_ALLOW_CROSS: true + # TARGET: aarch64-unknown-linux-gnu + # TARGET_DIR: target/aarch64-unknown-linux-gnu/release + # - name: Upload Artifacts + # uses: actions/upload-artifact@v4 + # with: + # name: wasmer-linux-aarch64 + # path: dist + # if-no-files-found: error + # retention-days: 2 - linux_riscv64: - name: Linux riscv64 - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: dtolnay/rust-toolchain@stable - with: - target: riscv64gc-unknown-linux-gnu - - name: Build cross image - run: | - docker build -t wasmer/riscv64 ${GITHUB_WORKSPACE}/.github/cross-linux-riscv64/ - env: - CROSS_DOCKER_IN_DOCKER: true - - name: Build Wasmer binary - run: | - make build-wasmer - env: - CARGO_BINARY: docker run -v /var/run/docker.sock:/var/run/docker.sock -v ${GITHUB_WORKSPACE}:/project -w /project wasmer/riscv64:latest cargo - CROSS_DOCKER_IN_DOCKER: true - CARGO_TARGET: riscv64gc-unknown-linux-gnu - PKG_CONFIG_PATH: /usr/lib/riscv64-linux-gnu/pkgconfig - PKG_CONFIG_ALLOW_CROSS: true - ENABLE_LLVM: 0 - - name: Build C API headless - shell: bash - run: | - make package-capi-headless - env: - CARGO_BINARY: docker run -v /var/run/docker.sock:/var/run/docker.sock -v ${GITHUB_WORKSPACE}:/project -w /project wasmer/riscv64:latest cargo - CROSS_DOCKER_IN_DOCKER: true - CARGO_TARGET: riscv64gc-unknown-linux-gnu - PKG_CONFIG_PATH: /usr/lib/riscv64-linux-gnu/pkgconfig - PKG_CONFIG_ALLOW_CROSS: true - ENABLE_LLVM: 0 - TARGET: riscv64gc-unknown-linux-gnu - TARGET_DIR: target/riscv64gc-unknown-linux-gnu/release - - name: Build C API - run: | - make build-capi - env: - CARGO_BINARY: docker run -v /var/run/docker.sock:/var/run/docker.sock -v ${GITHUB_WORKSPACE}:/project -w /project wasmer/riscv64:latest cargo - CROSS_DOCKER_IN_DOCKER: true - CARGO_TARGET: riscv64gc-unknown-linux-gnu - PKG_CONFIG_PATH: /usr/lib/riscv64-linux-gnu/pkgconfig - PKG_CONFIG_ALLOW_CROSS: true - ENABLE_LLVM: 0 - - name: Dist - run: | - make distribution - env: - CARGO_BINARY: docker run -v /var/run/docker.sock:/var/run/docker.sock -v ${GITHUB_WORKSPACE}:/project -w /project wasmer/riscv64:latest cargo - CROSS_DOCKER_IN_DOCKER: true - CARGO_TARGET: riscv64gc-unknown-linux-gnu - PKG_CONFIG_PATH: /usr/lib/riscv64-linux-gnu/pkgconfig - PKG_CONFIG_ALLOW_CROSS: true - TARGET: riscv64gc-unknown-linux-gnu - TARGET_DIR: target/riscv64gc-unknown-linux-gnu/release - - name: Upload Artifacts - uses: actions/upload-artifact@v4 - with: - name: wasmer-linux-riscv64 - path: dist - if-no-files-found: error - retention-days: 2 + # linux_riscv64: + # name: Linux riscv64 + # runs-on: ubuntu-latest + # steps: + # - uses: actions/checkout@v3 + # - uses: dtolnay/rust-toolchain@stable + # with: + # target: riscv64gc-unknown-linux-gnu + # - name: Build cross image + # run: | + # docker build -t wasmer/riscv64 ${GITHUB_WORKSPACE}/.github/cross-linux-riscv64/ + # env: + # CROSS_DOCKER_IN_DOCKER: true + # - name: Build Wasmer binary + # run: | + # make build-wasmer + # env: + # CARGO_BINARY: docker run -v /var/run/docker.sock:/var/run/docker.sock -v ${GITHUB_WORKSPACE}:/project -w /project wasmer/riscv64:latest cargo + # CROSS_DOCKER_IN_DOCKER: true + # CARGO_TARGET: riscv64gc-unknown-linux-gnu + # PKG_CONFIG_PATH: /usr/lib/riscv64-linux-gnu/pkgconfig + # PKG_CONFIG_ALLOW_CROSS: true + # ENABLE_LLVM: 0 + # - name: Build C API headless + # shell: bash + # run: | + # make package-capi-headless + # env: + # CARGO_BINARY: docker run -v /var/run/docker.sock:/var/run/docker.sock -v ${GITHUB_WORKSPACE}:/project -w /project wasmer/riscv64:latest cargo + # CROSS_DOCKER_IN_DOCKER: true + # CARGO_TARGET: riscv64gc-unknown-linux-gnu + # PKG_CONFIG_PATH: /usr/lib/riscv64-linux-gnu/pkgconfig + # PKG_CONFIG_ALLOW_CROSS: true + # ENABLE_LLVM: 0 + # TARGET: riscv64gc-unknown-linux-gnu + # TARGET_DIR: target/riscv64gc-unknown-linux-gnu/release + # - name: Build C API + # run: | + # make build-capi + # env: + # CARGO_BINARY: docker run -v /var/run/docker.sock:/var/run/docker.sock -v ${GITHUB_WORKSPACE}:/project -w /project wasmer/riscv64:latest cargo + # CROSS_DOCKER_IN_DOCKER: true + # CARGO_TARGET: riscv64gc-unknown-linux-gnu + # PKG_CONFIG_PATH: /usr/lib/riscv64-linux-gnu/pkgconfig + # PKG_CONFIG_ALLOW_CROSS: true + # ENABLE_LLVM: 0 + # - name: Dist + # run: | + # make distribution + # env: + # CARGO_BINARY: docker run -v /var/run/docker.sock:/var/run/docker.sock -v ${GITHUB_WORKSPACE}:/project -w /project wasmer/riscv64:latest cargo + # CROSS_DOCKER_IN_DOCKER: true + # CARGO_TARGET: riscv64gc-unknown-linux-gnu + # PKG_CONFIG_PATH: /usr/lib/riscv64-linux-gnu/pkgconfig + # PKG_CONFIG_ALLOW_CROSS: true + # TARGET: riscv64gc-unknown-linux-gnu + # TARGET_DIR: target/riscv64gc-unknown-linux-gnu/release + # - name: Upload Artifacts + # uses: actions/upload-artifact@v4 + # with: + # name: wasmer-linux-riscv64 + # path: dist + # if-no-files-found: error + # retention-days: 2 release: # needs: [setup, build, linux_aarch64, windows_gnu, linux_riscv64] - needs: [setup, build, windows_gnu] + # needs: [setup, build, windows_gnu] + needs: [setup, build] runs-on: ubuntu-latest if: needs.setup.outputs.DOING_RELEASE == '1' || github.event.inputs.release != '' steps: diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 112367d6beb..8735dc95b7a 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -1,1135 +1,1135 @@ -name: test-sys +# name: test-sys -on: - push: - branches: - - main - - 'with-ci-.*' - - 'v3.0.x' - - 'v3.1.x' - pull_request: - workflow_dispatch: - inputs: - release: - description: 'Make release' +# on: +# push: +# branches: +# - main +# - 'with-ci-.*' +# - 'v3.0.x' +# - 'v3.1.x' +# pull_request: +# workflow_dispatch: +# inputs: +# release: +# description: 'Make release' -# Automatically cancel previous workflow runs when a new commit is pushed. -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true +# # Automatically cancel previous workflow runs when a new commit is pushed. +# concurrency: +# group: ${{ github.workflow }}-${{ github.ref }} +# cancel-in-progress: true -env: - RUST_BACKTRACE: 1 - # Sparse will be enabled by dtolnay/rust-toolchain when installing nightly - # Rust, but it's not stable on 1.69 yet. By explicitly setting the protocol we - # can override that behaviour - CARGO_REGISTRIES_CRATES_IO_PROTOCOL: git - MSRV: "1.81" - NEXTEST_PROFILE: "ci" - RUSTUP_WINDOWS_PATH_ADD_BIN: 1 - WASI_SDK_VERSION: "22" +# env: +# RUST_BACKTRACE: 1 +# # Sparse will be enabled by dtolnay/rust-toolchain when installing nightly +# # Rust, but it's not stable on 1.69 yet. By explicitly setting the protocol we +# # can override that behaviour +# CARGO_REGISTRIES_CRATES_IO_PROTOCOL: git +# MSRV: "1.81" +# NEXTEST_PROFILE: "ci" +# RUSTUP_WINDOWS_PATH_ADD_BIN: 1 +# WASI_SDK_VERSION: "22" -jobs: - setup: - name: Set up - runs-on: ubuntu-22.04 - outputs: - VERSION: ${{ steps.setup.outputs.VERSION }} - DOING_RELEASE: ${{ steps.setup.outputs.DOING_RELEASE }} - steps: - - name: Set up env vars - id: setup - shell: bash - run: | - VERSION=${GITHUB_REF/refs\/tags\//} - echo "VERSION=${VERSION}" >> $GITHUB_OUTPUT - DOING_RELEASE=$(echo $VERSION | grep -c '^[0-9]\+\.[0-9]\+\.[0-9]\+\(-\([a-zA-Z]\+\)\?[0-9]*\)\?$' || true) - echo "DOING_RELEASE=${DOING_RELEASE}" >> $GITHUB_OUTPUT - echo $VERSION - echo $DOING_RELEASE +# jobs: +# setup: +# name: Set up +# runs-on: ubuntu-22.04 +# outputs: +# VERSION: ${{ steps.setup.outputs.VERSION }} +# DOING_RELEASE: ${{ steps.setup.outputs.DOING_RELEASE }} +# steps: +# - name: Set up env vars +# id: setup +# shell: bash +# run: | +# VERSION=${GITHUB_REF/refs\/tags\//} +# echo "VERSION=${VERSION}" >> $GITHUB_OUTPUT +# DOING_RELEASE=$(echo $VERSION | grep -c '^[0-9]\+\.[0-9]\+\.[0-9]\+\(-\([a-zA-Z]\+\)\?[0-9]*\)\?$' || true) +# echo "DOING_RELEASE=${DOING_RELEASE}" >> $GITHUB_OUTPUT +# echo $VERSION +# echo $DOING_RELEASE - lint: - name: Code lint - runs-on: ubuntu-22.04 - steps: - - uses: actions/checkout@v3 - - name: Install Rust - uses: dtolnay/rust-toolchain@stable - with: - toolchain: ${{ env.MSRV }} - components: rustfmt, clippy - - name: Install libtinfo - shell: bash - run: | - sudo apt install -y libtinfo5 - - name: Install LLVM (Linux) - run: | - curl --proto '=https' --tlsv1.2 -sSf https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-amd64.tar.xz -L -o /opt/llvm.tar.xz - mkdir -p /opt/llvm-18 - tar xf /opt/llvm.tar.xz --strip-components=1 -C /opt/llvm-18 - echo '/opt/llvm-18/bin' >> $GITHUB_PATH - echo 'LLVM_SYS_180_PREFIX=/opt/llvm-18' >> $GITHUB_ENV - - name: Cache - uses: whywaita/actions-cache-s3@v2 - with: - path: | - ~/.cargo/* - ./target/* - key: r22-${{ github.repository }}-${{ runner.os }}-${{ hashFiles('Cargo.lock') }}-wasmer-make-lint-linux-x64 - aws-s3-bucket: wasmer-rust-artifacts-cache - aws-access-key-id: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_TOKEN }} - aws-secret-access-key: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_KEY }} - aws-region: auto - aws-endpoint: https://1541b1e8a3fc6ad155ce67ef38899700.r2.cloudflarestorage.com - aws-s3-bucket-endpoint: false - aws-s3-force-path-style: true - - run: make lint - env: - ENABLE_CRANELIFT: "1" - ENABLE_LLVM: "1" - ENABLE_SINGLEPASS: "1" - - name: Assert no files have changed - run: | - git status - ! [[ $(git status -s) ]] +# lint: +# name: Code lint +# runs-on: ubuntu-22.04 +# steps: +# - uses: actions/checkout@v3 +# - name: Install Rust +# uses: dtolnay/rust-toolchain@stable +# with: +# toolchain: ${{ env.MSRV }} +# components: rustfmt, clippy +# - name: Install libtinfo +# shell: bash +# run: | +# sudo apt install -y libtinfo5 +# - name: Install LLVM (Linux) +# run: | +# curl --proto '=https' --tlsv1.2 -sSf https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-amd64.tar.xz -L -o /opt/llvm.tar.xz +# mkdir -p /opt/llvm-18 +# tar xf /opt/llvm.tar.xz --strip-components=1 -C /opt/llvm-18 +# echo '/opt/llvm-18/bin' >> $GITHUB_PATH +# echo 'LLVM_SYS_180_PREFIX=/opt/llvm-18' >> $GITHUB_ENV +# - name: Cache +# uses: whywaita/actions-cache-s3@v2 +# with: +# path: | +# ~/.cargo/* +# ./target/* +# key: r22-${{ github.repository }}-${{ runner.os }}-${{ hashFiles('Cargo.lock') }}-wasmer-make-lint-linux-x64 +# aws-s3-bucket: wasmer-rust-artifacts-cache +# aws-access-key-id: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_TOKEN }} +# aws-secret-access-key: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_KEY }} +# aws-region: auto +# aws-endpoint: https://1541b1e8a3fc6ad155ce67ef38899700.r2.cloudflarestorage.com +# aws-s3-bucket-endpoint: false +# aws-s3-force-path-style: true +# - run: make lint +# env: +# ENABLE_CRANELIFT: "1" +# ENABLE_LLVM: "1" +# ENABLE_SINGLEPASS: "1" +# - name: Assert no files have changed +# run: | +# git status +# ! [[ $(git status -s) ]] - cargo_deny: - name: cargo-deny - runs-on: ubuntu-22.04 - steps: - - uses: actions/checkout@v3 - - uses: EmbarkStudios/cargo-deny-action@v1 - with: - log-level: error +# cargo_deny: +# name: cargo-deny +# runs-on: ubuntu-22.04 +# steps: +# - uses: actions/checkout@v3 +# - uses: EmbarkStudios/cargo-deny-action@v1 +# with: +# log-level: error - test_nodejs: - name: Test on NodeJS - runs-on: ubuntu-22.04 - steps: - - uses: actions/checkout@v3 - - name: Install Rust - uses: dtolnay/rust-toolchain@stable - with: - toolchain: ${{ env.MSRV }} - - name: Install NodeJS - uses: actions/setup-node@v2 - with: - node-version: 16 - - name: Install wasm-pack - run: | - curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh - - name: make test-js - run: | - make test-js +# test_nodejs: +# name: Test on NodeJS +# runs-on: ubuntu-22.04 +# steps: +# - uses: actions/checkout@v3 +# - name: Install Rust +# uses: dtolnay/rust-toolchain@stable +# with: +# toolchain: ${{ env.MSRV }} +# - name: Install NodeJS +# uses: actions/setup-node@v2 +# with: +# node-version: 16 +# - name: Install wasm-pack +# run: | +# curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh +# - name: make test-js +# run: | +# make test-js - test_wasi_fyi: - name: Test wasi-fyi - runs-on: ubuntu-22.04 - steps: - - uses: actions/checkout@v3 - - name: Install Rust - uses: dtolnay/rust-toolchain@stable - with: - toolchain: nightly - targets: "wasm32-wasi" - - name: Install wasm-pack - run: | - curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh - - name: Install LLVM 18 - run: | - curl --proto '=https' --tlsv1.2 -sSf https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-amd64.tar.xz -L -o llvm.tar.xz - LLVM_DIR=$(pwd)/${{ env.LLVM_DIR }} - mkdir ${LLVM_DIR} - tar xf llvm.tar.xz --strip-components=1 -C ${LLVM_DIR} - echo "ENABLE_LLVM=1" >> $GITHUB_ENV - echo "${LLVM_DIR}/bin" >> $GITHUB_PATH - echo "${LLVM_DIR}/usr/bin" >> $GITHUB_PATH - echo "LLVM_SYS_180_PREFIX=${LLVM_DIR}" >> $GITHUB_ENV - env: - LLVM_DIR: .llvm - - name: make test-wasi-fyi - run: | - make test-wasi-fyi +# test_wasi_fyi: +# name: Test wasi-fyi +# runs-on: ubuntu-22.04 +# steps: +# - uses: actions/checkout@v3 +# - name: Install Rust +# uses: dtolnay/rust-toolchain@stable +# with: +# toolchain: nightly +# targets: "wasm32-wasi" +# - name: Install wasm-pack +# run: | +# curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh +# - name: Install LLVM 18 +# run: | +# curl --proto '=https' --tlsv1.2 -sSf https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-amd64.tar.xz -L -o llvm.tar.xz +# LLVM_DIR=$(pwd)/${{ env.LLVM_DIR }} +# mkdir ${LLVM_DIR} +# tar xf llvm.tar.xz --strip-components=1 -C ${LLVM_DIR} +# echo "ENABLE_LLVM=1" >> $GITHUB_ENV +# echo "${LLVM_DIR}/bin" >> $GITHUB_PATH +# echo "${LLVM_DIR}/usr/bin" >> $GITHUB_PATH +# echo "LLVM_SYS_180_PREFIX=${LLVM_DIR}" >> $GITHUB_ENV +# env: +# LLVM_DIR: .llvm +# - name: make test-wasi-fyi +# run: | +# make test-wasi-fyi - # The no_std functionality doesn't work at the moment - no point in testing it. - # - name: make test-js-core - # run: | - # make test-js-core +# # The no_std functionality doesn't work at the moment - no point in testing it. +# # - name: make test-js-core +# # run: | +# # make test-js-core - test_wasix: - name: Test WASIX - runs-on: ubuntu-22.04 - steps: - - uses: actions/checkout@v3 - - name: Install Rust - uses: dtolnay/rust-toolchain@stable - with: - toolchain: ${{ env.MSRV }} - - name: Install Tools - run: | - sudo apt-get update - sudo apt-get install -y git llvm clang make lld curl - - name: Build wasix sysroot - run: | - cd ~ - git clone --recurse-submodules https://github.com/wasix-org/wasix-libc - cd wasix-libc - ./build32.sh - rm -rf /opt/wasix-sysroot - cp -r sysroot32 ~/wasix-sysroot - - name: Install wasi-sdk Tools - run: | - cd ~ - curl -L "https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-${{ env.WASI_SDK_VERSION }}/wasi-sdk-${{ env.WASI_SDK_VERSION }}.0-linux.tar.gz" -o wasi-sdk.tar.gz - tar -xzf wasi-sdk.tar.gz - cp -r wasi-sdk-${{ env.WASI_SDK_VERSION }}.0 ~/wasi-sdk - - name: Install LLVM 18 - run: | - curl --proto '=https' --tlsv1.2 -sSf https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-amd64.tar.xz -L -o llvm.tar.xz - LLVM_DIR=$(pwd)/${{ env.LLVM_DIR }} - mkdir ${LLVM_DIR} - tar xf llvm.tar.xz --strip-components=1 -C ${LLVM_DIR} - echo "ENABLE_LLVM=1" >> $GITHUB_ENV - echo "${LLVM_DIR}/bin" >> $GITHUB_PATH - echo "${LLVM_DIR}/usr/bin" >> $GITHUB_PATH - echo "LLVM_SYS_180_PREFIX=${LLVM_DIR}" >> $GITHUB_ENV - env: - LLVM_DIR: .llvm - - name: Install wasm-opt - run: | - sudo apt-get install -y binaryen - - name: make test-wasix - run: | - WASI_SDK=~/wasi-sdk WASIX_SYSROOT=~/wasix-sysroot make test-wasix +# test_wasix: +# name: Test WASIX +# runs-on: ubuntu-22.04 +# steps: +# - uses: actions/checkout@v3 +# - name: Install Rust +# uses: dtolnay/rust-toolchain@stable +# with: +# toolchain: ${{ env.MSRV }} +# - name: Install Tools +# run: | +# sudo apt-get update +# sudo apt-get install -y git llvm clang make lld curl +# - name: Build wasix sysroot +# run: | +# cd ~ +# git clone --recurse-submodules https://github.com/wasix-org/wasix-libc +# cd wasix-libc +# ./build32.sh +# rm -rf /opt/wasix-sysroot +# cp -r sysroot32 ~/wasix-sysroot +# - name: Install wasi-sdk Tools +# run: | +# cd ~ +# curl -L "https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-${{ env.WASI_SDK_VERSION }}/wasi-sdk-${{ env.WASI_SDK_VERSION }}.0-linux.tar.gz" -o wasi-sdk.tar.gz +# tar -xzf wasi-sdk.tar.gz +# cp -r wasi-sdk-${{ env.WASI_SDK_VERSION }}.0 ~/wasi-sdk +# - name: Install LLVM 18 +# run: | +# curl --proto '=https' --tlsv1.2 -sSf https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-amd64.tar.xz -L -o llvm.tar.xz +# LLVM_DIR=$(pwd)/${{ env.LLVM_DIR }} +# mkdir ${LLVM_DIR} +# tar xf llvm.tar.xz --strip-components=1 -C ${LLVM_DIR} +# echo "ENABLE_LLVM=1" >> $GITHUB_ENV +# echo "${LLVM_DIR}/bin" >> $GITHUB_PATH +# echo "${LLVM_DIR}/usr/bin" >> $GITHUB_PATH +# echo "LLVM_SYS_180_PREFIX=${LLVM_DIR}" >> $GITHUB_ENV +# env: +# LLVM_DIR: .llvm +# - name: Install wasm-opt +# run: | +# sudo apt-get install -y binaryen +# - name: make test-wasix +# run: | +# WASI_SDK=~/wasi-sdk WASIX_SYSROOT=~/wasix-sysroot make test-wasix - test_wasm_build: - name: Test wasm build - runs-on: ubuntu-22.04 - steps: - - uses: actions/checkout@v3 - - name: rustup target add wasm32-wasi - run: rustup target add wasm32-wasi - - name: make build-wasmer-wasm - run: make build-wasmer-wasm +# test_wasm_build: +# name: Test wasm build +# runs-on: ubuntu-22.04 +# steps: +# - uses: actions/checkout@v3 +# - name: rustup target add wasm32-wasi +# run: rustup target add wasm32-wasi +# - name: make build-wasmer-wasm +# run: make build-wasmer-wasm - test_build_jsc: - name: Test JSC build - runs-on: ubuntu-22.04 - steps: - - uses: actions/checkout@v3 - - uses: dtolnay/rust-toolchain@stable - with: - toolchain: ${{ env.MSRV }} - target: x86_64-unknown-linux-gnu - - name: Install NodeJS - uses: actions/setup-node@v2 - with: - node-version: 16 - - name: Install libjavascriptcoregtk-4.0-dev - run: sudo apt update && sudo apt install -y libjavascriptcoregtk-4.0-dev - - name: make build-wasmer-jsc - run: make build-wasmer-jsc +# test_build_jsc: +# name: Test JSC build +# runs-on: ubuntu-22.04 +# steps: +# - uses: actions/checkout@v3 +# - uses: dtolnay/rust-toolchain@stable +# with: +# toolchain: ${{ env.MSRV }} +# target: x86_64-unknown-linux-gnu +# - name: Install NodeJS +# uses: actions/setup-node@v2 +# with: +# node-version: 16 +# - name: Install libjavascriptcoregtk-4.0-dev +# run: sudo apt update && sudo apt install -y libjavascriptcoregtk-4.0-dev +# - name: make build-wasmer-jsc +# run: make build-wasmer-jsc - test_interpreter_api: - name: ${{ matrix.build-what.name }} on ${{ matrix.metadata.build }} - runs-on: ${{ matrix.metadata.os }} - strategy: - fail-fast: false - matrix: - build-what: [ - { - key: wamr, - build-cmd: 'make test-wamr-api', - name: 'Test API for wamr feature' - }, - { - key: wasmi, - build-cmd: 'make test-wasmi-api', - name: 'Test API for wasmi feature' - }, - { - key: v8, - build-cmd: 'make test-v8-api', - name: 'Test API for v8 feature' - } +# test_interpreter_api: +# name: ${{ matrix.build-what.name }} on ${{ matrix.metadata.build }} +# runs-on: ${{ matrix.metadata.os }} +# strategy: +# fail-fast: false +# matrix: +# build-what: [ +# { +# key: wamr, +# build-cmd: 'make test-wamr-api', +# name: 'Test API for wamr feature' +# }, +# { +# key: wasmi, +# build-cmd: 'make test-wasmi-api', +# name: 'Test API for wasmi feature' +# }, +# { +# key: v8, +# build-cmd: 'make test-v8-api', +# name: 'Test API for v8 feature' +# } - ] - metadata: [ - { - build: linux-x64, - os: ubuntu-22.04, - }, - { - build: macos-arm, - os: macos-14, - }, - { - build: windows-x64, - os: windows-2022, - } - ] - container: ${{ matrix.metadata.container }} - steps: - - uses: actions/checkout@v3 +# ] +# metadata: [ +# { +# build: linux-x64, +# os: ubuntu-22.04, +# }, +# { +# build: macos-arm, +# os: macos-14, +# }, +# { +# build: windows-x64, +# os: windows-2022, +# } +# ] +# container: ${{ matrix.metadata.container }} +# steps: +# - uses: actions/checkout@v3 - - name: Setup MSVC (Windows) - uses: ilammy/msvc-dev-cmd@v1 - if: matrix.metadata.build == 'windows-x64' +# - name: Setup MSVC (Windows) +# uses: ilammy/msvc-dev-cmd@v1 +# if: matrix.metadata.build == 'windows-x64' - - uses: dtolnay/rust-toolchain@stable - with: - toolchain: ${{ env.MSRV }} +# - uses: dtolnay/rust-toolchain@stable +# with: +# toolchain: ${{ env.MSRV }} - - name: Install Nextest - uses: taiki-e/install-action@nextest +# - name: Install Nextest +# uses: taiki-e/install-action@nextest - - name: Install `ninja`, clang` and `mold` on Ubuntu - if: startsWith(matrix.metadata.build, 'linux-') - shell: bash - run: | - sudo apt-get update -y && sudo apt-get install ninja-build clang mold -y +# - name: Install `ninja`, clang` and `mold` on Ubuntu +# if: startsWith(matrix.metadata.build, 'linux-') +# shell: bash +# run: | +# sudo apt-get update -y && sudo apt-get install ninja-build clang mold -y - - name: Install `ninja` on macOS - if: startsWith(matrix.metadata.build, 'macos-') - shell: bash - run: | - brew install ninja +# - name: Install `ninja` on macOS +# if: startsWith(matrix.metadata.build, 'macos-') +# shell: bash +# run: | +# brew install ninja - - name: Install `ninja` on Windows - if: startsWith(matrix.metadata.build, 'windows-') - shell: bash - run: | - choco install ninja +# - name: Install `ninja` on Windows +# if: startsWith(matrix.metadata.build, 'windows-') +# shell: bash +# run: | +# choco install ninja - - name: Delete unwanted link to stop it from interfering (Windows) - shell: bash - run: rm /usr/bin/link.exe - if: startsWith(matrix.metadata.build, 'windows-') +# - name: Delete unwanted link to stop it from interfering (Windows) +# shell: bash +# run: rm /usr/bin/link.exe +# if: startsWith(matrix.metadata.build, 'windows-') - - name: Test WAMR API - if: ${{ matrix.build-what.key == 'wamr' }} - run: ${{ matrix.build-what.build-cmd }} +# - name: Test WAMR API +# if: ${{ matrix.build-what.key == 'wamr' }} +# run: ${{ matrix.build-what.build-cmd }} - - name: Test wasmi API - if: ${{ matrix.build-what.key == 'wasmi' }} - run: ${{ matrix.build-what.build-cmd }} +# - name: Test wasmi API +# if: ${{ matrix.build-what.key == 'wasmi' }} +# run: ${{ matrix.build-what.build-cmd }} - - name: Test v8 API (Linux + mold) - if: ${{ matrix.build-what.key == 'v8' && startsWith(matrix.metadata.build, 'linux-')}} - run: RUSTFLAGS="-C linker=clang -C link-arg=-fuse-ld=mold" CARGO_TERM_VERBOSE=true cargo nextest run --package=wasmer --release --features=v8 --no-default-features +# - name: Test v8 API (Linux + mold) +# if: ${{ matrix.build-what.key == 'v8' && startsWith(matrix.metadata.build, 'linux-')}} +# run: RUSTFLAGS="-C linker=clang -C link-arg=-fuse-ld=mold" CARGO_TERM_VERBOSE=true cargo nextest run --package=wasmer --release --features=v8 --no-default-features - - name: Test v8 API - if: ${{ matrix.build-what.key == 'v8' && !startsWith(matrix.metadata.build, 'linux-')}} - run: ${{ matrix.build-what.build-cmd }} +# - name: Test v8 API +# if: ${{ matrix.build-what.key == 'v8' && !startsWith(matrix.metadata.build, 'linux-')}} +# run: ${{ matrix.build-what.build-cmd }} - test_build_docs_rs: - name: Test build docs rs - runs-on: ubuntu-22.04 - steps: - - uses: actions/checkout@v3 - - uses: dtolnay/rust-toolchain@master - with: - toolchain: "nightly-2024-08-21" - target: x86_64-unknown-linux-gnu - - run: cargo install toml-cli # toml-cli is required to run `make test-build-docs-rs` +# test_build_docs_rs: +# name: Test build docs rs +# runs-on: ubuntu-22.04 +# steps: +# - uses: actions/checkout@v3 +# - uses: dtolnay/rust-toolchain@master +# with: +# toolchain: "nightly-2024-08-21" +# target: x86_64-unknown-linux-gnu +# - run: cargo install toml-cli # toml-cli is required to run `make test-build-docs-rs` - - name: Install `ninja` on Ubuntu - shell: bash - run: | - sudo apt-get install ninja-build -y +# - name: Install `ninja` on Ubuntu +# shell: bash +# run: | +# sudo apt-get install ninja-build -y - - name: Install LLVM 18 - run: | - curl --proto '=https' --tlsv1.2 -sSf https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-amd64.tar.xz -L -o llvm.tar.xz - LLVM_DIR=$(pwd)/${{ env.LLVM_DIR }} - mkdir ${LLVM_DIR} - tar xf llvm.tar.xz --strip-components=1 -C ${LLVM_DIR} - echo "ENABLE_LLVM=1" >> $GITHUB_ENV - echo "${LLVM_DIR}/bin" >> $GITHUB_PATH - echo "${LLVM_DIR}/usr/bin" >> $GITHUB_PATH - echo "LLVM_SYS_180_PREFIX=${LLVM_DIR}" >> $GITHUB_ENV - env: - LLVM_DIR: .llvm - - name: make test-build-docs-rs-ci - run: make test-build-docs-rs-ci +# - name: Install LLVM 18 +# run: | +# curl --proto '=https' --tlsv1.2 -sSf https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-amd64.tar.xz -L -o llvm.tar.xz +# LLVM_DIR=$(pwd)/${{ env.LLVM_DIR }} +# mkdir ${LLVM_DIR} +# tar xf llvm.tar.xz --strip-components=1 -C ${LLVM_DIR} +# echo "ENABLE_LLVM=1" >> $GITHUB_ENV +# echo "${LLVM_DIR}/bin" >> $GITHUB_PATH +# echo "${LLVM_DIR}/usr/bin" >> $GITHUB_PATH +# echo "LLVM_SYS_180_PREFIX=${LLVM_DIR}" >> $GITHUB_ENV +# env: +# LLVM_DIR: .llvm +# - name: make test-build-docs-rs-ci +# run: make test-build-docs-rs-ci - build_linux_aarch64: - name: ${{ matrix.build-what.name }} on linux-aarch64 - runs-on: ubuntu-22.04 - strategy: - fail-fast: false - matrix: - build-what: [ - { - key: capi, - build-cmd: 'make build-capi && make package-capi', - name: 'Build C-API' - }, - { - key: wasmer, - build-cmd: 'make build-wasmer && make package-wasmer && make tar-wasmer', - name: 'Build wasmer-cli' - } - ] - steps: - - uses: actions/checkout@v3 - - uses: dtolnay/rust-toolchain@stable - with: - toolchain: ${{ env.MSRV }} - target: aarch64-unknown-linux-gnu - - name: Build cross image - run: | - docker build -t wasmer/aarch64 ${GITHUB_WORKSPACE}/.github/cross-linux-aarch64/ - env: - CROSS_DOCKER_IN_DOCKER: true - - name: Build ${{ matrix.build-what.key }} - run: | - ${{ matrix.build-what.build-cmd }} - env: - CARGO_BINARY: docker run -v /var/run/docker.sock:/var/run/docker.sock -v ${GITHUB_WORKSPACE}:/project -w /project wasmer/aarch64 cross - CROSS_DOCKER_IN_DOCKER: true - CARGO_TARGET: aarch64-unknown-linux-gnu - PKG_CONFIG_PATH: /usr/lib/aarch64-linux-gnu/pkgconfig - PKG_CONFIG_ALLOW_CROSS: true - ENABLE_LLVM: 0 - - name: Dist - if: ${{ matrix.build-what.key == 'capi' }} - run: | - make distribution - env: - CARGO_BINARY: docker run -v /var/run/docker.sock:/var/run/docker.sock -v ${GITHUB_WORKSPACE}:/project -w /project wasmer/aarch64 cross - CROSS_DOCKER_IN_DOCKER: true - CARGO_TARGET: aarch64-unknown-linux-gnu - PKG_CONFIG_PATH: /usr/lib/aarch64-linux-gnu/pkgconfig - PKG_CONFIG_ALLOW_CROSS: true - TARGET: aarch64-unknown-linux-gnu - TARGET_DIR: target/aarch64-unknown-linux-gnu/release - - name: Upload Artifacts - if: ${{ matrix.build-what.key == 'capi' }} - uses: actions/upload-artifact@v4 - with: - name: capi-linux-aarch64 - path: dist - if-no-files-found: error - retention-days: 2 +# build_linux_aarch64: +# name: ${{ matrix.build-what.name }} on linux-aarch64 +# runs-on: ubuntu-22.04 +# strategy: +# fail-fast: false +# matrix: +# build-what: [ +# { +# key: capi, +# build-cmd: 'make build-capi && make package-capi', +# name: 'Build C-API' +# }, +# { +# key: wasmer, +# build-cmd: 'make build-wasmer && make package-wasmer && make tar-wasmer', +# name: 'Build wasmer-cli' +# } +# ] +# steps: +# - uses: actions/checkout@v3 +# - uses: dtolnay/rust-toolchain@stable +# with: +# toolchain: ${{ env.MSRV }} +# target: aarch64-unknown-linux-gnu +# - name: Build cross image +# run: | +# docker build -t wasmer/aarch64 ${GITHUB_WORKSPACE}/.github/cross-linux-aarch64/ +# env: +# CROSS_DOCKER_IN_DOCKER: true +# - name: Build ${{ matrix.build-what.key }} +# run: | +# ${{ matrix.build-what.build-cmd }} +# env: +# CARGO_BINARY: docker run -v /var/run/docker.sock:/var/run/docker.sock -v ${GITHUB_WORKSPACE}:/project -w /project wasmer/aarch64 cross +# CROSS_DOCKER_IN_DOCKER: true +# CARGO_TARGET: aarch64-unknown-linux-gnu +# PKG_CONFIG_PATH: /usr/lib/aarch64-linux-gnu/pkgconfig +# PKG_CONFIG_ALLOW_CROSS: true +# ENABLE_LLVM: 0 +# - name: Dist +# if: ${{ matrix.build-what.key == 'capi' }} +# run: | +# make distribution +# env: +# CARGO_BINARY: docker run -v /var/run/docker.sock:/var/run/docker.sock -v ${GITHUB_WORKSPACE}:/project -w /project wasmer/aarch64 cross +# CROSS_DOCKER_IN_DOCKER: true +# CARGO_TARGET: aarch64-unknown-linux-gnu +# PKG_CONFIG_PATH: /usr/lib/aarch64-linux-gnu/pkgconfig +# PKG_CONFIG_ALLOW_CROSS: true +# TARGET: aarch64-unknown-linux-gnu +# TARGET_DIR: target/aarch64-unknown-linux-gnu/release +# - name: Upload Artifacts +# if: ${{ matrix.build-what.key == 'capi' }} +# uses: actions/upload-artifact@v4 +# with: +# name: capi-linux-aarch64 +# path: dist +# if-no-files-found: error +# retention-days: 2 - build_linux_riscv64: - name: ${{ matrix.build-what.name }} on linux-riscv64 - runs-on: ubuntu-22.04 - strategy: - fail-fast: false - matrix: - build-what: [ - { - key: capi, - build-cmd: 'make build-capi && make package-capi', - name: 'Build C-API' - }, - { - key: wasmer, - build-cmd: 'make build-wasmer && make package-wasmer && make tar-wasmer', - name: 'Build wasmer-cli' - } - ] - steps: - - uses: actions/checkout@v3 - #- uses: dtolnay/rust-toolchain@stable - # with: - # toolchain: ${{ env.MSRV }} - # target: riscv64gc-unknown-linux-gnu - - name: Build cross image - run: | - docker build -t wasmer/riscv64 ${GITHUB_WORKSPACE}/.github/cross-linux-riscv64/ - env: - CROSS_DOCKER_IN_DOCKER: true - - name: Build ${{ matrix.build-what.key }} - run: | - ${{ matrix.build-what.build-cmd }} - env: - CARGO_BINARY: docker run -v /var/run/docker.sock:/var/run/docker.sock -v ${GITHUB_WORKSPACE}:/project -w /project wasmer/riscv64 cargo - CROSS_DOCKER_IN_DOCKER: true - CARGO_TARGET: riscv64gc-unknown-linux-gnu - ENABLE_LLVM: 0 - - name: Dist - if: ${{ matrix.build-what.key == 'capi' }} - run: | - make distribution - env: - CARGO_BINARY: docker run -v /var/run/docker.sock:/var/run/docker.sock -v ${GITHUB_WORKSPACE}:/project -w /project wasmer/riscv64 cargo - CROSS_DOCKER_IN_DOCKER: true - CARGO_TARGET: riscv64gc-unknown-linux-gnu - PKG_CONFIG_PATH: /usr/lib/riscv64-linux-gnu/pkgconfig - PKG_CONFIG_ALLOW_CROSS: true - TARGET: riscv64gc-unknown-linux-gnu - TARGET_DIR: target/riscv64gc-unknown-linux-gnu/release - - name: Upload Artifacts - if: ${{ matrix.build-what.key == 'capi' }} - uses: actions/upload-artifact@v4 - with: - name: capi-linux-riscv64 - path: dist - if-no-files-found: error - retention-days: 2 +# build_linux_riscv64: +# name: ${{ matrix.build-what.name }} on linux-riscv64 +# runs-on: ubuntu-22.04 +# strategy: +# fail-fast: false +# matrix: +# build-what: [ +# { +# key: capi, +# build-cmd: 'make build-capi && make package-capi', +# name: 'Build C-API' +# }, +# { +# key: wasmer, +# build-cmd: 'make build-wasmer && make package-wasmer && make tar-wasmer', +# name: 'Build wasmer-cli' +# } +# ] +# steps: +# - uses: actions/checkout@v3 +# #- uses: dtolnay/rust-toolchain@stable +# # with: +# # toolchain: ${{ env.MSRV }} +# # target: riscv64gc-unknown-linux-gnu +# - name: Build cross image +# run: | +# docker build -t wasmer/riscv64 ${GITHUB_WORKSPACE}/.github/cross-linux-riscv64/ +# env: +# CROSS_DOCKER_IN_DOCKER: true +# - name: Build ${{ matrix.build-what.key }} +# run: | +# ${{ matrix.build-what.build-cmd }} +# env: +# CARGO_BINARY: docker run -v /var/run/docker.sock:/var/run/docker.sock -v ${GITHUB_WORKSPACE}:/project -w /project wasmer/riscv64 cargo +# CROSS_DOCKER_IN_DOCKER: true +# CARGO_TARGET: riscv64gc-unknown-linux-gnu +# ENABLE_LLVM: 0 +# - name: Dist +# if: ${{ matrix.build-what.key == 'capi' }} +# run: | +# make distribution +# env: +# CARGO_BINARY: docker run -v /var/run/docker.sock:/var/run/docker.sock -v ${GITHUB_WORKSPACE}:/project -w /project wasmer/riscv64 cargo +# CROSS_DOCKER_IN_DOCKER: true +# CARGO_TARGET: riscv64gc-unknown-linux-gnu +# PKG_CONFIG_PATH: /usr/lib/riscv64-linux-gnu/pkgconfig +# PKG_CONFIG_ALLOW_CROSS: true +# TARGET: riscv64gc-unknown-linux-gnu +# TARGET_DIR: target/riscv64gc-unknown-linux-gnu/release +# - name: Upload Artifacts +# if: ${{ matrix.build-what.key == 'capi' }} +# uses: actions/upload-artifact@v4 +# with: +# name: capi-linux-riscv64 +# path: dist +# if-no-files-found: error +# retention-days: 2 - build: - name: ${{ matrix.build-what.name }} on ${{ matrix.metadata.build }} - runs-on: ${{ matrix.metadata.os }} - needs: setup - strategy: - fail-fast: false - matrix: - build-what: [ - { - key: capi, - build-cmd: 'make build-capi && make build-capi-headless && make package-capi && make tar-capi', - name: 'Build and test C-API' - }, - { - key: wasmer, - build-cmd: 'make build-wasmer && make package-wasmer && make tar-wasmer', - name: 'Build wasmer-cli' - } - ] - metadata: [ - { - build: linux-x64, - os: ubuntu-22.04, - target: x86_64-unknown-linux-gnu, - exe: '', - llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-amd64.tar.xz' - }, - { - build: macos-x64, - os: macos-12, - target: x86_64-apple-darwin, - exe: '', - llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-amd64.tar.xz' +# build: +# name: ${{ matrix.build-what.name }} on ${{ matrix.metadata.build }} +# runs-on: ${{ matrix.metadata.os }} +# needs: setup +# strategy: +# fail-fast: false +# matrix: +# build-what: [ +# { +# key: capi, +# build-cmd: 'make build-capi && make build-capi-headless && make package-capi && make tar-capi', +# name: 'Build and test C-API' +# }, +# { +# key: wasmer, +# build-cmd: 'make build-wasmer && make package-wasmer && make tar-wasmer', +# name: 'Build wasmer-cli' +# } +# ] +# metadata: [ +# { +# build: linux-x64, +# os: ubuntu-22.04, +# target: x86_64-unknown-linux-gnu, +# exe: '', +# llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-amd64.tar.xz' +# }, +# { +# build: macos-x64, +# os: macos-12, +# target: x86_64-apple-darwin, +# exe: '', +# llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-amd64.tar.xz' - }, - { - build: macos-arm, - os: macos-14, - target: aarch64-apple-darwin, - exe: '', - # [todo] xdoardo: Reinstate when the code we generate for aarch64 is working correctly. - # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-aarch64.tar.xz' - }, - { - build: windows-x64, - os: windows-2022, - target: x86_64-pc-windows-msvc, - exe: '.exe', - # For now, disable LLVM in `windows-x64.` - # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-windows-amd64.tar.xz' - }, - { - build: windows-gnu, - target: x86_64-pc-windows-gnu, - os: ubuntu-22.04, - }, - { - build: linux-musl, - target: x86_64-unknown-linux-musl, - os: ubuntu-22.04, - exe: '', - container: 'alpine:latest' - } +# }, +# { +# build: macos-arm, +# os: macos-14, +# target: aarch64-apple-darwin, +# exe: '', +# # [todo] xdoardo: Reinstate when the code we generate for aarch64 is working correctly. +# # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-aarch64.tar.xz' +# }, +# { +# build: windows-x64, +# os: windows-2022, +# target: x86_64-pc-windows-msvc, +# exe: '.exe', +# # For now, disable LLVM in `windows-x64.` +# # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-windows-amd64.tar.xz' +# }, +# { +# build: windows-gnu, +# target: x86_64-pc-windows-gnu, +# os: ubuntu-22.04, +# }, +# { +# build: linux-musl, +# target: x86_64-unknown-linux-musl, +# os: ubuntu-22.04, +# exe: '', +# container: 'alpine:latest' +# } - ] - container: ${{ matrix.metadata.container }} - env: - SCCACHE_AZURE_BLOB_CONTAINER: wasmerstoragesccacheblob - SCCACHE_AZURE_CONNECTION_STRING: ${{ secrets.SCCACHE_AZURE_CONNECTION_STRING }} - steps: - - uses: actions/checkout@v3 - - name: Set up libstdc++ on Linux - if: matrix.metadata.build == 'linux-x64' - run: | - sudo apt-get update -y - sudo apt-get install -y --allow-downgrades libstdc++6 libtinfo5 - sudo apt-get install --reinstall g++ - - name: Set up base deps on musl - if: matrix.metadata.build == 'linux-musl' - run: ./scripts/alpine-linux-install-deps.sh - - name: Set up dependencies for Mac OS - run: | - brew install automake - # using gnu-tar is a workaround for https://github.com/actions/cache/issues/403 - brew install gnu-tar - echo PATH="/usr/local/opt/gnu-tar/libexec/gnubin:$PATH" >> $GITHUB_ENV - if: matrix.metadata.os == 'macos-12' - - name: Install Rust - uses: dtolnay/rust-toolchain@stable - with: - toolchain: ${{ env.MSRV }} - target: ${{ matrix.metadata.target }} - - name: Install Nextest - uses: taiki-e/install-action@nextest - - name: Install MSVC dev-cmd (Windows) - uses: ilammy/msvc-dev-cmd@v1 - if: ${{ matrix.metadata.build == 'windows-x64' }} - - name: Delete unwanted link to stop it from interfering (Windows) - shell: bash - run: rm /usr/bin/link.exe - if: ${{ matrix.metadata.build == 'windows-x64' }} - - name: Install Windows-GNU linker - if: ${{ matrix.metadata.build == 'windows-gnu' }} - shell: bash - run: | - sudo apt install -y mingw-w64 - - name: Install Windows-GNU target - if: ${{ matrix.metadata.build == 'windows-gnu' }} - shell: bash - run: | - rustup target add x86_64-pc-windows-gnu - - name: Install Windows 10 SDK with xwin - if: ${{ matrix.metadata.build == 'windows-gnu' }} - shell: bash - run: | - mkdir -p /tmp/xwin - mkdir -p /tmp/xwindownload - mkdir -p /tmp/xwincache - git clone https://github.com/wasmerio/xwin --depth=1 /tmp/xwin - cargo build --release --manifest-path=/tmp/xwin/Cargo.toml - /tmp/xwin/target/release/xwin --accept-license --cache-dir /tmp/xwincache splat --output /tmp/xwindownload - mkdir -p /tmp/winsdk - cp /tmp/xwindownload/sdk/lib/10.0.20348/um/x86_64/WS2_32.lib /tmp/winsdk/ - cp /tmp/xwindownload/sdk/lib/10.0.20348/um/x86_64/KERNEL32.lib /tmp/winsdk/ - cp /tmp/xwindownload/sdk/lib/10.0.20348/um/x86_64/BCRYPT.lib /tmp/winsdk/ - cp /tmp/xwindownload/sdk/lib/10.0.20348/um/x86_64/ADVAPI32.lib /tmp/winsdk/ - cp /tmp/xwindownload/sdk/lib/10.0.20348/um/x86_64/USERENV.lib /tmp/winsdk/ - echo "WinSDK files:" - ls -laH /tmp/winsdk - echo "" - mkdir -p package - mkdir -p package/winsdk - cp -r /tmp/winsdk/* package/winsdk - - name: Install LLVM (macOS Apple Silicon) - if: matrix.metadata.os == 'macos-12' && !matrix.metadata.llvm_url - run: | - brew install llvm - - name: Install LLVM - shell: bash - if: matrix.metadata.llvm_url - run: | - curl --proto '=https' --tlsv1.2 -sSf ${{ matrix.metadata.llvm_url }} -L -o llvm.tar.xz - LLVM_DIR=$(pwd)/${{ env.LLVM_DIR }} - mkdir ${LLVM_DIR} - tar xf llvm.tar.xz --strip-components=1 -C ${LLVM_DIR} - echo "ENABLE_LLVM=1" >> $GITHUB_ENV - echo "${LLVM_DIR}/bin" >> $GITHUB_PATH - echo "${LLVM_DIR}/usr/bin" >> $GITHUB_PATH - echo "LLVM_SYS_180_PREFIX=${LLVM_DIR}" >> $GITHUB_ENV - env: - LLVM_DIR: .llvm - - name: Add `brew` libs to `RUSTFLAGS` - if: matrix.metadata.os == 'macos-14' - shell: bash - run: | - echo "RUSTFLAGS=-L/opt/homebrew/lib" >> $GITHUB_ENV - - name: Setup Rust target - shell: bash - run: | - mkdir -p .cargo - cat << EOF > .cargo/config.toml - [build] - target = "${{ matrix.metadata.target }}" - EOF - if: matrix.metadata.target - - name: which cargo - if: ${{ matrix.build-what.key == 'capi' && matrix.metadata.build == 'windows-x64' }} - run: which cargo - - name: Set cargo env - run: echo "CARGO_ROOT_DIR=$(dirname $(dirname $( which cargo )))" >> $GITHUB_ENV - - name: List root dir - shell: bash - if: ${{ matrix.build-what.key == 'capi' && matrix.metadata.build == 'windows-x64' }} - run: ls -R $CARGO_ROOT_DIR - - name: Cache - uses: whywaita/actions-cache-s3@v2 - with: - path: | - ~/.cargo/* - ./target/* - $CARGO_ROOT_DIR/* - key: r22-${{ github.repository }}-${{ runner.os }}-${{ hashFiles('Cargo.lock') }}-wasmer-make-build-wasmer-${{ matrix.build-what.key }}-${{ matrix.metadata.build }} - aws-s3-bucket: wasmer-rust-artifacts-cache - aws-access-key-id: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_TOKEN }} - aws-secret-access-key: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_KEY }} - aws-region: auto - aws-endpoint: https://1541b1e8a3fc6ad155ce67ef38899700.r2.cloudflarestorage.com - aws-s3-bucket-endpoint: false - aws-s3-force-path-style: true - - name: Build C-API - shell: bash - run: ${{ matrix.build-what.build-cmd }} - if: ${{ matrix.build-what.key == 'capi' }} - env: - TARGET: ${{ matrix.metadata.target }} - TARGET_DIR: target/${{ matrix.metadata.target }}/release - CARGO_TARGET: ${{ matrix.metadata.target }} - - name: Build Wasmer - shell: bash - if: ${{ matrix.build-what.key == 'wasmer' && matrix.metadata.build != 'windows-gnu' }} - run: ${{ matrix.build-what.build-cmd }} - env: - TARGET: ${{ matrix.metadata.target }} - TARGET_DIR: target/${{ matrix.metadata.target }}/release - CARGO_TARGET: ${{ matrix.metadata.target }} - - name: Test C-API - shell: bash - if: ${{ matrix.build-what.key == 'capi' && !(matrix.metadata.build == 'linux-musl' || matrix.metadata.build == 'windows-gnu') }} - run: make test-capi-ci - env: - TARGET: ${{ matrix.metadata.target }} - TARGET_DIR: target/${{ matrix.metadata.target }}/release - CARGO_TARGET: ${{ matrix.metadata.target }} - # C-API tests were disabled for linux-musl and macos-arm (we can't run them) - - name: Test C-API integration - shell: bash - if: ${{ matrix.build-what.key == 'capi' && !(matrix.metadata.build == 'linux-musl' || matrix.metadata.build == 'windows-gnu') }} - run: export WASMER_DIR=`pwd`/package && make test-stage-7-capi-integration-tests - env: - TARGET: ${{ matrix.metadata.target }} - TARGET_DIR: target/${{ matrix.metadata.target }}/release - CARGO_TARGET: ${{ matrix.metadata.target }} - - name: Archive production artifacts - uses: actions/upload-artifact@v4 - with: - name: wasmer-cli-${{ matrix.metadata.build }} - path: build-wasmer.tar.gz - if-no-files-found: ignore - retention-days: 2 - - name: Archive production artifacts - uses: actions/upload-artifact@v4 - with: - name: capi-${{ matrix.metadata.build }} - path: build-capi.tar.gz - if-no-files-found: ignore - retention-days: 2 +# ] +# container: ${{ matrix.metadata.container }} +# env: +# SCCACHE_AZURE_BLOB_CONTAINER: wasmerstoragesccacheblob +# SCCACHE_AZURE_CONNECTION_STRING: ${{ secrets.SCCACHE_AZURE_CONNECTION_STRING }} +# steps: +# - uses: actions/checkout@v3 +# - name: Set up libstdc++ on Linux +# if: matrix.metadata.build == 'linux-x64' +# run: | +# sudo apt-get update -y +# sudo apt-get install -y --allow-downgrades libstdc++6 libtinfo5 +# sudo apt-get install --reinstall g++ +# - name: Set up base deps on musl +# if: matrix.metadata.build == 'linux-musl' +# run: ./scripts/alpine-linux-install-deps.sh +# - name: Set up dependencies for Mac OS +# run: | +# brew install automake +# # using gnu-tar is a workaround for https://github.com/actions/cache/issues/403 +# brew install gnu-tar +# echo PATH="/usr/local/opt/gnu-tar/libexec/gnubin:$PATH" >> $GITHUB_ENV +# if: matrix.metadata.os == 'macos-12' +# - name: Install Rust +# uses: dtolnay/rust-toolchain@stable +# with: +# toolchain: ${{ env.MSRV }} +# target: ${{ matrix.metadata.target }} +# - name: Install Nextest +# uses: taiki-e/install-action@nextest +# - name: Install MSVC dev-cmd (Windows) +# uses: ilammy/msvc-dev-cmd@v1 +# if: ${{ matrix.metadata.build == 'windows-x64' }} +# - name: Delete unwanted link to stop it from interfering (Windows) +# shell: bash +# run: rm /usr/bin/link.exe +# if: ${{ matrix.metadata.build == 'windows-x64' }} +# - name: Install Windows-GNU linker +# if: ${{ matrix.metadata.build == 'windows-gnu' }} +# shell: bash +# run: | +# sudo apt install -y mingw-w64 +# - name: Install Windows-GNU target +# if: ${{ matrix.metadata.build == 'windows-gnu' }} +# shell: bash +# run: | +# rustup target add x86_64-pc-windows-gnu +# - name: Install Windows 10 SDK with xwin +# if: ${{ matrix.metadata.build == 'windows-gnu' }} +# shell: bash +# run: | +# mkdir -p /tmp/xwin +# mkdir -p /tmp/xwindownload +# mkdir -p /tmp/xwincache +# git clone https://github.com/wasmerio/xwin --depth=1 /tmp/xwin +# cargo build --release --manifest-path=/tmp/xwin/Cargo.toml +# /tmp/xwin/target/release/xwin --accept-license --cache-dir /tmp/xwincache splat --output /tmp/xwindownload +# mkdir -p /tmp/winsdk +# cp /tmp/xwindownload/sdk/lib/10.0.20348/um/x86_64/WS2_32.lib /tmp/winsdk/ +# cp /tmp/xwindownload/sdk/lib/10.0.20348/um/x86_64/KERNEL32.lib /tmp/winsdk/ +# cp /tmp/xwindownload/sdk/lib/10.0.20348/um/x86_64/BCRYPT.lib /tmp/winsdk/ +# cp /tmp/xwindownload/sdk/lib/10.0.20348/um/x86_64/ADVAPI32.lib /tmp/winsdk/ +# cp /tmp/xwindownload/sdk/lib/10.0.20348/um/x86_64/USERENV.lib /tmp/winsdk/ +# echo "WinSDK files:" +# ls -laH /tmp/winsdk +# echo "" +# mkdir -p package +# mkdir -p package/winsdk +# cp -r /tmp/winsdk/* package/winsdk +# - name: Install LLVM (macOS Apple Silicon) +# if: matrix.metadata.os == 'macos-12' && !matrix.metadata.llvm_url +# run: | +# brew install llvm +# - name: Install LLVM +# shell: bash +# if: matrix.metadata.llvm_url +# run: | +# curl --proto '=https' --tlsv1.2 -sSf ${{ matrix.metadata.llvm_url }} -L -o llvm.tar.xz +# LLVM_DIR=$(pwd)/${{ env.LLVM_DIR }} +# mkdir ${LLVM_DIR} +# tar xf llvm.tar.xz --strip-components=1 -C ${LLVM_DIR} +# echo "ENABLE_LLVM=1" >> $GITHUB_ENV +# echo "${LLVM_DIR}/bin" >> $GITHUB_PATH +# echo "${LLVM_DIR}/usr/bin" >> $GITHUB_PATH +# echo "LLVM_SYS_180_PREFIX=${LLVM_DIR}" >> $GITHUB_ENV +# env: +# LLVM_DIR: .llvm +# - name: Add `brew` libs to `RUSTFLAGS` +# if: matrix.metadata.os == 'macos-14' +# shell: bash +# run: | +# echo "RUSTFLAGS=-L/opt/homebrew/lib" >> $GITHUB_ENV +# - name: Setup Rust target +# shell: bash +# run: | +# mkdir -p .cargo +# cat << EOF > .cargo/config.toml +# [build] +# target = "${{ matrix.metadata.target }}" +# EOF +# if: matrix.metadata.target +# - name: which cargo +# if: ${{ matrix.build-what.key == 'capi' && matrix.metadata.build == 'windows-x64' }} +# run: which cargo +# - name: Set cargo env +# run: echo "CARGO_ROOT_DIR=$(dirname $(dirname $( which cargo )))" >> $GITHUB_ENV +# - name: List root dir +# shell: bash +# if: ${{ matrix.build-what.key == 'capi' && matrix.metadata.build == 'windows-x64' }} +# run: ls -R $CARGO_ROOT_DIR +# - name: Cache +# uses: whywaita/actions-cache-s3@v2 +# with: +# path: | +# ~/.cargo/* +# ./target/* +# $CARGO_ROOT_DIR/* +# key: r22-${{ github.repository }}-${{ runner.os }}-${{ hashFiles('Cargo.lock') }}-wasmer-make-build-wasmer-${{ matrix.build-what.key }}-${{ matrix.metadata.build }} +# aws-s3-bucket: wasmer-rust-artifacts-cache +# aws-access-key-id: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_TOKEN }} +# aws-secret-access-key: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_KEY }} +# aws-region: auto +# aws-endpoint: https://1541b1e8a3fc6ad155ce67ef38899700.r2.cloudflarestorage.com +# aws-s3-bucket-endpoint: false +# aws-s3-force-path-style: true +# - name: Build C-API +# shell: bash +# run: ${{ matrix.build-what.build-cmd }} +# if: ${{ matrix.build-what.key == 'capi' }} +# env: +# TARGET: ${{ matrix.metadata.target }} +# TARGET_DIR: target/${{ matrix.metadata.target }}/release +# CARGO_TARGET: ${{ matrix.metadata.target }} +# - name: Build Wasmer +# shell: bash +# if: ${{ matrix.build-what.key == 'wasmer' && matrix.metadata.build != 'windows-gnu' }} +# run: ${{ matrix.build-what.build-cmd }} +# env: +# TARGET: ${{ matrix.metadata.target }} +# TARGET_DIR: target/${{ matrix.metadata.target }}/release +# CARGO_TARGET: ${{ matrix.metadata.target }} +# - name: Test C-API +# shell: bash +# if: ${{ matrix.build-what.key == 'capi' && !(matrix.metadata.build == 'linux-musl' || matrix.metadata.build == 'windows-gnu') }} +# run: make test-capi-ci +# env: +# TARGET: ${{ matrix.metadata.target }} +# TARGET_DIR: target/${{ matrix.metadata.target }}/release +# CARGO_TARGET: ${{ matrix.metadata.target }} +# # C-API tests were disabled for linux-musl and macos-arm (we can't run them) +# - name: Test C-API integration +# shell: bash +# if: ${{ matrix.build-what.key == 'capi' && !(matrix.metadata.build == 'linux-musl' || matrix.metadata.build == 'windows-gnu') }} +# run: export WASMER_DIR=`pwd`/package && make test-stage-7-capi-integration-tests +# env: +# TARGET: ${{ matrix.metadata.target }} +# TARGET_DIR: target/${{ matrix.metadata.target }}/release +# CARGO_TARGET: ${{ matrix.metadata.target }} +# - name: Archive production artifacts +# uses: actions/upload-artifact@v4 +# with: +# name: wasmer-cli-${{ matrix.metadata.build }} +# path: build-wasmer.tar.gz +# if-no-files-found: ignore +# retention-days: 2 +# - name: Archive production artifacts +# uses: actions/upload-artifact@v4 +# with: +# name: capi-${{ matrix.metadata.build }} +# path: build-capi.tar.gz +# if-no-files-found: ignore +# retention-days: 2 - test: - name: ${{ matrix.stage.description }} on ${{ matrix.metadata.build }} - runs-on: ${{ matrix.metadata.os }} - needs: setup - strategy: - fail-fast: false - matrix: - stage: [ - { - description: 'Run wast test suite for all compilers', - make: 'test-stage-0-wast', - }, - { - description: 'Unit-test packages on std', - make: 'test-stage-1-test-all', - }, - { - description: 'Unit-test cranelift on no-std', - make: 'test-stage-2-test-compiler-cranelift-nostd', - }, - { - description: 'Unit-test singlepass on no-std', - make: 'test-stage-3-test-compiler-singlepass-nostd', - }, - { - description: 'Unit-test wasmer-cli', - make: 'test-stage-4-wasmer-cli', - }, - { - description: 'Unit-test examples', - make: 'test-stage-5-test-examples', - } - ] - metadata: [ - # We cannot test on macos-arm since we don't have ARM runners - { - build: linux-x64, - os: ubuntu-22.04, - target: x86_64-unknown-linux-gnu, - exe: '', - llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-amd64.tar.xz' - }, - { - build: macos-x64, - os: macos-12, - target: x86_64-apple-darwin, - exe: '', - llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-amd64.tar.xz' +# test: +# name: ${{ matrix.stage.description }} on ${{ matrix.metadata.build }} +# runs-on: ${{ matrix.metadata.os }} +# needs: setup +# strategy: +# fail-fast: false +# matrix: +# stage: [ +# { +# description: 'Run wast test suite for all compilers', +# make: 'test-stage-0-wast', +# }, +# { +# description: 'Unit-test packages on std', +# make: 'test-stage-1-test-all', +# }, +# { +# description: 'Unit-test cranelift on no-std', +# make: 'test-stage-2-test-compiler-cranelift-nostd', +# }, +# { +# description: 'Unit-test singlepass on no-std', +# make: 'test-stage-3-test-compiler-singlepass-nostd', +# }, +# { +# description: 'Unit-test wasmer-cli', +# make: 'test-stage-4-wasmer-cli', +# }, +# { +# description: 'Unit-test examples', +# make: 'test-stage-5-test-examples', +# } +# ] +# metadata: [ +# # We cannot test on macos-arm since we don't have ARM runners +# { +# build: linux-x64, +# os: ubuntu-22.04, +# target: x86_64-unknown-linux-gnu, +# exe: '', +# llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-amd64.tar.xz' +# }, +# { +# build: macos-x64, +# os: macos-12, +# target: x86_64-apple-darwin, +# exe: '', +# llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-amd64.tar.xz' - }, - { - build: macos-arm, - os: macos-14, - target: aarch64-apple-darwin, - exe: '', - # [todo] xdoardo: Reinstate when the code we generate for aarch64 is working correctly. - # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-aarch64.tar.xz' - }, - { - build: windows-x64, - os: windows-2022, - target: x86_64-pc-windows-msvc, - exe: '.exe', - # For now, disable LLVM in `windows-x64.` - # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-windows-amd64.tar.xz' - }, - { - build: linux-musl, - target: x86_64-unknown-linux-musl, - os: ubuntu-22.04, - exe: '', - container: 'alpine:latest' - } - ] - container: ${{ matrix.metadata.container }} - env: - SCCACHE_AZURE_BLOB_CONTAINER: wasmerstoragesccacheblob - SCCACHE_AZURE_CONNECTION_STRING: ${{ secrets.SCCACHE_AZURE_CONNECTION_STRING }} - steps: - - uses: actions/checkout@v3 - - name: Set up libstdc++ on Linux - if: matrix.metadata.build == 'linux-x64' - run: | - sudo apt-get update -y - sudo apt-get install -y --allow-downgrades libstdc++6 - sudo apt-get install --reinstall g++ - - name: Set up base deps on musl - if: matrix.metadata.build == 'linux-musl' - run: ./scripts/alpine-linux-install-deps.sh - - name: Install MSVC dev-cmd (Windows) - uses: ilammy/msvc-dev-cmd@v1 - if: ${{ matrix.metadata.build == 'windows-x64' }} - - name: Delete unwanted link to stop it from interfering (Windows) - shell: bash - run: rm /usr/bin/link.exe - if: ${{ matrix.metadata.build == 'windows-x64' }} +# }, +# { +# build: macos-arm, +# os: macos-14, +# target: aarch64-apple-darwin, +# exe: '', +# # [todo] xdoardo: Reinstate when the code we generate for aarch64 is working correctly. +# # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-aarch64.tar.xz' +# }, +# { +# build: windows-x64, +# os: windows-2022, +# target: x86_64-pc-windows-msvc, +# exe: '.exe', +# # For now, disable LLVM in `windows-x64.` +# # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-windows-amd64.tar.xz' +# }, +# { +# build: linux-musl, +# target: x86_64-unknown-linux-musl, +# os: ubuntu-22.04, +# exe: '', +# container: 'alpine:latest' +# } +# ] +# container: ${{ matrix.metadata.container }} +# env: +# SCCACHE_AZURE_BLOB_CONTAINER: wasmerstoragesccacheblob +# SCCACHE_AZURE_CONNECTION_STRING: ${{ secrets.SCCACHE_AZURE_CONNECTION_STRING }} +# steps: +# - uses: actions/checkout@v3 +# - name: Set up libstdc++ on Linux +# if: matrix.metadata.build == 'linux-x64' +# run: | +# sudo apt-get update -y +# sudo apt-get install -y --allow-downgrades libstdc++6 +# sudo apt-get install --reinstall g++ +# - name: Set up base deps on musl +# if: matrix.metadata.build == 'linux-musl' +# run: ./scripts/alpine-linux-install-deps.sh +# - name: Install MSVC dev-cmd (Windows) +# uses: ilammy/msvc-dev-cmd@v1 +# if: ${{ matrix.metadata.build == 'windows-x64' }} +# - name: Delete unwanted link to stop it from interfering (Windows) +# shell: bash +# run: rm /usr/bin/link.exe +# if: ${{ matrix.metadata.build == 'windows-x64' }} - - name: Set up dependencies for Mac OS - run: | - brew install automake - # using gnu-tar is a workaround for https://github.com/actions/cache/issues/403 - brew install gnu-tar - echo PATH="/usr/local/opt/gnu-tar/libexec/gnubin:$PATH" >> $GITHUB_ENV - if: matrix.metadata.os == 'macos-12' - - name: Install Rust - uses: dtolnay/rust-toolchain@stable - with: - toolchain: ${{ env.MSRV }} - target: ${{ matrix.metadata.target }} - - name: Install Nextest - uses: taiki-e/install-action@nextest - - name: Install LLVM (macOS Apple Silicon) - if: matrix.metadata.os == 'macos-12' && !matrix.metadata.llvm_url - run: | - brew install llvm - - name: Install LLVM - shell: bash - if: matrix.metadata.llvm_url - run: | - curl --proto '=https' --tlsv1.2 -sSf ${{ matrix.metadata.llvm_url }} -L -o llvm.tar.xz - LLVM_DIR=$(pwd)/${{ env.LLVM_DIR }} - mkdir ${LLVM_DIR} - tar xf llvm.tar.xz --strip-components=1 -C ${LLVM_DIR} - echo "${LLVM_DIR}/bin" >> $GITHUB_PATH - echo "${LLVM_DIR}/usr/bin" >> $GITHUB_PATH - echo "LLVM_SYS_180_PREFIX=${LLVM_DIR}" >> $GITHUB_ENV - echo "ENABLE_LLVM=1" >> $GITHUB_ENV - env: - LLVM_DIR: .llvm - - name: Add `brew` libs to `RUSTFLAGS` - if: matrix.metadata.os == 'macos-14' - shell: bash - run: | - echo "RUSTFLAGS=-L/opt/homebrew/lib" >> $GITHUB_ENV - - name: Setup Rust target - shell: bash - run: | - mkdir -p .cargo - cat << EOF > .cargo/config.toml - [build] - target = "${{ matrix.metadata.target }}" - EOF - if: matrix.metadata.target - - name: Cache - uses: whywaita/actions-cache-s3@v2 - with: - path: | - ~/.cargo/* - ./target/* - key: r22-${{ github.repository }}-${{ runner.os }}-${{ hashFiles('Cargo.lock') }}-wasmer-make-test-stage-${{ matrix.stage.make }}-${{ matrix.metadata.build }} - aws-s3-bucket: wasmer-rust-artifacts-cache - aws-access-key-id: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_TOKEN }} - aws-secret-access-key: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_KEY }} - aws-region: auto - aws-endpoint: https://1541b1e8a3fc6ad155ce67ef38899700.r2.cloudflarestorage.com - aws-s3-bucket-endpoint: false - aws-s3-force-path-style: true - - name: ${{ matrix.stage.description }} - shell: bash - run: make ${{ matrix.stage.make }} - env: - TARGET: ${{ matrix.metadata.target }} - TARGET_DIR: target/${{ matrix.metadata.target }}/release - CARGO_TARGET: ${{ matrix.metadata.target }} +# - name: Set up dependencies for Mac OS +# run: | +# brew install automake +# # using gnu-tar is a workaround for https://github.com/actions/cache/issues/403 +# brew install gnu-tar +# echo PATH="/usr/local/opt/gnu-tar/libexec/gnubin:$PATH" >> $GITHUB_ENV +# if: matrix.metadata.os == 'macos-12' +# - name: Install Rust +# uses: dtolnay/rust-toolchain@stable +# with: +# toolchain: ${{ env.MSRV }} +# target: ${{ matrix.metadata.target }} +# - name: Install Nextest +# uses: taiki-e/install-action@nextest +# - name: Install LLVM (macOS Apple Silicon) +# if: matrix.metadata.os == 'macos-12' && !matrix.metadata.llvm_url +# run: | +# brew install llvm +# - name: Install LLVM +# shell: bash +# if: matrix.metadata.llvm_url +# run: | +# curl --proto '=https' --tlsv1.2 -sSf ${{ matrix.metadata.llvm_url }} -L -o llvm.tar.xz +# LLVM_DIR=$(pwd)/${{ env.LLVM_DIR }} +# mkdir ${LLVM_DIR} +# tar xf llvm.tar.xz --strip-components=1 -C ${LLVM_DIR} +# echo "${LLVM_DIR}/bin" >> $GITHUB_PATH +# echo "${LLVM_DIR}/usr/bin" >> $GITHUB_PATH +# echo "LLVM_SYS_180_PREFIX=${LLVM_DIR}" >> $GITHUB_ENV +# echo "ENABLE_LLVM=1" >> $GITHUB_ENV +# env: +# LLVM_DIR: .llvm +# - name: Add `brew` libs to `RUSTFLAGS` +# if: matrix.metadata.os == 'macos-14' +# shell: bash +# run: | +# echo "RUSTFLAGS=-L/opt/homebrew/lib" >> $GITHUB_ENV +# - name: Setup Rust target +# shell: bash +# run: | +# mkdir -p .cargo +# cat << EOF > .cargo/config.toml +# [build] +# target = "${{ matrix.metadata.target }}" +# EOF +# if: matrix.metadata.target +# - name: Cache +# uses: whywaita/actions-cache-s3@v2 +# with: +# path: | +# ~/.cargo/* +# ./target/* +# key: r22-${{ github.repository }}-${{ runner.os }}-${{ hashFiles('Cargo.lock') }}-wasmer-make-test-stage-${{ matrix.stage.make }}-${{ matrix.metadata.build }} +# aws-s3-bucket: wasmer-rust-artifacts-cache +# aws-access-key-id: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_TOKEN }} +# aws-secret-access-key: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_KEY }} +# aws-region: auto +# aws-endpoint: https://1541b1e8a3fc6ad155ce67ef38899700.r2.cloudflarestorage.com +# aws-s3-bucket-endpoint: false +# aws-s3-force-path-style: true +# - name: ${{ matrix.stage.description }} +# shell: bash +# run: make ${{ matrix.stage.make }} +# env: +# TARGET: ${{ matrix.metadata.target }} +# TARGET_DIR: target/${{ matrix.metadata.target }}/release +# CARGO_TARGET: ${{ matrix.metadata.target }} - test_integration_cli: - name: CLI integration tests on ${{ matrix.build }} - runs-on: ${{ matrix.os }} - needs: [build, build_linux_aarch64, build_linux_riscv64] - strategy: - fail-fast: false - matrix: - include: - - build: linux-x64 - os: ubuntu-22.04 - target: x86_64-unknown-linux-gnu - llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-amd64.tar.xz' - - build: macos-x64 - os: macos-12 - target: x86_64-apple-darwin - # we only build the integration-test CLI, we don't run tests - - build: macos-arm - os: macos-12 - target: aarch64-apple-darwin, - - build: linux-musl - target: x86_64-unknown-linux-musl - os: ubuntu-22.04 - container: alpine:latest - - build: windows-x64 - os: windows-2019 - target: x86_64-pc-windows-msvc - # For now, disable LLVM in `windows-x64.` - # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-windows-amd64.tar.xz' +# test_integration_cli: +# name: CLI integration tests on ${{ matrix.build }} +# runs-on: ${{ matrix.os }} +# needs: [build, build_linux_aarch64, build_linux_riscv64] +# strategy: +# fail-fast: false +# matrix: +# include: +# - build: linux-x64 +# os: ubuntu-22.04 +# target: x86_64-unknown-linux-gnu +# llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-amd64.tar.xz' +# - build: macos-x64 +# os: macos-12 +# target: x86_64-apple-darwin +# # we only build the integration-test CLI, we don't run tests +# - build: macos-arm +# os: macos-12 +# target: aarch64-apple-darwin, +# - build: linux-musl +# target: x86_64-unknown-linux-musl +# os: ubuntu-22.04 +# container: alpine:latest +# - build: windows-x64 +# os: windows-2019 +# target: x86_64-pc-windows-msvc +# # For now, disable LLVM in `windows-x64.` +# # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-windows-amd64.tar.xz' - container: ${{ matrix.container }} - env: - SCCACHE_AZURE_BLOB_CONTAINER: wasmerstoragesccacheblob - SCCACHE_AZURE_CONNECTION_STRING: ${{ secrets.SCCACHE_AZURE_CONNECTION_STRING }} - steps: - - uses: actions/checkout@v3 - - uses: goto-bus-stop/setup-zig@v2 - with: - version: 0.10.0 - - name: Set up base deps on musl - if: matrix.build == 'linux-musl' - run: ./scripts/alpine-linux-install-deps.sh - - uses: actions/download-artifact@v4 - id: download - with: - name: capi-${{ matrix.build }} - - uses: actions/download-artifact@v4 - with: - name: wasmer-cli-${{ matrix.build }} - - name: 'Echo download path' - run: echo ${{steps.download.outputs.download-path}} - - name: Install Rust - uses: dtolnay/rust-toolchain@stable - with: - toolchain: ${{ env.MSRV }} - target: ${{ matrix.metadata.target }} - - name: Install Nextest - uses: taiki-e/install-action@nextest - - name: Cache - uses: whywaita/actions-cache-s3@v2 - with: - path: | - ~/.cargo/* - ./target/* - key: r22-${{ github.repository }}-${{ runner.os }}-${{ hashFiles('Cargo.lock') }}-wasmer-make-test-integration-cli-${{ matrix.build }} - aws-s3-bucket: wasmer-rust-artifacts-cache - aws-access-key-id: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_TOKEN }} - aws-secret-access-key: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_KEY }} - aws-region: auto - aws-endpoint: https://1541b1e8a3fc6ad155ce67ef38899700.r2.cloudflarestorage.com - aws-s3-bucket-endpoint: false - aws-s3-force-path-style: true - - name: Prepare package directory - shell: bash - run: | - mkdir -p package - mkdir -p package/cache - - uses: actions/download-artifact@v4 - with: - name: capi-linux-aarch64 - path: package/cache/wasmercache1 - - uses: actions/download-artifact@v4 - with: - name: capi-windows-x64 - path: package/cache/wasmercache2 - - uses: actions/download-artifact@v4 - with: - name: capi-macos-arm - path: package/cache/wasmercache3 - - uses: actions/download-artifact@v4 - with: - name: capi-macos-x64 - path: package/cache/wasmercache4 - - uses: actions/download-artifact@v4 - with: - name: capi-linux-x64 - path: package/cache/wasmercache5 - - uses: actions/download-artifact@v4 - with: - name: capi-linux-riscv64 - path: package/cache/wasmercache6 - - name: Copy .tar.gz files to proper location - shell: bash - run: | - ls package/cache/wasmercache1 - ls package/cache/wasmercache2 - ls package/cache/wasmercache3 - ls package/cache/wasmercache4 - ls package/cache/wasmercache5 - cp package/cache/wasmercache1/wasmer.tar.gz package/cache/wasmer-linux-aarch64.tar.gz - cp package/cache/wasmercache2/build-capi.tar.gz package/cache/wasmer-windows-gnu64.tar.gz - cp package/cache/wasmercache3/build-capi.tar.gz package/cache/wasmer-darwin-arm64.tar.gz - cp package/cache/wasmercache4/build-capi.tar.gz package/cache/wasmer-darwin-amd64.tar.gz - cp package/cache/wasmercache5/build-capi.tar.gz package/cache/wasmer-linux-amd64.tar.gz - cp package/cache/wasmercache6/wasmer.tar.gz package/cache/wasmer-linux-riscv64.tar.gz - - uses: actions/download-artifact@v4 - if: ${{ matrix.build == 'windows-x64' }} - with: - name: capi-windows-x64 - path: download_link - - uses: actions/download-artifact@v4 - if: ${{ matrix.build == 'linux-musl' }} - with: - name: capi-linux-musl - path: download_link - - uses: actions/download-artifact@v4 - if: ${{ matrix.build == 'macos-arm' }} - with: - name: capi-macos-arm - path: download_link - - uses: actions/download-artifact@v4 - if: ${{ matrix.build == 'macos-x64' }} - with: - name: capi-macos-x64 - path: download_link - - uses: actions/download-artifact@v4 - if: ${{ matrix.build == 'linux-x64' }} - with: - name: capi-linux-x64 - path: download_link - - name: Copy build-capi.tar.gz to link.tar.gz - shell: bash - run: | - cp download_link/build-capi.tar.gz link.tar.gz - - name: Unzip Artifacts - shell: bash - run: | - make untar-capi - - name: Unzip Artifacts - shell: bash - run: | - make untar-wasmer +# container: ${{ matrix.container }} +# env: +# SCCACHE_AZURE_BLOB_CONTAINER: wasmerstoragesccacheblob +# SCCACHE_AZURE_CONNECTION_STRING: ${{ secrets.SCCACHE_AZURE_CONNECTION_STRING }} +# steps: +# - uses: actions/checkout@v3 +# - uses: goto-bus-stop/setup-zig@v2 +# with: +# version: 0.10.0 +# - name: Set up base deps on musl +# if: matrix.build == 'linux-musl' +# run: ./scripts/alpine-linux-install-deps.sh +# - uses: actions/download-artifact@v4 +# id: download +# with: +# name: capi-${{ matrix.build }} +# - uses: actions/download-artifact@v4 +# with: +# name: wasmer-cli-${{ matrix.build }} +# - name: 'Echo download path' +# run: echo ${{steps.download.outputs.download-path}} +# - name: Install Rust +# uses: dtolnay/rust-toolchain@stable +# with: +# toolchain: ${{ env.MSRV }} +# target: ${{ matrix.metadata.target }} +# - name: Install Nextest +# uses: taiki-e/install-action@nextest +# - name: Cache +# uses: whywaita/actions-cache-s3@v2 +# with: +# path: | +# ~/.cargo/* +# ./target/* +# key: r22-${{ github.repository }}-${{ runner.os }}-${{ hashFiles('Cargo.lock') }}-wasmer-make-test-integration-cli-${{ matrix.build }} +# aws-s3-bucket: wasmer-rust-artifacts-cache +# aws-access-key-id: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_TOKEN }} +# aws-secret-access-key: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_KEY }} +# aws-region: auto +# aws-endpoint: https://1541b1e8a3fc6ad155ce67ef38899700.r2.cloudflarestorage.com +# aws-s3-bucket-endpoint: false +# aws-s3-force-path-style: true +# - name: Prepare package directory +# shell: bash +# run: | +# mkdir -p package +# mkdir -p package/cache +# - uses: actions/download-artifact@v4 +# with: +# name: capi-linux-aarch64 +# path: package/cache/wasmercache1 +# - uses: actions/download-artifact@v4 +# with: +# name: capi-windows-x64 +# path: package/cache/wasmercache2 +# - uses: actions/download-artifact@v4 +# with: +# name: capi-macos-arm +# path: package/cache/wasmercache3 +# - uses: actions/download-artifact@v4 +# with: +# name: capi-macos-x64 +# path: package/cache/wasmercache4 +# - uses: actions/download-artifact@v4 +# with: +# name: capi-linux-x64 +# path: package/cache/wasmercache5 +# - uses: actions/download-artifact@v4 +# with: +# name: capi-linux-riscv64 +# path: package/cache/wasmercache6 +# - name: Copy .tar.gz files to proper location +# shell: bash +# run: | +# ls package/cache/wasmercache1 +# ls package/cache/wasmercache2 +# ls package/cache/wasmercache3 +# ls package/cache/wasmercache4 +# ls package/cache/wasmercache5 +# cp package/cache/wasmercache1/wasmer.tar.gz package/cache/wasmer-linux-aarch64.tar.gz +# cp package/cache/wasmercache2/build-capi.tar.gz package/cache/wasmer-windows-gnu64.tar.gz +# cp package/cache/wasmercache3/build-capi.tar.gz package/cache/wasmer-darwin-arm64.tar.gz +# cp package/cache/wasmercache4/build-capi.tar.gz package/cache/wasmer-darwin-amd64.tar.gz +# cp package/cache/wasmercache5/build-capi.tar.gz package/cache/wasmer-linux-amd64.tar.gz +# cp package/cache/wasmercache6/wasmer.tar.gz package/cache/wasmer-linux-riscv64.tar.gz +# - uses: actions/download-artifact@v4 +# if: ${{ matrix.build == 'windows-x64' }} +# with: +# name: capi-windows-x64 +# path: download_link +# - uses: actions/download-artifact@v4 +# if: ${{ matrix.build == 'linux-musl' }} +# with: +# name: capi-linux-musl +# path: download_link +# - uses: actions/download-artifact@v4 +# if: ${{ matrix.build == 'macos-arm' }} +# with: +# name: capi-macos-arm +# path: download_link +# - uses: actions/download-artifact@v4 +# if: ${{ matrix.build == 'macos-x64' }} +# with: +# name: capi-macos-x64 +# path: download_link +# - uses: actions/download-artifact@v4 +# if: ${{ matrix.build == 'linux-x64' }} +# with: +# name: capi-linux-x64 +# path: download_link +# - name: Copy build-capi.tar.gz to link.tar.gz +# shell: bash +# run: | +# cp download_link/build-capi.tar.gz link.tar.gz +# - name: Unzip Artifacts +# shell: bash +# run: | +# make untar-capi +# - name: Unzip Artifacts +# shell: bash +# run: | +# make untar-wasmer - # Removed in favour of freestanding integration tests - # - # - name: Test integration CLI - # if: false # matrix.build != 'macos-arm' - # shell: bash - # run: | - # export WASMER_PATH=`pwd`/target/${{ matrix.target }}/release/wasmer${{ matrix.exe }} - # export WASMER_DIR=`pwd`/package && make test-integration-cli-ci - # env: - # TARGET: ${{ matrix.target }} - # TARGET_DIR: target/${{ matrix.target }}/release - # CARGO_TARGET: ${{ matrix.target }} - # WAPM_DEV_TOKEN: ${{ secrets.WAPM_DEV_TOKEN }} - # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} +# # Removed in favour of freestanding integration tests +# # +# # - name: Test integration CLI +# # if: false # matrix.build != 'macos-arm' +# # shell: bash +# # run: | +# # export WASMER_PATH=`pwd`/target/${{ matrix.target }}/release/wasmer${{ matrix.exe }} +# # export WASMER_DIR=`pwd`/package && make test-integration-cli-ci +# # env: +# # TARGET: ${{ matrix.target }} +# # TARGET_DIR: target/${{ matrix.target }}/release +# # CARGO_TARGET: ${{ matrix.target }} +# # WAPM_DEV_TOKEN: ${{ secrets.WAPM_DEV_TOKEN }} +# # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # ---- - # Note (xdoardo on 2024/10/07): - # --- - # As of now the WAMR, WASMI (and V8) backends are not that mature enough. We will re-enable these tests - # when they've been used and matured. - # ---- - # - # - name: Test CLI integration (WAMR) - # shell: bash - # run: | - # export WASMER_PATH=`pwd`/target/${{ matrix.target }}/release/wasmer${{ matrix.exe }} - # export WASMER_DIR=`pwd`/package && make test-integration-cli-wamr-ci - # env: - # TARGET: ${{ matrix.target }} - # TARGET_DIR: target/${{ matrix.target }}/release - # CARGO_TARGET: ${{ matrix.target }} - # WAPM_DEV_TOKEN: ${{ secrets.WAPM_DEV_TOKEN }} - # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} +# # ---- +# # Note (xdoardo on 2024/10/07): +# # --- +# # As of now the WAMR, WASMI (and V8) backends are not that mature enough. We will re-enable these tests +# # when they've been used and matured. +# # ---- +# # +# # - name: Test CLI integration (WAMR) +# # shell: bash +# # run: | +# # export WASMER_PATH=`pwd`/target/${{ matrix.target }}/release/wasmer${{ matrix.exe }} +# # export WASMER_DIR=`pwd`/package && make test-integration-cli-wamr-ci +# # env: +# # TARGET: ${{ matrix.target }} +# # TARGET_DIR: target/${{ matrix.target }}/release +# # CARGO_TARGET: ${{ matrix.target }} +# # WAPM_DEV_TOKEN: ${{ secrets.WAPM_DEV_TOKEN }} +# # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # - name: Test CLI integration (WASMI) - # shell: bash - # run: | - # export WASMER_PATH=`pwd`/target/${{ matrix.target }}/release/wasmer${{ matrix.exe }} - # export WASMER_DIR=`pwd`/package && make test-integration-cli-wasmi-ci - # env: - # TARGET: ${{ matrix.target }} - # TARGET_DIR: target/${{ matrix.target }}/release - # CARGO_TARGET: ${{ matrix.target }} - # WAPM_DEV_TOKEN: ${{ secrets.WAPM_DEV_TOKEN }} - # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} +# # - name: Test CLI integration (WASMI) +# # shell: bash +# # run: | +# # export WASMER_PATH=`pwd`/target/${{ matrix.target }}/release/wasmer${{ matrix.exe }} +# # export WASMER_DIR=`pwd`/package && make test-integration-cli-wasmi-ci +# # env: +# # TARGET: ${{ matrix.target }} +# # TARGET_DIR: target/${{ matrix.target }}/release +# # CARGO_TARGET: ${{ matrix.target }} +# # WAPM_DEV_TOKEN: ${{ secrets.WAPM_DEV_TOKEN }} +# # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # there is another set of integration tests in 'wasmer-integration-tests' repo. Run those - test-wasmer-integration-tests: - needs: [build] - runs-on: ubuntu-22.04 - steps: - - name: Checkout wasmer-integration-tests repository - uses: actions/checkout@v3 - with: - repository: wasmerio/wasmer-integration-tests - submodules: true - token: ${{ secrets.CLONE_WASMER_INTEGRATION_TESTS }} - - uses: actions/download-artifact@v4 - with: - name: wasmer-cli-linux-x64 - - name: Cargo Registry Cache - uses: actions/cache@v3 - with: - path: | - ~/.cargo/advisory-db - ~/.cargo/git - ~/.cargo/registry - key: cargo-registry-${{ hashFiles('**/Cargo.lock') }} - - name: Cargo target cache - uses: actions/cache@v3 - with: - path: | - target/ - key: cargo-release-${{ hashFiles('**/Cargo.lock') }} - - run: | - # install rust toolchain - curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y - . "$HOME/.cargo/env" +# # there is another set of integration tests in 'wasmer-integration-tests' repo. Run those +# test-wasmer-integration-tests: +# needs: [build] +# runs-on: ubuntu-22.04 +# steps: +# - name: Checkout wasmer-integration-tests repository +# uses: actions/checkout@v3 +# with: +# repository: wasmerio/wasmer-integration-tests +# submodules: true +# token: ${{ secrets.CLONE_WASMER_INTEGRATION_TESTS }} +# - uses: actions/download-artifact@v4 +# with: +# name: wasmer-cli-linux-x64 +# - name: Cargo Registry Cache +# uses: actions/cache@v3 +# with: +# path: | +# ~/.cargo/advisory-db +# ~/.cargo/git +# ~/.cargo/registry +# key: cargo-registry-${{ hashFiles('**/Cargo.lock') }} +# - name: Cargo target cache +# uses: actions/cache@v3 +# with: +# path: | +# target/ +# key: cargo-release-${{ hashFiles('**/Cargo.lock') }} +# - run: | +# # install rust toolchain +# curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y +# . "$HOME/.cargo/env" - # add wasmer cli to PATH - tar -xzf build-wasmer.tar.gz +# # add wasmer cli to PATH +# tar -xzf build-wasmer.tar.gz - docker build -t tmp . - docker run -v $PWD:/app -w /app tmp bash -c " \ - cp ./bin/wasmer /root/.wasmer/bin/wasmer &&\ - export MYSQL_HOST='${{ vars.INTEGRATION_TEST_MYSQL_HOST }}' &&\ - export MYSQL_DBNAME='${{ vars.INTEGRATION_TEST_MYSQL_DBNAME }}' &&\ - export MYSQL_USERNAME='${{ secrets.INTEGRATION_TEST_MYSQL_USERNAME }}' &&\ - export MYSQL_PASSWORD='${{ secrets.INTEGRATION_TEST_MYSQL_PASSWORD }}' &&\ - export MYSQL_PORT='${{ vars.INTEGRATION_TEST_MYSQL_PORT }}' &&\ - export MYSQL_CERT='${{ secrets.INTEGRATION_TEST_MYSQL_CERT }}' &&\ - export PG_HOST='${{ vars.INTEGRATION_TEST_PG_HOST }}' &&\ - export PG_DBNAME='${{ vars.INTEGRATION_TEST_PG_DBNAME }}' &&\ - export PG_USERNAME='${{ secrets.INTEGRATION_TEST_PG_USERNAME }}' &&\ - export PG_PASSWORD='${{ secrets.INTEGRATION_TEST_PG_PASSWORD }}' &&\ - export PG_PORT='${{ vars.INTEGRATION_TEST_PG_PORT }}' &&\ - wasmer config set registry.url https://registry.wasmer.io/graphql &&\ - wasmer login '${{ secrets.WAPM_PROD_TOKEN }}' &&\ - wasmer config set registry.url https://registry.wasmer.wtf/graphql &&\ - wasmer login '${{ secrets.WAPM_DEV_TOKEN }}' &&\ - cargo test --no-fail-fast" - - name: notify failure in slack - if: failure() - run: | - curl -X POST -H 'Content-type: application/json' --data '{"text":"Integration tests failed ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"}' ${{ secrets.INTEGRATION_TEST_SLACK_WEBHOOK }} +# docker build -t tmp . +# docker run -v $PWD:/app -w /app tmp bash -c " \ +# cp ./bin/wasmer /root/.wasmer/bin/wasmer &&\ +# export MYSQL_HOST='${{ vars.INTEGRATION_TEST_MYSQL_HOST }}' &&\ +# export MYSQL_DBNAME='${{ vars.INTEGRATION_TEST_MYSQL_DBNAME }}' &&\ +# export MYSQL_USERNAME='${{ secrets.INTEGRATION_TEST_MYSQL_USERNAME }}' &&\ +# export MYSQL_PASSWORD='${{ secrets.INTEGRATION_TEST_MYSQL_PASSWORD }}' &&\ +# export MYSQL_PORT='${{ vars.INTEGRATION_TEST_MYSQL_PORT }}' &&\ +# export MYSQL_CERT='${{ secrets.INTEGRATION_TEST_MYSQL_CERT }}' &&\ +# export PG_HOST='${{ vars.INTEGRATION_TEST_PG_HOST }}' &&\ +# export PG_DBNAME='${{ vars.INTEGRATION_TEST_PG_DBNAME }}' &&\ +# export PG_USERNAME='${{ secrets.INTEGRATION_TEST_PG_USERNAME }}' &&\ +# export PG_PASSWORD='${{ secrets.INTEGRATION_TEST_PG_PASSWORD }}' &&\ +# export PG_PORT='${{ vars.INTEGRATION_TEST_PG_PORT }}' &&\ +# wasmer config set registry.url https://registry.wasmer.io/graphql &&\ +# wasmer login '${{ secrets.WAPM_PROD_TOKEN }}' &&\ +# wasmer config set registry.url https://registry.wasmer.wtf/graphql &&\ +# wasmer login '${{ secrets.WAPM_DEV_TOKEN }}' &&\ +# cargo test --no-fail-fast" +# - name: notify failure in slack +# if: failure() +# run: | +# curl -X POST -H 'Content-type: application/json' --data '{"text":"Integration tests failed ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"}' ${{ secrets.INTEGRATION_TEST_SLACK_WEBHOOK }} diff --git a/.github/workflows/wasmer-config.yaml b/.github/workflows/wasmer-config.yaml index 9091574b1e3..90a36b31efd 100644 --- a/.github/workflows/wasmer-config.yaml +++ b/.github/workflows/wasmer-config.yaml @@ -1,54 +1,54 @@ -# Dedicated workflow just for the wasmer-config crate -name: wasmer-config +# # Dedicated workflow just for the wasmer-config crate +# name: wasmer-config -on: - push: - branches: - - main - pull_request: +# on: +# push: +# branches: +# - main +# pull_request: -# Automatically cancel previous workflow runs when a new commit is pushed. -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true +# # Automatically cancel previous workflow runs when a new commit is pushed. +# concurrency: +# group: ${{ github.workflow }}-${{ github.ref }} +# cancel-in-progress: true -env: - DEFAULT_CRATE_NAME: wasmer_toml +# env: +# DEFAULT_CRATE_NAME: wasmer_toml -jobs: - check: - name: Compile and Test - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Rust Cache - uses: Swatinem/rust-cache@v2 - - name: Setup Rust - uses: dsherret/rust-toolchain-file@v1 - - name: Install Nextest - uses: taiki-e/install-action@nextest - - name: Type Checking - run: | - cd lib/config && cargo check --verbose --locked - - name: Build - run: | - cd lib/config && cargo build --verbose --locked - - name: Test - run: | - cd lib/config && cargo nextest run --verbose --locked +# jobs: +# check: +# name: Compile and Test +# runs-on: ubuntu-latest +# steps: +# - uses: actions/checkout@v2 +# - name: Rust Cache +# uses: Swatinem/rust-cache@v2 +# - name: Setup Rust +# uses: dsherret/rust-toolchain-file@v1 +# - name: Install Nextest +# uses: taiki-e/install-action@nextest +# - name: Type Checking +# run: | +# cd lib/config && cargo check --verbose --locked +# - name: Build +# run: | +# cd lib/config && cargo build --verbose --locked +# - name: Test +# run: | +# cd lib/config && cargo nextest run --verbose --locked - lints: - name: Linting and Formatting - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Rust Cache - uses: Swatinem/rust-cache@v2 - - name: Setup Rust - uses: dsherret/rust-toolchain-file@v1 - - name: Check Formatting - run: | - cd lib/config && cargo fmt --verbose --check - - name: Clippy - run: | - cd lib/config && cargo clippy --verbose +# lints: +# name: Linting and Formatting +# runs-on: ubuntu-latest +# steps: +# - uses: actions/checkout@v2 +# - name: Rust Cache +# uses: Swatinem/rust-cache@v2 +# - name: Setup Rust +# uses: dsherret/rust-toolchain-file@v1 +# - name: Check Formatting +# run: | +# cd lib/config && cargo fmt --verbose --check +# - name: Clippy +# run: | +# cd lib/config && cargo clippy --verbose From 5effb8d11222cb6ca6224c33437547f22a261662 Mon Sep 17 00:00:00 2001 From: "M.Amin Rayej" Date: Thu, 24 Oct 2024 14:54:40 +0330 Subject: [PATCH 02/39] fix syntax --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5f94527ce83..1a5483697cd 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -12,7 +12,7 @@ on: tags: # this is _not_ a regex, see: https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#filter-pattern-cheat-sheet - '[0-9]+.[0-9]+.[0-9]+*' - pull_request: # TODO: MUST BE REMOVED! ONLY FOR TESTING + pull_request: # TODO: MUST BE REMOVED! ONLY FOR TESTING branches: - 'main' # Run jobs on PRs targeting the 'main' branch workflow_dispatch: From a7a15a1480a56d5296afe6f00e5c0b4a44877405 Mon Sep 17 00:00:00 2001 From: "M.Amin Rayej" Date: Thu, 24 Oct 2024 16:03:20 +0330 Subject: [PATCH 03/39] enable other windows jobs --- .github/workflows/build.yml | 48 ++++++++++++++++++------------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1a5483697cd..3f73021c161 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -154,30 +154,30 @@ jobs: use_sccache: false use_llvm: true build_wasm: false - # - build: windows-x64-v8 - # os: windows-2022 - # artifact_name: 'wasmer-v8-windows-amd64' - # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-windows-amd64.tar.xz' - # cross_compilation_artifact_name: 'cross_compiled_from_win' - # use_sccache: false - # use_llvm: true - # build_wasm: false - # - build: windows-x64-wamr - # os: windows-2022 - # artifact_name: 'wasmer-wamr-windows-amd64' - # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-windows-amd64.tar.xz' - # cross_compilation_artifact_name: 'cross_compiled_from_win' - # use_sccache: false - # use_llvm: true - # build_wasm: false - # - build: windows-x64-wasmi - # os: windows-2022 - # artifact_name: 'wasmer-wasmi-windows-amd64' - # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-windows-amd64.tar.xz' - # cross_compilation_artifact_name: 'cross_compiled_from_win' - # use_sccache: false - # use_llvm: true - # build_wasm: false + - build: windows-x64-v8 + os: windows-2022 + artifact_name: 'wasmer-v8-windows-amd64' + llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-windows-amd64.tar.xz' + cross_compilation_artifact_name: 'cross_compiled_from_win' + use_sccache: false + use_llvm: true + build_wasm: false + - build: windows-x64-wamr + os: windows-2022 + artifact_name: 'wasmer-wamr-windows-amd64' + llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-windows-amd64.tar.xz' + cross_compilation_artifact_name: 'cross_compiled_from_win' + use_sccache: false + use_llvm: true + build_wasm: false + - build: windows-x64-wasmi + os: windows-2022 + artifact_name: 'wasmer-wasmi-windows-amd64' + llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-windows-amd64.tar.xz' + cross_compilation_artifact_name: 'cross_compiled_from_win' + use_sccache: false + use_llvm: true + build_wasm: false # - build: linux-musl-x64 # os: ubuntu-latest # artifact_name: 'wasmer-linux-musl-amd64' From 7bb9599354e4dbf50bed5b27b9fc6ab599a0c41c Mon Sep 17 00:00:00 2001 From: "M.Amin Rayej" Date: Thu, 24 Oct 2024 17:06:37 +0330 Subject: [PATCH 04/39] test new arm runner --- .github/workflows/build.yml | 72 ++++++++++++++++++++----------------- 1 file changed, 40 insertions(+), 32 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3f73021c161..7385f343465 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -46,6 +46,14 @@ jobs: fail-fast: false matrix: include: + - build: linux-arm64 + os: arm64-ubuntu-latest-8-cores + artifact_name: 'wasmer-linux-arm64' + llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-aarch64.tar.xz' + cross_compilation_artifact_name: 'cross_compiled_from_linux' + use_sccache: false + use_llvm: true + build_wasm: true # - build: linux-x64 # os: ubuntu-22.04 # artifact_name: 'wasmer-linux-amd64' @@ -146,38 +154,38 @@ jobs: # build_wasm: false # # [todo] xdoardo: Reinstate when the code we generate for aarch64 is working correctly. # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-aarch64.tar.xz' - - build: windows-x64 - os: windows-2022 - artifact_name: 'wasmer-windows-amd64' - llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-windows-amd64.tar.xz' - cross_compilation_artifact_name: 'cross_compiled_from_win' - use_sccache: false - use_llvm: true - build_wasm: false - - build: windows-x64-v8 - os: windows-2022 - artifact_name: 'wasmer-v8-windows-amd64' - llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-windows-amd64.tar.xz' - cross_compilation_artifact_name: 'cross_compiled_from_win' - use_sccache: false - use_llvm: true - build_wasm: false - - build: windows-x64-wamr - os: windows-2022 - artifact_name: 'wasmer-wamr-windows-amd64' - llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-windows-amd64.tar.xz' - cross_compilation_artifact_name: 'cross_compiled_from_win' - use_sccache: false - use_llvm: true - build_wasm: false - - build: windows-x64-wasmi - os: windows-2022 - artifact_name: 'wasmer-wasmi-windows-amd64' - llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-windows-amd64.tar.xz' - cross_compilation_artifact_name: 'cross_compiled_from_win' - use_sccache: false - use_llvm: true - build_wasm: false + # - build: windows-x64 + # os: windows-2022 + # artifact_name: 'wasmer-windows-amd64' + # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-windows-amd64.tar.xz' + # cross_compilation_artifact_name: 'cross_compiled_from_win' + # use_sccache: false + # use_llvm: true + # build_wasm: false + # - build: windows-x64-v8 + # os: windows-2022 + # artifact_name: 'wasmer-v8-windows-amd64' + # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-windows-amd64.tar.xz' + # cross_compilation_artifact_name: 'cross_compiled_from_win' + # use_sccache: false + # use_llvm: true + # build_wasm: false + # - build: windows-x64-wamr + # os: windows-2022 + # artifact_name: 'wasmer-wamr-windows-amd64' + # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-windows-amd64.tar.xz' + # cross_compilation_artifact_name: 'cross_compiled_from_win' + # use_sccache: false + # use_llvm: true + # build_wasm: false + # - build: windows-x64-wasmi + # os: windows-2022 + # artifact_name: 'wasmer-wasmi-windows-amd64' + # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-windows-amd64.tar.xz' + # cross_compilation_artifact_name: 'cross_compiled_from_win' + # use_sccache: false + # use_llvm: true + # build_wasm: false # - build: linux-musl-x64 # os: ubuntu-latest # artifact_name: 'wasmer-linux-musl-amd64' From 7e9495e2d30a6da194515da42699d4d41f650867 Mon Sep 17 00:00:00 2001 From: "M.Amin Rayej" Date: Thu, 24 Oct 2024 17:32:48 +0330 Subject: [PATCH 05/39] export LLVM_SYS for Linux as well --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7385f343465..1f5110ad95c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -253,6 +253,7 @@ jobs: mkdir -p ${LLVM_DIR} curl --proto '=https' --tlsv1.2 -sSf "${{ matrix.llvm_url }}" -L -o - | tar xJv -C ${LLVM_DIR} echo "${LLVM_DIR}/bin" >> $GITHUB_PATH + echo LLVM_SYS_180_PREFIX="${LLVM_DIR}" >> $GITHUB_ENV env: LLVM_DIR: .llvm - name: Configure LLVM (Windows) From f6d2e6636ae5aa4d1a32d6704f38b8051b4e04a8 Mon Sep 17 00:00:00 2001 From: "M.Amin Rayej" Date: Thu, 24 Oct 2024 17:40:30 +0330 Subject: [PATCH 06/39] only build wasmer --- .github/workflows/build.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1f5110ad95c..0661968f8de 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -327,14 +327,14 @@ jobs: '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' -s echo 'RUSTC_WRAPPER=${{ runner.tool_cache }}/cargo-sccache/bin/sccache' >> $GITHUB_ENV shell: bash - - name: Build C API headless - shell: bash - run: | - make package-capi-headless - - name: Build C API - shell: bash - run: | - make build-capi + # - name: Build C API headless + # shell: bash + # run: | + # make package-capi-headless + # - name: Build C API + # shell: bash + # run: | + # make build-capi - name: Build Wasmer binary with LLVM if: matrix.use_llvm shell: bash From ff04ef645a51828bb192ac82e79e31d03d160fc9 Mon Sep 17 00:00:00 2001 From: "M.Amin Rayej" Date: Thu, 24 Oct 2024 17:51:52 +0330 Subject: [PATCH 07/39] list llvm dir --- .github/workflows/build.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0661968f8de..4c025907d3a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -254,6 +254,7 @@ jobs: curl --proto '=https' --tlsv1.2 -sSf "${{ matrix.llvm_url }}" -L -o - | tar xJv -C ${LLVM_DIR} echo "${LLVM_DIR}/bin" >> $GITHUB_PATH echo LLVM_SYS_180_PREFIX="${LLVM_DIR}" >> $GITHUB_ENV + ls -R ${LLVM_DIR} env: LLVM_DIR: .llvm - name: Configure LLVM (Windows) @@ -339,6 +340,7 @@ jobs: if: matrix.use_llvm shell: bash run: | + ls -R ${LLVM_SYS_180_PREFIX} make build-wasmer env: ENABLE_LLVM: 1 From 3dfb2af314298c69940c23fcff4b1e0f5f0f094d Mon Sep 17 00:00:00 2001 From: "M.Amin Rayej" Date: Thu, 24 Oct 2024 18:09:55 +0330 Subject: [PATCH 08/39] use llvm from the package manager --- .github/workflows/build.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4c025907d3a..4b0ac4a764d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -49,7 +49,7 @@ jobs: - build: linux-arm64 os: arm64-ubuntu-latest-8-cores artifact_name: 'wasmer-linux-arm64' - llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-aarch64.tar.xz' + # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-aarch64.tar.xz' cross_compilation_artifact_name: 'cross_compiled_from_linux' use_sccache: false use_llvm: true @@ -207,6 +207,10 @@ jobs: if: startsWith(matrix.build, 'linux-x64') run: | sudo apt install mold ninja-build + - name: Install Linux ARM tools + if: startsWith(matrix.build, 'linux-arm64') + run: | + sudo apt install mold ninja-build llvm-dev libclang-dev clang cmake make - name: Install Linux musl tools if: startsWith(matrix.build, 'linux-musl') run: | @@ -253,8 +257,6 @@ jobs: mkdir -p ${LLVM_DIR} curl --proto '=https' --tlsv1.2 -sSf "${{ matrix.llvm_url }}" -L -o - | tar xJv -C ${LLVM_DIR} echo "${LLVM_DIR}/bin" >> $GITHUB_PATH - echo LLVM_SYS_180_PREFIX="${LLVM_DIR}" >> $GITHUB_ENV - ls -R ${LLVM_DIR} env: LLVM_DIR: .llvm - name: Configure LLVM (Windows) @@ -340,7 +342,6 @@ jobs: if: matrix.use_llvm shell: bash run: | - ls -R ${LLVM_SYS_180_PREFIX} make build-wasmer env: ENABLE_LLVM: 1 From 30a69f0191010bce26916aa5b2807c3262fcf2f9 Mon Sep 17 00:00:00 2001 From: "M.Amin Rayej" Date: Thu, 24 Oct 2024 18:17:45 +0330 Subject: [PATCH 09/39] install libpolly --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4b0ac4a764d..8e616cc4b88 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -210,7 +210,7 @@ jobs: - name: Install Linux ARM tools if: startsWith(matrix.build, 'linux-arm64') run: | - sudo apt install mold ninja-build llvm-dev libclang-dev clang cmake make + sudo apt install mold ninja-build llvm-18-dev libclang-18-dev clang-18 cmake make libpolly-18-dev - name: Install Linux musl tools if: startsWith(matrix.build, 'linux-musl') run: | From 2057393478015e48624888dffdf9fa5287fbe8d9 Mon Sep 17 00:00:00 2001 From: "M.Amin Rayej" Date: Thu, 24 Oct 2024 18:26:57 +0330 Subject: [PATCH 10/39] install zstd --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8e616cc4b88..1943ec146e0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -210,7 +210,7 @@ jobs: - name: Install Linux ARM tools if: startsWith(matrix.build, 'linux-arm64') run: | - sudo apt install mold ninja-build llvm-18-dev libclang-18-dev clang-18 cmake make libpolly-18-dev + sudo apt install mold ninja-build llvm-18-dev libclang-18-dev clang-18 cmake make libpolly-18-dev libzstd1 zstd - name: Install Linux musl tools if: startsWith(matrix.build, 'linux-musl') run: | From cd42522f3bb26fd0370d85234a156fe8f8f2f0e2 Mon Sep 17 00:00:00 2001 From: "M.Amin Rayej" Date: Thu, 24 Oct 2024 18:39:07 +0330 Subject: [PATCH 11/39] install libzstd-dev --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1943ec146e0..6236bf837bc 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -210,7 +210,7 @@ jobs: - name: Install Linux ARM tools if: startsWith(matrix.build, 'linux-arm64') run: | - sudo apt install mold ninja-build llvm-18-dev libclang-18-dev clang-18 cmake make libpolly-18-dev libzstd1 zstd + sudo apt install mold ninja-build llvm-18-dev libclang-18-dev clang-18 cmake make libpolly-18-dev libzstd1 zstd libzstd-dev - name: Install Linux musl tools if: startsWith(matrix.build, 'linux-musl') run: | From 967905fffc710c098e61c39212b2737fc4e03544 Mon Sep 17 00:00:00 2001 From: "M.Amin Rayej" Date: Thu, 24 Oct 2024 18:48:28 +0330 Subject: [PATCH 12/39] complete setup for arm64 --- .github/workflows/build.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6236bf837bc..1fb51378798 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -330,14 +330,14 @@ jobs: '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' -s echo 'RUSTC_WRAPPER=${{ runner.tool_cache }}/cargo-sccache/bin/sccache' >> $GITHUB_ENV shell: bash - # - name: Build C API headless - # shell: bash - # run: | - # make package-capi-headless - # - name: Build C API - # shell: bash - # run: | - # make build-capi + - name: Build C API headless + shell: bash + run: | + make package-capi-headless + - name: Build C API + shell: bash + run: | + make build-capi - name: Build Wasmer binary with LLVM if: matrix.use_llvm shell: bash From 2c7a9d74d58726ca2a9c9e8e2ecc3fc9216aa0e5 Mon Sep 17 00:00:00 2001 From: "M.Amin Rayej" Date: Thu, 24 Oct 2024 19:22:45 +0330 Subject: [PATCH 13/39] re-enable workflows again --- .github/workflows/build.yml | 622 ++++++++++++++++-------------------- 1 file changed, 276 insertions(+), 346 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1fb51378798..2eb50a6b9bb 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -12,9 +12,6 @@ on: tags: # this is _not_ a regex, see: https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#filter-pattern-cheat-sheet - '[0-9]+.[0-9]+.[0-9]+*' - pull_request: # TODO: MUST BE REMOVED! ONLY FOR TESTING - branches: - - 'main' # Run jobs on PRs targeting the 'main' branch workflow_dispatch: inputs: release: @@ -48,151 +45,150 @@ jobs: include: - build: linux-arm64 os: arm64-ubuntu-latest-8-cores - artifact_name: 'wasmer-linux-arm64' - # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-aarch64.tar.xz' + artifact_name: 'wasmer-linux-aarch64' + cross_compilation_artifact_name: 'cross_compiled_from_linux' + use_sccache: false + use_llvm: true + build_wasm: true + - build: linux-x64 + os: ubuntu-22.04 + artifact_name: 'wasmer-linux-amd64' + llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-amd64.tar.xz' + cross_compilation_artifact_name: 'cross_compiled_from_linux' + use_sccache: false + use_llvm: true + build_wasm: true + - build: linux-x64-v8 + os: ubuntu-22.04 + artifact_name: 'wasmer-v8-linux-amd64' + llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-amd64.tar.xz' + cross_compilation_artifact_name: 'cross_compiled_from_linux' + use_sccache: false + use_llvm: true + build_wasm: true + - build: linux-x64-wamr + os: ubuntu-22.04 + artifact_name: 'wasmer-wamr-linux-amd64' + llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-amd64.tar.xz' + cross_compilation_artifact_name: 'cross_compiled_from_linux' + use_sccache: false + use_llvm: true + build_wasm: true + - build: linux-x64-wasmi + os: ubuntu-22.04 + artifact_name: 'wasmer-wasmi-linux-amd64' + llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-amd64.tar.xz' cross_compilation_artifact_name: 'cross_compiled_from_linux' use_sccache: false use_llvm: true build_wasm: true - # - build: linux-x64 - # os: ubuntu-22.04 - # artifact_name: 'wasmer-linux-amd64' - # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-amd64.tar.xz' - # cross_compilation_artifact_name: 'cross_compiled_from_linux' - # use_sccache: false - # use_llvm: true - # build_wasm: true - # - build: linux-x64-v8 - # os: ubuntu-22.04 - # artifact_name: 'wasmer-v8-linux-amd64' - # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-amd64.tar.xz' - # cross_compilation_artifact_name: 'cross_compiled_from_linux' - # use_sccache: false - # use_llvm: true - # build_wasm: true - # - build: linux-x64-wamr - # os: ubuntu-22.04 - # artifact_name: 'wasmer-wamr-linux-amd64' - # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-amd64.tar.xz' - # cross_compilation_artifact_name: 'cross_compiled_from_linux' - # use_sccache: false - # use_llvm: true - # build_wasm: true - # - build: linux-x64-wasmi - # os: ubuntu-22.04 - # artifact_name: 'wasmer-wasmi-linux-amd64' - # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-amd64.tar.xz' - # cross_compilation_artifact_name: 'cross_compiled_from_linux' - # use_sccache: false - # use_llvm: true - # build_wasm: true - # - build: macos-x64 - # os: macos-13 - # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-amd64.tar.xz' - # artifact_name: 'wasmer-darwin-amd64' - # cross_compilation_artifact_name: 'cross_compiled_from_mac' - # use_sccache: false - # use_llvm: true - # build_wasm: false - # - build: macos-x64-v8 - # os: macos-13 - # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-amd64.tar.xz' - # artifact_name: 'wasmer-v8-darwin-amd64' - # cross_compilation_artifact_name: 'cross_compiled_from_mac' - # use_sccache: false - # use_llvm: true - # build_wasm: false - # - build: macos-x64-wamr - # os: macos-13 - # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-amd64.tar.xz' - # artifact_name: 'wasmer-wamr-darwin-amd64' - # cross_compilation_artifact_name: 'cross_compiled_from_mac' - # use_sccache: false - # use_llvm: true - # build_wasm: false - # - build: macos-x64-wasmi - # os: macos-13 - # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-amd64.tar.xz' - # artifact_name: 'wasmer-wasmi-darwin-amd64' - # cross_compilation_artifact_name: 'cross_compiled_from_mac' - # use_sccache: false - # use_llvm: true - # build_wasm: false - # - build: macos-arm64 - # os: macos-14 - # target: aarch64-apple-darwin - # artifact_name: 'wasmer-darwin-arm64' - # use_sccache: false - # use_llvm: false - # build_wasm: false - # # [todo] xdoardo: Reinstate when the code we generate for aarch64 is working correctly. - # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-aarch64.tar.xz' - # - build: macos-arm64-v8 - # os: macos-14 - # target: aarch64-apple-darwin - # artifact_name: 'wasmer-v8-darwin-arm64' - # use_sccache: false - # use_llvm: false - # build_wasm: false - # # [todo] xdoardo: Reinstate when the code we generate for aarch64 is working correctly. - # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-aarch64.tar.xz' - # - build: macos-arm64-wamr - # os: macos-14 - # target: aarch64-apple-darwin - # artifact_name: 'wasmer-wamr-darwin-arm64' - # use_sccache: false - # use_llvm: false - # build_wasm: false - # # [todo] xdoardo: Reinstate when the code we generate for aarch64 is working correctly. - # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-aarch64.tar.xz' - # - build: macos-arm64-wasmi - # os: macos-14 - # target: aarch64-apple-darwin - # artifact_name: 'wasmer-wasmi-darwin-arm64' - # use_sccache: false - # use_llvm: false - # build_wasm: false - # # [todo] xdoardo: Reinstate when the code we generate for aarch64 is working correctly. - # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-aarch64.tar.xz' - # - build: windows-x64 - # os: windows-2022 - # artifact_name: 'wasmer-windows-amd64' - # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-windows-amd64.tar.xz' - # cross_compilation_artifact_name: 'cross_compiled_from_win' - # use_sccache: false - # use_llvm: true - # build_wasm: false - # - build: windows-x64-v8 - # os: windows-2022 - # artifact_name: 'wasmer-v8-windows-amd64' - # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-windows-amd64.tar.xz' - # cross_compilation_artifact_name: 'cross_compiled_from_win' - # use_sccache: false - # use_llvm: true - # build_wasm: false - # - build: windows-x64-wamr - # os: windows-2022 - # artifact_name: 'wasmer-wamr-windows-amd64' - # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-windows-amd64.tar.xz' - # cross_compilation_artifact_name: 'cross_compiled_from_win' - # use_sccache: false - # use_llvm: true - # build_wasm: false - # - build: windows-x64-wasmi - # os: windows-2022 - # artifact_name: 'wasmer-wasmi-windows-amd64' - # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-windows-amd64.tar.xz' - # cross_compilation_artifact_name: 'cross_compiled_from_win' - # use_sccache: false - # use_llvm: true - # build_wasm: false - # - build: linux-musl-x64 - # os: ubuntu-latest - # artifact_name: 'wasmer-linux-musl-amd64' - # container: alpine:latest - # use_sccache: false - # use_llvm: false - # build_wasm: true + - build: macos-x64 + os: macos-13 + llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-amd64.tar.xz' + artifact_name: 'wasmer-darwin-amd64' + cross_compilation_artifact_name: 'cross_compiled_from_mac' + use_sccache: false + use_llvm: true + build_wasm: false + - build: macos-x64-v8 + os: macos-13 + llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-amd64.tar.xz' + artifact_name: 'wasmer-v8-darwin-amd64' + cross_compilation_artifact_name: 'cross_compiled_from_mac' + use_sccache: false + use_llvm: true + build_wasm: false + - build: macos-x64-wamr + os: macos-13 + llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-amd64.tar.xz' + artifact_name: 'wasmer-wamr-darwin-amd64' + cross_compilation_artifact_name: 'cross_compiled_from_mac' + use_sccache: false + use_llvm: true + build_wasm: false + - build: macos-x64-wasmi + os: macos-13 + llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-amd64.tar.xz' + artifact_name: 'wasmer-wasmi-darwin-amd64' + cross_compilation_artifact_name: 'cross_compiled_from_mac' + use_sccache: false + use_llvm: true + build_wasm: false + - build: macos-arm64 + os: macos-14 + target: aarch64-apple-darwin + artifact_name: 'wasmer-darwin-arm64' + use_sccache: false + use_llvm: false + build_wasm: false + # [todo] xdoardo: Reinstate when the code we generate for aarch64 is working correctly. + llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-aarch64.tar.xz' + - build: macos-arm64-v8 + os: macos-14 + target: aarch64-apple-darwin + artifact_name: 'wasmer-v8-darwin-arm64' + use_sccache: false + use_llvm: false + build_wasm: false + # [todo] xdoardo: Reinstate when the code we generate for aarch64 is working correctly. + llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-aarch64.tar.xz' + - build: macos-arm64-wamr + os: macos-14 + target: aarch64-apple-darwin + artifact_name: 'wasmer-wamr-darwin-arm64' + use_sccache: false + use_llvm: false + build_wasm: false + # [todo] xdoardo: Reinstate when the code we generate for aarch64 is working correctly. + llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-aarch64.tar.xz' + - build: macos-arm64-wasmi + os: macos-14 + target: aarch64-apple-darwin + artifact_name: 'wasmer-wasmi-darwin-arm64' + use_sccache: false + use_llvm: false + build_wasm: false + # [todo] xdoardo: Reinstate when the code we generate for aarch64 is working correctly. + llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-aarch64.tar.xz' + - build: windows-x64 + os: windows-2022 + artifact_name: 'wasmer-windows-amd64' + llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-windows-amd64.tar.xz' + cross_compilation_artifact_name: 'cross_compiled_from_win' + use_sccache: false + use_llvm: true + build_wasm: false + - build: windows-x64-v8 + os: windows-2022 + artifact_name: 'wasmer-v8-windows-amd64' + llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-windows-amd64.tar.xz' + cross_compilation_artifact_name: 'cross_compiled_from_win' + use_sccache: false + use_llvm: true + build_wasm: false + - build: windows-x64-wamr + os: windows-2022 + artifact_name: 'wasmer-wamr-windows-amd64' + llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-windows-amd64.tar.xz' + cross_compilation_artifact_name: 'cross_compiled_from_win' + use_sccache: false + use_llvm: true + build_wasm: false + - build: windows-x64-wasmi + os: windows-2022 + artifact_name: 'wasmer-wasmi-windows-amd64' + llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-windows-amd64.tar.xz' + cross_compilation_artifact_name: 'cross_compiled_from_win' + use_sccache: false + use_llvm: true + build_wasm: false + - build: linux-musl-x64 + os: ubuntu-latest + artifact_name: 'wasmer-linux-musl-amd64' + container: alpine:latest + use_sccache: false + use_llvm: false + build_wasm: true container: ${{ matrix.container }} env: SCCACHE_AZURE_BLOB_CONTAINER: wasmerstoragesccacheblob @@ -408,199 +404,134 @@ jobs: if-no-files-found: error retention-days: 2 - # windows_gnu: - # name: Windows GNU - # runs-on: ubuntu-latest - # steps: - # - uses: actions/checkout@v3 - # - name: Install Windows-GNU linker - # shell: bash - # run: | - # sudo apt install -y mingw-w64 - # - uses: dtolnay/rust-toolchain@stable - # with: - # target: x86_64-pc-windows-gnu - # - name: Install Windows-GNU target - # shell: bash - # run: | - # rustup target add x86_64-pc-windows-gnu - # - name: Install Windows 10 SDK with xwin - # shell: bash - # run: | - # mkdir -p /tmp/xwin - # mkdir -p /tmp/xwindownload - # mkdir -p /tmp/xwincache - # git clone https://github.com/wasmerio/xwin --depth=1 /tmp/xwin - # cargo build --release --manifest-path=/tmp/xwin/Cargo.toml - # /tmp/xwin/target/release/xwin --accept-license --cache-dir /tmp/xwincache splat --output /tmp/xwindownload - # mkdir -p /tmp/winsdk - # cp /tmp/xwindownload/sdk/lib/10.0.20348/um/x86_64/WS2_32.lib /tmp/winsdk/ - # cp /tmp/xwindownload/sdk/lib/10.0.20348/um/x86_64/KERNEL32.lib /tmp/winsdk/ - # cp /tmp/xwindownload/sdk/lib/10.0.20348/um/x86_64/BCRYPT.lib /tmp/winsdk/ - # cp /tmp/xwindownload/sdk/lib/10.0.20348/um/x86_64/ADVAPI32.lib /tmp/winsdk/ - # cp /tmp/xwindownload/sdk/lib/10.0.20348/um/x86_64/USERENV.lib /tmp/winsdk/ - # echo "WinSDK files:" - # ls -laH /tmp/winsdk - # echo "" - # mkdir -p package - # mkdir -p package/winsdk - # cp -r /tmp/winsdk/* package/winsdk - # - name: Build Wasmer C-API without LLVM - # shell: bash - # run: | - # make build-capi - # env: - # RUSTFLAGS: -Cpanic=abort - # CARGO_TARGET: x86_64-pc-windows-gnu - # ENABLE_LLVM: 0 - # - name: Build Wasmer C-API headless without LLVM - # shell: bash - # run: | - # make build-capi-headless - # env: - # RUSTFLAGS: -Cpanic=abort - # CARGO_TARGET: x86_64-pc-windows-gnu - # ENABLE_LLVM: 0 - # - name: Dist - # run: | - # make distribution-gnu - # env: - # CARGO_TARGET: x86_64-pc-windows-gnu - # TARGET_DIR: target/x86_64-pc-windows-gnu/release - # - name: Upload Artifacts - # uses: actions/upload-artifact@v4 - # with: - # name: 'wasmer-windows-gnu64' - # path: dist - # if-no-files-found: error - # retention-days: 2 - - # darwin_aarch64_jsc: - # name: macOS aarch64 (JSC) - # runs-on: macos-12 - # steps: - # - uses: actions/checkout@v3 - # - uses: dtolnay/rust-toolchain@stable - # with: - # target: aarch64-apple-darwin - # - name: Install Darwin-aarch64 target - # shell: bash - # run: | - # rustup target add aarch64-apple-darwin - # - name: Build Wasmer C-API (JSC) - # shell: bash - # run: | - # make build-capi-jsc - # env: - # RUSTFLAGS: -Cpanic=abort - # CARGO_TARGET: aarch64-apple-darwin - # - name: Dist - # run: | - # make distribution - # env: - # CARGO_TARGET: aarch64-apple-darwin - # TARGET_DIR: target/aarch64-apple-darwin/release - # - name: Upload Artifacts - # uses: actions/upload-artifact@v4 - # with: - # name: 'aarch64-apple-darwin-jsc' - # path: dist - # if-no-files-found: error - # retention-days: 2 + windows_gnu: + name: Windows GNU + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Install Windows-GNU linker + shell: bash + run: | + sudo apt install -y mingw-w64 + - uses: dtolnay/rust-toolchain@stable + with: + target: x86_64-pc-windows-gnu + - name: Install Windows-GNU target + shell: bash + run: | + rustup target add x86_64-pc-windows-gnu + - name: Install Windows 10 SDK with xwin + shell: bash + run: | + mkdir -p /tmp/xwin + mkdir -p /tmp/xwindownload + mkdir -p /tmp/xwincache + git clone https://github.com/wasmerio/xwin --depth=1 /tmp/xwin + cargo build --release --manifest-path=/tmp/xwin/Cargo.toml + /tmp/xwin/target/release/xwin --accept-license --cache-dir /tmp/xwincache splat --output /tmp/xwindownload + mkdir -p /tmp/winsdk + cp /tmp/xwindownload/sdk/lib/10.0.20348/um/x86_64/WS2_32.lib /tmp/winsdk/ + cp /tmp/xwindownload/sdk/lib/10.0.20348/um/x86_64/KERNEL32.lib /tmp/winsdk/ + cp /tmp/xwindownload/sdk/lib/10.0.20348/um/x86_64/BCRYPT.lib /tmp/winsdk/ + cp /tmp/xwindownload/sdk/lib/10.0.20348/um/x86_64/ADVAPI32.lib /tmp/winsdk/ + cp /tmp/xwindownload/sdk/lib/10.0.20348/um/x86_64/USERENV.lib /tmp/winsdk/ + echo "WinSDK files:" + ls -laH /tmp/winsdk + echo "" + mkdir -p package + mkdir -p package/winsdk + cp -r /tmp/winsdk/* package/winsdk + - name: Build Wasmer C-API without LLVM + shell: bash + run: | + make build-capi + env: + RUSTFLAGS: -Cpanic=abort + CARGO_TARGET: x86_64-pc-windows-gnu + ENABLE_LLVM: 0 + - name: Build Wasmer C-API headless without LLVM + shell: bash + run: | + make build-capi-headless + env: + RUSTFLAGS: -Cpanic=abort + CARGO_TARGET: x86_64-pc-windows-gnu + ENABLE_LLVM: 0 + - name: Dist + run: | + make distribution-gnu + env: + CARGO_TARGET: x86_64-pc-windows-gnu + TARGET_DIR: target/x86_64-pc-windows-gnu/release + - name: Upload Artifacts + uses: actions/upload-artifact@v4 + with: + name: 'wasmer-windows-gnu64' + path: dist + if-no-files-found: error + retention-days: 2 - # darwin_x86_64_jsc: - # name: macOS x86_64 (JSC) - # runs-on: macos-12 - # steps: - # - uses: actions/checkout@v3 - # - uses: dtolnay/rust-toolchain@stable - # with: - # target: x86_64-apple-darwin - # - name: Build Wasmer C-API (JSC) - # shell: bash - # run: | - # make build-capi-jsc - # env: - # RUSTFLAGS: -Cpanic=abort - # CARGO_TARGET: x86_64-apple-darwin - # - name: Dist - # run: | - # make distribution - # env: - # CARGO_TARGET: x86_64-apple-darwin - # TARGET_DIR: target/x86_64-apple-darwin/release - # - name: Upload Artifacts - # uses: actions/upload-artifact@v4 - # with: - # name: 'x86_64-apple-darwin-jsc' - # path: dist - # if-no-files-found: error - # retention-days: 2 + darwin_aarch64_jsc: + name: macOS aarch64 (JSC) + runs-on: macos-12 + steps: + - uses: actions/checkout@v3 + - uses: dtolnay/rust-toolchain@stable + with: + target: aarch64-apple-darwin + - name: Install Darwin-aarch64 target + shell: bash + run: | + rustup target add aarch64-apple-darwin + - name: Build Wasmer C-API (JSC) + shell: bash + run: | + make build-capi-jsc + env: + RUSTFLAGS: -Cpanic=abort + CARGO_TARGET: aarch64-apple-darwin + - name: Dist + run: | + make distribution + env: + CARGO_TARGET: aarch64-apple-darwin + TARGET_DIR: target/aarch64-apple-darwin/release + - name: Upload Artifacts + uses: actions/upload-artifact@v4 + with: + name: 'aarch64-apple-darwin-jsc' + path: dist + if-no-files-found: error + retention-days: 2 - # linux_aarch64: - # name: Linux aarch64 - # runs-on: ubuntu-latest - # steps: - # - uses: actions/checkout@v3 - # - uses: dtolnay/rust-toolchain@stable - # with: - # target: aarch64-unknown-linux-gnu - # - name: Build cross image - # run: | - # docker build -t wasmer/aarch64 ${GITHUB_WORKSPACE}/.github/cross-linux-aarch64/ - # env: - # CROSS_DOCKER_IN_DOCKER: true - # - name: Build Wasmer binary - # run: | - # make build-wasmer - # env: - # CARGO_BINARY: docker run -v /var/run/docker.sock:/var/run/docker.sock -v ${GITHUB_WORKSPACE}:/project -w /project wasmer/aarch64 cross - # CROSS_DOCKER_IN_DOCKER: true - # CARGO_TARGET: aarch64-unknown-linux-gnu - # PKG_CONFIG_PATH: /usr/lib/aarch64-linux-gnu/pkgconfig - # PKG_CONFIG_ALLOW_CROSS: true - # ENABLE_LLVM: 0 - # - name: Build C API headless - # shell: bash - # run: | - # make package-capi-headless - # env: - # CARGO_BINARY: docker run -v /var/run/docker.sock:/var/run/docker.sock -v ${GITHUB_WORKSPACE}:/project -w /project wasmer/aarch64 cross - # CROSS_DOCKER_IN_DOCKER: true - # CARGO_TARGET: aarch64-unknown-linux-gnu - # PKG_CONFIG_PATH: /usr/lib/aarch64-linux-gnu/pkgconfig - # PKG_CONFIG_ALLOW_CROSS: true - # ENABLE_LLVM: 0 - # TARGET: aarch64-unknown-linux-gnu - # TARGET_DIR: target/aarch64-unknown-linux-gnu/release - # - name: Build C API - # run: | - # make build-capi - # env: - # CARGO_BINARY: docker run -v /var/run/docker.sock:/var/run/docker.sock -v ${GITHUB_WORKSPACE}:/project -w /project wasmer/aarch64 cross - # CROSS_DOCKER_IN_DOCKER: true - # CARGO_TARGET: aarch64-unknown-linux-gnu - # PKG_CONFIG_PATH: /usr/lib/aarch64-linux-gnu/pkgconfig - # PKG_CONFIG_ALLOW_CROSS: true - # ENABLE_LLVM: 0 - # - name: Dist - # run: | - # make distribution - # env: - # CARGO_BINARY: docker run -v /var/run/docker.sock:/var/run/docker.sock -v ${GITHUB_WORKSPACE}:/project -w /project wasmer/aarch64 cross - # CROSS_DOCKER_IN_DOCKER: true - # CARGO_TARGET: aarch64-unknown-linux-gnu - # PKG_CONFIG_PATH: /usr/lib/aarch64-linux-gnu/pkgconfig - # PKG_CONFIG_ALLOW_CROSS: true - # TARGET: aarch64-unknown-linux-gnu - # TARGET_DIR: target/aarch64-unknown-linux-gnu/release - # - name: Upload Artifacts - # uses: actions/upload-artifact@v4 - # with: - # name: wasmer-linux-aarch64 - # path: dist - # if-no-files-found: error - # retention-days: 2 + darwin_x86_64_jsc: + name: macOS x86_64 (JSC) + runs-on: macos-12 + steps: + - uses: actions/checkout@v3 + - uses: dtolnay/rust-toolchain@stable + with: + target: x86_64-apple-darwin + - name: Build Wasmer C-API (JSC) + shell: bash + run: | + make build-capi-jsc + env: + RUSTFLAGS: -Cpanic=abort + CARGO_TARGET: x86_64-apple-darwin + - name: Dist + run: | + make distribution + env: + CARGO_TARGET: x86_64-apple-darwin + TARGET_DIR: target/x86_64-apple-darwin/release + - name: Upload Artifacts + uses: actions/upload-artifact@v4 + with: + name: 'x86_64-apple-darwin-jsc' + path: dist + if-no-files-found: error + retention-days: 2 # linux_riscv64: # name: Linux riscv64 @@ -669,8 +600,7 @@ jobs: release: # needs: [setup, build, linux_aarch64, windows_gnu, linux_riscv64] - # needs: [setup, build, windows_gnu] - needs: [setup, build] + needs: [setup, build, windows_gnu] runs-on: ubuntu-latest if: needs.setup.outputs.DOING_RELEASE == '1' || github.event.inputs.release != '' steps: @@ -769,15 +699,15 @@ jobs: asset_path: artifacts/wasmer-wasmi-linux-amd64/wasmer.tar.gz asset_name: wasmer-wasmi-linux-amd64.tar.gz asset_content_type: application/gzip - # - name: Upload Release Asset Linux aarch64 - # uses: actions/upload-release-asset@v1 - # env: - # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # with: - # upload_url: ${{ steps.create_release.outputs.upload_url }} - # asset_path: artifacts/wasmer-linux-aarch64/wasmer.tar.gz - # asset_name: wasmer-linux-aarch64.tar.gz - # asset_content_type: application/gzip + - name: Upload Release Asset Linux aarch64 + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: artifacts/wasmer-linux-aarch64/wasmer.tar.gz + asset_name: wasmer-linux-aarch64.tar.gz + asset_content_type: application/gzip # - name: Upload Release Asset Linux riscv64 # uses: actions/upload-release-asset@v1 # env: From be707f31b662cb3bda4b19aa91c720aeb723d948 Mon Sep 17 00:00:00 2001 From: "M.Amin Rayej" Date: Thu, 24 Oct 2024 19:24:44 +0330 Subject: [PATCH 14/39] re-enable other workflows --- .github/workflows/test.yaml | 2176 +++++++++++++------------- .github/workflows/wasmer-config.yaml | 98 +- 2 files changed, 1137 insertions(+), 1137 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 8735dc95b7a..112367d6beb 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -1,1135 +1,1135 @@ -# name: test-sys +name: test-sys -# on: -# push: -# branches: -# - main -# - 'with-ci-.*' -# - 'v3.0.x' -# - 'v3.1.x' -# pull_request: -# workflow_dispatch: -# inputs: -# release: -# description: 'Make release' +on: + push: + branches: + - main + - 'with-ci-.*' + - 'v3.0.x' + - 'v3.1.x' + pull_request: + workflow_dispatch: + inputs: + release: + description: 'Make release' -# # Automatically cancel previous workflow runs when a new commit is pushed. -# concurrency: -# group: ${{ github.workflow }}-${{ github.ref }} -# cancel-in-progress: true +# Automatically cancel previous workflow runs when a new commit is pushed. +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true -# env: -# RUST_BACKTRACE: 1 -# # Sparse will be enabled by dtolnay/rust-toolchain when installing nightly -# # Rust, but it's not stable on 1.69 yet. By explicitly setting the protocol we -# # can override that behaviour -# CARGO_REGISTRIES_CRATES_IO_PROTOCOL: git -# MSRV: "1.81" -# NEXTEST_PROFILE: "ci" -# RUSTUP_WINDOWS_PATH_ADD_BIN: 1 -# WASI_SDK_VERSION: "22" +env: + RUST_BACKTRACE: 1 + # Sparse will be enabled by dtolnay/rust-toolchain when installing nightly + # Rust, but it's not stable on 1.69 yet. By explicitly setting the protocol we + # can override that behaviour + CARGO_REGISTRIES_CRATES_IO_PROTOCOL: git + MSRV: "1.81" + NEXTEST_PROFILE: "ci" + RUSTUP_WINDOWS_PATH_ADD_BIN: 1 + WASI_SDK_VERSION: "22" -# jobs: -# setup: -# name: Set up -# runs-on: ubuntu-22.04 -# outputs: -# VERSION: ${{ steps.setup.outputs.VERSION }} -# DOING_RELEASE: ${{ steps.setup.outputs.DOING_RELEASE }} -# steps: -# - name: Set up env vars -# id: setup -# shell: bash -# run: | -# VERSION=${GITHUB_REF/refs\/tags\//} -# echo "VERSION=${VERSION}" >> $GITHUB_OUTPUT -# DOING_RELEASE=$(echo $VERSION | grep -c '^[0-9]\+\.[0-9]\+\.[0-9]\+\(-\([a-zA-Z]\+\)\?[0-9]*\)\?$' || true) -# echo "DOING_RELEASE=${DOING_RELEASE}" >> $GITHUB_OUTPUT -# echo $VERSION -# echo $DOING_RELEASE +jobs: + setup: + name: Set up + runs-on: ubuntu-22.04 + outputs: + VERSION: ${{ steps.setup.outputs.VERSION }} + DOING_RELEASE: ${{ steps.setup.outputs.DOING_RELEASE }} + steps: + - name: Set up env vars + id: setup + shell: bash + run: | + VERSION=${GITHUB_REF/refs\/tags\//} + echo "VERSION=${VERSION}" >> $GITHUB_OUTPUT + DOING_RELEASE=$(echo $VERSION | grep -c '^[0-9]\+\.[0-9]\+\.[0-9]\+\(-\([a-zA-Z]\+\)\?[0-9]*\)\?$' || true) + echo "DOING_RELEASE=${DOING_RELEASE}" >> $GITHUB_OUTPUT + echo $VERSION + echo $DOING_RELEASE -# lint: -# name: Code lint -# runs-on: ubuntu-22.04 -# steps: -# - uses: actions/checkout@v3 -# - name: Install Rust -# uses: dtolnay/rust-toolchain@stable -# with: -# toolchain: ${{ env.MSRV }} -# components: rustfmt, clippy -# - name: Install libtinfo -# shell: bash -# run: | -# sudo apt install -y libtinfo5 -# - name: Install LLVM (Linux) -# run: | -# curl --proto '=https' --tlsv1.2 -sSf https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-amd64.tar.xz -L -o /opt/llvm.tar.xz -# mkdir -p /opt/llvm-18 -# tar xf /opt/llvm.tar.xz --strip-components=1 -C /opt/llvm-18 -# echo '/opt/llvm-18/bin' >> $GITHUB_PATH -# echo 'LLVM_SYS_180_PREFIX=/opt/llvm-18' >> $GITHUB_ENV -# - name: Cache -# uses: whywaita/actions-cache-s3@v2 -# with: -# path: | -# ~/.cargo/* -# ./target/* -# key: r22-${{ github.repository }}-${{ runner.os }}-${{ hashFiles('Cargo.lock') }}-wasmer-make-lint-linux-x64 -# aws-s3-bucket: wasmer-rust-artifacts-cache -# aws-access-key-id: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_TOKEN }} -# aws-secret-access-key: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_KEY }} -# aws-region: auto -# aws-endpoint: https://1541b1e8a3fc6ad155ce67ef38899700.r2.cloudflarestorage.com -# aws-s3-bucket-endpoint: false -# aws-s3-force-path-style: true -# - run: make lint -# env: -# ENABLE_CRANELIFT: "1" -# ENABLE_LLVM: "1" -# ENABLE_SINGLEPASS: "1" -# - name: Assert no files have changed -# run: | -# git status -# ! [[ $(git status -s) ]] + lint: + name: Code lint + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v3 + - name: Install Rust + uses: dtolnay/rust-toolchain@stable + with: + toolchain: ${{ env.MSRV }} + components: rustfmt, clippy + - name: Install libtinfo + shell: bash + run: | + sudo apt install -y libtinfo5 + - name: Install LLVM (Linux) + run: | + curl --proto '=https' --tlsv1.2 -sSf https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-amd64.tar.xz -L -o /opt/llvm.tar.xz + mkdir -p /opt/llvm-18 + tar xf /opt/llvm.tar.xz --strip-components=1 -C /opt/llvm-18 + echo '/opt/llvm-18/bin' >> $GITHUB_PATH + echo 'LLVM_SYS_180_PREFIX=/opt/llvm-18' >> $GITHUB_ENV + - name: Cache + uses: whywaita/actions-cache-s3@v2 + with: + path: | + ~/.cargo/* + ./target/* + key: r22-${{ github.repository }}-${{ runner.os }}-${{ hashFiles('Cargo.lock') }}-wasmer-make-lint-linux-x64 + aws-s3-bucket: wasmer-rust-artifacts-cache + aws-access-key-id: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_TOKEN }} + aws-secret-access-key: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_KEY }} + aws-region: auto + aws-endpoint: https://1541b1e8a3fc6ad155ce67ef38899700.r2.cloudflarestorage.com + aws-s3-bucket-endpoint: false + aws-s3-force-path-style: true + - run: make lint + env: + ENABLE_CRANELIFT: "1" + ENABLE_LLVM: "1" + ENABLE_SINGLEPASS: "1" + - name: Assert no files have changed + run: | + git status + ! [[ $(git status -s) ]] -# cargo_deny: -# name: cargo-deny -# runs-on: ubuntu-22.04 -# steps: -# - uses: actions/checkout@v3 -# - uses: EmbarkStudios/cargo-deny-action@v1 -# with: -# log-level: error + cargo_deny: + name: cargo-deny + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v3 + - uses: EmbarkStudios/cargo-deny-action@v1 + with: + log-level: error -# test_nodejs: -# name: Test on NodeJS -# runs-on: ubuntu-22.04 -# steps: -# - uses: actions/checkout@v3 -# - name: Install Rust -# uses: dtolnay/rust-toolchain@stable -# with: -# toolchain: ${{ env.MSRV }} -# - name: Install NodeJS -# uses: actions/setup-node@v2 -# with: -# node-version: 16 -# - name: Install wasm-pack -# run: | -# curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh -# - name: make test-js -# run: | -# make test-js + test_nodejs: + name: Test on NodeJS + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v3 + - name: Install Rust + uses: dtolnay/rust-toolchain@stable + with: + toolchain: ${{ env.MSRV }} + - name: Install NodeJS + uses: actions/setup-node@v2 + with: + node-version: 16 + - name: Install wasm-pack + run: | + curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh + - name: make test-js + run: | + make test-js -# test_wasi_fyi: -# name: Test wasi-fyi -# runs-on: ubuntu-22.04 -# steps: -# - uses: actions/checkout@v3 -# - name: Install Rust -# uses: dtolnay/rust-toolchain@stable -# with: -# toolchain: nightly -# targets: "wasm32-wasi" -# - name: Install wasm-pack -# run: | -# curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh -# - name: Install LLVM 18 -# run: | -# curl --proto '=https' --tlsv1.2 -sSf https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-amd64.tar.xz -L -o llvm.tar.xz -# LLVM_DIR=$(pwd)/${{ env.LLVM_DIR }} -# mkdir ${LLVM_DIR} -# tar xf llvm.tar.xz --strip-components=1 -C ${LLVM_DIR} -# echo "ENABLE_LLVM=1" >> $GITHUB_ENV -# echo "${LLVM_DIR}/bin" >> $GITHUB_PATH -# echo "${LLVM_DIR}/usr/bin" >> $GITHUB_PATH -# echo "LLVM_SYS_180_PREFIX=${LLVM_DIR}" >> $GITHUB_ENV -# env: -# LLVM_DIR: .llvm -# - name: make test-wasi-fyi -# run: | -# make test-wasi-fyi + test_wasi_fyi: + name: Test wasi-fyi + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v3 + - name: Install Rust + uses: dtolnay/rust-toolchain@stable + with: + toolchain: nightly + targets: "wasm32-wasi" + - name: Install wasm-pack + run: | + curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh + - name: Install LLVM 18 + run: | + curl --proto '=https' --tlsv1.2 -sSf https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-amd64.tar.xz -L -o llvm.tar.xz + LLVM_DIR=$(pwd)/${{ env.LLVM_DIR }} + mkdir ${LLVM_DIR} + tar xf llvm.tar.xz --strip-components=1 -C ${LLVM_DIR} + echo "ENABLE_LLVM=1" >> $GITHUB_ENV + echo "${LLVM_DIR}/bin" >> $GITHUB_PATH + echo "${LLVM_DIR}/usr/bin" >> $GITHUB_PATH + echo "LLVM_SYS_180_PREFIX=${LLVM_DIR}" >> $GITHUB_ENV + env: + LLVM_DIR: .llvm + - name: make test-wasi-fyi + run: | + make test-wasi-fyi -# # The no_std functionality doesn't work at the moment - no point in testing it. -# # - name: make test-js-core -# # run: | -# # make test-js-core + # The no_std functionality doesn't work at the moment - no point in testing it. + # - name: make test-js-core + # run: | + # make test-js-core -# test_wasix: -# name: Test WASIX -# runs-on: ubuntu-22.04 -# steps: -# - uses: actions/checkout@v3 -# - name: Install Rust -# uses: dtolnay/rust-toolchain@stable -# with: -# toolchain: ${{ env.MSRV }} -# - name: Install Tools -# run: | -# sudo apt-get update -# sudo apt-get install -y git llvm clang make lld curl -# - name: Build wasix sysroot -# run: | -# cd ~ -# git clone --recurse-submodules https://github.com/wasix-org/wasix-libc -# cd wasix-libc -# ./build32.sh -# rm -rf /opt/wasix-sysroot -# cp -r sysroot32 ~/wasix-sysroot -# - name: Install wasi-sdk Tools -# run: | -# cd ~ -# curl -L "https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-${{ env.WASI_SDK_VERSION }}/wasi-sdk-${{ env.WASI_SDK_VERSION }}.0-linux.tar.gz" -o wasi-sdk.tar.gz -# tar -xzf wasi-sdk.tar.gz -# cp -r wasi-sdk-${{ env.WASI_SDK_VERSION }}.0 ~/wasi-sdk -# - name: Install LLVM 18 -# run: | -# curl --proto '=https' --tlsv1.2 -sSf https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-amd64.tar.xz -L -o llvm.tar.xz -# LLVM_DIR=$(pwd)/${{ env.LLVM_DIR }} -# mkdir ${LLVM_DIR} -# tar xf llvm.tar.xz --strip-components=1 -C ${LLVM_DIR} -# echo "ENABLE_LLVM=1" >> $GITHUB_ENV -# echo "${LLVM_DIR}/bin" >> $GITHUB_PATH -# echo "${LLVM_DIR}/usr/bin" >> $GITHUB_PATH -# echo "LLVM_SYS_180_PREFIX=${LLVM_DIR}" >> $GITHUB_ENV -# env: -# LLVM_DIR: .llvm -# - name: Install wasm-opt -# run: | -# sudo apt-get install -y binaryen -# - name: make test-wasix -# run: | -# WASI_SDK=~/wasi-sdk WASIX_SYSROOT=~/wasix-sysroot make test-wasix + test_wasix: + name: Test WASIX + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v3 + - name: Install Rust + uses: dtolnay/rust-toolchain@stable + with: + toolchain: ${{ env.MSRV }} + - name: Install Tools + run: | + sudo apt-get update + sudo apt-get install -y git llvm clang make lld curl + - name: Build wasix sysroot + run: | + cd ~ + git clone --recurse-submodules https://github.com/wasix-org/wasix-libc + cd wasix-libc + ./build32.sh + rm -rf /opt/wasix-sysroot + cp -r sysroot32 ~/wasix-sysroot + - name: Install wasi-sdk Tools + run: | + cd ~ + curl -L "https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-${{ env.WASI_SDK_VERSION }}/wasi-sdk-${{ env.WASI_SDK_VERSION }}.0-linux.tar.gz" -o wasi-sdk.tar.gz + tar -xzf wasi-sdk.tar.gz + cp -r wasi-sdk-${{ env.WASI_SDK_VERSION }}.0 ~/wasi-sdk + - name: Install LLVM 18 + run: | + curl --proto '=https' --tlsv1.2 -sSf https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-amd64.tar.xz -L -o llvm.tar.xz + LLVM_DIR=$(pwd)/${{ env.LLVM_DIR }} + mkdir ${LLVM_DIR} + tar xf llvm.tar.xz --strip-components=1 -C ${LLVM_DIR} + echo "ENABLE_LLVM=1" >> $GITHUB_ENV + echo "${LLVM_DIR}/bin" >> $GITHUB_PATH + echo "${LLVM_DIR}/usr/bin" >> $GITHUB_PATH + echo "LLVM_SYS_180_PREFIX=${LLVM_DIR}" >> $GITHUB_ENV + env: + LLVM_DIR: .llvm + - name: Install wasm-opt + run: | + sudo apt-get install -y binaryen + - name: make test-wasix + run: | + WASI_SDK=~/wasi-sdk WASIX_SYSROOT=~/wasix-sysroot make test-wasix -# test_wasm_build: -# name: Test wasm build -# runs-on: ubuntu-22.04 -# steps: -# - uses: actions/checkout@v3 -# - name: rustup target add wasm32-wasi -# run: rustup target add wasm32-wasi -# - name: make build-wasmer-wasm -# run: make build-wasmer-wasm + test_wasm_build: + name: Test wasm build + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v3 + - name: rustup target add wasm32-wasi + run: rustup target add wasm32-wasi + - name: make build-wasmer-wasm + run: make build-wasmer-wasm -# test_build_jsc: -# name: Test JSC build -# runs-on: ubuntu-22.04 -# steps: -# - uses: actions/checkout@v3 -# - uses: dtolnay/rust-toolchain@stable -# with: -# toolchain: ${{ env.MSRV }} -# target: x86_64-unknown-linux-gnu -# - name: Install NodeJS -# uses: actions/setup-node@v2 -# with: -# node-version: 16 -# - name: Install libjavascriptcoregtk-4.0-dev -# run: sudo apt update && sudo apt install -y libjavascriptcoregtk-4.0-dev -# - name: make build-wasmer-jsc -# run: make build-wasmer-jsc + test_build_jsc: + name: Test JSC build + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v3 + - uses: dtolnay/rust-toolchain@stable + with: + toolchain: ${{ env.MSRV }} + target: x86_64-unknown-linux-gnu + - name: Install NodeJS + uses: actions/setup-node@v2 + with: + node-version: 16 + - name: Install libjavascriptcoregtk-4.0-dev + run: sudo apt update && sudo apt install -y libjavascriptcoregtk-4.0-dev + - name: make build-wasmer-jsc + run: make build-wasmer-jsc -# test_interpreter_api: -# name: ${{ matrix.build-what.name }} on ${{ matrix.metadata.build }} -# runs-on: ${{ matrix.metadata.os }} -# strategy: -# fail-fast: false -# matrix: -# build-what: [ -# { -# key: wamr, -# build-cmd: 'make test-wamr-api', -# name: 'Test API for wamr feature' -# }, -# { -# key: wasmi, -# build-cmd: 'make test-wasmi-api', -# name: 'Test API for wasmi feature' -# }, -# { -# key: v8, -# build-cmd: 'make test-v8-api', -# name: 'Test API for v8 feature' -# } + test_interpreter_api: + name: ${{ matrix.build-what.name }} on ${{ matrix.metadata.build }} + runs-on: ${{ matrix.metadata.os }} + strategy: + fail-fast: false + matrix: + build-what: [ + { + key: wamr, + build-cmd: 'make test-wamr-api', + name: 'Test API for wamr feature' + }, + { + key: wasmi, + build-cmd: 'make test-wasmi-api', + name: 'Test API for wasmi feature' + }, + { + key: v8, + build-cmd: 'make test-v8-api', + name: 'Test API for v8 feature' + } -# ] -# metadata: [ -# { -# build: linux-x64, -# os: ubuntu-22.04, -# }, -# { -# build: macos-arm, -# os: macos-14, -# }, -# { -# build: windows-x64, -# os: windows-2022, -# } -# ] -# container: ${{ matrix.metadata.container }} -# steps: -# - uses: actions/checkout@v3 + ] + metadata: [ + { + build: linux-x64, + os: ubuntu-22.04, + }, + { + build: macos-arm, + os: macos-14, + }, + { + build: windows-x64, + os: windows-2022, + } + ] + container: ${{ matrix.metadata.container }} + steps: + - uses: actions/checkout@v3 -# - name: Setup MSVC (Windows) -# uses: ilammy/msvc-dev-cmd@v1 -# if: matrix.metadata.build == 'windows-x64' + - name: Setup MSVC (Windows) + uses: ilammy/msvc-dev-cmd@v1 + if: matrix.metadata.build == 'windows-x64' -# - uses: dtolnay/rust-toolchain@stable -# with: -# toolchain: ${{ env.MSRV }} + - uses: dtolnay/rust-toolchain@stable + with: + toolchain: ${{ env.MSRV }} -# - name: Install Nextest -# uses: taiki-e/install-action@nextest + - name: Install Nextest + uses: taiki-e/install-action@nextest -# - name: Install `ninja`, clang` and `mold` on Ubuntu -# if: startsWith(matrix.metadata.build, 'linux-') -# shell: bash -# run: | -# sudo apt-get update -y && sudo apt-get install ninja-build clang mold -y + - name: Install `ninja`, clang` and `mold` on Ubuntu + if: startsWith(matrix.metadata.build, 'linux-') + shell: bash + run: | + sudo apt-get update -y && sudo apt-get install ninja-build clang mold -y -# - name: Install `ninja` on macOS -# if: startsWith(matrix.metadata.build, 'macos-') -# shell: bash -# run: | -# brew install ninja + - name: Install `ninja` on macOS + if: startsWith(matrix.metadata.build, 'macos-') + shell: bash + run: | + brew install ninja -# - name: Install `ninja` on Windows -# if: startsWith(matrix.metadata.build, 'windows-') -# shell: bash -# run: | -# choco install ninja + - name: Install `ninja` on Windows + if: startsWith(matrix.metadata.build, 'windows-') + shell: bash + run: | + choco install ninja -# - name: Delete unwanted link to stop it from interfering (Windows) -# shell: bash -# run: rm /usr/bin/link.exe -# if: startsWith(matrix.metadata.build, 'windows-') + - name: Delete unwanted link to stop it from interfering (Windows) + shell: bash + run: rm /usr/bin/link.exe + if: startsWith(matrix.metadata.build, 'windows-') -# - name: Test WAMR API -# if: ${{ matrix.build-what.key == 'wamr' }} -# run: ${{ matrix.build-what.build-cmd }} + - name: Test WAMR API + if: ${{ matrix.build-what.key == 'wamr' }} + run: ${{ matrix.build-what.build-cmd }} -# - name: Test wasmi API -# if: ${{ matrix.build-what.key == 'wasmi' }} -# run: ${{ matrix.build-what.build-cmd }} + - name: Test wasmi API + if: ${{ matrix.build-what.key == 'wasmi' }} + run: ${{ matrix.build-what.build-cmd }} -# - name: Test v8 API (Linux + mold) -# if: ${{ matrix.build-what.key == 'v8' && startsWith(matrix.metadata.build, 'linux-')}} -# run: RUSTFLAGS="-C linker=clang -C link-arg=-fuse-ld=mold" CARGO_TERM_VERBOSE=true cargo nextest run --package=wasmer --release --features=v8 --no-default-features + - name: Test v8 API (Linux + mold) + if: ${{ matrix.build-what.key == 'v8' && startsWith(matrix.metadata.build, 'linux-')}} + run: RUSTFLAGS="-C linker=clang -C link-arg=-fuse-ld=mold" CARGO_TERM_VERBOSE=true cargo nextest run --package=wasmer --release --features=v8 --no-default-features -# - name: Test v8 API -# if: ${{ matrix.build-what.key == 'v8' && !startsWith(matrix.metadata.build, 'linux-')}} -# run: ${{ matrix.build-what.build-cmd }} + - name: Test v8 API + if: ${{ matrix.build-what.key == 'v8' && !startsWith(matrix.metadata.build, 'linux-')}} + run: ${{ matrix.build-what.build-cmd }} -# test_build_docs_rs: -# name: Test build docs rs -# runs-on: ubuntu-22.04 -# steps: -# - uses: actions/checkout@v3 -# - uses: dtolnay/rust-toolchain@master -# with: -# toolchain: "nightly-2024-08-21" -# target: x86_64-unknown-linux-gnu -# - run: cargo install toml-cli # toml-cli is required to run `make test-build-docs-rs` + test_build_docs_rs: + name: Test build docs rs + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v3 + - uses: dtolnay/rust-toolchain@master + with: + toolchain: "nightly-2024-08-21" + target: x86_64-unknown-linux-gnu + - run: cargo install toml-cli # toml-cli is required to run `make test-build-docs-rs` -# - name: Install `ninja` on Ubuntu -# shell: bash -# run: | -# sudo apt-get install ninja-build -y + - name: Install `ninja` on Ubuntu + shell: bash + run: | + sudo apt-get install ninja-build -y -# - name: Install LLVM 18 -# run: | -# curl --proto '=https' --tlsv1.2 -sSf https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-amd64.tar.xz -L -o llvm.tar.xz -# LLVM_DIR=$(pwd)/${{ env.LLVM_DIR }} -# mkdir ${LLVM_DIR} -# tar xf llvm.tar.xz --strip-components=1 -C ${LLVM_DIR} -# echo "ENABLE_LLVM=1" >> $GITHUB_ENV -# echo "${LLVM_DIR}/bin" >> $GITHUB_PATH -# echo "${LLVM_DIR}/usr/bin" >> $GITHUB_PATH -# echo "LLVM_SYS_180_PREFIX=${LLVM_DIR}" >> $GITHUB_ENV -# env: -# LLVM_DIR: .llvm -# - name: make test-build-docs-rs-ci -# run: make test-build-docs-rs-ci + - name: Install LLVM 18 + run: | + curl --proto '=https' --tlsv1.2 -sSf https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-amd64.tar.xz -L -o llvm.tar.xz + LLVM_DIR=$(pwd)/${{ env.LLVM_DIR }} + mkdir ${LLVM_DIR} + tar xf llvm.tar.xz --strip-components=1 -C ${LLVM_DIR} + echo "ENABLE_LLVM=1" >> $GITHUB_ENV + echo "${LLVM_DIR}/bin" >> $GITHUB_PATH + echo "${LLVM_DIR}/usr/bin" >> $GITHUB_PATH + echo "LLVM_SYS_180_PREFIX=${LLVM_DIR}" >> $GITHUB_ENV + env: + LLVM_DIR: .llvm + - name: make test-build-docs-rs-ci + run: make test-build-docs-rs-ci -# build_linux_aarch64: -# name: ${{ matrix.build-what.name }} on linux-aarch64 -# runs-on: ubuntu-22.04 -# strategy: -# fail-fast: false -# matrix: -# build-what: [ -# { -# key: capi, -# build-cmd: 'make build-capi && make package-capi', -# name: 'Build C-API' -# }, -# { -# key: wasmer, -# build-cmd: 'make build-wasmer && make package-wasmer && make tar-wasmer', -# name: 'Build wasmer-cli' -# } -# ] -# steps: -# - uses: actions/checkout@v3 -# - uses: dtolnay/rust-toolchain@stable -# with: -# toolchain: ${{ env.MSRV }} -# target: aarch64-unknown-linux-gnu -# - name: Build cross image -# run: | -# docker build -t wasmer/aarch64 ${GITHUB_WORKSPACE}/.github/cross-linux-aarch64/ -# env: -# CROSS_DOCKER_IN_DOCKER: true -# - name: Build ${{ matrix.build-what.key }} -# run: | -# ${{ matrix.build-what.build-cmd }} -# env: -# CARGO_BINARY: docker run -v /var/run/docker.sock:/var/run/docker.sock -v ${GITHUB_WORKSPACE}:/project -w /project wasmer/aarch64 cross -# CROSS_DOCKER_IN_DOCKER: true -# CARGO_TARGET: aarch64-unknown-linux-gnu -# PKG_CONFIG_PATH: /usr/lib/aarch64-linux-gnu/pkgconfig -# PKG_CONFIG_ALLOW_CROSS: true -# ENABLE_LLVM: 0 -# - name: Dist -# if: ${{ matrix.build-what.key == 'capi' }} -# run: | -# make distribution -# env: -# CARGO_BINARY: docker run -v /var/run/docker.sock:/var/run/docker.sock -v ${GITHUB_WORKSPACE}:/project -w /project wasmer/aarch64 cross -# CROSS_DOCKER_IN_DOCKER: true -# CARGO_TARGET: aarch64-unknown-linux-gnu -# PKG_CONFIG_PATH: /usr/lib/aarch64-linux-gnu/pkgconfig -# PKG_CONFIG_ALLOW_CROSS: true -# TARGET: aarch64-unknown-linux-gnu -# TARGET_DIR: target/aarch64-unknown-linux-gnu/release -# - name: Upload Artifacts -# if: ${{ matrix.build-what.key == 'capi' }} -# uses: actions/upload-artifact@v4 -# with: -# name: capi-linux-aarch64 -# path: dist -# if-no-files-found: error -# retention-days: 2 + build_linux_aarch64: + name: ${{ matrix.build-what.name }} on linux-aarch64 + runs-on: ubuntu-22.04 + strategy: + fail-fast: false + matrix: + build-what: [ + { + key: capi, + build-cmd: 'make build-capi && make package-capi', + name: 'Build C-API' + }, + { + key: wasmer, + build-cmd: 'make build-wasmer && make package-wasmer && make tar-wasmer', + name: 'Build wasmer-cli' + } + ] + steps: + - uses: actions/checkout@v3 + - uses: dtolnay/rust-toolchain@stable + with: + toolchain: ${{ env.MSRV }} + target: aarch64-unknown-linux-gnu + - name: Build cross image + run: | + docker build -t wasmer/aarch64 ${GITHUB_WORKSPACE}/.github/cross-linux-aarch64/ + env: + CROSS_DOCKER_IN_DOCKER: true + - name: Build ${{ matrix.build-what.key }} + run: | + ${{ matrix.build-what.build-cmd }} + env: + CARGO_BINARY: docker run -v /var/run/docker.sock:/var/run/docker.sock -v ${GITHUB_WORKSPACE}:/project -w /project wasmer/aarch64 cross + CROSS_DOCKER_IN_DOCKER: true + CARGO_TARGET: aarch64-unknown-linux-gnu + PKG_CONFIG_PATH: /usr/lib/aarch64-linux-gnu/pkgconfig + PKG_CONFIG_ALLOW_CROSS: true + ENABLE_LLVM: 0 + - name: Dist + if: ${{ matrix.build-what.key == 'capi' }} + run: | + make distribution + env: + CARGO_BINARY: docker run -v /var/run/docker.sock:/var/run/docker.sock -v ${GITHUB_WORKSPACE}:/project -w /project wasmer/aarch64 cross + CROSS_DOCKER_IN_DOCKER: true + CARGO_TARGET: aarch64-unknown-linux-gnu + PKG_CONFIG_PATH: /usr/lib/aarch64-linux-gnu/pkgconfig + PKG_CONFIG_ALLOW_CROSS: true + TARGET: aarch64-unknown-linux-gnu + TARGET_DIR: target/aarch64-unknown-linux-gnu/release + - name: Upload Artifacts + if: ${{ matrix.build-what.key == 'capi' }} + uses: actions/upload-artifact@v4 + with: + name: capi-linux-aarch64 + path: dist + if-no-files-found: error + retention-days: 2 -# build_linux_riscv64: -# name: ${{ matrix.build-what.name }} on linux-riscv64 -# runs-on: ubuntu-22.04 -# strategy: -# fail-fast: false -# matrix: -# build-what: [ -# { -# key: capi, -# build-cmd: 'make build-capi && make package-capi', -# name: 'Build C-API' -# }, -# { -# key: wasmer, -# build-cmd: 'make build-wasmer && make package-wasmer && make tar-wasmer', -# name: 'Build wasmer-cli' -# } -# ] -# steps: -# - uses: actions/checkout@v3 -# #- uses: dtolnay/rust-toolchain@stable -# # with: -# # toolchain: ${{ env.MSRV }} -# # target: riscv64gc-unknown-linux-gnu -# - name: Build cross image -# run: | -# docker build -t wasmer/riscv64 ${GITHUB_WORKSPACE}/.github/cross-linux-riscv64/ -# env: -# CROSS_DOCKER_IN_DOCKER: true -# - name: Build ${{ matrix.build-what.key }} -# run: | -# ${{ matrix.build-what.build-cmd }} -# env: -# CARGO_BINARY: docker run -v /var/run/docker.sock:/var/run/docker.sock -v ${GITHUB_WORKSPACE}:/project -w /project wasmer/riscv64 cargo -# CROSS_DOCKER_IN_DOCKER: true -# CARGO_TARGET: riscv64gc-unknown-linux-gnu -# ENABLE_LLVM: 0 -# - name: Dist -# if: ${{ matrix.build-what.key == 'capi' }} -# run: | -# make distribution -# env: -# CARGO_BINARY: docker run -v /var/run/docker.sock:/var/run/docker.sock -v ${GITHUB_WORKSPACE}:/project -w /project wasmer/riscv64 cargo -# CROSS_DOCKER_IN_DOCKER: true -# CARGO_TARGET: riscv64gc-unknown-linux-gnu -# PKG_CONFIG_PATH: /usr/lib/riscv64-linux-gnu/pkgconfig -# PKG_CONFIG_ALLOW_CROSS: true -# TARGET: riscv64gc-unknown-linux-gnu -# TARGET_DIR: target/riscv64gc-unknown-linux-gnu/release -# - name: Upload Artifacts -# if: ${{ matrix.build-what.key == 'capi' }} -# uses: actions/upload-artifact@v4 -# with: -# name: capi-linux-riscv64 -# path: dist -# if-no-files-found: error -# retention-days: 2 + build_linux_riscv64: + name: ${{ matrix.build-what.name }} on linux-riscv64 + runs-on: ubuntu-22.04 + strategy: + fail-fast: false + matrix: + build-what: [ + { + key: capi, + build-cmd: 'make build-capi && make package-capi', + name: 'Build C-API' + }, + { + key: wasmer, + build-cmd: 'make build-wasmer && make package-wasmer && make tar-wasmer', + name: 'Build wasmer-cli' + } + ] + steps: + - uses: actions/checkout@v3 + #- uses: dtolnay/rust-toolchain@stable + # with: + # toolchain: ${{ env.MSRV }} + # target: riscv64gc-unknown-linux-gnu + - name: Build cross image + run: | + docker build -t wasmer/riscv64 ${GITHUB_WORKSPACE}/.github/cross-linux-riscv64/ + env: + CROSS_DOCKER_IN_DOCKER: true + - name: Build ${{ matrix.build-what.key }} + run: | + ${{ matrix.build-what.build-cmd }} + env: + CARGO_BINARY: docker run -v /var/run/docker.sock:/var/run/docker.sock -v ${GITHUB_WORKSPACE}:/project -w /project wasmer/riscv64 cargo + CROSS_DOCKER_IN_DOCKER: true + CARGO_TARGET: riscv64gc-unknown-linux-gnu + ENABLE_LLVM: 0 + - name: Dist + if: ${{ matrix.build-what.key == 'capi' }} + run: | + make distribution + env: + CARGO_BINARY: docker run -v /var/run/docker.sock:/var/run/docker.sock -v ${GITHUB_WORKSPACE}:/project -w /project wasmer/riscv64 cargo + CROSS_DOCKER_IN_DOCKER: true + CARGO_TARGET: riscv64gc-unknown-linux-gnu + PKG_CONFIG_PATH: /usr/lib/riscv64-linux-gnu/pkgconfig + PKG_CONFIG_ALLOW_CROSS: true + TARGET: riscv64gc-unknown-linux-gnu + TARGET_DIR: target/riscv64gc-unknown-linux-gnu/release + - name: Upload Artifacts + if: ${{ matrix.build-what.key == 'capi' }} + uses: actions/upload-artifact@v4 + with: + name: capi-linux-riscv64 + path: dist + if-no-files-found: error + retention-days: 2 -# build: -# name: ${{ matrix.build-what.name }} on ${{ matrix.metadata.build }} -# runs-on: ${{ matrix.metadata.os }} -# needs: setup -# strategy: -# fail-fast: false -# matrix: -# build-what: [ -# { -# key: capi, -# build-cmd: 'make build-capi && make build-capi-headless && make package-capi && make tar-capi', -# name: 'Build and test C-API' -# }, -# { -# key: wasmer, -# build-cmd: 'make build-wasmer && make package-wasmer && make tar-wasmer', -# name: 'Build wasmer-cli' -# } -# ] -# metadata: [ -# { -# build: linux-x64, -# os: ubuntu-22.04, -# target: x86_64-unknown-linux-gnu, -# exe: '', -# llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-amd64.tar.xz' -# }, -# { -# build: macos-x64, -# os: macos-12, -# target: x86_64-apple-darwin, -# exe: '', -# llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-amd64.tar.xz' + build: + name: ${{ matrix.build-what.name }} on ${{ matrix.metadata.build }} + runs-on: ${{ matrix.metadata.os }} + needs: setup + strategy: + fail-fast: false + matrix: + build-what: [ + { + key: capi, + build-cmd: 'make build-capi && make build-capi-headless && make package-capi && make tar-capi', + name: 'Build and test C-API' + }, + { + key: wasmer, + build-cmd: 'make build-wasmer && make package-wasmer && make tar-wasmer', + name: 'Build wasmer-cli' + } + ] + metadata: [ + { + build: linux-x64, + os: ubuntu-22.04, + target: x86_64-unknown-linux-gnu, + exe: '', + llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-amd64.tar.xz' + }, + { + build: macos-x64, + os: macos-12, + target: x86_64-apple-darwin, + exe: '', + llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-amd64.tar.xz' -# }, -# { -# build: macos-arm, -# os: macos-14, -# target: aarch64-apple-darwin, -# exe: '', -# # [todo] xdoardo: Reinstate when the code we generate for aarch64 is working correctly. -# # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-aarch64.tar.xz' -# }, -# { -# build: windows-x64, -# os: windows-2022, -# target: x86_64-pc-windows-msvc, -# exe: '.exe', -# # For now, disable LLVM in `windows-x64.` -# # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-windows-amd64.tar.xz' -# }, -# { -# build: windows-gnu, -# target: x86_64-pc-windows-gnu, -# os: ubuntu-22.04, -# }, -# { -# build: linux-musl, -# target: x86_64-unknown-linux-musl, -# os: ubuntu-22.04, -# exe: '', -# container: 'alpine:latest' -# } + }, + { + build: macos-arm, + os: macos-14, + target: aarch64-apple-darwin, + exe: '', + # [todo] xdoardo: Reinstate when the code we generate for aarch64 is working correctly. + # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-aarch64.tar.xz' + }, + { + build: windows-x64, + os: windows-2022, + target: x86_64-pc-windows-msvc, + exe: '.exe', + # For now, disable LLVM in `windows-x64.` + # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-windows-amd64.tar.xz' + }, + { + build: windows-gnu, + target: x86_64-pc-windows-gnu, + os: ubuntu-22.04, + }, + { + build: linux-musl, + target: x86_64-unknown-linux-musl, + os: ubuntu-22.04, + exe: '', + container: 'alpine:latest' + } -# ] -# container: ${{ matrix.metadata.container }} -# env: -# SCCACHE_AZURE_BLOB_CONTAINER: wasmerstoragesccacheblob -# SCCACHE_AZURE_CONNECTION_STRING: ${{ secrets.SCCACHE_AZURE_CONNECTION_STRING }} -# steps: -# - uses: actions/checkout@v3 -# - name: Set up libstdc++ on Linux -# if: matrix.metadata.build == 'linux-x64' -# run: | -# sudo apt-get update -y -# sudo apt-get install -y --allow-downgrades libstdc++6 libtinfo5 -# sudo apt-get install --reinstall g++ -# - name: Set up base deps on musl -# if: matrix.metadata.build == 'linux-musl' -# run: ./scripts/alpine-linux-install-deps.sh -# - name: Set up dependencies for Mac OS -# run: | -# brew install automake -# # using gnu-tar is a workaround for https://github.com/actions/cache/issues/403 -# brew install gnu-tar -# echo PATH="/usr/local/opt/gnu-tar/libexec/gnubin:$PATH" >> $GITHUB_ENV -# if: matrix.metadata.os == 'macos-12' -# - name: Install Rust -# uses: dtolnay/rust-toolchain@stable -# with: -# toolchain: ${{ env.MSRV }} -# target: ${{ matrix.metadata.target }} -# - name: Install Nextest -# uses: taiki-e/install-action@nextest -# - name: Install MSVC dev-cmd (Windows) -# uses: ilammy/msvc-dev-cmd@v1 -# if: ${{ matrix.metadata.build == 'windows-x64' }} -# - name: Delete unwanted link to stop it from interfering (Windows) -# shell: bash -# run: rm /usr/bin/link.exe -# if: ${{ matrix.metadata.build == 'windows-x64' }} -# - name: Install Windows-GNU linker -# if: ${{ matrix.metadata.build == 'windows-gnu' }} -# shell: bash -# run: | -# sudo apt install -y mingw-w64 -# - name: Install Windows-GNU target -# if: ${{ matrix.metadata.build == 'windows-gnu' }} -# shell: bash -# run: | -# rustup target add x86_64-pc-windows-gnu -# - name: Install Windows 10 SDK with xwin -# if: ${{ matrix.metadata.build == 'windows-gnu' }} -# shell: bash -# run: | -# mkdir -p /tmp/xwin -# mkdir -p /tmp/xwindownload -# mkdir -p /tmp/xwincache -# git clone https://github.com/wasmerio/xwin --depth=1 /tmp/xwin -# cargo build --release --manifest-path=/tmp/xwin/Cargo.toml -# /tmp/xwin/target/release/xwin --accept-license --cache-dir /tmp/xwincache splat --output /tmp/xwindownload -# mkdir -p /tmp/winsdk -# cp /tmp/xwindownload/sdk/lib/10.0.20348/um/x86_64/WS2_32.lib /tmp/winsdk/ -# cp /tmp/xwindownload/sdk/lib/10.0.20348/um/x86_64/KERNEL32.lib /tmp/winsdk/ -# cp /tmp/xwindownload/sdk/lib/10.0.20348/um/x86_64/BCRYPT.lib /tmp/winsdk/ -# cp /tmp/xwindownload/sdk/lib/10.0.20348/um/x86_64/ADVAPI32.lib /tmp/winsdk/ -# cp /tmp/xwindownload/sdk/lib/10.0.20348/um/x86_64/USERENV.lib /tmp/winsdk/ -# echo "WinSDK files:" -# ls -laH /tmp/winsdk -# echo "" -# mkdir -p package -# mkdir -p package/winsdk -# cp -r /tmp/winsdk/* package/winsdk -# - name: Install LLVM (macOS Apple Silicon) -# if: matrix.metadata.os == 'macos-12' && !matrix.metadata.llvm_url -# run: | -# brew install llvm -# - name: Install LLVM -# shell: bash -# if: matrix.metadata.llvm_url -# run: | -# curl --proto '=https' --tlsv1.2 -sSf ${{ matrix.metadata.llvm_url }} -L -o llvm.tar.xz -# LLVM_DIR=$(pwd)/${{ env.LLVM_DIR }} -# mkdir ${LLVM_DIR} -# tar xf llvm.tar.xz --strip-components=1 -C ${LLVM_DIR} -# echo "ENABLE_LLVM=1" >> $GITHUB_ENV -# echo "${LLVM_DIR}/bin" >> $GITHUB_PATH -# echo "${LLVM_DIR}/usr/bin" >> $GITHUB_PATH -# echo "LLVM_SYS_180_PREFIX=${LLVM_DIR}" >> $GITHUB_ENV -# env: -# LLVM_DIR: .llvm -# - name: Add `brew` libs to `RUSTFLAGS` -# if: matrix.metadata.os == 'macos-14' -# shell: bash -# run: | -# echo "RUSTFLAGS=-L/opt/homebrew/lib" >> $GITHUB_ENV -# - name: Setup Rust target -# shell: bash -# run: | -# mkdir -p .cargo -# cat << EOF > .cargo/config.toml -# [build] -# target = "${{ matrix.metadata.target }}" -# EOF -# if: matrix.metadata.target -# - name: which cargo -# if: ${{ matrix.build-what.key == 'capi' && matrix.metadata.build == 'windows-x64' }} -# run: which cargo -# - name: Set cargo env -# run: echo "CARGO_ROOT_DIR=$(dirname $(dirname $( which cargo )))" >> $GITHUB_ENV -# - name: List root dir -# shell: bash -# if: ${{ matrix.build-what.key == 'capi' && matrix.metadata.build == 'windows-x64' }} -# run: ls -R $CARGO_ROOT_DIR -# - name: Cache -# uses: whywaita/actions-cache-s3@v2 -# with: -# path: | -# ~/.cargo/* -# ./target/* -# $CARGO_ROOT_DIR/* -# key: r22-${{ github.repository }}-${{ runner.os }}-${{ hashFiles('Cargo.lock') }}-wasmer-make-build-wasmer-${{ matrix.build-what.key }}-${{ matrix.metadata.build }} -# aws-s3-bucket: wasmer-rust-artifacts-cache -# aws-access-key-id: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_TOKEN }} -# aws-secret-access-key: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_KEY }} -# aws-region: auto -# aws-endpoint: https://1541b1e8a3fc6ad155ce67ef38899700.r2.cloudflarestorage.com -# aws-s3-bucket-endpoint: false -# aws-s3-force-path-style: true -# - name: Build C-API -# shell: bash -# run: ${{ matrix.build-what.build-cmd }} -# if: ${{ matrix.build-what.key == 'capi' }} -# env: -# TARGET: ${{ matrix.metadata.target }} -# TARGET_DIR: target/${{ matrix.metadata.target }}/release -# CARGO_TARGET: ${{ matrix.metadata.target }} -# - name: Build Wasmer -# shell: bash -# if: ${{ matrix.build-what.key == 'wasmer' && matrix.metadata.build != 'windows-gnu' }} -# run: ${{ matrix.build-what.build-cmd }} -# env: -# TARGET: ${{ matrix.metadata.target }} -# TARGET_DIR: target/${{ matrix.metadata.target }}/release -# CARGO_TARGET: ${{ matrix.metadata.target }} -# - name: Test C-API -# shell: bash -# if: ${{ matrix.build-what.key == 'capi' && !(matrix.metadata.build == 'linux-musl' || matrix.metadata.build == 'windows-gnu') }} -# run: make test-capi-ci -# env: -# TARGET: ${{ matrix.metadata.target }} -# TARGET_DIR: target/${{ matrix.metadata.target }}/release -# CARGO_TARGET: ${{ matrix.metadata.target }} -# # C-API tests were disabled for linux-musl and macos-arm (we can't run them) -# - name: Test C-API integration -# shell: bash -# if: ${{ matrix.build-what.key == 'capi' && !(matrix.metadata.build == 'linux-musl' || matrix.metadata.build == 'windows-gnu') }} -# run: export WASMER_DIR=`pwd`/package && make test-stage-7-capi-integration-tests -# env: -# TARGET: ${{ matrix.metadata.target }} -# TARGET_DIR: target/${{ matrix.metadata.target }}/release -# CARGO_TARGET: ${{ matrix.metadata.target }} -# - name: Archive production artifacts -# uses: actions/upload-artifact@v4 -# with: -# name: wasmer-cli-${{ matrix.metadata.build }} -# path: build-wasmer.tar.gz -# if-no-files-found: ignore -# retention-days: 2 -# - name: Archive production artifacts -# uses: actions/upload-artifact@v4 -# with: -# name: capi-${{ matrix.metadata.build }} -# path: build-capi.tar.gz -# if-no-files-found: ignore -# retention-days: 2 + ] + container: ${{ matrix.metadata.container }} + env: + SCCACHE_AZURE_BLOB_CONTAINER: wasmerstoragesccacheblob + SCCACHE_AZURE_CONNECTION_STRING: ${{ secrets.SCCACHE_AZURE_CONNECTION_STRING }} + steps: + - uses: actions/checkout@v3 + - name: Set up libstdc++ on Linux + if: matrix.metadata.build == 'linux-x64' + run: | + sudo apt-get update -y + sudo apt-get install -y --allow-downgrades libstdc++6 libtinfo5 + sudo apt-get install --reinstall g++ + - name: Set up base deps on musl + if: matrix.metadata.build == 'linux-musl' + run: ./scripts/alpine-linux-install-deps.sh + - name: Set up dependencies for Mac OS + run: | + brew install automake + # using gnu-tar is a workaround for https://github.com/actions/cache/issues/403 + brew install gnu-tar + echo PATH="/usr/local/opt/gnu-tar/libexec/gnubin:$PATH" >> $GITHUB_ENV + if: matrix.metadata.os == 'macos-12' + - name: Install Rust + uses: dtolnay/rust-toolchain@stable + with: + toolchain: ${{ env.MSRV }} + target: ${{ matrix.metadata.target }} + - name: Install Nextest + uses: taiki-e/install-action@nextest + - name: Install MSVC dev-cmd (Windows) + uses: ilammy/msvc-dev-cmd@v1 + if: ${{ matrix.metadata.build == 'windows-x64' }} + - name: Delete unwanted link to stop it from interfering (Windows) + shell: bash + run: rm /usr/bin/link.exe + if: ${{ matrix.metadata.build == 'windows-x64' }} + - name: Install Windows-GNU linker + if: ${{ matrix.metadata.build == 'windows-gnu' }} + shell: bash + run: | + sudo apt install -y mingw-w64 + - name: Install Windows-GNU target + if: ${{ matrix.metadata.build == 'windows-gnu' }} + shell: bash + run: | + rustup target add x86_64-pc-windows-gnu + - name: Install Windows 10 SDK with xwin + if: ${{ matrix.metadata.build == 'windows-gnu' }} + shell: bash + run: | + mkdir -p /tmp/xwin + mkdir -p /tmp/xwindownload + mkdir -p /tmp/xwincache + git clone https://github.com/wasmerio/xwin --depth=1 /tmp/xwin + cargo build --release --manifest-path=/tmp/xwin/Cargo.toml + /tmp/xwin/target/release/xwin --accept-license --cache-dir /tmp/xwincache splat --output /tmp/xwindownload + mkdir -p /tmp/winsdk + cp /tmp/xwindownload/sdk/lib/10.0.20348/um/x86_64/WS2_32.lib /tmp/winsdk/ + cp /tmp/xwindownload/sdk/lib/10.0.20348/um/x86_64/KERNEL32.lib /tmp/winsdk/ + cp /tmp/xwindownload/sdk/lib/10.0.20348/um/x86_64/BCRYPT.lib /tmp/winsdk/ + cp /tmp/xwindownload/sdk/lib/10.0.20348/um/x86_64/ADVAPI32.lib /tmp/winsdk/ + cp /tmp/xwindownload/sdk/lib/10.0.20348/um/x86_64/USERENV.lib /tmp/winsdk/ + echo "WinSDK files:" + ls -laH /tmp/winsdk + echo "" + mkdir -p package + mkdir -p package/winsdk + cp -r /tmp/winsdk/* package/winsdk + - name: Install LLVM (macOS Apple Silicon) + if: matrix.metadata.os == 'macos-12' && !matrix.metadata.llvm_url + run: | + brew install llvm + - name: Install LLVM + shell: bash + if: matrix.metadata.llvm_url + run: | + curl --proto '=https' --tlsv1.2 -sSf ${{ matrix.metadata.llvm_url }} -L -o llvm.tar.xz + LLVM_DIR=$(pwd)/${{ env.LLVM_DIR }} + mkdir ${LLVM_DIR} + tar xf llvm.tar.xz --strip-components=1 -C ${LLVM_DIR} + echo "ENABLE_LLVM=1" >> $GITHUB_ENV + echo "${LLVM_DIR}/bin" >> $GITHUB_PATH + echo "${LLVM_DIR}/usr/bin" >> $GITHUB_PATH + echo "LLVM_SYS_180_PREFIX=${LLVM_DIR}" >> $GITHUB_ENV + env: + LLVM_DIR: .llvm + - name: Add `brew` libs to `RUSTFLAGS` + if: matrix.metadata.os == 'macos-14' + shell: bash + run: | + echo "RUSTFLAGS=-L/opt/homebrew/lib" >> $GITHUB_ENV + - name: Setup Rust target + shell: bash + run: | + mkdir -p .cargo + cat << EOF > .cargo/config.toml + [build] + target = "${{ matrix.metadata.target }}" + EOF + if: matrix.metadata.target + - name: which cargo + if: ${{ matrix.build-what.key == 'capi' && matrix.metadata.build == 'windows-x64' }} + run: which cargo + - name: Set cargo env + run: echo "CARGO_ROOT_DIR=$(dirname $(dirname $( which cargo )))" >> $GITHUB_ENV + - name: List root dir + shell: bash + if: ${{ matrix.build-what.key == 'capi' && matrix.metadata.build == 'windows-x64' }} + run: ls -R $CARGO_ROOT_DIR + - name: Cache + uses: whywaita/actions-cache-s3@v2 + with: + path: | + ~/.cargo/* + ./target/* + $CARGO_ROOT_DIR/* + key: r22-${{ github.repository }}-${{ runner.os }}-${{ hashFiles('Cargo.lock') }}-wasmer-make-build-wasmer-${{ matrix.build-what.key }}-${{ matrix.metadata.build }} + aws-s3-bucket: wasmer-rust-artifacts-cache + aws-access-key-id: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_TOKEN }} + aws-secret-access-key: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_KEY }} + aws-region: auto + aws-endpoint: https://1541b1e8a3fc6ad155ce67ef38899700.r2.cloudflarestorage.com + aws-s3-bucket-endpoint: false + aws-s3-force-path-style: true + - name: Build C-API + shell: bash + run: ${{ matrix.build-what.build-cmd }} + if: ${{ matrix.build-what.key == 'capi' }} + env: + TARGET: ${{ matrix.metadata.target }} + TARGET_DIR: target/${{ matrix.metadata.target }}/release + CARGO_TARGET: ${{ matrix.metadata.target }} + - name: Build Wasmer + shell: bash + if: ${{ matrix.build-what.key == 'wasmer' && matrix.metadata.build != 'windows-gnu' }} + run: ${{ matrix.build-what.build-cmd }} + env: + TARGET: ${{ matrix.metadata.target }} + TARGET_DIR: target/${{ matrix.metadata.target }}/release + CARGO_TARGET: ${{ matrix.metadata.target }} + - name: Test C-API + shell: bash + if: ${{ matrix.build-what.key == 'capi' && !(matrix.metadata.build == 'linux-musl' || matrix.metadata.build == 'windows-gnu') }} + run: make test-capi-ci + env: + TARGET: ${{ matrix.metadata.target }} + TARGET_DIR: target/${{ matrix.metadata.target }}/release + CARGO_TARGET: ${{ matrix.metadata.target }} + # C-API tests were disabled for linux-musl and macos-arm (we can't run them) + - name: Test C-API integration + shell: bash + if: ${{ matrix.build-what.key == 'capi' && !(matrix.metadata.build == 'linux-musl' || matrix.metadata.build == 'windows-gnu') }} + run: export WASMER_DIR=`pwd`/package && make test-stage-7-capi-integration-tests + env: + TARGET: ${{ matrix.metadata.target }} + TARGET_DIR: target/${{ matrix.metadata.target }}/release + CARGO_TARGET: ${{ matrix.metadata.target }} + - name: Archive production artifacts + uses: actions/upload-artifact@v4 + with: + name: wasmer-cli-${{ matrix.metadata.build }} + path: build-wasmer.tar.gz + if-no-files-found: ignore + retention-days: 2 + - name: Archive production artifacts + uses: actions/upload-artifact@v4 + with: + name: capi-${{ matrix.metadata.build }} + path: build-capi.tar.gz + if-no-files-found: ignore + retention-days: 2 -# test: -# name: ${{ matrix.stage.description }} on ${{ matrix.metadata.build }} -# runs-on: ${{ matrix.metadata.os }} -# needs: setup -# strategy: -# fail-fast: false -# matrix: -# stage: [ -# { -# description: 'Run wast test suite for all compilers', -# make: 'test-stage-0-wast', -# }, -# { -# description: 'Unit-test packages on std', -# make: 'test-stage-1-test-all', -# }, -# { -# description: 'Unit-test cranelift on no-std', -# make: 'test-stage-2-test-compiler-cranelift-nostd', -# }, -# { -# description: 'Unit-test singlepass on no-std', -# make: 'test-stage-3-test-compiler-singlepass-nostd', -# }, -# { -# description: 'Unit-test wasmer-cli', -# make: 'test-stage-4-wasmer-cli', -# }, -# { -# description: 'Unit-test examples', -# make: 'test-stage-5-test-examples', -# } -# ] -# metadata: [ -# # We cannot test on macos-arm since we don't have ARM runners -# { -# build: linux-x64, -# os: ubuntu-22.04, -# target: x86_64-unknown-linux-gnu, -# exe: '', -# llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-amd64.tar.xz' -# }, -# { -# build: macos-x64, -# os: macos-12, -# target: x86_64-apple-darwin, -# exe: '', -# llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-amd64.tar.xz' + test: + name: ${{ matrix.stage.description }} on ${{ matrix.metadata.build }} + runs-on: ${{ matrix.metadata.os }} + needs: setup + strategy: + fail-fast: false + matrix: + stage: [ + { + description: 'Run wast test suite for all compilers', + make: 'test-stage-0-wast', + }, + { + description: 'Unit-test packages on std', + make: 'test-stage-1-test-all', + }, + { + description: 'Unit-test cranelift on no-std', + make: 'test-stage-2-test-compiler-cranelift-nostd', + }, + { + description: 'Unit-test singlepass on no-std', + make: 'test-stage-3-test-compiler-singlepass-nostd', + }, + { + description: 'Unit-test wasmer-cli', + make: 'test-stage-4-wasmer-cli', + }, + { + description: 'Unit-test examples', + make: 'test-stage-5-test-examples', + } + ] + metadata: [ + # We cannot test on macos-arm since we don't have ARM runners + { + build: linux-x64, + os: ubuntu-22.04, + target: x86_64-unknown-linux-gnu, + exe: '', + llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-amd64.tar.xz' + }, + { + build: macos-x64, + os: macos-12, + target: x86_64-apple-darwin, + exe: '', + llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-amd64.tar.xz' -# }, -# { -# build: macos-arm, -# os: macos-14, -# target: aarch64-apple-darwin, -# exe: '', -# # [todo] xdoardo: Reinstate when the code we generate for aarch64 is working correctly. -# # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-aarch64.tar.xz' -# }, -# { -# build: windows-x64, -# os: windows-2022, -# target: x86_64-pc-windows-msvc, -# exe: '.exe', -# # For now, disable LLVM in `windows-x64.` -# # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-windows-amd64.tar.xz' -# }, -# { -# build: linux-musl, -# target: x86_64-unknown-linux-musl, -# os: ubuntu-22.04, -# exe: '', -# container: 'alpine:latest' -# } -# ] -# container: ${{ matrix.metadata.container }} -# env: -# SCCACHE_AZURE_BLOB_CONTAINER: wasmerstoragesccacheblob -# SCCACHE_AZURE_CONNECTION_STRING: ${{ secrets.SCCACHE_AZURE_CONNECTION_STRING }} -# steps: -# - uses: actions/checkout@v3 -# - name: Set up libstdc++ on Linux -# if: matrix.metadata.build == 'linux-x64' -# run: | -# sudo apt-get update -y -# sudo apt-get install -y --allow-downgrades libstdc++6 -# sudo apt-get install --reinstall g++ -# - name: Set up base deps on musl -# if: matrix.metadata.build == 'linux-musl' -# run: ./scripts/alpine-linux-install-deps.sh -# - name: Install MSVC dev-cmd (Windows) -# uses: ilammy/msvc-dev-cmd@v1 -# if: ${{ matrix.metadata.build == 'windows-x64' }} -# - name: Delete unwanted link to stop it from interfering (Windows) -# shell: bash -# run: rm /usr/bin/link.exe -# if: ${{ matrix.metadata.build == 'windows-x64' }} + }, + { + build: macos-arm, + os: macos-14, + target: aarch64-apple-darwin, + exe: '', + # [todo] xdoardo: Reinstate when the code we generate for aarch64 is working correctly. + # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-aarch64.tar.xz' + }, + { + build: windows-x64, + os: windows-2022, + target: x86_64-pc-windows-msvc, + exe: '.exe', + # For now, disable LLVM in `windows-x64.` + # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-windows-amd64.tar.xz' + }, + { + build: linux-musl, + target: x86_64-unknown-linux-musl, + os: ubuntu-22.04, + exe: '', + container: 'alpine:latest' + } + ] + container: ${{ matrix.metadata.container }} + env: + SCCACHE_AZURE_BLOB_CONTAINER: wasmerstoragesccacheblob + SCCACHE_AZURE_CONNECTION_STRING: ${{ secrets.SCCACHE_AZURE_CONNECTION_STRING }} + steps: + - uses: actions/checkout@v3 + - name: Set up libstdc++ on Linux + if: matrix.metadata.build == 'linux-x64' + run: | + sudo apt-get update -y + sudo apt-get install -y --allow-downgrades libstdc++6 + sudo apt-get install --reinstall g++ + - name: Set up base deps on musl + if: matrix.metadata.build == 'linux-musl' + run: ./scripts/alpine-linux-install-deps.sh + - name: Install MSVC dev-cmd (Windows) + uses: ilammy/msvc-dev-cmd@v1 + if: ${{ matrix.metadata.build == 'windows-x64' }} + - name: Delete unwanted link to stop it from interfering (Windows) + shell: bash + run: rm /usr/bin/link.exe + if: ${{ matrix.metadata.build == 'windows-x64' }} -# - name: Set up dependencies for Mac OS -# run: | -# brew install automake -# # using gnu-tar is a workaround for https://github.com/actions/cache/issues/403 -# brew install gnu-tar -# echo PATH="/usr/local/opt/gnu-tar/libexec/gnubin:$PATH" >> $GITHUB_ENV -# if: matrix.metadata.os == 'macos-12' -# - name: Install Rust -# uses: dtolnay/rust-toolchain@stable -# with: -# toolchain: ${{ env.MSRV }} -# target: ${{ matrix.metadata.target }} -# - name: Install Nextest -# uses: taiki-e/install-action@nextest -# - name: Install LLVM (macOS Apple Silicon) -# if: matrix.metadata.os == 'macos-12' && !matrix.metadata.llvm_url -# run: | -# brew install llvm -# - name: Install LLVM -# shell: bash -# if: matrix.metadata.llvm_url -# run: | -# curl --proto '=https' --tlsv1.2 -sSf ${{ matrix.metadata.llvm_url }} -L -o llvm.tar.xz -# LLVM_DIR=$(pwd)/${{ env.LLVM_DIR }} -# mkdir ${LLVM_DIR} -# tar xf llvm.tar.xz --strip-components=1 -C ${LLVM_DIR} -# echo "${LLVM_DIR}/bin" >> $GITHUB_PATH -# echo "${LLVM_DIR}/usr/bin" >> $GITHUB_PATH -# echo "LLVM_SYS_180_PREFIX=${LLVM_DIR}" >> $GITHUB_ENV -# echo "ENABLE_LLVM=1" >> $GITHUB_ENV -# env: -# LLVM_DIR: .llvm -# - name: Add `brew` libs to `RUSTFLAGS` -# if: matrix.metadata.os == 'macos-14' -# shell: bash -# run: | -# echo "RUSTFLAGS=-L/opt/homebrew/lib" >> $GITHUB_ENV -# - name: Setup Rust target -# shell: bash -# run: | -# mkdir -p .cargo -# cat << EOF > .cargo/config.toml -# [build] -# target = "${{ matrix.metadata.target }}" -# EOF -# if: matrix.metadata.target -# - name: Cache -# uses: whywaita/actions-cache-s3@v2 -# with: -# path: | -# ~/.cargo/* -# ./target/* -# key: r22-${{ github.repository }}-${{ runner.os }}-${{ hashFiles('Cargo.lock') }}-wasmer-make-test-stage-${{ matrix.stage.make }}-${{ matrix.metadata.build }} -# aws-s3-bucket: wasmer-rust-artifacts-cache -# aws-access-key-id: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_TOKEN }} -# aws-secret-access-key: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_KEY }} -# aws-region: auto -# aws-endpoint: https://1541b1e8a3fc6ad155ce67ef38899700.r2.cloudflarestorage.com -# aws-s3-bucket-endpoint: false -# aws-s3-force-path-style: true -# - name: ${{ matrix.stage.description }} -# shell: bash -# run: make ${{ matrix.stage.make }} -# env: -# TARGET: ${{ matrix.metadata.target }} -# TARGET_DIR: target/${{ matrix.metadata.target }}/release -# CARGO_TARGET: ${{ matrix.metadata.target }} + - name: Set up dependencies for Mac OS + run: | + brew install automake + # using gnu-tar is a workaround for https://github.com/actions/cache/issues/403 + brew install gnu-tar + echo PATH="/usr/local/opt/gnu-tar/libexec/gnubin:$PATH" >> $GITHUB_ENV + if: matrix.metadata.os == 'macos-12' + - name: Install Rust + uses: dtolnay/rust-toolchain@stable + with: + toolchain: ${{ env.MSRV }} + target: ${{ matrix.metadata.target }} + - name: Install Nextest + uses: taiki-e/install-action@nextest + - name: Install LLVM (macOS Apple Silicon) + if: matrix.metadata.os == 'macos-12' && !matrix.metadata.llvm_url + run: | + brew install llvm + - name: Install LLVM + shell: bash + if: matrix.metadata.llvm_url + run: | + curl --proto '=https' --tlsv1.2 -sSf ${{ matrix.metadata.llvm_url }} -L -o llvm.tar.xz + LLVM_DIR=$(pwd)/${{ env.LLVM_DIR }} + mkdir ${LLVM_DIR} + tar xf llvm.tar.xz --strip-components=1 -C ${LLVM_DIR} + echo "${LLVM_DIR}/bin" >> $GITHUB_PATH + echo "${LLVM_DIR}/usr/bin" >> $GITHUB_PATH + echo "LLVM_SYS_180_PREFIX=${LLVM_DIR}" >> $GITHUB_ENV + echo "ENABLE_LLVM=1" >> $GITHUB_ENV + env: + LLVM_DIR: .llvm + - name: Add `brew` libs to `RUSTFLAGS` + if: matrix.metadata.os == 'macos-14' + shell: bash + run: | + echo "RUSTFLAGS=-L/opt/homebrew/lib" >> $GITHUB_ENV + - name: Setup Rust target + shell: bash + run: | + mkdir -p .cargo + cat << EOF > .cargo/config.toml + [build] + target = "${{ matrix.metadata.target }}" + EOF + if: matrix.metadata.target + - name: Cache + uses: whywaita/actions-cache-s3@v2 + with: + path: | + ~/.cargo/* + ./target/* + key: r22-${{ github.repository }}-${{ runner.os }}-${{ hashFiles('Cargo.lock') }}-wasmer-make-test-stage-${{ matrix.stage.make }}-${{ matrix.metadata.build }} + aws-s3-bucket: wasmer-rust-artifacts-cache + aws-access-key-id: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_TOKEN }} + aws-secret-access-key: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_KEY }} + aws-region: auto + aws-endpoint: https://1541b1e8a3fc6ad155ce67ef38899700.r2.cloudflarestorage.com + aws-s3-bucket-endpoint: false + aws-s3-force-path-style: true + - name: ${{ matrix.stage.description }} + shell: bash + run: make ${{ matrix.stage.make }} + env: + TARGET: ${{ matrix.metadata.target }} + TARGET_DIR: target/${{ matrix.metadata.target }}/release + CARGO_TARGET: ${{ matrix.metadata.target }} -# test_integration_cli: -# name: CLI integration tests on ${{ matrix.build }} -# runs-on: ${{ matrix.os }} -# needs: [build, build_linux_aarch64, build_linux_riscv64] -# strategy: -# fail-fast: false -# matrix: -# include: -# - build: linux-x64 -# os: ubuntu-22.04 -# target: x86_64-unknown-linux-gnu -# llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-amd64.tar.xz' -# - build: macos-x64 -# os: macos-12 -# target: x86_64-apple-darwin -# # we only build the integration-test CLI, we don't run tests -# - build: macos-arm -# os: macos-12 -# target: aarch64-apple-darwin, -# - build: linux-musl -# target: x86_64-unknown-linux-musl -# os: ubuntu-22.04 -# container: alpine:latest -# - build: windows-x64 -# os: windows-2019 -# target: x86_64-pc-windows-msvc -# # For now, disable LLVM in `windows-x64.` -# # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-windows-amd64.tar.xz' + test_integration_cli: + name: CLI integration tests on ${{ matrix.build }} + runs-on: ${{ matrix.os }} + needs: [build, build_linux_aarch64, build_linux_riscv64] + strategy: + fail-fast: false + matrix: + include: + - build: linux-x64 + os: ubuntu-22.04 + target: x86_64-unknown-linux-gnu + llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-amd64.tar.xz' + - build: macos-x64 + os: macos-12 + target: x86_64-apple-darwin + # we only build the integration-test CLI, we don't run tests + - build: macos-arm + os: macos-12 + target: aarch64-apple-darwin, + - build: linux-musl + target: x86_64-unknown-linux-musl + os: ubuntu-22.04 + container: alpine:latest + - build: windows-x64 + os: windows-2019 + target: x86_64-pc-windows-msvc + # For now, disable LLVM in `windows-x64.` + # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-windows-amd64.tar.xz' -# container: ${{ matrix.container }} -# env: -# SCCACHE_AZURE_BLOB_CONTAINER: wasmerstoragesccacheblob -# SCCACHE_AZURE_CONNECTION_STRING: ${{ secrets.SCCACHE_AZURE_CONNECTION_STRING }} -# steps: -# - uses: actions/checkout@v3 -# - uses: goto-bus-stop/setup-zig@v2 -# with: -# version: 0.10.0 -# - name: Set up base deps on musl -# if: matrix.build == 'linux-musl' -# run: ./scripts/alpine-linux-install-deps.sh -# - uses: actions/download-artifact@v4 -# id: download -# with: -# name: capi-${{ matrix.build }} -# - uses: actions/download-artifact@v4 -# with: -# name: wasmer-cli-${{ matrix.build }} -# - name: 'Echo download path' -# run: echo ${{steps.download.outputs.download-path}} -# - name: Install Rust -# uses: dtolnay/rust-toolchain@stable -# with: -# toolchain: ${{ env.MSRV }} -# target: ${{ matrix.metadata.target }} -# - name: Install Nextest -# uses: taiki-e/install-action@nextest -# - name: Cache -# uses: whywaita/actions-cache-s3@v2 -# with: -# path: | -# ~/.cargo/* -# ./target/* -# key: r22-${{ github.repository }}-${{ runner.os }}-${{ hashFiles('Cargo.lock') }}-wasmer-make-test-integration-cli-${{ matrix.build }} -# aws-s3-bucket: wasmer-rust-artifacts-cache -# aws-access-key-id: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_TOKEN }} -# aws-secret-access-key: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_KEY }} -# aws-region: auto -# aws-endpoint: https://1541b1e8a3fc6ad155ce67ef38899700.r2.cloudflarestorage.com -# aws-s3-bucket-endpoint: false -# aws-s3-force-path-style: true -# - name: Prepare package directory -# shell: bash -# run: | -# mkdir -p package -# mkdir -p package/cache -# - uses: actions/download-artifact@v4 -# with: -# name: capi-linux-aarch64 -# path: package/cache/wasmercache1 -# - uses: actions/download-artifact@v4 -# with: -# name: capi-windows-x64 -# path: package/cache/wasmercache2 -# - uses: actions/download-artifact@v4 -# with: -# name: capi-macos-arm -# path: package/cache/wasmercache3 -# - uses: actions/download-artifact@v4 -# with: -# name: capi-macos-x64 -# path: package/cache/wasmercache4 -# - uses: actions/download-artifact@v4 -# with: -# name: capi-linux-x64 -# path: package/cache/wasmercache5 -# - uses: actions/download-artifact@v4 -# with: -# name: capi-linux-riscv64 -# path: package/cache/wasmercache6 -# - name: Copy .tar.gz files to proper location -# shell: bash -# run: | -# ls package/cache/wasmercache1 -# ls package/cache/wasmercache2 -# ls package/cache/wasmercache3 -# ls package/cache/wasmercache4 -# ls package/cache/wasmercache5 -# cp package/cache/wasmercache1/wasmer.tar.gz package/cache/wasmer-linux-aarch64.tar.gz -# cp package/cache/wasmercache2/build-capi.tar.gz package/cache/wasmer-windows-gnu64.tar.gz -# cp package/cache/wasmercache3/build-capi.tar.gz package/cache/wasmer-darwin-arm64.tar.gz -# cp package/cache/wasmercache4/build-capi.tar.gz package/cache/wasmer-darwin-amd64.tar.gz -# cp package/cache/wasmercache5/build-capi.tar.gz package/cache/wasmer-linux-amd64.tar.gz -# cp package/cache/wasmercache6/wasmer.tar.gz package/cache/wasmer-linux-riscv64.tar.gz -# - uses: actions/download-artifact@v4 -# if: ${{ matrix.build == 'windows-x64' }} -# with: -# name: capi-windows-x64 -# path: download_link -# - uses: actions/download-artifact@v4 -# if: ${{ matrix.build == 'linux-musl' }} -# with: -# name: capi-linux-musl -# path: download_link -# - uses: actions/download-artifact@v4 -# if: ${{ matrix.build == 'macos-arm' }} -# with: -# name: capi-macos-arm -# path: download_link -# - uses: actions/download-artifact@v4 -# if: ${{ matrix.build == 'macos-x64' }} -# with: -# name: capi-macos-x64 -# path: download_link -# - uses: actions/download-artifact@v4 -# if: ${{ matrix.build == 'linux-x64' }} -# with: -# name: capi-linux-x64 -# path: download_link -# - name: Copy build-capi.tar.gz to link.tar.gz -# shell: bash -# run: | -# cp download_link/build-capi.tar.gz link.tar.gz -# - name: Unzip Artifacts -# shell: bash -# run: | -# make untar-capi -# - name: Unzip Artifacts -# shell: bash -# run: | -# make untar-wasmer + container: ${{ matrix.container }} + env: + SCCACHE_AZURE_BLOB_CONTAINER: wasmerstoragesccacheblob + SCCACHE_AZURE_CONNECTION_STRING: ${{ secrets.SCCACHE_AZURE_CONNECTION_STRING }} + steps: + - uses: actions/checkout@v3 + - uses: goto-bus-stop/setup-zig@v2 + with: + version: 0.10.0 + - name: Set up base deps on musl + if: matrix.build == 'linux-musl' + run: ./scripts/alpine-linux-install-deps.sh + - uses: actions/download-artifact@v4 + id: download + with: + name: capi-${{ matrix.build }} + - uses: actions/download-artifact@v4 + with: + name: wasmer-cli-${{ matrix.build }} + - name: 'Echo download path' + run: echo ${{steps.download.outputs.download-path}} + - name: Install Rust + uses: dtolnay/rust-toolchain@stable + with: + toolchain: ${{ env.MSRV }} + target: ${{ matrix.metadata.target }} + - name: Install Nextest + uses: taiki-e/install-action@nextest + - name: Cache + uses: whywaita/actions-cache-s3@v2 + with: + path: | + ~/.cargo/* + ./target/* + key: r22-${{ github.repository }}-${{ runner.os }}-${{ hashFiles('Cargo.lock') }}-wasmer-make-test-integration-cli-${{ matrix.build }} + aws-s3-bucket: wasmer-rust-artifacts-cache + aws-access-key-id: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_TOKEN }} + aws-secret-access-key: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_KEY }} + aws-region: auto + aws-endpoint: https://1541b1e8a3fc6ad155ce67ef38899700.r2.cloudflarestorage.com + aws-s3-bucket-endpoint: false + aws-s3-force-path-style: true + - name: Prepare package directory + shell: bash + run: | + mkdir -p package + mkdir -p package/cache + - uses: actions/download-artifact@v4 + with: + name: capi-linux-aarch64 + path: package/cache/wasmercache1 + - uses: actions/download-artifact@v4 + with: + name: capi-windows-x64 + path: package/cache/wasmercache2 + - uses: actions/download-artifact@v4 + with: + name: capi-macos-arm + path: package/cache/wasmercache3 + - uses: actions/download-artifact@v4 + with: + name: capi-macos-x64 + path: package/cache/wasmercache4 + - uses: actions/download-artifact@v4 + with: + name: capi-linux-x64 + path: package/cache/wasmercache5 + - uses: actions/download-artifact@v4 + with: + name: capi-linux-riscv64 + path: package/cache/wasmercache6 + - name: Copy .tar.gz files to proper location + shell: bash + run: | + ls package/cache/wasmercache1 + ls package/cache/wasmercache2 + ls package/cache/wasmercache3 + ls package/cache/wasmercache4 + ls package/cache/wasmercache5 + cp package/cache/wasmercache1/wasmer.tar.gz package/cache/wasmer-linux-aarch64.tar.gz + cp package/cache/wasmercache2/build-capi.tar.gz package/cache/wasmer-windows-gnu64.tar.gz + cp package/cache/wasmercache3/build-capi.tar.gz package/cache/wasmer-darwin-arm64.tar.gz + cp package/cache/wasmercache4/build-capi.tar.gz package/cache/wasmer-darwin-amd64.tar.gz + cp package/cache/wasmercache5/build-capi.tar.gz package/cache/wasmer-linux-amd64.tar.gz + cp package/cache/wasmercache6/wasmer.tar.gz package/cache/wasmer-linux-riscv64.tar.gz + - uses: actions/download-artifact@v4 + if: ${{ matrix.build == 'windows-x64' }} + with: + name: capi-windows-x64 + path: download_link + - uses: actions/download-artifact@v4 + if: ${{ matrix.build == 'linux-musl' }} + with: + name: capi-linux-musl + path: download_link + - uses: actions/download-artifact@v4 + if: ${{ matrix.build == 'macos-arm' }} + with: + name: capi-macos-arm + path: download_link + - uses: actions/download-artifact@v4 + if: ${{ matrix.build == 'macos-x64' }} + with: + name: capi-macos-x64 + path: download_link + - uses: actions/download-artifact@v4 + if: ${{ matrix.build == 'linux-x64' }} + with: + name: capi-linux-x64 + path: download_link + - name: Copy build-capi.tar.gz to link.tar.gz + shell: bash + run: | + cp download_link/build-capi.tar.gz link.tar.gz + - name: Unzip Artifacts + shell: bash + run: | + make untar-capi + - name: Unzip Artifacts + shell: bash + run: | + make untar-wasmer -# # Removed in favour of freestanding integration tests -# # -# # - name: Test integration CLI -# # if: false # matrix.build != 'macos-arm' -# # shell: bash -# # run: | -# # export WASMER_PATH=`pwd`/target/${{ matrix.target }}/release/wasmer${{ matrix.exe }} -# # export WASMER_DIR=`pwd`/package && make test-integration-cli-ci -# # env: -# # TARGET: ${{ matrix.target }} -# # TARGET_DIR: target/${{ matrix.target }}/release -# # CARGO_TARGET: ${{ matrix.target }} -# # WAPM_DEV_TOKEN: ${{ secrets.WAPM_DEV_TOKEN }} -# # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # Removed in favour of freestanding integration tests + # + # - name: Test integration CLI + # if: false # matrix.build != 'macos-arm' + # shell: bash + # run: | + # export WASMER_PATH=`pwd`/target/${{ matrix.target }}/release/wasmer${{ matrix.exe }} + # export WASMER_DIR=`pwd`/package && make test-integration-cli-ci + # env: + # TARGET: ${{ matrix.target }} + # TARGET_DIR: target/${{ matrix.target }}/release + # CARGO_TARGET: ${{ matrix.target }} + # WAPM_DEV_TOKEN: ${{ secrets.WAPM_DEV_TOKEN }} + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} -# # ---- -# # Note (xdoardo on 2024/10/07): -# # --- -# # As of now the WAMR, WASMI (and V8) backends are not that mature enough. We will re-enable these tests -# # when they've been used and matured. -# # ---- -# # -# # - name: Test CLI integration (WAMR) -# # shell: bash -# # run: | -# # export WASMER_PATH=`pwd`/target/${{ matrix.target }}/release/wasmer${{ matrix.exe }} -# # export WASMER_DIR=`pwd`/package && make test-integration-cli-wamr-ci -# # env: -# # TARGET: ${{ matrix.target }} -# # TARGET_DIR: target/${{ matrix.target }}/release -# # CARGO_TARGET: ${{ matrix.target }} -# # WAPM_DEV_TOKEN: ${{ secrets.WAPM_DEV_TOKEN }} -# # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # ---- + # Note (xdoardo on 2024/10/07): + # --- + # As of now the WAMR, WASMI (and V8) backends are not that mature enough. We will re-enable these tests + # when they've been used and matured. + # ---- + # + # - name: Test CLI integration (WAMR) + # shell: bash + # run: | + # export WASMER_PATH=`pwd`/target/${{ matrix.target }}/release/wasmer${{ matrix.exe }} + # export WASMER_DIR=`pwd`/package && make test-integration-cli-wamr-ci + # env: + # TARGET: ${{ matrix.target }} + # TARGET_DIR: target/${{ matrix.target }}/release + # CARGO_TARGET: ${{ matrix.target }} + # WAPM_DEV_TOKEN: ${{ secrets.WAPM_DEV_TOKEN }} + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} -# # - name: Test CLI integration (WASMI) -# # shell: bash -# # run: | -# # export WASMER_PATH=`pwd`/target/${{ matrix.target }}/release/wasmer${{ matrix.exe }} -# # export WASMER_DIR=`pwd`/package && make test-integration-cli-wasmi-ci -# # env: -# # TARGET: ${{ matrix.target }} -# # TARGET_DIR: target/${{ matrix.target }}/release -# # CARGO_TARGET: ${{ matrix.target }} -# # WAPM_DEV_TOKEN: ${{ secrets.WAPM_DEV_TOKEN }} -# # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # - name: Test CLI integration (WASMI) + # shell: bash + # run: | + # export WASMER_PATH=`pwd`/target/${{ matrix.target }}/release/wasmer${{ matrix.exe }} + # export WASMER_DIR=`pwd`/package && make test-integration-cli-wasmi-ci + # env: + # TARGET: ${{ matrix.target }} + # TARGET_DIR: target/${{ matrix.target }}/release + # CARGO_TARGET: ${{ matrix.target }} + # WAPM_DEV_TOKEN: ${{ secrets.WAPM_DEV_TOKEN }} + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} -# # there is another set of integration tests in 'wasmer-integration-tests' repo. Run those -# test-wasmer-integration-tests: -# needs: [build] -# runs-on: ubuntu-22.04 -# steps: -# - name: Checkout wasmer-integration-tests repository -# uses: actions/checkout@v3 -# with: -# repository: wasmerio/wasmer-integration-tests -# submodules: true -# token: ${{ secrets.CLONE_WASMER_INTEGRATION_TESTS }} -# - uses: actions/download-artifact@v4 -# with: -# name: wasmer-cli-linux-x64 -# - name: Cargo Registry Cache -# uses: actions/cache@v3 -# with: -# path: | -# ~/.cargo/advisory-db -# ~/.cargo/git -# ~/.cargo/registry -# key: cargo-registry-${{ hashFiles('**/Cargo.lock') }} -# - name: Cargo target cache -# uses: actions/cache@v3 -# with: -# path: | -# target/ -# key: cargo-release-${{ hashFiles('**/Cargo.lock') }} -# - run: | -# # install rust toolchain -# curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y -# . "$HOME/.cargo/env" + # there is another set of integration tests in 'wasmer-integration-tests' repo. Run those + test-wasmer-integration-tests: + needs: [build] + runs-on: ubuntu-22.04 + steps: + - name: Checkout wasmer-integration-tests repository + uses: actions/checkout@v3 + with: + repository: wasmerio/wasmer-integration-tests + submodules: true + token: ${{ secrets.CLONE_WASMER_INTEGRATION_TESTS }} + - uses: actions/download-artifact@v4 + with: + name: wasmer-cli-linux-x64 + - name: Cargo Registry Cache + uses: actions/cache@v3 + with: + path: | + ~/.cargo/advisory-db + ~/.cargo/git + ~/.cargo/registry + key: cargo-registry-${{ hashFiles('**/Cargo.lock') }} + - name: Cargo target cache + uses: actions/cache@v3 + with: + path: | + target/ + key: cargo-release-${{ hashFiles('**/Cargo.lock') }} + - run: | + # install rust toolchain + curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y + . "$HOME/.cargo/env" -# # add wasmer cli to PATH -# tar -xzf build-wasmer.tar.gz + # add wasmer cli to PATH + tar -xzf build-wasmer.tar.gz -# docker build -t tmp . -# docker run -v $PWD:/app -w /app tmp bash -c " \ -# cp ./bin/wasmer /root/.wasmer/bin/wasmer &&\ -# export MYSQL_HOST='${{ vars.INTEGRATION_TEST_MYSQL_HOST }}' &&\ -# export MYSQL_DBNAME='${{ vars.INTEGRATION_TEST_MYSQL_DBNAME }}' &&\ -# export MYSQL_USERNAME='${{ secrets.INTEGRATION_TEST_MYSQL_USERNAME }}' &&\ -# export MYSQL_PASSWORD='${{ secrets.INTEGRATION_TEST_MYSQL_PASSWORD }}' &&\ -# export MYSQL_PORT='${{ vars.INTEGRATION_TEST_MYSQL_PORT }}' &&\ -# export MYSQL_CERT='${{ secrets.INTEGRATION_TEST_MYSQL_CERT }}' &&\ -# export PG_HOST='${{ vars.INTEGRATION_TEST_PG_HOST }}' &&\ -# export PG_DBNAME='${{ vars.INTEGRATION_TEST_PG_DBNAME }}' &&\ -# export PG_USERNAME='${{ secrets.INTEGRATION_TEST_PG_USERNAME }}' &&\ -# export PG_PASSWORD='${{ secrets.INTEGRATION_TEST_PG_PASSWORD }}' &&\ -# export PG_PORT='${{ vars.INTEGRATION_TEST_PG_PORT }}' &&\ -# wasmer config set registry.url https://registry.wasmer.io/graphql &&\ -# wasmer login '${{ secrets.WAPM_PROD_TOKEN }}' &&\ -# wasmer config set registry.url https://registry.wasmer.wtf/graphql &&\ -# wasmer login '${{ secrets.WAPM_DEV_TOKEN }}' &&\ -# cargo test --no-fail-fast" -# - name: notify failure in slack -# if: failure() -# run: | -# curl -X POST -H 'Content-type: application/json' --data '{"text":"Integration tests failed ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"}' ${{ secrets.INTEGRATION_TEST_SLACK_WEBHOOK }} + docker build -t tmp . + docker run -v $PWD:/app -w /app tmp bash -c " \ + cp ./bin/wasmer /root/.wasmer/bin/wasmer &&\ + export MYSQL_HOST='${{ vars.INTEGRATION_TEST_MYSQL_HOST }}' &&\ + export MYSQL_DBNAME='${{ vars.INTEGRATION_TEST_MYSQL_DBNAME }}' &&\ + export MYSQL_USERNAME='${{ secrets.INTEGRATION_TEST_MYSQL_USERNAME }}' &&\ + export MYSQL_PASSWORD='${{ secrets.INTEGRATION_TEST_MYSQL_PASSWORD }}' &&\ + export MYSQL_PORT='${{ vars.INTEGRATION_TEST_MYSQL_PORT }}' &&\ + export MYSQL_CERT='${{ secrets.INTEGRATION_TEST_MYSQL_CERT }}' &&\ + export PG_HOST='${{ vars.INTEGRATION_TEST_PG_HOST }}' &&\ + export PG_DBNAME='${{ vars.INTEGRATION_TEST_PG_DBNAME }}' &&\ + export PG_USERNAME='${{ secrets.INTEGRATION_TEST_PG_USERNAME }}' &&\ + export PG_PASSWORD='${{ secrets.INTEGRATION_TEST_PG_PASSWORD }}' &&\ + export PG_PORT='${{ vars.INTEGRATION_TEST_PG_PORT }}' &&\ + wasmer config set registry.url https://registry.wasmer.io/graphql &&\ + wasmer login '${{ secrets.WAPM_PROD_TOKEN }}' &&\ + wasmer config set registry.url https://registry.wasmer.wtf/graphql &&\ + wasmer login '${{ secrets.WAPM_DEV_TOKEN }}' &&\ + cargo test --no-fail-fast" + - name: notify failure in slack + if: failure() + run: | + curl -X POST -H 'Content-type: application/json' --data '{"text":"Integration tests failed ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"}' ${{ secrets.INTEGRATION_TEST_SLACK_WEBHOOK }} diff --git a/.github/workflows/wasmer-config.yaml b/.github/workflows/wasmer-config.yaml index 90a36b31efd..9091574b1e3 100644 --- a/.github/workflows/wasmer-config.yaml +++ b/.github/workflows/wasmer-config.yaml @@ -1,54 +1,54 @@ -# # Dedicated workflow just for the wasmer-config crate -# name: wasmer-config +# Dedicated workflow just for the wasmer-config crate +name: wasmer-config -# on: -# push: -# branches: -# - main -# pull_request: +on: + push: + branches: + - main + pull_request: -# # Automatically cancel previous workflow runs when a new commit is pushed. -# concurrency: -# group: ${{ github.workflow }}-${{ github.ref }} -# cancel-in-progress: true +# Automatically cancel previous workflow runs when a new commit is pushed. +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true -# env: -# DEFAULT_CRATE_NAME: wasmer_toml +env: + DEFAULT_CRATE_NAME: wasmer_toml -# jobs: -# check: -# name: Compile and Test -# runs-on: ubuntu-latest -# steps: -# - uses: actions/checkout@v2 -# - name: Rust Cache -# uses: Swatinem/rust-cache@v2 -# - name: Setup Rust -# uses: dsherret/rust-toolchain-file@v1 -# - name: Install Nextest -# uses: taiki-e/install-action@nextest -# - name: Type Checking -# run: | -# cd lib/config && cargo check --verbose --locked -# - name: Build -# run: | -# cd lib/config && cargo build --verbose --locked -# - name: Test -# run: | -# cd lib/config && cargo nextest run --verbose --locked +jobs: + check: + name: Compile and Test + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Rust Cache + uses: Swatinem/rust-cache@v2 + - name: Setup Rust + uses: dsherret/rust-toolchain-file@v1 + - name: Install Nextest + uses: taiki-e/install-action@nextest + - name: Type Checking + run: | + cd lib/config && cargo check --verbose --locked + - name: Build + run: | + cd lib/config && cargo build --verbose --locked + - name: Test + run: | + cd lib/config && cargo nextest run --verbose --locked -# lints: -# name: Linting and Formatting -# runs-on: ubuntu-latest -# steps: -# - uses: actions/checkout@v2 -# - name: Rust Cache -# uses: Swatinem/rust-cache@v2 -# - name: Setup Rust -# uses: dsherret/rust-toolchain-file@v1 -# - name: Check Formatting -# run: | -# cd lib/config && cargo fmt --verbose --check -# - name: Clippy -# run: | -# cd lib/config && cargo clippy --verbose + lints: + name: Linting and Formatting + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Rust Cache + uses: Swatinem/rust-cache@v2 + - name: Setup Rust + uses: dsherret/rust-toolchain-file@v1 + - name: Check Formatting + run: | + cd lib/config && cargo fmt --verbose --check + - name: Clippy + run: | + cd lib/config && cargo clippy --verbose From 11381bb2959cdbbc1a7ec07ae8460c634a16a476 Mon Sep 17 00:00:00 2001 From: "M.Amin Rayej" Date: Sun, 27 Oct 2024 23:49:05 +0330 Subject: [PATCH 15/39] enable musl builds --- .github/workflows/build.yml | 586 +++---- .github/workflows/test.yaml | 2176 +++++++++++++------------- .github/workflows/wasmer-config.yaml | 98 +- Cargo.lock | 11 - lib/api/Cargo.toml | 2 +- lib/api/build.rs | 17 +- 6 files changed, 1470 insertions(+), 1420 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2eb50a6b9bb..d0c2288643e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -12,6 +12,9 @@ on: tags: # this is _not_ a regex, see: https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#filter-pattern-cheat-sheet - '[0-9]+.[0-9]+.[0-9]+*' + pull_request: + branches: + - 'main' workflow_dispatch: inputs: release: @@ -43,152 +46,166 @@ jobs: fail-fast: false matrix: include: - - build: linux-arm64 - os: arm64-ubuntu-latest-8-cores - artifact_name: 'wasmer-linux-aarch64' - cross_compilation_artifact_name: 'cross_compiled_from_linux' - use_sccache: false - use_llvm: true - build_wasm: true - - build: linux-x64 - os: ubuntu-22.04 - artifact_name: 'wasmer-linux-amd64' - llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-amd64.tar.xz' - cross_compilation_artifact_name: 'cross_compiled_from_linux' - use_sccache: false - use_llvm: true - build_wasm: true - - build: linux-x64-v8 - os: ubuntu-22.04 - artifact_name: 'wasmer-v8-linux-amd64' - llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-amd64.tar.xz' - cross_compilation_artifact_name: 'cross_compiled_from_linux' + # - build: linux-arm64 + # os: arm64-ubuntu-latest-8-cores + # artifact_name: 'wasmer-linux-aarch64' + # cross_compilation_artifact_name: 'cross_compiled_from_linux' + # use_sccache: false + # use_llvm: true + # build_wasm: true + # - build: linux-x64 + # os: ubuntu-22.04 + # artifact_name: 'wasmer-linux-amd64' + # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-amd64.tar.xz' + # cross_compilation_artifact_name: 'cross_compiled_from_linux' + # use_sccache: false + # use_llvm: true + # build_wasm: true + # - build: linux-x64-v8 + # os: ubuntu-22.04 + # artifact_name: 'wasmer-v8-linux-amd64' + # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-amd64.tar.xz' + # cross_compilation_artifact_name: 'cross_compiled_from_linux' + # use_sccache: false + # use_llvm: true + # build_wasm: true + # - build: linux-x64-wamr + # os: ubuntu-22.04 + # artifact_name: 'wasmer-wamr-linux-amd64' + # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-amd64.tar.xz' + # cross_compilation_artifact_name: 'cross_compiled_from_linux' + # use_sccache: false + # use_llvm: true + # build_wasm: true + # - build: linux-x64-wasmi + # os: ubuntu-22.04 + # artifact_name: 'wasmer-wasmi-linux-amd64' + # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-amd64.tar.xz' + # cross_compilation_artifact_name: 'cross_compiled_from_linux' + # use_sccache: false + # use_llvm: true + # build_wasm: true + # - build: macos-x64 + # os: macos-13 + # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-amd64.tar.xz' + # artifact_name: 'wasmer-darwin-amd64' + # cross_compilation_artifact_name: 'cross_compiled_from_mac' + # use_sccache: false + # use_llvm: true + # build_wasm: false + # - build: macos-x64-v8 + # os: macos-13 + # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-amd64.tar.xz' + # artifact_name: 'wasmer-v8-darwin-amd64' + # cross_compilation_artifact_name: 'cross_compiled_from_mac' + # use_sccache: false + # use_llvm: true + # build_wasm: false + # - build: macos-x64-wamr + # os: macos-13 + # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-amd64.tar.xz' + # artifact_name: 'wasmer-wamr-darwin-amd64' + # cross_compilation_artifact_name: 'cross_compiled_from_mac' + # use_sccache: false + # use_llvm: true + # build_wasm: false + # - build: macos-x64-wasmi + # os: macos-13 + # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-amd64.tar.xz' + # artifact_name: 'wasmer-wasmi-darwin-amd64' + # cross_compilation_artifact_name: 'cross_compiled_from_mac' + # use_sccache: false + # use_llvm: true + # build_wasm: false + # - build: macos-arm64 + # os: macos-14 + # target: aarch64-apple-darwin + # artifact_name: 'wasmer-darwin-arm64' + # use_sccache: false + # use_llvm: false + # build_wasm: false + # # [todo] xdoardo: Reinstate when the code we generate for aarch64 is working correctly. + # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-aarch64.tar.xz' + # - build: macos-arm64-v8 + # os: macos-14 + # target: aarch64-apple-darwin + # artifact_name: 'wasmer-v8-darwin-arm64' + # use_sccache: false + # use_llvm: false + # build_wasm: false + # # [todo] xdoardo: Reinstate when the code we generate for aarch64 is working correctly. + # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-aarch64.tar.xz' + # - build: macos-arm64-wamr + # os: macos-14 + # target: aarch64-apple-darwin + # artifact_name: 'wasmer-wamr-darwin-arm64' + # use_sccache: false + # use_llvm: false + # build_wasm: false + # # [todo] xdoardo: Reinstate when the code we generate for aarch64 is working correctly. + # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-aarch64.tar.xz' + # - build: macos-arm64-wasmi + # os: macos-14 + # target: aarch64-apple-darwin + # artifact_name: 'wasmer-wasmi-darwin-arm64' + # use_sccache: false + # use_llvm: false + # build_wasm: false + # # [todo] xdoardo: Reinstate when the code we generate for aarch64 is working correctly. + # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-aarch64.tar.xz' + # - build: windows-x64 + # os: windows-2022 + # artifact_name: 'wasmer-windows-amd64' + # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-windows-amd64.tar.xz' + # cross_compilation_artifact_name: 'cross_compiled_from_win' + # use_sccache: false + # use_llvm: true + # build_wasm: false + # - build: windows-x64-v8 + # os: windows-2022 + # artifact_name: 'wasmer-v8-windows-amd64' + # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-windows-amd64.tar.xz' + # cross_compilation_artifact_name: 'cross_compiled_from_win' + # use_sccache: false + # use_llvm: true + # build_wasm: false + # - build: windows-x64-wamr + # os: windows-2022 + # artifact_name: 'wasmer-wamr-windows-amd64' + # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-windows-amd64.tar.xz' + # cross_compilation_artifact_name: 'cross_compiled_from_win' + # use_sccache: false + # use_llvm: true + # build_wasm: false + # - build: windows-x64-wasmi + # os: windows-2022 + # artifact_name: 'wasmer-wasmi-windows-amd64' + # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-windows-amd64.tar.xz' + # cross_compilation_artifact_name: 'cross_compiled_from_win' + # use_sccache: false + # use_llvm: true + # build_wasm: false + - build: linux-musl-x64 + os: ubuntu-latest + artifact_name: 'wasmer-linux-musl-amd64' + container: alpine:latest use_sccache: false - use_llvm: true + use_llvm: false build_wasm: true - - build: linux-x64-wamr + - build: linux-musl-x64-v8 os: ubuntu-22.04 - artifact_name: 'wasmer-wamr-linux-amd64' - llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-amd64.tar.xz' + artifact_name: 'wasmer-v8-linux-musl-amd64' cross_compilation_artifact_name: 'cross_compiled_from_linux' use_sccache: false use_llvm: true build_wasm: true - - build: linux-x64-wasmi + - build: linux-musl-x64-wasmi os: ubuntu-22.04 - artifact_name: 'wasmer-wasmi-linux-amd64' - llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-amd64.tar.xz' + artifact_name: 'wasmer-wasmi-linux-musl-amd64' cross_compilation_artifact_name: 'cross_compiled_from_linux' use_sccache: false use_llvm: true build_wasm: true - - build: macos-x64 - os: macos-13 - llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-amd64.tar.xz' - artifact_name: 'wasmer-darwin-amd64' - cross_compilation_artifact_name: 'cross_compiled_from_mac' - use_sccache: false - use_llvm: true - build_wasm: false - - build: macos-x64-v8 - os: macos-13 - llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-amd64.tar.xz' - artifact_name: 'wasmer-v8-darwin-amd64' - cross_compilation_artifact_name: 'cross_compiled_from_mac' - use_sccache: false - use_llvm: true - build_wasm: false - - build: macos-x64-wamr - os: macos-13 - llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-amd64.tar.xz' - artifact_name: 'wasmer-wamr-darwin-amd64' - cross_compilation_artifact_name: 'cross_compiled_from_mac' - use_sccache: false - use_llvm: true - build_wasm: false - - build: macos-x64-wasmi - os: macos-13 - llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-amd64.tar.xz' - artifact_name: 'wasmer-wasmi-darwin-amd64' - cross_compilation_artifact_name: 'cross_compiled_from_mac' - use_sccache: false - use_llvm: true - build_wasm: false - - build: macos-arm64 - os: macos-14 - target: aarch64-apple-darwin - artifact_name: 'wasmer-darwin-arm64' - use_sccache: false - use_llvm: false - build_wasm: false - # [todo] xdoardo: Reinstate when the code we generate for aarch64 is working correctly. - llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-aarch64.tar.xz' - - build: macos-arm64-v8 - os: macos-14 - target: aarch64-apple-darwin - artifact_name: 'wasmer-v8-darwin-arm64' - use_sccache: false - use_llvm: false - build_wasm: false - # [todo] xdoardo: Reinstate when the code we generate for aarch64 is working correctly. - llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-aarch64.tar.xz' - - build: macos-arm64-wamr - os: macos-14 - target: aarch64-apple-darwin - artifact_name: 'wasmer-wamr-darwin-arm64' - use_sccache: false - use_llvm: false - build_wasm: false - # [todo] xdoardo: Reinstate when the code we generate for aarch64 is working correctly. - llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-aarch64.tar.xz' - - build: macos-arm64-wasmi - os: macos-14 - target: aarch64-apple-darwin - artifact_name: 'wasmer-wasmi-darwin-arm64' - use_sccache: false - use_llvm: false - build_wasm: false - # [todo] xdoardo: Reinstate when the code we generate for aarch64 is working correctly. - llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-aarch64.tar.xz' - - build: windows-x64 - os: windows-2022 - artifact_name: 'wasmer-windows-amd64' - llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-windows-amd64.tar.xz' - cross_compilation_artifact_name: 'cross_compiled_from_win' - use_sccache: false - use_llvm: true - build_wasm: false - - build: windows-x64-v8 - os: windows-2022 - artifact_name: 'wasmer-v8-windows-amd64' - llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-windows-amd64.tar.xz' - cross_compilation_artifact_name: 'cross_compiled_from_win' - use_sccache: false - use_llvm: true - build_wasm: false - - build: windows-x64-wamr - os: windows-2022 - artifact_name: 'wasmer-wamr-windows-amd64' - llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-windows-amd64.tar.xz' - cross_compilation_artifact_name: 'cross_compiled_from_win' - use_sccache: false - use_llvm: true - build_wasm: false - - build: windows-x64-wasmi - os: windows-2022 - artifact_name: 'wasmer-wasmi-windows-amd64' - llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-windows-amd64.tar.xz' - cross_compilation_artifact_name: 'cross_compiled_from_win' - use_sccache: false - use_llvm: true - build_wasm: false - - build: linux-musl-x64 - os: ubuntu-latest - artifact_name: 'wasmer-linux-musl-amd64' - container: alpine:latest - use_sccache: false - use_llvm: false - build_wasm: true container: ${{ matrix.container }} env: SCCACHE_AZURE_BLOB_CONTAINER: wasmerstoragesccacheblob @@ -197,8 +214,9 @@ jobs: steps: - uses: actions/checkout@v3 - name: Set up base deps on musl - if: matrix.build == 'linux-musl-x64' - run: ./scripts/alpine-linux-install-deps.sh + if: startsWith(matrix.build, 'linux-musl-x64') + run: | + apk add bash mold make curl cmake ninja clang18 zstd-static llvm18-dev clang18-static llvm18-static ncurses-static zlib-static - name: Install Linux tools if: startsWith(matrix.build, 'linux-x64') run: | @@ -345,19 +363,36 @@ jobs: if: ${{ endsWith(matrix.build, 'v8') && startsWith(matrix.build, 'linux-x64') }} run: | RUSTFLAGS="-C linker=clang -C link-arg=-fuse-ld=mold" make build-wasmer-v8 + - name: Build Wasmer with v8 backend musl + if: ${{ endsWith(matrix.build, 'v8') && startsWith(matrix.build, 'linux-musl') }} + run: | + ln -s /usr/bin/clang-18 /usr/bin/clang + echo "#!/bin/bash" >> /usr/bin/llvm-config + echo 'if [ "$1" = "--libs" ]; then' >> /usr/bin/llvm-config + echo 'llvm-config-18 "$@" "--link-static"' >> /usr/bin/llvm-config + echo "else" >> /usr/bin/llvm-config + echo 'llvm-config-18 "$@"' >> /usr/bin/llvm-config + echo 'fi' >> /usr/bin/llvm-config + cat /usr/bin/llvm-config + chmod +x /usr/bin/llvm-config + LLVM_CONFIG_PATH=/usr/bin/llvm-config RUSTFLAGS="-C linker=clang -C link-arg=-fuse-ld=mold -lzstd" make build-wasmer-v8 - name: Build Wasmer with v8 backend if: ${{ endsWith(matrix.build, 'v8') && !startsWith(matrix.build, 'linux-x64') }} run: | echo $LIBCLANG_STATIC_PATH make build-wasmer-v8 - name: Build Wasmer with wamr backend - if: endsWith(matrix.build, 'wamr') + if: ${{ endsWith(matrix.build, 'wamr') && !startsWith(matrix.build, 'linux-musl') }} run: | make build-wasmer-wamr - name: Build Wasmer with wasmi backend - if: endsWith(matrix.build, 'wasmi') + if: ${{ endsWith(matrix.build, 'wasmi') && !startsWith(matrix.build, 'linux-musl') }} run: | make build-wasmer-wasmi + - name: Build Wasmer with wasmi backend musl + if: ${{ endsWith(matrix.build, 'wasmi') && startsWith(matrix.build, 'linux-musl') }} + run: | + LLVM_CONFIG_PATH=/usr/bin/llvm-config RUSTFLAGS="-C linker=clang -C link-arg=-fuse-ld=mold -lzstd" make build-wasmer-wasmi - name: Build Wasmer binary without LLVM if: matrix.use_llvm != true shell: bash @@ -404,134 +439,134 @@ jobs: if-no-files-found: error retention-days: 2 - windows_gnu: - name: Windows GNU - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: Install Windows-GNU linker - shell: bash - run: | - sudo apt install -y mingw-w64 - - uses: dtolnay/rust-toolchain@stable - with: - target: x86_64-pc-windows-gnu - - name: Install Windows-GNU target - shell: bash - run: | - rustup target add x86_64-pc-windows-gnu - - name: Install Windows 10 SDK with xwin - shell: bash - run: | - mkdir -p /tmp/xwin - mkdir -p /tmp/xwindownload - mkdir -p /tmp/xwincache - git clone https://github.com/wasmerio/xwin --depth=1 /tmp/xwin - cargo build --release --manifest-path=/tmp/xwin/Cargo.toml - /tmp/xwin/target/release/xwin --accept-license --cache-dir /tmp/xwincache splat --output /tmp/xwindownload - mkdir -p /tmp/winsdk - cp /tmp/xwindownload/sdk/lib/10.0.20348/um/x86_64/WS2_32.lib /tmp/winsdk/ - cp /tmp/xwindownload/sdk/lib/10.0.20348/um/x86_64/KERNEL32.lib /tmp/winsdk/ - cp /tmp/xwindownload/sdk/lib/10.0.20348/um/x86_64/BCRYPT.lib /tmp/winsdk/ - cp /tmp/xwindownload/sdk/lib/10.0.20348/um/x86_64/ADVAPI32.lib /tmp/winsdk/ - cp /tmp/xwindownload/sdk/lib/10.0.20348/um/x86_64/USERENV.lib /tmp/winsdk/ - echo "WinSDK files:" - ls -laH /tmp/winsdk - echo "" - mkdir -p package - mkdir -p package/winsdk - cp -r /tmp/winsdk/* package/winsdk - - name: Build Wasmer C-API without LLVM - shell: bash - run: | - make build-capi - env: - RUSTFLAGS: -Cpanic=abort - CARGO_TARGET: x86_64-pc-windows-gnu - ENABLE_LLVM: 0 - - name: Build Wasmer C-API headless without LLVM - shell: bash - run: | - make build-capi-headless - env: - RUSTFLAGS: -Cpanic=abort - CARGO_TARGET: x86_64-pc-windows-gnu - ENABLE_LLVM: 0 - - name: Dist - run: | - make distribution-gnu - env: - CARGO_TARGET: x86_64-pc-windows-gnu - TARGET_DIR: target/x86_64-pc-windows-gnu/release - - name: Upload Artifacts - uses: actions/upload-artifact@v4 - with: - name: 'wasmer-windows-gnu64' - path: dist - if-no-files-found: error - retention-days: 2 + # windows_gnu: + # name: Windows GNU + # runs-on: ubuntu-latest + # steps: + # - uses: actions/checkout@v3 + # - name: Install Windows-GNU linker + # shell: bash + # run: | + # sudo apt install -y mingw-w64 + # - uses: dtolnay/rust-toolchain@stable + # with: + # target: x86_64-pc-windows-gnu + # - name: Install Windows-GNU target + # shell: bash + # run: | + # rustup target add x86_64-pc-windows-gnu + # - name: Install Windows 10 SDK with xwin + # shell: bash + # run: | + # mkdir -p /tmp/xwin + # mkdir -p /tmp/xwindownload + # mkdir -p /tmp/xwincache + # git clone https://github.com/wasmerio/xwin --depth=1 /tmp/xwin + # cargo build --release --manifest-path=/tmp/xwin/Cargo.toml + # /tmp/xwin/target/release/xwin --accept-license --cache-dir /tmp/xwincache splat --output /tmp/xwindownload + # mkdir -p /tmp/winsdk + # cp /tmp/xwindownload/sdk/lib/10.0.20348/um/x86_64/WS2_32.lib /tmp/winsdk/ + # cp /tmp/xwindownload/sdk/lib/10.0.20348/um/x86_64/KERNEL32.lib /tmp/winsdk/ + # cp /tmp/xwindownload/sdk/lib/10.0.20348/um/x86_64/BCRYPT.lib /tmp/winsdk/ + # cp /tmp/xwindownload/sdk/lib/10.0.20348/um/x86_64/ADVAPI32.lib /tmp/winsdk/ + # cp /tmp/xwindownload/sdk/lib/10.0.20348/um/x86_64/USERENV.lib /tmp/winsdk/ + # echo "WinSDK files:" + # ls -laH /tmp/winsdk + # echo "" + # mkdir -p package + # mkdir -p package/winsdk + # cp -r /tmp/winsdk/* package/winsdk + # - name: Build Wasmer C-API without LLVM + # shell: bash + # run: | + # make build-capi + # env: + # RUSTFLAGS: -Cpanic=abort + # CARGO_TARGET: x86_64-pc-windows-gnu + # ENABLE_LLVM: 0 + # - name: Build Wasmer C-API headless without LLVM + # shell: bash + # run: | + # make build-capi-headless + # env: + # RUSTFLAGS: -Cpanic=abort + # CARGO_TARGET: x86_64-pc-windows-gnu + # ENABLE_LLVM: 0 + # - name: Dist + # run: | + # make distribution-gnu + # env: + # CARGO_TARGET: x86_64-pc-windows-gnu + # TARGET_DIR: target/x86_64-pc-windows-gnu/release + # - name: Upload Artifacts + # uses: actions/upload-artifact@v4 + # with: + # name: 'wasmer-windows-gnu64' + # path: dist + # if-no-files-found: error + # retention-days: 2 - darwin_aarch64_jsc: - name: macOS aarch64 (JSC) - runs-on: macos-12 - steps: - - uses: actions/checkout@v3 - - uses: dtolnay/rust-toolchain@stable - with: - target: aarch64-apple-darwin - - name: Install Darwin-aarch64 target - shell: bash - run: | - rustup target add aarch64-apple-darwin - - name: Build Wasmer C-API (JSC) - shell: bash - run: | - make build-capi-jsc - env: - RUSTFLAGS: -Cpanic=abort - CARGO_TARGET: aarch64-apple-darwin - - name: Dist - run: | - make distribution - env: - CARGO_TARGET: aarch64-apple-darwin - TARGET_DIR: target/aarch64-apple-darwin/release - - name: Upload Artifacts - uses: actions/upload-artifact@v4 - with: - name: 'aarch64-apple-darwin-jsc' - path: dist - if-no-files-found: error - retention-days: 2 + # darwin_aarch64_jsc: + # name: macOS aarch64 (JSC) + # runs-on: macos-12 + # steps: + # - uses: actions/checkout@v3 + # - uses: dtolnay/rust-toolchain@stable + # with: + # target: aarch64-apple-darwin + # - name: Install Darwin-aarch64 target + # shell: bash + # run: | + # rustup target add aarch64-apple-darwin + # - name: Build Wasmer C-API (JSC) + # shell: bash + # run: | + # make build-capi-jsc + # env: + # RUSTFLAGS: -Cpanic=abort + # CARGO_TARGET: aarch64-apple-darwin + # - name: Dist + # run: | + # make distribution + # env: + # CARGO_TARGET: aarch64-apple-darwin + # TARGET_DIR: target/aarch64-apple-darwin/release + # - name: Upload Artifacts + # uses: actions/upload-artifact@v4 + # with: + # name: 'aarch64-apple-darwin-jsc' + # path: dist + # if-no-files-found: error + # retention-days: 2 - darwin_x86_64_jsc: - name: macOS x86_64 (JSC) - runs-on: macos-12 - steps: - - uses: actions/checkout@v3 - - uses: dtolnay/rust-toolchain@stable - with: - target: x86_64-apple-darwin - - name: Build Wasmer C-API (JSC) - shell: bash - run: | - make build-capi-jsc - env: - RUSTFLAGS: -Cpanic=abort - CARGO_TARGET: x86_64-apple-darwin - - name: Dist - run: | - make distribution - env: - CARGO_TARGET: x86_64-apple-darwin - TARGET_DIR: target/x86_64-apple-darwin/release - - name: Upload Artifacts - uses: actions/upload-artifact@v4 - with: - name: 'x86_64-apple-darwin-jsc' - path: dist - if-no-files-found: error - retention-days: 2 + # darwin_x86_64_jsc: + # name: macOS x86_64 (JSC) + # runs-on: macos-12 + # steps: + # - uses: actions/checkout@v3 + # - uses: dtolnay/rust-toolchain@stable + # with: + # target: x86_64-apple-darwin + # - name: Build Wasmer C-API (JSC) + # shell: bash + # run: | + # make build-capi-jsc + # env: + # RUSTFLAGS: -Cpanic=abort + # CARGO_TARGET: x86_64-apple-darwin + # - name: Dist + # run: | + # make distribution + # env: + # CARGO_TARGET: x86_64-apple-darwin + # TARGET_DIR: target/x86_64-apple-darwin/release + # - name: Upload Artifacts + # uses: actions/upload-artifact@v4 + # with: + # name: 'x86_64-apple-darwin-jsc' + # path: dist + # if-no-files-found: error + # retention-days: 2 # linux_riscv64: # name: Linux riscv64 @@ -600,7 +635,8 @@ jobs: release: # needs: [setup, build, linux_aarch64, windows_gnu, linux_riscv64] - needs: [setup, build, windows_gnu] + # needs: [setup, build, windows_gnu] + needs: [setup, build] runs-on: ubuntu-latest if: needs.setup.outputs.DOING_RELEASE == '1' || github.event.inputs.release != '' steps: @@ -736,6 +772,26 @@ jobs: asset_path: artifacts/wasmer-linux-musl-amd64/wasmer.tar.gz asset_name: wasmer-linux-musl-amd64.tar.gz asset_content_type: application/gzip + - name: Upload Release Asset Linux amd64 (musl) With v8 + 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-v8-linux-musl-amd64/wasmer.tar.gz + asset_name: wasmer-v8-linux-musl-amd64.tar.gz + asset_content_type: application/gzip + - name: Upload Release Asset Linux amd64 (musl) with wasmi + 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-wasmi-linux-musl-amd64/wasmer.tar.gz + asset_name: wasmer-wasmi-linux-musl-amd64.tar.gz + asset_content_type: application/gzip - name: Upload Release Asset Mac amd64 uses: actions/upload-release-asset@v1 env: diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 112367d6beb..8735dc95b7a 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -1,1135 +1,1135 @@ -name: test-sys +# name: test-sys -on: - push: - branches: - - main - - 'with-ci-.*' - - 'v3.0.x' - - 'v3.1.x' - pull_request: - workflow_dispatch: - inputs: - release: - description: 'Make release' +# on: +# push: +# branches: +# - main +# - 'with-ci-.*' +# - 'v3.0.x' +# - 'v3.1.x' +# pull_request: +# workflow_dispatch: +# inputs: +# release: +# description: 'Make release' -# Automatically cancel previous workflow runs when a new commit is pushed. -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true +# # Automatically cancel previous workflow runs when a new commit is pushed. +# concurrency: +# group: ${{ github.workflow }}-${{ github.ref }} +# cancel-in-progress: true -env: - RUST_BACKTRACE: 1 - # Sparse will be enabled by dtolnay/rust-toolchain when installing nightly - # Rust, but it's not stable on 1.69 yet. By explicitly setting the protocol we - # can override that behaviour - CARGO_REGISTRIES_CRATES_IO_PROTOCOL: git - MSRV: "1.81" - NEXTEST_PROFILE: "ci" - RUSTUP_WINDOWS_PATH_ADD_BIN: 1 - WASI_SDK_VERSION: "22" +# env: +# RUST_BACKTRACE: 1 +# # Sparse will be enabled by dtolnay/rust-toolchain when installing nightly +# # Rust, but it's not stable on 1.69 yet. By explicitly setting the protocol we +# # can override that behaviour +# CARGO_REGISTRIES_CRATES_IO_PROTOCOL: git +# MSRV: "1.81" +# NEXTEST_PROFILE: "ci" +# RUSTUP_WINDOWS_PATH_ADD_BIN: 1 +# WASI_SDK_VERSION: "22" -jobs: - setup: - name: Set up - runs-on: ubuntu-22.04 - outputs: - VERSION: ${{ steps.setup.outputs.VERSION }} - DOING_RELEASE: ${{ steps.setup.outputs.DOING_RELEASE }} - steps: - - name: Set up env vars - id: setup - shell: bash - run: | - VERSION=${GITHUB_REF/refs\/tags\//} - echo "VERSION=${VERSION}" >> $GITHUB_OUTPUT - DOING_RELEASE=$(echo $VERSION | grep -c '^[0-9]\+\.[0-9]\+\.[0-9]\+\(-\([a-zA-Z]\+\)\?[0-9]*\)\?$' || true) - echo "DOING_RELEASE=${DOING_RELEASE}" >> $GITHUB_OUTPUT - echo $VERSION - echo $DOING_RELEASE +# jobs: +# setup: +# name: Set up +# runs-on: ubuntu-22.04 +# outputs: +# VERSION: ${{ steps.setup.outputs.VERSION }} +# DOING_RELEASE: ${{ steps.setup.outputs.DOING_RELEASE }} +# steps: +# - name: Set up env vars +# id: setup +# shell: bash +# run: | +# VERSION=${GITHUB_REF/refs\/tags\//} +# echo "VERSION=${VERSION}" >> $GITHUB_OUTPUT +# DOING_RELEASE=$(echo $VERSION | grep -c '^[0-9]\+\.[0-9]\+\.[0-9]\+\(-\([a-zA-Z]\+\)\?[0-9]*\)\?$' || true) +# echo "DOING_RELEASE=${DOING_RELEASE}" >> $GITHUB_OUTPUT +# echo $VERSION +# echo $DOING_RELEASE - lint: - name: Code lint - runs-on: ubuntu-22.04 - steps: - - uses: actions/checkout@v3 - - name: Install Rust - uses: dtolnay/rust-toolchain@stable - with: - toolchain: ${{ env.MSRV }} - components: rustfmt, clippy - - name: Install libtinfo - shell: bash - run: | - sudo apt install -y libtinfo5 - - name: Install LLVM (Linux) - run: | - curl --proto '=https' --tlsv1.2 -sSf https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-amd64.tar.xz -L -o /opt/llvm.tar.xz - mkdir -p /opt/llvm-18 - tar xf /opt/llvm.tar.xz --strip-components=1 -C /opt/llvm-18 - echo '/opt/llvm-18/bin' >> $GITHUB_PATH - echo 'LLVM_SYS_180_PREFIX=/opt/llvm-18' >> $GITHUB_ENV - - name: Cache - uses: whywaita/actions-cache-s3@v2 - with: - path: | - ~/.cargo/* - ./target/* - key: r22-${{ github.repository }}-${{ runner.os }}-${{ hashFiles('Cargo.lock') }}-wasmer-make-lint-linux-x64 - aws-s3-bucket: wasmer-rust-artifacts-cache - aws-access-key-id: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_TOKEN }} - aws-secret-access-key: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_KEY }} - aws-region: auto - aws-endpoint: https://1541b1e8a3fc6ad155ce67ef38899700.r2.cloudflarestorage.com - aws-s3-bucket-endpoint: false - aws-s3-force-path-style: true - - run: make lint - env: - ENABLE_CRANELIFT: "1" - ENABLE_LLVM: "1" - ENABLE_SINGLEPASS: "1" - - name: Assert no files have changed - run: | - git status - ! [[ $(git status -s) ]] +# lint: +# name: Code lint +# runs-on: ubuntu-22.04 +# steps: +# - uses: actions/checkout@v3 +# - name: Install Rust +# uses: dtolnay/rust-toolchain@stable +# with: +# toolchain: ${{ env.MSRV }} +# components: rustfmt, clippy +# - name: Install libtinfo +# shell: bash +# run: | +# sudo apt install -y libtinfo5 +# - name: Install LLVM (Linux) +# run: | +# curl --proto '=https' --tlsv1.2 -sSf https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-amd64.tar.xz -L -o /opt/llvm.tar.xz +# mkdir -p /opt/llvm-18 +# tar xf /opt/llvm.tar.xz --strip-components=1 -C /opt/llvm-18 +# echo '/opt/llvm-18/bin' >> $GITHUB_PATH +# echo 'LLVM_SYS_180_PREFIX=/opt/llvm-18' >> $GITHUB_ENV +# - name: Cache +# uses: whywaita/actions-cache-s3@v2 +# with: +# path: | +# ~/.cargo/* +# ./target/* +# key: r22-${{ github.repository }}-${{ runner.os }}-${{ hashFiles('Cargo.lock') }}-wasmer-make-lint-linux-x64 +# aws-s3-bucket: wasmer-rust-artifacts-cache +# aws-access-key-id: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_TOKEN }} +# aws-secret-access-key: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_KEY }} +# aws-region: auto +# aws-endpoint: https://1541b1e8a3fc6ad155ce67ef38899700.r2.cloudflarestorage.com +# aws-s3-bucket-endpoint: false +# aws-s3-force-path-style: true +# - run: make lint +# env: +# ENABLE_CRANELIFT: "1" +# ENABLE_LLVM: "1" +# ENABLE_SINGLEPASS: "1" +# - name: Assert no files have changed +# run: | +# git status +# ! [[ $(git status -s) ]] - cargo_deny: - name: cargo-deny - runs-on: ubuntu-22.04 - steps: - - uses: actions/checkout@v3 - - uses: EmbarkStudios/cargo-deny-action@v1 - with: - log-level: error +# cargo_deny: +# name: cargo-deny +# runs-on: ubuntu-22.04 +# steps: +# - uses: actions/checkout@v3 +# - uses: EmbarkStudios/cargo-deny-action@v1 +# with: +# log-level: error - test_nodejs: - name: Test on NodeJS - runs-on: ubuntu-22.04 - steps: - - uses: actions/checkout@v3 - - name: Install Rust - uses: dtolnay/rust-toolchain@stable - with: - toolchain: ${{ env.MSRV }} - - name: Install NodeJS - uses: actions/setup-node@v2 - with: - node-version: 16 - - name: Install wasm-pack - run: | - curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh - - name: make test-js - run: | - make test-js +# test_nodejs: +# name: Test on NodeJS +# runs-on: ubuntu-22.04 +# steps: +# - uses: actions/checkout@v3 +# - name: Install Rust +# uses: dtolnay/rust-toolchain@stable +# with: +# toolchain: ${{ env.MSRV }} +# - name: Install NodeJS +# uses: actions/setup-node@v2 +# with: +# node-version: 16 +# - name: Install wasm-pack +# run: | +# curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh +# - name: make test-js +# run: | +# make test-js - test_wasi_fyi: - name: Test wasi-fyi - runs-on: ubuntu-22.04 - steps: - - uses: actions/checkout@v3 - - name: Install Rust - uses: dtolnay/rust-toolchain@stable - with: - toolchain: nightly - targets: "wasm32-wasi" - - name: Install wasm-pack - run: | - curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh - - name: Install LLVM 18 - run: | - curl --proto '=https' --tlsv1.2 -sSf https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-amd64.tar.xz -L -o llvm.tar.xz - LLVM_DIR=$(pwd)/${{ env.LLVM_DIR }} - mkdir ${LLVM_DIR} - tar xf llvm.tar.xz --strip-components=1 -C ${LLVM_DIR} - echo "ENABLE_LLVM=1" >> $GITHUB_ENV - echo "${LLVM_DIR}/bin" >> $GITHUB_PATH - echo "${LLVM_DIR}/usr/bin" >> $GITHUB_PATH - echo "LLVM_SYS_180_PREFIX=${LLVM_DIR}" >> $GITHUB_ENV - env: - LLVM_DIR: .llvm - - name: make test-wasi-fyi - run: | - make test-wasi-fyi +# test_wasi_fyi: +# name: Test wasi-fyi +# runs-on: ubuntu-22.04 +# steps: +# - uses: actions/checkout@v3 +# - name: Install Rust +# uses: dtolnay/rust-toolchain@stable +# with: +# toolchain: nightly +# targets: "wasm32-wasi" +# - name: Install wasm-pack +# run: | +# curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh +# - name: Install LLVM 18 +# run: | +# curl --proto '=https' --tlsv1.2 -sSf https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-amd64.tar.xz -L -o llvm.tar.xz +# LLVM_DIR=$(pwd)/${{ env.LLVM_DIR }} +# mkdir ${LLVM_DIR} +# tar xf llvm.tar.xz --strip-components=1 -C ${LLVM_DIR} +# echo "ENABLE_LLVM=1" >> $GITHUB_ENV +# echo "${LLVM_DIR}/bin" >> $GITHUB_PATH +# echo "${LLVM_DIR}/usr/bin" >> $GITHUB_PATH +# echo "LLVM_SYS_180_PREFIX=${LLVM_DIR}" >> $GITHUB_ENV +# env: +# LLVM_DIR: .llvm +# - name: make test-wasi-fyi +# run: | +# make test-wasi-fyi - # The no_std functionality doesn't work at the moment - no point in testing it. - # - name: make test-js-core - # run: | - # make test-js-core +# # The no_std functionality doesn't work at the moment - no point in testing it. +# # - name: make test-js-core +# # run: | +# # make test-js-core - test_wasix: - name: Test WASIX - runs-on: ubuntu-22.04 - steps: - - uses: actions/checkout@v3 - - name: Install Rust - uses: dtolnay/rust-toolchain@stable - with: - toolchain: ${{ env.MSRV }} - - name: Install Tools - run: | - sudo apt-get update - sudo apt-get install -y git llvm clang make lld curl - - name: Build wasix sysroot - run: | - cd ~ - git clone --recurse-submodules https://github.com/wasix-org/wasix-libc - cd wasix-libc - ./build32.sh - rm -rf /opt/wasix-sysroot - cp -r sysroot32 ~/wasix-sysroot - - name: Install wasi-sdk Tools - run: | - cd ~ - curl -L "https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-${{ env.WASI_SDK_VERSION }}/wasi-sdk-${{ env.WASI_SDK_VERSION }}.0-linux.tar.gz" -o wasi-sdk.tar.gz - tar -xzf wasi-sdk.tar.gz - cp -r wasi-sdk-${{ env.WASI_SDK_VERSION }}.0 ~/wasi-sdk - - name: Install LLVM 18 - run: | - curl --proto '=https' --tlsv1.2 -sSf https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-amd64.tar.xz -L -o llvm.tar.xz - LLVM_DIR=$(pwd)/${{ env.LLVM_DIR }} - mkdir ${LLVM_DIR} - tar xf llvm.tar.xz --strip-components=1 -C ${LLVM_DIR} - echo "ENABLE_LLVM=1" >> $GITHUB_ENV - echo "${LLVM_DIR}/bin" >> $GITHUB_PATH - echo "${LLVM_DIR}/usr/bin" >> $GITHUB_PATH - echo "LLVM_SYS_180_PREFIX=${LLVM_DIR}" >> $GITHUB_ENV - env: - LLVM_DIR: .llvm - - name: Install wasm-opt - run: | - sudo apt-get install -y binaryen - - name: make test-wasix - run: | - WASI_SDK=~/wasi-sdk WASIX_SYSROOT=~/wasix-sysroot make test-wasix +# test_wasix: +# name: Test WASIX +# runs-on: ubuntu-22.04 +# steps: +# - uses: actions/checkout@v3 +# - name: Install Rust +# uses: dtolnay/rust-toolchain@stable +# with: +# toolchain: ${{ env.MSRV }} +# - name: Install Tools +# run: | +# sudo apt-get update +# sudo apt-get install -y git llvm clang make lld curl +# - name: Build wasix sysroot +# run: | +# cd ~ +# git clone --recurse-submodules https://github.com/wasix-org/wasix-libc +# cd wasix-libc +# ./build32.sh +# rm -rf /opt/wasix-sysroot +# cp -r sysroot32 ~/wasix-sysroot +# - name: Install wasi-sdk Tools +# run: | +# cd ~ +# curl -L "https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-${{ env.WASI_SDK_VERSION }}/wasi-sdk-${{ env.WASI_SDK_VERSION }}.0-linux.tar.gz" -o wasi-sdk.tar.gz +# tar -xzf wasi-sdk.tar.gz +# cp -r wasi-sdk-${{ env.WASI_SDK_VERSION }}.0 ~/wasi-sdk +# - name: Install LLVM 18 +# run: | +# curl --proto '=https' --tlsv1.2 -sSf https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-amd64.tar.xz -L -o llvm.tar.xz +# LLVM_DIR=$(pwd)/${{ env.LLVM_DIR }} +# mkdir ${LLVM_DIR} +# tar xf llvm.tar.xz --strip-components=1 -C ${LLVM_DIR} +# echo "ENABLE_LLVM=1" >> $GITHUB_ENV +# echo "${LLVM_DIR}/bin" >> $GITHUB_PATH +# echo "${LLVM_DIR}/usr/bin" >> $GITHUB_PATH +# echo "LLVM_SYS_180_PREFIX=${LLVM_DIR}" >> $GITHUB_ENV +# env: +# LLVM_DIR: .llvm +# - name: Install wasm-opt +# run: | +# sudo apt-get install -y binaryen +# - name: make test-wasix +# run: | +# WASI_SDK=~/wasi-sdk WASIX_SYSROOT=~/wasix-sysroot make test-wasix - test_wasm_build: - name: Test wasm build - runs-on: ubuntu-22.04 - steps: - - uses: actions/checkout@v3 - - name: rustup target add wasm32-wasi - run: rustup target add wasm32-wasi - - name: make build-wasmer-wasm - run: make build-wasmer-wasm +# test_wasm_build: +# name: Test wasm build +# runs-on: ubuntu-22.04 +# steps: +# - uses: actions/checkout@v3 +# - name: rustup target add wasm32-wasi +# run: rustup target add wasm32-wasi +# - name: make build-wasmer-wasm +# run: make build-wasmer-wasm - test_build_jsc: - name: Test JSC build - runs-on: ubuntu-22.04 - steps: - - uses: actions/checkout@v3 - - uses: dtolnay/rust-toolchain@stable - with: - toolchain: ${{ env.MSRV }} - target: x86_64-unknown-linux-gnu - - name: Install NodeJS - uses: actions/setup-node@v2 - with: - node-version: 16 - - name: Install libjavascriptcoregtk-4.0-dev - run: sudo apt update && sudo apt install -y libjavascriptcoregtk-4.0-dev - - name: make build-wasmer-jsc - run: make build-wasmer-jsc +# test_build_jsc: +# name: Test JSC build +# runs-on: ubuntu-22.04 +# steps: +# - uses: actions/checkout@v3 +# - uses: dtolnay/rust-toolchain@stable +# with: +# toolchain: ${{ env.MSRV }} +# target: x86_64-unknown-linux-gnu +# - name: Install NodeJS +# uses: actions/setup-node@v2 +# with: +# node-version: 16 +# - name: Install libjavascriptcoregtk-4.0-dev +# run: sudo apt update && sudo apt install -y libjavascriptcoregtk-4.0-dev +# - name: make build-wasmer-jsc +# run: make build-wasmer-jsc - test_interpreter_api: - name: ${{ matrix.build-what.name }} on ${{ matrix.metadata.build }} - runs-on: ${{ matrix.metadata.os }} - strategy: - fail-fast: false - matrix: - build-what: [ - { - key: wamr, - build-cmd: 'make test-wamr-api', - name: 'Test API for wamr feature' - }, - { - key: wasmi, - build-cmd: 'make test-wasmi-api', - name: 'Test API for wasmi feature' - }, - { - key: v8, - build-cmd: 'make test-v8-api', - name: 'Test API for v8 feature' - } +# test_interpreter_api: +# name: ${{ matrix.build-what.name }} on ${{ matrix.metadata.build }} +# runs-on: ${{ matrix.metadata.os }} +# strategy: +# fail-fast: false +# matrix: +# build-what: [ +# { +# key: wamr, +# build-cmd: 'make test-wamr-api', +# name: 'Test API for wamr feature' +# }, +# { +# key: wasmi, +# build-cmd: 'make test-wasmi-api', +# name: 'Test API for wasmi feature' +# }, +# { +# key: v8, +# build-cmd: 'make test-v8-api', +# name: 'Test API for v8 feature' +# } - ] - metadata: [ - { - build: linux-x64, - os: ubuntu-22.04, - }, - { - build: macos-arm, - os: macos-14, - }, - { - build: windows-x64, - os: windows-2022, - } - ] - container: ${{ matrix.metadata.container }} - steps: - - uses: actions/checkout@v3 +# ] +# metadata: [ +# { +# build: linux-x64, +# os: ubuntu-22.04, +# }, +# { +# build: macos-arm, +# os: macos-14, +# }, +# { +# build: windows-x64, +# os: windows-2022, +# } +# ] +# container: ${{ matrix.metadata.container }} +# steps: +# - uses: actions/checkout@v3 - - name: Setup MSVC (Windows) - uses: ilammy/msvc-dev-cmd@v1 - if: matrix.metadata.build == 'windows-x64' +# - name: Setup MSVC (Windows) +# uses: ilammy/msvc-dev-cmd@v1 +# if: matrix.metadata.build == 'windows-x64' - - uses: dtolnay/rust-toolchain@stable - with: - toolchain: ${{ env.MSRV }} +# - uses: dtolnay/rust-toolchain@stable +# with: +# toolchain: ${{ env.MSRV }} - - name: Install Nextest - uses: taiki-e/install-action@nextest +# - name: Install Nextest +# uses: taiki-e/install-action@nextest - - name: Install `ninja`, clang` and `mold` on Ubuntu - if: startsWith(matrix.metadata.build, 'linux-') - shell: bash - run: | - sudo apt-get update -y && sudo apt-get install ninja-build clang mold -y +# - name: Install `ninja`, clang` and `mold` on Ubuntu +# if: startsWith(matrix.metadata.build, 'linux-') +# shell: bash +# run: | +# sudo apt-get update -y && sudo apt-get install ninja-build clang mold -y - - name: Install `ninja` on macOS - if: startsWith(matrix.metadata.build, 'macos-') - shell: bash - run: | - brew install ninja +# - name: Install `ninja` on macOS +# if: startsWith(matrix.metadata.build, 'macos-') +# shell: bash +# run: | +# brew install ninja - - name: Install `ninja` on Windows - if: startsWith(matrix.metadata.build, 'windows-') - shell: bash - run: | - choco install ninja +# - name: Install `ninja` on Windows +# if: startsWith(matrix.metadata.build, 'windows-') +# shell: bash +# run: | +# choco install ninja - - name: Delete unwanted link to stop it from interfering (Windows) - shell: bash - run: rm /usr/bin/link.exe - if: startsWith(matrix.metadata.build, 'windows-') +# - name: Delete unwanted link to stop it from interfering (Windows) +# shell: bash +# run: rm /usr/bin/link.exe +# if: startsWith(matrix.metadata.build, 'windows-') - - name: Test WAMR API - if: ${{ matrix.build-what.key == 'wamr' }} - run: ${{ matrix.build-what.build-cmd }} +# - name: Test WAMR API +# if: ${{ matrix.build-what.key == 'wamr' }} +# run: ${{ matrix.build-what.build-cmd }} - - name: Test wasmi API - if: ${{ matrix.build-what.key == 'wasmi' }} - run: ${{ matrix.build-what.build-cmd }} +# - name: Test wasmi API +# if: ${{ matrix.build-what.key == 'wasmi' }} +# run: ${{ matrix.build-what.build-cmd }} - - name: Test v8 API (Linux + mold) - if: ${{ matrix.build-what.key == 'v8' && startsWith(matrix.metadata.build, 'linux-')}} - run: RUSTFLAGS="-C linker=clang -C link-arg=-fuse-ld=mold" CARGO_TERM_VERBOSE=true cargo nextest run --package=wasmer --release --features=v8 --no-default-features +# - name: Test v8 API (Linux + mold) +# if: ${{ matrix.build-what.key == 'v8' && startsWith(matrix.metadata.build, 'linux-')}} +# run: RUSTFLAGS="-C linker=clang -C link-arg=-fuse-ld=mold" CARGO_TERM_VERBOSE=true cargo nextest run --package=wasmer --release --features=v8 --no-default-features - - name: Test v8 API - if: ${{ matrix.build-what.key == 'v8' && !startsWith(matrix.metadata.build, 'linux-')}} - run: ${{ matrix.build-what.build-cmd }} +# - name: Test v8 API +# if: ${{ matrix.build-what.key == 'v8' && !startsWith(matrix.metadata.build, 'linux-')}} +# run: ${{ matrix.build-what.build-cmd }} - test_build_docs_rs: - name: Test build docs rs - runs-on: ubuntu-22.04 - steps: - - uses: actions/checkout@v3 - - uses: dtolnay/rust-toolchain@master - with: - toolchain: "nightly-2024-08-21" - target: x86_64-unknown-linux-gnu - - run: cargo install toml-cli # toml-cli is required to run `make test-build-docs-rs` +# test_build_docs_rs: +# name: Test build docs rs +# runs-on: ubuntu-22.04 +# steps: +# - uses: actions/checkout@v3 +# - uses: dtolnay/rust-toolchain@master +# with: +# toolchain: "nightly-2024-08-21" +# target: x86_64-unknown-linux-gnu +# - run: cargo install toml-cli # toml-cli is required to run `make test-build-docs-rs` - - name: Install `ninja` on Ubuntu - shell: bash - run: | - sudo apt-get install ninja-build -y +# - name: Install `ninja` on Ubuntu +# shell: bash +# run: | +# sudo apt-get install ninja-build -y - - name: Install LLVM 18 - run: | - curl --proto '=https' --tlsv1.2 -sSf https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-amd64.tar.xz -L -o llvm.tar.xz - LLVM_DIR=$(pwd)/${{ env.LLVM_DIR }} - mkdir ${LLVM_DIR} - tar xf llvm.tar.xz --strip-components=1 -C ${LLVM_DIR} - echo "ENABLE_LLVM=1" >> $GITHUB_ENV - echo "${LLVM_DIR}/bin" >> $GITHUB_PATH - echo "${LLVM_DIR}/usr/bin" >> $GITHUB_PATH - echo "LLVM_SYS_180_PREFIX=${LLVM_DIR}" >> $GITHUB_ENV - env: - LLVM_DIR: .llvm - - name: make test-build-docs-rs-ci - run: make test-build-docs-rs-ci +# - name: Install LLVM 18 +# run: | +# curl --proto '=https' --tlsv1.2 -sSf https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-amd64.tar.xz -L -o llvm.tar.xz +# LLVM_DIR=$(pwd)/${{ env.LLVM_DIR }} +# mkdir ${LLVM_DIR} +# tar xf llvm.tar.xz --strip-components=1 -C ${LLVM_DIR} +# echo "ENABLE_LLVM=1" >> $GITHUB_ENV +# echo "${LLVM_DIR}/bin" >> $GITHUB_PATH +# echo "${LLVM_DIR}/usr/bin" >> $GITHUB_PATH +# echo "LLVM_SYS_180_PREFIX=${LLVM_DIR}" >> $GITHUB_ENV +# env: +# LLVM_DIR: .llvm +# - name: make test-build-docs-rs-ci +# run: make test-build-docs-rs-ci - build_linux_aarch64: - name: ${{ matrix.build-what.name }} on linux-aarch64 - runs-on: ubuntu-22.04 - strategy: - fail-fast: false - matrix: - build-what: [ - { - key: capi, - build-cmd: 'make build-capi && make package-capi', - name: 'Build C-API' - }, - { - key: wasmer, - build-cmd: 'make build-wasmer && make package-wasmer && make tar-wasmer', - name: 'Build wasmer-cli' - } - ] - steps: - - uses: actions/checkout@v3 - - uses: dtolnay/rust-toolchain@stable - with: - toolchain: ${{ env.MSRV }} - target: aarch64-unknown-linux-gnu - - name: Build cross image - run: | - docker build -t wasmer/aarch64 ${GITHUB_WORKSPACE}/.github/cross-linux-aarch64/ - env: - CROSS_DOCKER_IN_DOCKER: true - - name: Build ${{ matrix.build-what.key }} - run: | - ${{ matrix.build-what.build-cmd }} - env: - CARGO_BINARY: docker run -v /var/run/docker.sock:/var/run/docker.sock -v ${GITHUB_WORKSPACE}:/project -w /project wasmer/aarch64 cross - CROSS_DOCKER_IN_DOCKER: true - CARGO_TARGET: aarch64-unknown-linux-gnu - PKG_CONFIG_PATH: /usr/lib/aarch64-linux-gnu/pkgconfig - PKG_CONFIG_ALLOW_CROSS: true - ENABLE_LLVM: 0 - - name: Dist - if: ${{ matrix.build-what.key == 'capi' }} - run: | - make distribution - env: - CARGO_BINARY: docker run -v /var/run/docker.sock:/var/run/docker.sock -v ${GITHUB_WORKSPACE}:/project -w /project wasmer/aarch64 cross - CROSS_DOCKER_IN_DOCKER: true - CARGO_TARGET: aarch64-unknown-linux-gnu - PKG_CONFIG_PATH: /usr/lib/aarch64-linux-gnu/pkgconfig - PKG_CONFIG_ALLOW_CROSS: true - TARGET: aarch64-unknown-linux-gnu - TARGET_DIR: target/aarch64-unknown-linux-gnu/release - - name: Upload Artifacts - if: ${{ matrix.build-what.key == 'capi' }} - uses: actions/upload-artifact@v4 - with: - name: capi-linux-aarch64 - path: dist - if-no-files-found: error - retention-days: 2 +# build_linux_aarch64: +# name: ${{ matrix.build-what.name }} on linux-aarch64 +# runs-on: ubuntu-22.04 +# strategy: +# fail-fast: false +# matrix: +# build-what: [ +# { +# key: capi, +# build-cmd: 'make build-capi && make package-capi', +# name: 'Build C-API' +# }, +# { +# key: wasmer, +# build-cmd: 'make build-wasmer && make package-wasmer && make tar-wasmer', +# name: 'Build wasmer-cli' +# } +# ] +# steps: +# - uses: actions/checkout@v3 +# - uses: dtolnay/rust-toolchain@stable +# with: +# toolchain: ${{ env.MSRV }} +# target: aarch64-unknown-linux-gnu +# - name: Build cross image +# run: | +# docker build -t wasmer/aarch64 ${GITHUB_WORKSPACE}/.github/cross-linux-aarch64/ +# env: +# CROSS_DOCKER_IN_DOCKER: true +# - name: Build ${{ matrix.build-what.key }} +# run: | +# ${{ matrix.build-what.build-cmd }} +# env: +# CARGO_BINARY: docker run -v /var/run/docker.sock:/var/run/docker.sock -v ${GITHUB_WORKSPACE}:/project -w /project wasmer/aarch64 cross +# CROSS_DOCKER_IN_DOCKER: true +# CARGO_TARGET: aarch64-unknown-linux-gnu +# PKG_CONFIG_PATH: /usr/lib/aarch64-linux-gnu/pkgconfig +# PKG_CONFIG_ALLOW_CROSS: true +# ENABLE_LLVM: 0 +# - name: Dist +# if: ${{ matrix.build-what.key == 'capi' }} +# run: | +# make distribution +# env: +# CARGO_BINARY: docker run -v /var/run/docker.sock:/var/run/docker.sock -v ${GITHUB_WORKSPACE}:/project -w /project wasmer/aarch64 cross +# CROSS_DOCKER_IN_DOCKER: true +# CARGO_TARGET: aarch64-unknown-linux-gnu +# PKG_CONFIG_PATH: /usr/lib/aarch64-linux-gnu/pkgconfig +# PKG_CONFIG_ALLOW_CROSS: true +# TARGET: aarch64-unknown-linux-gnu +# TARGET_DIR: target/aarch64-unknown-linux-gnu/release +# - name: Upload Artifacts +# if: ${{ matrix.build-what.key == 'capi' }} +# uses: actions/upload-artifact@v4 +# with: +# name: capi-linux-aarch64 +# path: dist +# if-no-files-found: error +# retention-days: 2 - build_linux_riscv64: - name: ${{ matrix.build-what.name }} on linux-riscv64 - runs-on: ubuntu-22.04 - strategy: - fail-fast: false - matrix: - build-what: [ - { - key: capi, - build-cmd: 'make build-capi && make package-capi', - name: 'Build C-API' - }, - { - key: wasmer, - build-cmd: 'make build-wasmer && make package-wasmer && make tar-wasmer', - name: 'Build wasmer-cli' - } - ] - steps: - - uses: actions/checkout@v3 - #- uses: dtolnay/rust-toolchain@stable - # with: - # toolchain: ${{ env.MSRV }} - # target: riscv64gc-unknown-linux-gnu - - name: Build cross image - run: | - docker build -t wasmer/riscv64 ${GITHUB_WORKSPACE}/.github/cross-linux-riscv64/ - env: - CROSS_DOCKER_IN_DOCKER: true - - name: Build ${{ matrix.build-what.key }} - run: | - ${{ matrix.build-what.build-cmd }} - env: - CARGO_BINARY: docker run -v /var/run/docker.sock:/var/run/docker.sock -v ${GITHUB_WORKSPACE}:/project -w /project wasmer/riscv64 cargo - CROSS_DOCKER_IN_DOCKER: true - CARGO_TARGET: riscv64gc-unknown-linux-gnu - ENABLE_LLVM: 0 - - name: Dist - if: ${{ matrix.build-what.key == 'capi' }} - run: | - make distribution - env: - CARGO_BINARY: docker run -v /var/run/docker.sock:/var/run/docker.sock -v ${GITHUB_WORKSPACE}:/project -w /project wasmer/riscv64 cargo - CROSS_DOCKER_IN_DOCKER: true - CARGO_TARGET: riscv64gc-unknown-linux-gnu - PKG_CONFIG_PATH: /usr/lib/riscv64-linux-gnu/pkgconfig - PKG_CONFIG_ALLOW_CROSS: true - TARGET: riscv64gc-unknown-linux-gnu - TARGET_DIR: target/riscv64gc-unknown-linux-gnu/release - - name: Upload Artifacts - if: ${{ matrix.build-what.key == 'capi' }} - uses: actions/upload-artifact@v4 - with: - name: capi-linux-riscv64 - path: dist - if-no-files-found: error - retention-days: 2 +# build_linux_riscv64: +# name: ${{ matrix.build-what.name }} on linux-riscv64 +# runs-on: ubuntu-22.04 +# strategy: +# fail-fast: false +# matrix: +# build-what: [ +# { +# key: capi, +# build-cmd: 'make build-capi && make package-capi', +# name: 'Build C-API' +# }, +# { +# key: wasmer, +# build-cmd: 'make build-wasmer && make package-wasmer && make tar-wasmer', +# name: 'Build wasmer-cli' +# } +# ] +# steps: +# - uses: actions/checkout@v3 +# #- uses: dtolnay/rust-toolchain@stable +# # with: +# # toolchain: ${{ env.MSRV }} +# # target: riscv64gc-unknown-linux-gnu +# - name: Build cross image +# run: | +# docker build -t wasmer/riscv64 ${GITHUB_WORKSPACE}/.github/cross-linux-riscv64/ +# env: +# CROSS_DOCKER_IN_DOCKER: true +# - name: Build ${{ matrix.build-what.key }} +# run: | +# ${{ matrix.build-what.build-cmd }} +# env: +# CARGO_BINARY: docker run -v /var/run/docker.sock:/var/run/docker.sock -v ${GITHUB_WORKSPACE}:/project -w /project wasmer/riscv64 cargo +# CROSS_DOCKER_IN_DOCKER: true +# CARGO_TARGET: riscv64gc-unknown-linux-gnu +# ENABLE_LLVM: 0 +# - name: Dist +# if: ${{ matrix.build-what.key == 'capi' }} +# run: | +# make distribution +# env: +# CARGO_BINARY: docker run -v /var/run/docker.sock:/var/run/docker.sock -v ${GITHUB_WORKSPACE}:/project -w /project wasmer/riscv64 cargo +# CROSS_DOCKER_IN_DOCKER: true +# CARGO_TARGET: riscv64gc-unknown-linux-gnu +# PKG_CONFIG_PATH: /usr/lib/riscv64-linux-gnu/pkgconfig +# PKG_CONFIG_ALLOW_CROSS: true +# TARGET: riscv64gc-unknown-linux-gnu +# TARGET_DIR: target/riscv64gc-unknown-linux-gnu/release +# - name: Upload Artifacts +# if: ${{ matrix.build-what.key == 'capi' }} +# uses: actions/upload-artifact@v4 +# with: +# name: capi-linux-riscv64 +# path: dist +# if-no-files-found: error +# retention-days: 2 - build: - name: ${{ matrix.build-what.name }} on ${{ matrix.metadata.build }} - runs-on: ${{ matrix.metadata.os }} - needs: setup - strategy: - fail-fast: false - matrix: - build-what: [ - { - key: capi, - build-cmd: 'make build-capi && make build-capi-headless && make package-capi && make tar-capi', - name: 'Build and test C-API' - }, - { - key: wasmer, - build-cmd: 'make build-wasmer && make package-wasmer && make tar-wasmer', - name: 'Build wasmer-cli' - } - ] - metadata: [ - { - build: linux-x64, - os: ubuntu-22.04, - target: x86_64-unknown-linux-gnu, - exe: '', - llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-amd64.tar.xz' - }, - { - build: macos-x64, - os: macos-12, - target: x86_64-apple-darwin, - exe: '', - llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-amd64.tar.xz' +# build: +# name: ${{ matrix.build-what.name }} on ${{ matrix.metadata.build }} +# runs-on: ${{ matrix.metadata.os }} +# needs: setup +# strategy: +# fail-fast: false +# matrix: +# build-what: [ +# { +# key: capi, +# build-cmd: 'make build-capi && make build-capi-headless && make package-capi && make tar-capi', +# name: 'Build and test C-API' +# }, +# { +# key: wasmer, +# build-cmd: 'make build-wasmer && make package-wasmer && make tar-wasmer', +# name: 'Build wasmer-cli' +# } +# ] +# metadata: [ +# { +# build: linux-x64, +# os: ubuntu-22.04, +# target: x86_64-unknown-linux-gnu, +# exe: '', +# llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-amd64.tar.xz' +# }, +# { +# build: macos-x64, +# os: macos-12, +# target: x86_64-apple-darwin, +# exe: '', +# llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-amd64.tar.xz' - }, - { - build: macos-arm, - os: macos-14, - target: aarch64-apple-darwin, - exe: '', - # [todo] xdoardo: Reinstate when the code we generate for aarch64 is working correctly. - # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-aarch64.tar.xz' - }, - { - build: windows-x64, - os: windows-2022, - target: x86_64-pc-windows-msvc, - exe: '.exe', - # For now, disable LLVM in `windows-x64.` - # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-windows-amd64.tar.xz' - }, - { - build: windows-gnu, - target: x86_64-pc-windows-gnu, - os: ubuntu-22.04, - }, - { - build: linux-musl, - target: x86_64-unknown-linux-musl, - os: ubuntu-22.04, - exe: '', - container: 'alpine:latest' - } +# }, +# { +# build: macos-arm, +# os: macos-14, +# target: aarch64-apple-darwin, +# exe: '', +# # [todo] xdoardo: Reinstate when the code we generate for aarch64 is working correctly. +# # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-aarch64.tar.xz' +# }, +# { +# build: windows-x64, +# os: windows-2022, +# target: x86_64-pc-windows-msvc, +# exe: '.exe', +# # For now, disable LLVM in `windows-x64.` +# # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-windows-amd64.tar.xz' +# }, +# { +# build: windows-gnu, +# target: x86_64-pc-windows-gnu, +# os: ubuntu-22.04, +# }, +# { +# build: linux-musl, +# target: x86_64-unknown-linux-musl, +# os: ubuntu-22.04, +# exe: '', +# container: 'alpine:latest' +# } - ] - container: ${{ matrix.metadata.container }} - env: - SCCACHE_AZURE_BLOB_CONTAINER: wasmerstoragesccacheblob - SCCACHE_AZURE_CONNECTION_STRING: ${{ secrets.SCCACHE_AZURE_CONNECTION_STRING }} - steps: - - uses: actions/checkout@v3 - - name: Set up libstdc++ on Linux - if: matrix.metadata.build == 'linux-x64' - run: | - sudo apt-get update -y - sudo apt-get install -y --allow-downgrades libstdc++6 libtinfo5 - sudo apt-get install --reinstall g++ - - name: Set up base deps on musl - if: matrix.metadata.build == 'linux-musl' - run: ./scripts/alpine-linux-install-deps.sh - - name: Set up dependencies for Mac OS - run: | - brew install automake - # using gnu-tar is a workaround for https://github.com/actions/cache/issues/403 - brew install gnu-tar - echo PATH="/usr/local/opt/gnu-tar/libexec/gnubin:$PATH" >> $GITHUB_ENV - if: matrix.metadata.os == 'macos-12' - - name: Install Rust - uses: dtolnay/rust-toolchain@stable - with: - toolchain: ${{ env.MSRV }} - target: ${{ matrix.metadata.target }} - - name: Install Nextest - uses: taiki-e/install-action@nextest - - name: Install MSVC dev-cmd (Windows) - uses: ilammy/msvc-dev-cmd@v1 - if: ${{ matrix.metadata.build == 'windows-x64' }} - - name: Delete unwanted link to stop it from interfering (Windows) - shell: bash - run: rm /usr/bin/link.exe - if: ${{ matrix.metadata.build == 'windows-x64' }} - - name: Install Windows-GNU linker - if: ${{ matrix.metadata.build == 'windows-gnu' }} - shell: bash - run: | - sudo apt install -y mingw-w64 - - name: Install Windows-GNU target - if: ${{ matrix.metadata.build == 'windows-gnu' }} - shell: bash - run: | - rustup target add x86_64-pc-windows-gnu - - name: Install Windows 10 SDK with xwin - if: ${{ matrix.metadata.build == 'windows-gnu' }} - shell: bash - run: | - mkdir -p /tmp/xwin - mkdir -p /tmp/xwindownload - mkdir -p /tmp/xwincache - git clone https://github.com/wasmerio/xwin --depth=1 /tmp/xwin - cargo build --release --manifest-path=/tmp/xwin/Cargo.toml - /tmp/xwin/target/release/xwin --accept-license --cache-dir /tmp/xwincache splat --output /tmp/xwindownload - mkdir -p /tmp/winsdk - cp /tmp/xwindownload/sdk/lib/10.0.20348/um/x86_64/WS2_32.lib /tmp/winsdk/ - cp /tmp/xwindownload/sdk/lib/10.0.20348/um/x86_64/KERNEL32.lib /tmp/winsdk/ - cp /tmp/xwindownload/sdk/lib/10.0.20348/um/x86_64/BCRYPT.lib /tmp/winsdk/ - cp /tmp/xwindownload/sdk/lib/10.0.20348/um/x86_64/ADVAPI32.lib /tmp/winsdk/ - cp /tmp/xwindownload/sdk/lib/10.0.20348/um/x86_64/USERENV.lib /tmp/winsdk/ - echo "WinSDK files:" - ls -laH /tmp/winsdk - echo "" - mkdir -p package - mkdir -p package/winsdk - cp -r /tmp/winsdk/* package/winsdk - - name: Install LLVM (macOS Apple Silicon) - if: matrix.metadata.os == 'macos-12' && !matrix.metadata.llvm_url - run: | - brew install llvm - - name: Install LLVM - shell: bash - if: matrix.metadata.llvm_url - run: | - curl --proto '=https' --tlsv1.2 -sSf ${{ matrix.metadata.llvm_url }} -L -o llvm.tar.xz - LLVM_DIR=$(pwd)/${{ env.LLVM_DIR }} - mkdir ${LLVM_DIR} - tar xf llvm.tar.xz --strip-components=1 -C ${LLVM_DIR} - echo "ENABLE_LLVM=1" >> $GITHUB_ENV - echo "${LLVM_DIR}/bin" >> $GITHUB_PATH - echo "${LLVM_DIR}/usr/bin" >> $GITHUB_PATH - echo "LLVM_SYS_180_PREFIX=${LLVM_DIR}" >> $GITHUB_ENV - env: - LLVM_DIR: .llvm - - name: Add `brew` libs to `RUSTFLAGS` - if: matrix.metadata.os == 'macos-14' - shell: bash - run: | - echo "RUSTFLAGS=-L/opt/homebrew/lib" >> $GITHUB_ENV - - name: Setup Rust target - shell: bash - run: | - mkdir -p .cargo - cat << EOF > .cargo/config.toml - [build] - target = "${{ matrix.metadata.target }}" - EOF - if: matrix.metadata.target - - name: which cargo - if: ${{ matrix.build-what.key == 'capi' && matrix.metadata.build == 'windows-x64' }} - run: which cargo - - name: Set cargo env - run: echo "CARGO_ROOT_DIR=$(dirname $(dirname $( which cargo )))" >> $GITHUB_ENV - - name: List root dir - shell: bash - if: ${{ matrix.build-what.key == 'capi' && matrix.metadata.build == 'windows-x64' }} - run: ls -R $CARGO_ROOT_DIR - - name: Cache - uses: whywaita/actions-cache-s3@v2 - with: - path: | - ~/.cargo/* - ./target/* - $CARGO_ROOT_DIR/* - key: r22-${{ github.repository }}-${{ runner.os }}-${{ hashFiles('Cargo.lock') }}-wasmer-make-build-wasmer-${{ matrix.build-what.key }}-${{ matrix.metadata.build }} - aws-s3-bucket: wasmer-rust-artifacts-cache - aws-access-key-id: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_TOKEN }} - aws-secret-access-key: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_KEY }} - aws-region: auto - aws-endpoint: https://1541b1e8a3fc6ad155ce67ef38899700.r2.cloudflarestorage.com - aws-s3-bucket-endpoint: false - aws-s3-force-path-style: true - - name: Build C-API - shell: bash - run: ${{ matrix.build-what.build-cmd }} - if: ${{ matrix.build-what.key == 'capi' }} - env: - TARGET: ${{ matrix.metadata.target }} - TARGET_DIR: target/${{ matrix.metadata.target }}/release - CARGO_TARGET: ${{ matrix.metadata.target }} - - name: Build Wasmer - shell: bash - if: ${{ matrix.build-what.key == 'wasmer' && matrix.metadata.build != 'windows-gnu' }} - run: ${{ matrix.build-what.build-cmd }} - env: - TARGET: ${{ matrix.metadata.target }} - TARGET_DIR: target/${{ matrix.metadata.target }}/release - CARGO_TARGET: ${{ matrix.metadata.target }} - - name: Test C-API - shell: bash - if: ${{ matrix.build-what.key == 'capi' && !(matrix.metadata.build == 'linux-musl' || matrix.metadata.build == 'windows-gnu') }} - run: make test-capi-ci - env: - TARGET: ${{ matrix.metadata.target }} - TARGET_DIR: target/${{ matrix.metadata.target }}/release - CARGO_TARGET: ${{ matrix.metadata.target }} - # C-API tests were disabled for linux-musl and macos-arm (we can't run them) - - name: Test C-API integration - shell: bash - if: ${{ matrix.build-what.key == 'capi' && !(matrix.metadata.build == 'linux-musl' || matrix.metadata.build == 'windows-gnu') }} - run: export WASMER_DIR=`pwd`/package && make test-stage-7-capi-integration-tests - env: - TARGET: ${{ matrix.metadata.target }} - TARGET_DIR: target/${{ matrix.metadata.target }}/release - CARGO_TARGET: ${{ matrix.metadata.target }} - - name: Archive production artifacts - uses: actions/upload-artifact@v4 - with: - name: wasmer-cli-${{ matrix.metadata.build }} - path: build-wasmer.tar.gz - if-no-files-found: ignore - retention-days: 2 - - name: Archive production artifacts - uses: actions/upload-artifact@v4 - with: - name: capi-${{ matrix.metadata.build }} - path: build-capi.tar.gz - if-no-files-found: ignore - retention-days: 2 +# ] +# container: ${{ matrix.metadata.container }} +# env: +# SCCACHE_AZURE_BLOB_CONTAINER: wasmerstoragesccacheblob +# SCCACHE_AZURE_CONNECTION_STRING: ${{ secrets.SCCACHE_AZURE_CONNECTION_STRING }} +# steps: +# - uses: actions/checkout@v3 +# - name: Set up libstdc++ on Linux +# if: matrix.metadata.build == 'linux-x64' +# run: | +# sudo apt-get update -y +# sudo apt-get install -y --allow-downgrades libstdc++6 libtinfo5 +# sudo apt-get install --reinstall g++ +# - name: Set up base deps on musl +# if: matrix.metadata.build == 'linux-musl' +# run: ./scripts/alpine-linux-install-deps.sh +# - name: Set up dependencies for Mac OS +# run: | +# brew install automake +# # using gnu-tar is a workaround for https://github.com/actions/cache/issues/403 +# brew install gnu-tar +# echo PATH="/usr/local/opt/gnu-tar/libexec/gnubin:$PATH" >> $GITHUB_ENV +# if: matrix.metadata.os == 'macos-12' +# - name: Install Rust +# uses: dtolnay/rust-toolchain@stable +# with: +# toolchain: ${{ env.MSRV }} +# target: ${{ matrix.metadata.target }} +# - name: Install Nextest +# uses: taiki-e/install-action@nextest +# - name: Install MSVC dev-cmd (Windows) +# uses: ilammy/msvc-dev-cmd@v1 +# if: ${{ matrix.metadata.build == 'windows-x64' }} +# - name: Delete unwanted link to stop it from interfering (Windows) +# shell: bash +# run: rm /usr/bin/link.exe +# if: ${{ matrix.metadata.build == 'windows-x64' }} +# - name: Install Windows-GNU linker +# if: ${{ matrix.metadata.build == 'windows-gnu' }} +# shell: bash +# run: | +# sudo apt install -y mingw-w64 +# - name: Install Windows-GNU target +# if: ${{ matrix.metadata.build == 'windows-gnu' }} +# shell: bash +# run: | +# rustup target add x86_64-pc-windows-gnu +# - name: Install Windows 10 SDK with xwin +# if: ${{ matrix.metadata.build == 'windows-gnu' }} +# shell: bash +# run: | +# mkdir -p /tmp/xwin +# mkdir -p /tmp/xwindownload +# mkdir -p /tmp/xwincache +# git clone https://github.com/wasmerio/xwin --depth=1 /tmp/xwin +# cargo build --release --manifest-path=/tmp/xwin/Cargo.toml +# /tmp/xwin/target/release/xwin --accept-license --cache-dir /tmp/xwincache splat --output /tmp/xwindownload +# mkdir -p /tmp/winsdk +# cp /tmp/xwindownload/sdk/lib/10.0.20348/um/x86_64/WS2_32.lib /tmp/winsdk/ +# cp /tmp/xwindownload/sdk/lib/10.0.20348/um/x86_64/KERNEL32.lib /tmp/winsdk/ +# cp /tmp/xwindownload/sdk/lib/10.0.20348/um/x86_64/BCRYPT.lib /tmp/winsdk/ +# cp /tmp/xwindownload/sdk/lib/10.0.20348/um/x86_64/ADVAPI32.lib /tmp/winsdk/ +# cp /tmp/xwindownload/sdk/lib/10.0.20348/um/x86_64/USERENV.lib /tmp/winsdk/ +# echo "WinSDK files:" +# ls -laH /tmp/winsdk +# echo "" +# mkdir -p package +# mkdir -p package/winsdk +# cp -r /tmp/winsdk/* package/winsdk +# - name: Install LLVM (macOS Apple Silicon) +# if: matrix.metadata.os == 'macos-12' && !matrix.metadata.llvm_url +# run: | +# brew install llvm +# - name: Install LLVM +# shell: bash +# if: matrix.metadata.llvm_url +# run: | +# curl --proto '=https' --tlsv1.2 -sSf ${{ matrix.metadata.llvm_url }} -L -o llvm.tar.xz +# LLVM_DIR=$(pwd)/${{ env.LLVM_DIR }} +# mkdir ${LLVM_DIR} +# tar xf llvm.tar.xz --strip-components=1 -C ${LLVM_DIR} +# echo "ENABLE_LLVM=1" >> $GITHUB_ENV +# echo "${LLVM_DIR}/bin" >> $GITHUB_PATH +# echo "${LLVM_DIR}/usr/bin" >> $GITHUB_PATH +# echo "LLVM_SYS_180_PREFIX=${LLVM_DIR}" >> $GITHUB_ENV +# env: +# LLVM_DIR: .llvm +# - name: Add `brew` libs to `RUSTFLAGS` +# if: matrix.metadata.os == 'macos-14' +# shell: bash +# run: | +# echo "RUSTFLAGS=-L/opt/homebrew/lib" >> $GITHUB_ENV +# - name: Setup Rust target +# shell: bash +# run: | +# mkdir -p .cargo +# cat << EOF > .cargo/config.toml +# [build] +# target = "${{ matrix.metadata.target }}" +# EOF +# if: matrix.metadata.target +# - name: which cargo +# if: ${{ matrix.build-what.key == 'capi' && matrix.metadata.build == 'windows-x64' }} +# run: which cargo +# - name: Set cargo env +# run: echo "CARGO_ROOT_DIR=$(dirname $(dirname $( which cargo )))" >> $GITHUB_ENV +# - name: List root dir +# shell: bash +# if: ${{ matrix.build-what.key == 'capi' && matrix.metadata.build == 'windows-x64' }} +# run: ls -R $CARGO_ROOT_DIR +# - name: Cache +# uses: whywaita/actions-cache-s3@v2 +# with: +# path: | +# ~/.cargo/* +# ./target/* +# $CARGO_ROOT_DIR/* +# key: r22-${{ github.repository }}-${{ runner.os }}-${{ hashFiles('Cargo.lock') }}-wasmer-make-build-wasmer-${{ matrix.build-what.key }}-${{ matrix.metadata.build }} +# aws-s3-bucket: wasmer-rust-artifacts-cache +# aws-access-key-id: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_TOKEN }} +# aws-secret-access-key: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_KEY }} +# aws-region: auto +# aws-endpoint: https://1541b1e8a3fc6ad155ce67ef38899700.r2.cloudflarestorage.com +# aws-s3-bucket-endpoint: false +# aws-s3-force-path-style: true +# - name: Build C-API +# shell: bash +# run: ${{ matrix.build-what.build-cmd }} +# if: ${{ matrix.build-what.key == 'capi' }} +# env: +# TARGET: ${{ matrix.metadata.target }} +# TARGET_DIR: target/${{ matrix.metadata.target }}/release +# CARGO_TARGET: ${{ matrix.metadata.target }} +# - name: Build Wasmer +# shell: bash +# if: ${{ matrix.build-what.key == 'wasmer' && matrix.metadata.build != 'windows-gnu' }} +# run: ${{ matrix.build-what.build-cmd }} +# env: +# TARGET: ${{ matrix.metadata.target }} +# TARGET_DIR: target/${{ matrix.metadata.target }}/release +# CARGO_TARGET: ${{ matrix.metadata.target }} +# - name: Test C-API +# shell: bash +# if: ${{ matrix.build-what.key == 'capi' && !(matrix.metadata.build == 'linux-musl' || matrix.metadata.build == 'windows-gnu') }} +# run: make test-capi-ci +# env: +# TARGET: ${{ matrix.metadata.target }} +# TARGET_DIR: target/${{ matrix.metadata.target }}/release +# CARGO_TARGET: ${{ matrix.metadata.target }} +# # C-API tests were disabled for linux-musl and macos-arm (we can't run them) +# - name: Test C-API integration +# shell: bash +# if: ${{ matrix.build-what.key == 'capi' && !(matrix.metadata.build == 'linux-musl' || matrix.metadata.build == 'windows-gnu') }} +# run: export WASMER_DIR=`pwd`/package && make test-stage-7-capi-integration-tests +# env: +# TARGET: ${{ matrix.metadata.target }} +# TARGET_DIR: target/${{ matrix.metadata.target }}/release +# CARGO_TARGET: ${{ matrix.metadata.target }} +# - name: Archive production artifacts +# uses: actions/upload-artifact@v4 +# with: +# name: wasmer-cli-${{ matrix.metadata.build }} +# path: build-wasmer.tar.gz +# if-no-files-found: ignore +# retention-days: 2 +# - name: Archive production artifacts +# uses: actions/upload-artifact@v4 +# with: +# name: capi-${{ matrix.metadata.build }} +# path: build-capi.tar.gz +# if-no-files-found: ignore +# retention-days: 2 - test: - name: ${{ matrix.stage.description }} on ${{ matrix.metadata.build }} - runs-on: ${{ matrix.metadata.os }} - needs: setup - strategy: - fail-fast: false - matrix: - stage: [ - { - description: 'Run wast test suite for all compilers', - make: 'test-stage-0-wast', - }, - { - description: 'Unit-test packages on std', - make: 'test-stage-1-test-all', - }, - { - description: 'Unit-test cranelift on no-std', - make: 'test-stage-2-test-compiler-cranelift-nostd', - }, - { - description: 'Unit-test singlepass on no-std', - make: 'test-stage-3-test-compiler-singlepass-nostd', - }, - { - description: 'Unit-test wasmer-cli', - make: 'test-stage-4-wasmer-cli', - }, - { - description: 'Unit-test examples', - make: 'test-stage-5-test-examples', - } - ] - metadata: [ - # We cannot test on macos-arm since we don't have ARM runners - { - build: linux-x64, - os: ubuntu-22.04, - target: x86_64-unknown-linux-gnu, - exe: '', - llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-amd64.tar.xz' - }, - { - build: macos-x64, - os: macos-12, - target: x86_64-apple-darwin, - exe: '', - llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-amd64.tar.xz' +# test: +# name: ${{ matrix.stage.description }} on ${{ matrix.metadata.build }} +# runs-on: ${{ matrix.metadata.os }} +# needs: setup +# strategy: +# fail-fast: false +# matrix: +# stage: [ +# { +# description: 'Run wast test suite for all compilers', +# make: 'test-stage-0-wast', +# }, +# { +# description: 'Unit-test packages on std', +# make: 'test-stage-1-test-all', +# }, +# { +# description: 'Unit-test cranelift on no-std', +# make: 'test-stage-2-test-compiler-cranelift-nostd', +# }, +# { +# description: 'Unit-test singlepass on no-std', +# make: 'test-stage-3-test-compiler-singlepass-nostd', +# }, +# { +# description: 'Unit-test wasmer-cli', +# make: 'test-stage-4-wasmer-cli', +# }, +# { +# description: 'Unit-test examples', +# make: 'test-stage-5-test-examples', +# } +# ] +# metadata: [ +# # We cannot test on macos-arm since we don't have ARM runners +# { +# build: linux-x64, +# os: ubuntu-22.04, +# target: x86_64-unknown-linux-gnu, +# exe: '', +# llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-amd64.tar.xz' +# }, +# { +# build: macos-x64, +# os: macos-12, +# target: x86_64-apple-darwin, +# exe: '', +# llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-amd64.tar.xz' - }, - { - build: macos-arm, - os: macos-14, - target: aarch64-apple-darwin, - exe: '', - # [todo] xdoardo: Reinstate when the code we generate for aarch64 is working correctly. - # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-aarch64.tar.xz' - }, - { - build: windows-x64, - os: windows-2022, - target: x86_64-pc-windows-msvc, - exe: '.exe', - # For now, disable LLVM in `windows-x64.` - # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-windows-amd64.tar.xz' - }, - { - build: linux-musl, - target: x86_64-unknown-linux-musl, - os: ubuntu-22.04, - exe: '', - container: 'alpine:latest' - } - ] - container: ${{ matrix.metadata.container }} - env: - SCCACHE_AZURE_BLOB_CONTAINER: wasmerstoragesccacheblob - SCCACHE_AZURE_CONNECTION_STRING: ${{ secrets.SCCACHE_AZURE_CONNECTION_STRING }} - steps: - - uses: actions/checkout@v3 - - name: Set up libstdc++ on Linux - if: matrix.metadata.build == 'linux-x64' - run: | - sudo apt-get update -y - sudo apt-get install -y --allow-downgrades libstdc++6 - sudo apt-get install --reinstall g++ - - name: Set up base deps on musl - if: matrix.metadata.build == 'linux-musl' - run: ./scripts/alpine-linux-install-deps.sh - - name: Install MSVC dev-cmd (Windows) - uses: ilammy/msvc-dev-cmd@v1 - if: ${{ matrix.metadata.build == 'windows-x64' }} - - name: Delete unwanted link to stop it from interfering (Windows) - shell: bash - run: rm /usr/bin/link.exe - if: ${{ matrix.metadata.build == 'windows-x64' }} +# }, +# { +# build: macos-arm, +# os: macos-14, +# target: aarch64-apple-darwin, +# exe: '', +# # [todo] xdoardo: Reinstate when the code we generate for aarch64 is working correctly. +# # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-aarch64.tar.xz' +# }, +# { +# build: windows-x64, +# os: windows-2022, +# target: x86_64-pc-windows-msvc, +# exe: '.exe', +# # For now, disable LLVM in `windows-x64.` +# # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-windows-amd64.tar.xz' +# }, +# { +# build: linux-musl, +# target: x86_64-unknown-linux-musl, +# os: ubuntu-22.04, +# exe: '', +# container: 'alpine:latest' +# } +# ] +# container: ${{ matrix.metadata.container }} +# env: +# SCCACHE_AZURE_BLOB_CONTAINER: wasmerstoragesccacheblob +# SCCACHE_AZURE_CONNECTION_STRING: ${{ secrets.SCCACHE_AZURE_CONNECTION_STRING }} +# steps: +# - uses: actions/checkout@v3 +# - name: Set up libstdc++ on Linux +# if: matrix.metadata.build == 'linux-x64' +# run: | +# sudo apt-get update -y +# sudo apt-get install -y --allow-downgrades libstdc++6 +# sudo apt-get install --reinstall g++ +# - name: Set up base deps on musl +# if: matrix.metadata.build == 'linux-musl' +# run: ./scripts/alpine-linux-install-deps.sh +# - name: Install MSVC dev-cmd (Windows) +# uses: ilammy/msvc-dev-cmd@v1 +# if: ${{ matrix.metadata.build == 'windows-x64' }} +# - name: Delete unwanted link to stop it from interfering (Windows) +# shell: bash +# run: rm /usr/bin/link.exe +# if: ${{ matrix.metadata.build == 'windows-x64' }} - - name: Set up dependencies for Mac OS - run: | - brew install automake - # using gnu-tar is a workaround for https://github.com/actions/cache/issues/403 - brew install gnu-tar - echo PATH="/usr/local/opt/gnu-tar/libexec/gnubin:$PATH" >> $GITHUB_ENV - if: matrix.metadata.os == 'macos-12' - - name: Install Rust - uses: dtolnay/rust-toolchain@stable - with: - toolchain: ${{ env.MSRV }} - target: ${{ matrix.metadata.target }} - - name: Install Nextest - uses: taiki-e/install-action@nextest - - name: Install LLVM (macOS Apple Silicon) - if: matrix.metadata.os == 'macos-12' && !matrix.metadata.llvm_url - run: | - brew install llvm - - name: Install LLVM - shell: bash - if: matrix.metadata.llvm_url - run: | - curl --proto '=https' --tlsv1.2 -sSf ${{ matrix.metadata.llvm_url }} -L -o llvm.tar.xz - LLVM_DIR=$(pwd)/${{ env.LLVM_DIR }} - mkdir ${LLVM_DIR} - tar xf llvm.tar.xz --strip-components=1 -C ${LLVM_DIR} - echo "${LLVM_DIR}/bin" >> $GITHUB_PATH - echo "${LLVM_DIR}/usr/bin" >> $GITHUB_PATH - echo "LLVM_SYS_180_PREFIX=${LLVM_DIR}" >> $GITHUB_ENV - echo "ENABLE_LLVM=1" >> $GITHUB_ENV - env: - LLVM_DIR: .llvm - - name: Add `brew` libs to `RUSTFLAGS` - if: matrix.metadata.os == 'macos-14' - shell: bash - run: | - echo "RUSTFLAGS=-L/opt/homebrew/lib" >> $GITHUB_ENV - - name: Setup Rust target - shell: bash - run: | - mkdir -p .cargo - cat << EOF > .cargo/config.toml - [build] - target = "${{ matrix.metadata.target }}" - EOF - if: matrix.metadata.target - - name: Cache - uses: whywaita/actions-cache-s3@v2 - with: - path: | - ~/.cargo/* - ./target/* - key: r22-${{ github.repository }}-${{ runner.os }}-${{ hashFiles('Cargo.lock') }}-wasmer-make-test-stage-${{ matrix.stage.make }}-${{ matrix.metadata.build }} - aws-s3-bucket: wasmer-rust-artifacts-cache - aws-access-key-id: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_TOKEN }} - aws-secret-access-key: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_KEY }} - aws-region: auto - aws-endpoint: https://1541b1e8a3fc6ad155ce67ef38899700.r2.cloudflarestorage.com - aws-s3-bucket-endpoint: false - aws-s3-force-path-style: true - - name: ${{ matrix.stage.description }} - shell: bash - run: make ${{ matrix.stage.make }} - env: - TARGET: ${{ matrix.metadata.target }} - TARGET_DIR: target/${{ matrix.metadata.target }}/release - CARGO_TARGET: ${{ matrix.metadata.target }} +# - name: Set up dependencies for Mac OS +# run: | +# brew install automake +# # using gnu-tar is a workaround for https://github.com/actions/cache/issues/403 +# brew install gnu-tar +# echo PATH="/usr/local/opt/gnu-tar/libexec/gnubin:$PATH" >> $GITHUB_ENV +# if: matrix.metadata.os == 'macos-12' +# - name: Install Rust +# uses: dtolnay/rust-toolchain@stable +# with: +# toolchain: ${{ env.MSRV }} +# target: ${{ matrix.metadata.target }} +# - name: Install Nextest +# uses: taiki-e/install-action@nextest +# - name: Install LLVM (macOS Apple Silicon) +# if: matrix.metadata.os == 'macos-12' && !matrix.metadata.llvm_url +# run: | +# brew install llvm +# - name: Install LLVM +# shell: bash +# if: matrix.metadata.llvm_url +# run: | +# curl --proto '=https' --tlsv1.2 -sSf ${{ matrix.metadata.llvm_url }} -L -o llvm.tar.xz +# LLVM_DIR=$(pwd)/${{ env.LLVM_DIR }} +# mkdir ${LLVM_DIR} +# tar xf llvm.tar.xz --strip-components=1 -C ${LLVM_DIR} +# echo "${LLVM_DIR}/bin" >> $GITHUB_PATH +# echo "${LLVM_DIR}/usr/bin" >> $GITHUB_PATH +# echo "LLVM_SYS_180_PREFIX=${LLVM_DIR}" >> $GITHUB_ENV +# echo "ENABLE_LLVM=1" >> $GITHUB_ENV +# env: +# LLVM_DIR: .llvm +# - name: Add `brew` libs to `RUSTFLAGS` +# if: matrix.metadata.os == 'macos-14' +# shell: bash +# run: | +# echo "RUSTFLAGS=-L/opt/homebrew/lib" >> $GITHUB_ENV +# - name: Setup Rust target +# shell: bash +# run: | +# mkdir -p .cargo +# cat << EOF > .cargo/config.toml +# [build] +# target = "${{ matrix.metadata.target }}" +# EOF +# if: matrix.metadata.target +# - name: Cache +# uses: whywaita/actions-cache-s3@v2 +# with: +# path: | +# ~/.cargo/* +# ./target/* +# key: r22-${{ github.repository }}-${{ runner.os }}-${{ hashFiles('Cargo.lock') }}-wasmer-make-test-stage-${{ matrix.stage.make }}-${{ matrix.metadata.build }} +# aws-s3-bucket: wasmer-rust-artifacts-cache +# aws-access-key-id: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_TOKEN }} +# aws-secret-access-key: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_KEY }} +# aws-region: auto +# aws-endpoint: https://1541b1e8a3fc6ad155ce67ef38899700.r2.cloudflarestorage.com +# aws-s3-bucket-endpoint: false +# aws-s3-force-path-style: true +# - name: ${{ matrix.stage.description }} +# shell: bash +# run: make ${{ matrix.stage.make }} +# env: +# TARGET: ${{ matrix.metadata.target }} +# TARGET_DIR: target/${{ matrix.metadata.target }}/release +# CARGO_TARGET: ${{ matrix.metadata.target }} - test_integration_cli: - name: CLI integration tests on ${{ matrix.build }} - runs-on: ${{ matrix.os }} - needs: [build, build_linux_aarch64, build_linux_riscv64] - strategy: - fail-fast: false - matrix: - include: - - build: linux-x64 - os: ubuntu-22.04 - target: x86_64-unknown-linux-gnu - llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-amd64.tar.xz' - - build: macos-x64 - os: macos-12 - target: x86_64-apple-darwin - # we only build the integration-test CLI, we don't run tests - - build: macos-arm - os: macos-12 - target: aarch64-apple-darwin, - - build: linux-musl - target: x86_64-unknown-linux-musl - os: ubuntu-22.04 - container: alpine:latest - - build: windows-x64 - os: windows-2019 - target: x86_64-pc-windows-msvc - # For now, disable LLVM in `windows-x64.` - # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-windows-amd64.tar.xz' +# test_integration_cli: +# name: CLI integration tests on ${{ matrix.build }} +# runs-on: ${{ matrix.os }} +# needs: [build, build_linux_aarch64, build_linux_riscv64] +# strategy: +# fail-fast: false +# matrix: +# include: +# - build: linux-x64 +# os: ubuntu-22.04 +# target: x86_64-unknown-linux-gnu +# llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-amd64.tar.xz' +# - build: macos-x64 +# os: macos-12 +# target: x86_64-apple-darwin +# # we only build the integration-test CLI, we don't run tests +# - build: macos-arm +# os: macos-12 +# target: aarch64-apple-darwin, +# - build: linux-musl +# target: x86_64-unknown-linux-musl +# os: ubuntu-22.04 +# container: alpine:latest +# - build: windows-x64 +# os: windows-2019 +# target: x86_64-pc-windows-msvc +# # For now, disable LLVM in `windows-x64.` +# # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-windows-amd64.tar.xz' - container: ${{ matrix.container }} - env: - SCCACHE_AZURE_BLOB_CONTAINER: wasmerstoragesccacheblob - SCCACHE_AZURE_CONNECTION_STRING: ${{ secrets.SCCACHE_AZURE_CONNECTION_STRING }} - steps: - - uses: actions/checkout@v3 - - uses: goto-bus-stop/setup-zig@v2 - with: - version: 0.10.0 - - name: Set up base deps on musl - if: matrix.build == 'linux-musl' - run: ./scripts/alpine-linux-install-deps.sh - - uses: actions/download-artifact@v4 - id: download - with: - name: capi-${{ matrix.build }} - - uses: actions/download-artifact@v4 - with: - name: wasmer-cli-${{ matrix.build }} - - name: 'Echo download path' - run: echo ${{steps.download.outputs.download-path}} - - name: Install Rust - uses: dtolnay/rust-toolchain@stable - with: - toolchain: ${{ env.MSRV }} - target: ${{ matrix.metadata.target }} - - name: Install Nextest - uses: taiki-e/install-action@nextest - - name: Cache - uses: whywaita/actions-cache-s3@v2 - with: - path: | - ~/.cargo/* - ./target/* - key: r22-${{ github.repository }}-${{ runner.os }}-${{ hashFiles('Cargo.lock') }}-wasmer-make-test-integration-cli-${{ matrix.build }} - aws-s3-bucket: wasmer-rust-artifacts-cache - aws-access-key-id: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_TOKEN }} - aws-secret-access-key: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_KEY }} - aws-region: auto - aws-endpoint: https://1541b1e8a3fc6ad155ce67ef38899700.r2.cloudflarestorage.com - aws-s3-bucket-endpoint: false - aws-s3-force-path-style: true - - name: Prepare package directory - shell: bash - run: | - mkdir -p package - mkdir -p package/cache - - uses: actions/download-artifact@v4 - with: - name: capi-linux-aarch64 - path: package/cache/wasmercache1 - - uses: actions/download-artifact@v4 - with: - name: capi-windows-x64 - path: package/cache/wasmercache2 - - uses: actions/download-artifact@v4 - with: - name: capi-macos-arm - path: package/cache/wasmercache3 - - uses: actions/download-artifact@v4 - with: - name: capi-macos-x64 - path: package/cache/wasmercache4 - - uses: actions/download-artifact@v4 - with: - name: capi-linux-x64 - path: package/cache/wasmercache5 - - uses: actions/download-artifact@v4 - with: - name: capi-linux-riscv64 - path: package/cache/wasmercache6 - - name: Copy .tar.gz files to proper location - shell: bash - run: | - ls package/cache/wasmercache1 - ls package/cache/wasmercache2 - ls package/cache/wasmercache3 - ls package/cache/wasmercache4 - ls package/cache/wasmercache5 - cp package/cache/wasmercache1/wasmer.tar.gz package/cache/wasmer-linux-aarch64.tar.gz - cp package/cache/wasmercache2/build-capi.tar.gz package/cache/wasmer-windows-gnu64.tar.gz - cp package/cache/wasmercache3/build-capi.tar.gz package/cache/wasmer-darwin-arm64.tar.gz - cp package/cache/wasmercache4/build-capi.tar.gz package/cache/wasmer-darwin-amd64.tar.gz - cp package/cache/wasmercache5/build-capi.tar.gz package/cache/wasmer-linux-amd64.tar.gz - cp package/cache/wasmercache6/wasmer.tar.gz package/cache/wasmer-linux-riscv64.tar.gz - - uses: actions/download-artifact@v4 - if: ${{ matrix.build == 'windows-x64' }} - with: - name: capi-windows-x64 - path: download_link - - uses: actions/download-artifact@v4 - if: ${{ matrix.build == 'linux-musl' }} - with: - name: capi-linux-musl - path: download_link - - uses: actions/download-artifact@v4 - if: ${{ matrix.build == 'macos-arm' }} - with: - name: capi-macos-arm - path: download_link - - uses: actions/download-artifact@v4 - if: ${{ matrix.build == 'macos-x64' }} - with: - name: capi-macos-x64 - path: download_link - - uses: actions/download-artifact@v4 - if: ${{ matrix.build == 'linux-x64' }} - with: - name: capi-linux-x64 - path: download_link - - name: Copy build-capi.tar.gz to link.tar.gz - shell: bash - run: | - cp download_link/build-capi.tar.gz link.tar.gz - - name: Unzip Artifacts - shell: bash - run: | - make untar-capi - - name: Unzip Artifacts - shell: bash - run: | - make untar-wasmer +# container: ${{ matrix.container }} +# env: +# SCCACHE_AZURE_BLOB_CONTAINER: wasmerstoragesccacheblob +# SCCACHE_AZURE_CONNECTION_STRING: ${{ secrets.SCCACHE_AZURE_CONNECTION_STRING }} +# steps: +# - uses: actions/checkout@v3 +# - uses: goto-bus-stop/setup-zig@v2 +# with: +# version: 0.10.0 +# - name: Set up base deps on musl +# if: matrix.build == 'linux-musl' +# run: ./scripts/alpine-linux-install-deps.sh +# - uses: actions/download-artifact@v4 +# id: download +# with: +# name: capi-${{ matrix.build }} +# - uses: actions/download-artifact@v4 +# with: +# name: wasmer-cli-${{ matrix.build }} +# - name: 'Echo download path' +# run: echo ${{steps.download.outputs.download-path}} +# - name: Install Rust +# uses: dtolnay/rust-toolchain@stable +# with: +# toolchain: ${{ env.MSRV }} +# target: ${{ matrix.metadata.target }} +# - name: Install Nextest +# uses: taiki-e/install-action@nextest +# - name: Cache +# uses: whywaita/actions-cache-s3@v2 +# with: +# path: | +# ~/.cargo/* +# ./target/* +# key: r22-${{ github.repository }}-${{ runner.os }}-${{ hashFiles('Cargo.lock') }}-wasmer-make-test-integration-cli-${{ matrix.build }} +# aws-s3-bucket: wasmer-rust-artifacts-cache +# aws-access-key-id: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_TOKEN }} +# aws-secret-access-key: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_KEY }} +# aws-region: auto +# aws-endpoint: https://1541b1e8a3fc6ad155ce67ef38899700.r2.cloudflarestorage.com +# aws-s3-bucket-endpoint: false +# aws-s3-force-path-style: true +# - name: Prepare package directory +# shell: bash +# run: | +# mkdir -p package +# mkdir -p package/cache +# - uses: actions/download-artifact@v4 +# with: +# name: capi-linux-aarch64 +# path: package/cache/wasmercache1 +# - uses: actions/download-artifact@v4 +# with: +# name: capi-windows-x64 +# path: package/cache/wasmercache2 +# - uses: actions/download-artifact@v4 +# with: +# name: capi-macos-arm +# path: package/cache/wasmercache3 +# - uses: actions/download-artifact@v4 +# with: +# name: capi-macos-x64 +# path: package/cache/wasmercache4 +# - uses: actions/download-artifact@v4 +# with: +# name: capi-linux-x64 +# path: package/cache/wasmercache5 +# - uses: actions/download-artifact@v4 +# with: +# name: capi-linux-riscv64 +# path: package/cache/wasmercache6 +# - name: Copy .tar.gz files to proper location +# shell: bash +# run: | +# ls package/cache/wasmercache1 +# ls package/cache/wasmercache2 +# ls package/cache/wasmercache3 +# ls package/cache/wasmercache4 +# ls package/cache/wasmercache5 +# cp package/cache/wasmercache1/wasmer.tar.gz package/cache/wasmer-linux-aarch64.tar.gz +# cp package/cache/wasmercache2/build-capi.tar.gz package/cache/wasmer-windows-gnu64.tar.gz +# cp package/cache/wasmercache3/build-capi.tar.gz package/cache/wasmer-darwin-arm64.tar.gz +# cp package/cache/wasmercache4/build-capi.tar.gz package/cache/wasmer-darwin-amd64.tar.gz +# cp package/cache/wasmercache5/build-capi.tar.gz package/cache/wasmer-linux-amd64.tar.gz +# cp package/cache/wasmercache6/wasmer.tar.gz package/cache/wasmer-linux-riscv64.tar.gz +# - uses: actions/download-artifact@v4 +# if: ${{ matrix.build == 'windows-x64' }} +# with: +# name: capi-windows-x64 +# path: download_link +# - uses: actions/download-artifact@v4 +# if: ${{ matrix.build == 'linux-musl' }} +# with: +# name: capi-linux-musl +# path: download_link +# - uses: actions/download-artifact@v4 +# if: ${{ matrix.build == 'macos-arm' }} +# with: +# name: capi-macos-arm +# path: download_link +# - uses: actions/download-artifact@v4 +# if: ${{ matrix.build == 'macos-x64' }} +# with: +# name: capi-macos-x64 +# path: download_link +# - uses: actions/download-artifact@v4 +# if: ${{ matrix.build == 'linux-x64' }} +# with: +# name: capi-linux-x64 +# path: download_link +# - name: Copy build-capi.tar.gz to link.tar.gz +# shell: bash +# run: | +# cp download_link/build-capi.tar.gz link.tar.gz +# - name: Unzip Artifacts +# shell: bash +# run: | +# make untar-capi +# - name: Unzip Artifacts +# shell: bash +# run: | +# make untar-wasmer - # Removed in favour of freestanding integration tests - # - # - name: Test integration CLI - # if: false # matrix.build != 'macos-arm' - # shell: bash - # run: | - # export WASMER_PATH=`pwd`/target/${{ matrix.target }}/release/wasmer${{ matrix.exe }} - # export WASMER_DIR=`pwd`/package && make test-integration-cli-ci - # env: - # TARGET: ${{ matrix.target }} - # TARGET_DIR: target/${{ matrix.target }}/release - # CARGO_TARGET: ${{ matrix.target }} - # WAPM_DEV_TOKEN: ${{ secrets.WAPM_DEV_TOKEN }} - # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} +# # Removed in favour of freestanding integration tests +# # +# # - name: Test integration CLI +# # if: false # matrix.build != 'macos-arm' +# # shell: bash +# # run: | +# # export WASMER_PATH=`pwd`/target/${{ matrix.target }}/release/wasmer${{ matrix.exe }} +# # export WASMER_DIR=`pwd`/package && make test-integration-cli-ci +# # env: +# # TARGET: ${{ matrix.target }} +# # TARGET_DIR: target/${{ matrix.target }}/release +# # CARGO_TARGET: ${{ matrix.target }} +# # WAPM_DEV_TOKEN: ${{ secrets.WAPM_DEV_TOKEN }} +# # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # ---- - # Note (xdoardo on 2024/10/07): - # --- - # As of now the WAMR, WASMI (and V8) backends are not that mature enough. We will re-enable these tests - # when they've been used and matured. - # ---- - # - # - name: Test CLI integration (WAMR) - # shell: bash - # run: | - # export WASMER_PATH=`pwd`/target/${{ matrix.target }}/release/wasmer${{ matrix.exe }} - # export WASMER_DIR=`pwd`/package && make test-integration-cli-wamr-ci - # env: - # TARGET: ${{ matrix.target }} - # TARGET_DIR: target/${{ matrix.target }}/release - # CARGO_TARGET: ${{ matrix.target }} - # WAPM_DEV_TOKEN: ${{ secrets.WAPM_DEV_TOKEN }} - # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} +# # ---- +# # Note (xdoardo on 2024/10/07): +# # --- +# # As of now the WAMR, WASMI (and V8) backends are not that mature enough. We will re-enable these tests +# # when they've been used and matured. +# # ---- +# # +# # - name: Test CLI integration (WAMR) +# # shell: bash +# # run: | +# # export WASMER_PATH=`pwd`/target/${{ matrix.target }}/release/wasmer${{ matrix.exe }} +# # export WASMER_DIR=`pwd`/package && make test-integration-cli-wamr-ci +# # env: +# # TARGET: ${{ matrix.target }} +# # TARGET_DIR: target/${{ matrix.target }}/release +# # CARGO_TARGET: ${{ matrix.target }} +# # WAPM_DEV_TOKEN: ${{ secrets.WAPM_DEV_TOKEN }} +# # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # - name: Test CLI integration (WASMI) - # shell: bash - # run: | - # export WASMER_PATH=`pwd`/target/${{ matrix.target }}/release/wasmer${{ matrix.exe }} - # export WASMER_DIR=`pwd`/package && make test-integration-cli-wasmi-ci - # env: - # TARGET: ${{ matrix.target }} - # TARGET_DIR: target/${{ matrix.target }}/release - # CARGO_TARGET: ${{ matrix.target }} - # WAPM_DEV_TOKEN: ${{ secrets.WAPM_DEV_TOKEN }} - # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} +# # - name: Test CLI integration (WASMI) +# # shell: bash +# # run: | +# # export WASMER_PATH=`pwd`/target/${{ matrix.target }}/release/wasmer${{ matrix.exe }} +# # export WASMER_DIR=`pwd`/package && make test-integration-cli-wasmi-ci +# # env: +# # TARGET: ${{ matrix.target }} +# # TARGET_DIR: target/${{ matrix.target }}/release +# # CARGO_TARGET: ${{ matrix.target }} +# # WAPM_DEV_TOKEN: ${{ secrets.WAPM_DEV_TOKEN }} +# # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # there is another set of integration tests in 'wasmer-integration-tests' repo. Run those - test-wasmer-integration-tests: - needs: [build] - runs-on: ubuntu-22.04 - steps: - - name: Checkout wasmer-integration-tests repository - uses: actions/checkout@v3 - with: - repository: wasmerio/wasmer-integration-tests - submodules: true - token: ${{ secrets.CLONE_WASMER_INTEGRATION_TESTS }} - - uses: actions/download-artifact@v4 - with: - name: wasmer-cli-linux-x64 - - name: Cargo Registry Cache - uses: actions/cache@v3 - with: - path: | - ~/.cargo/advisory-db - ~/.cargo/git - ~/.cargo/registry - key: cargo-registry-${{ hashFiles('**/Cargo.lock') }} - - name: Cargo target cache - uses: actions/cache@v3 - with: - path: | - target/ - key: cargo-release-${{ hashFiles('**/Cargo.lock') }} - - run: | - # install rust toolchain - curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y - . "$HOME/.cargo/env" +# # there is another set of integration tests in 'wasmer-integration-tests' repo. Run those +# test-wasmer-integration-tests: +# needs: [build] +# runs-on: ubuntu-22.04 +# steps: +# - name: Checkout wasmer-integration-tests repository +# uses: actions/checkout@v3 +# with: +# repository: wasmerio/wasmer-integration-tests +# submodules: true +# token: ${{ secrets.CLONE_WASMER_INTEGRATION_TESTS }} +# - uses: actions/download-artifact@v4 +# with: +# name: wasmer-cli-linux-x64 +# - name: Cargo Registry Cache +# uses: actions/cache@v3 +# with: +# path: | +# ~/.cargo/advisory-db +# ~/.cargo/git +# ~/.cargo/registry +# key: cargo-registry-${{ hashFiles('**/Cargo.lock') }} +# - name: Cargo target cache +# uses: actions/cache@v3 +# with: +# path: | +# target/ +# key: cargo-release-${{ hashFiles('**/Cargo.lock') }} +# - run: | +# # install rust toolchain +# curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y +# . "$HOME/.cargo/env" - # add wasmer cli to PATH - tar -xzf build-wasmer.tar.gz +# # add wasmer cli to PATH +# tar -xzf build-wasmer.tar.gz - docker build -t tmp . - docker run -v $PWD:/app -w /app tmp bash -c " \ - cp ./bin/wasmer /root/.wasmer/bin/wasmer &&\ - export MYSQL_HOST='${{ vars.INTEGRATION_TEST_MYSQL_HOST }}' &&\ - export MYSQL_DBNAME='${{ vars.INTEGRATION_TEST_MYSQL_DBNAME }}' &&\ - export MYSQL_USERNAME='${{ secrets.INTEGRATION_TEST_MYSQL_USERNAME }}' &&\ - export MYSQL_PASSWORD='${{ secrets.INTEGRATION_TEST_MYSQL_PASSWORD }}' &&\ - export MYSQL_PORT='${{ vars.INTEGRATION_TEST_MYSQL_PORT }}' &&\ - export MYSQL_CERT='${{ secrets.INTEGRATION_TEST_MYSQL_CERT }}' &&\ - export PG_HOST='${{ vars.INTEGRATION_TEST_PG_HOST }}' &&\ - export PG_DBNAME='${{ vars.INTEGRATION_TEST_PG_DBNAME }}' &&\ - export PG_USERNAME='${{ secrets.INTEGRATION_TEST_PG_USERNAME }}' &&\ - export PG_PASSWORD='${{ secrets.INTEGRATION_TEST_PG_PASSWORD }}' &&\ - export PG_PORT='${{ vars.INTEGRATION_TEST_PG_PORT }}' &&\ - wasmer config set registry.url https://registry.wasmer.io/graphql &&\ - wasmer login '${{ secrets.WAPM_PROD_TOKEN }}' &&\ - wasmer config set registry.url https://registry.wasmer.wtf/graphql &&\ - wasmer login '${{ secrets.WAPM_DEV_TOKEN }}' &&\ - cargo test --no-fail-fast" - - name: notify failure in slack - if: failure() - run: | - curl -X POST -H 'Content-type: application/json' --data '{"text":"Integration tests failed ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"}' ${{ secrets.INTEGRATION_TEST_SLACK_WEBHOOK }} +# docker build -t tmp . +# docker run -v $PWD:/app -w /app tmp bash -c " \ +# cp ./bin/wasmer /root/.wasmer/bin/wasmer &&\ +# export MYSQL_HOST='${{ vars.INTEGRATION_TEST_MYSQL_HOST }}' &&\ +# export MYSQL_DBNAME='${{ vars.INTEGRATION_TEST_MYSQL_DBNAME }}' &&\ +# export MYSQL_USERNAME='${{ secrets.INTEGRATION_TEST_MYSQL_USERNAME }}' &&\ +# export MYSQL_PASSWORD='${{ secrets.INTEGRATION_TEST_MYSQL_PASSWORD }}' &&\ +# export MYSQL_PORT='${{ vars.INTEGRATION_TEST_MYSQL_PORT }}' &&\ +# export MYSQL_CERT='${{ secrets.INTEGRATION_TEST_MYSQL_CERT }}' &&\ +# export PG_HOST='${{ vars.INTEGRATION_TEST_PG_HOST }}' &&\ +# export PG_DBNAME='${{ vars.INTEGRATION_TEST_PG_DBNAME }}' &&\ +# export PG_USERNAME='${{ secrets.INTEGRATION_TEST_PG_USERNAME }}' &&\ +# export PG_PASSWORD='${{ secrets.INTEGRATION_TEST_PG_PASSWORD }}' &&\ +# export PG_PORT='${{ vars.INTEGRATION_TEST_PG_PORT }}' &&\ +# wasmer config set registry.url https://registry.wasmer.io/graphql &&\ +# wasmer login '${{ secrets.WAPM_PROD_TOKEN }}' &&\ +# wasmer config set registry.url https://registry.wasmer.wtf/graphql &&\ +# wasmer login '${{ secrets.WAPM_DEV_TOKEN }}' &&\ +# cargo test --no-fail-fast" +# - name: notify failure in slack +# if: failure() +# run: | +# curl -X POST -H 'Content-type: application/json' --data '{"text":"Integration tests failed ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"}' ${{ secrets.INTEGRATION_TEST_SLACK_WEBHOOK }} diff --git a/.github/workflows/wasmer-config.yaml b/.github/workflows/wasmer-config.yaml index 9091574b1e3..90a36b31efd 100644 --- a/.github/workflows/wasmer-config.yaml +++ b/.github/workflows/wasmer-config.yaml @@ -1,54 +1,54 @@ -# Dedicated workflow just for the wasmer-config crate -name: wasmer-config +# # Dedicated workflow just for the wasmer-config crate +# name: wasmer-config -on: - push: - branches: - - main - pull_request: +# on: +# push: +# branches: +# - main +# pull_request: -# Automatically cancel previous workflow runs when a new commit is pushed. -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true +# # Automatically cancel previous workflow runs when a new commit is pushed. +# concurrency: +# group: ${{ github.workflow }}-${{ github.ref }} +# cancel-in-progress: true -env: - DEFAULT_CRATE_NAME: wasmer_toml +# env: +# DEFAULT_CRATE_NAME: wasmer_toml -jobs: - check: - name: Compile and Test - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Rust Cache - uses: Swatinem/rust-cache@v2 - - name: Setup Rust - uses: dsherret/rust-toolchain-file@v1 - - name: Install Nextest - uses: taiki-e/install-action@nextest - - name: Type Checking - run: | - cd lib/config && cargo check --verbose --locked - - name: Build - run: | - cd lib/config && cargo build --verbose --locked - - name: Test - run: | - cd lib/config && cargo nextest run --verbose --locked +# jobs: +# check: +# name: Compile and Test +# runs-on: ubuntu-latest +# steps: +# - uses: actions/checkout@v2 +# - name: Rust Cache +# uses: Swatinem/rust-cache@v2 +# - name: Setup Rust +# uses: dsherret/rust-toolchain-file@v1 +# - name: Install Nextest +# uses: taiki-e/install-action@nextest +# - name: Type Checking +# run: | +# cd lib/config && cargo check --verbose --locked +# - name: Build +# run: | +# cd lib/config && cargo build --verbose --locked +# - name: Test +# run: | +# cd lib/config && cargo nextest run --verbose --locked - lints: - name: Linting and Formatting - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Rust Cache - uses: Swatinem/rust-cache@v2 - - name: Setup Rust - uses: dsherret/rust-toolchain-file@v1 - - name: Check Formatting - run: | - cd lib/config && cargo fmt --verbose --check - - name: Clippy - run: | - cd lib/config && cargo clippy --verbose +# lints: +# name: Linting and Formatting +# runs-on: ubuntu-latest +# steps: +# - uses: actions/checkout@v2 +# - name: Rust Cache +# uses: Swatinem/rust-cache@v2 +# - name: Setup Rust +# uses: dsherret/rust-toolchain-file@v1 +# - name: Check Formatting +# run: | +# cd lib/config && cargo fmt --verbose --check +# - name: Clippy +# run: | +# cd lib/config && cargo clippy --verbose diff --git a/Cargo.lock b/Cargo.lock index 16be699eacb..65e7d478673 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -710,7 +710,6 @@ checksum = "0b023947811758c97c59bf9d1c188fd619ad4718dcaa767947df1cadb14f39f4" dependencies = [ "glob", "libc", - "libloading", ] [[package]] @@ -2902,16 +2901,6 @@ dependencies = [ "once_cell", ] -[[package]] -name = "libloading" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4979f22fdb869068da03c9f7528f8297c6fd2606bc3a4affe42e6a823fdb8da4" -dependencies = [ - "cfg-if 1.0.0", - "windows-targets 0.52.6", -] - [[package]] name = "libm" version = "0.2.8" diff --git a/lib/api/Cargo.toml b/lib/api/Cargo.toml index 59173c75ca7..8510482de59 100644 --- a/lib/api/Cargo.toml +++ b/lib/api/Cargo.toml @@ -161,7 +161,7 @@ static-artifact-load = ["wasmer-compiler/static-artifact-load"] static-artifact-create = ["wasmer-compiler/static-artifact-create"] [build-dependencies] -bindgen = "0.70.1" +bindgen = { version = "0.70.1", default-features = false, features = ["static", "logging", "prettyplease"] } cmake = "0.1.50" tar = "0.4.42" ureq = "2.10.1" diff --git a/lib/api/build.rs b/lib/api/build.rs index af0941cfbca..64e2076e137 100644 --- a/lib/api/build.rs +++ b/lib/api/build.rs @@ -151,12 +151,17 @@ fn main() { { use std::{env, path::PathBuf}; - let url = match (env::var("CARGO_CFG_TARGET_OS").unwrap().as_str(), env::var("CARGO_CFG_TARGET_ARCH").unwrap().as_str()) { - ("macos", "aarch64") => "https://github.com/wasmerio/wee8-custom-builds/releases/download/11.6/wee8-darwin-aarch64.tar.xz", - ("macos", "x86_64") => "https://github.com/wasmerio/wee8-custom-builds/releases/download/11.6/wee8-darwin-amd64.tar.xz", - ("linux", "x86_64") => "https://github.com/wasmerio/wee8-custom-builds/releases/download/11.6/wee8-linux-amd64.tar.xz", - ("windows", "x86_64") =>"https://github.com/wasmerio/wee8-custom-builds/releases/download/11.6/wee8-windows-amd64.tar.xz", - (os, arch) => panic!("target os + arch combination not supported: {os}, {arch}") + let url = match ( + env::var("CARGO_CFG_TARGET_OS").unwrap().as_str(), + env::var("CARGO_CFG_TARGET_ARCH").unwrap().as_str(), + env::var("CARGO_CFG_TARGET_ENV").unwrap_or_default().as_str(), + ) { + ("macos", "aarch64", _) => "https://github.com/wasmerio/wee8-custom-builds/releases/download/11.7/wee8-darwin-aarch64.tar.xz", + ("macos", "x86_64", _) => "https://github.com/wasmerio/wee8-custom-builds/releases/download/11.7/wee8-darwin-amd64.tar.xz", + ("linux", "x86_64", "gnu") => "https://github.com/wasmerio/wee8-custom-builds/releases/download/11.7/wee8-linux-amd64.tar.xz", + ("linux", "x86_64", "musl") => "https://github.com/wasmerio/wee8-custom-builds/releases/download/11.7/wee8-linux-musl.tar.xz", + ("windows", "x86_64", _) => "https://github.com/wasmerio/wee8-custom-builds/releases/download/11.7/wee8-windows-amd64.tar.xz", + (os, arch, _) => panic!("target os + arch combination not supported: {os}, {arch}"), }; let crate_root = env::var("CARGO_MANIFEST_DIR").unwrap(); From 49049bd47d038b7a4eb5393822ac7a874db2fd65 Mon Sep 17 00:00:00 2001 From: "M.Amin Rayej" Date: Sun, 27 Oct 2024 23:51:20 +0330 Subject: [PATCH 16/39] fix ids --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d0c2288643e..1b6272727ba 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -773,7 +773,7 @@ jobs: asset_name: wasmer-linux-musl-amd64.tar.gz asset_content_type: application/gzip - name: Upload Release Asset Linux amd64 (musl) With v8 - id: upload-release-asset-linux-musl-amd64 + id: upload-release-asset-linux-musl-amd64-v8 uses: actions/upload-release-asset@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -783,7 +783,7 @@ jobs: asset_name: wasmer-v8-linux-musl-amd64.tar.gz asset_content_type: application/gzip - name: Upload Release Asset Linux amd64 (musl) with wasmi - id: upload-release-asset-linux-musl-amd64 + id: upload-release-asset-linux-musl-amd64-wasmi uses: actions/upload-release-asset@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 31c3b39b9fed73a28697033349cd0d4a23473648 Mon Sep 17 00:00:00 2001 From: "M.Amin Rayej" Date: Sun, 27 Oct 2024 23:54:19 +0330 Subject: [PATCH 17/39] fix container --- .github/workflows/build.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1b6272727ba..2dc2e643d99 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -193,18 +193,18 @@ jobs: use_llvm: false build_wasm: true - build: linux-musl-x64-v8 - os: ubuntu-22.04 + os: ubuntu-latest artifact_name: 'wasmer-v8-linux-musl-amd64' - cross_compilation_artifact_name: 'cross_compiled_from_linux' + container: alpine:latest use_sccache: false - use_llvm: true + use_llvm: false build_wasm: true - build: linux-musl-x64-wasmi - os: ubuntu-22.04 + os: ubuntu-latest artifact_name: 'wasmer-wasmi-linux-musl-amd64' - cross_compilation_artifact_name: 'cross_compiled_from_linux' + container: alpine:latest use_sccache: false - use_llvm: true + use_llvm: false build_wasm: true container: ${{ matrix.container }} env: From ff2610b02702dc812989888d29dfd41b98309abd Mon Sep 17 00:00:00 2001 From: "M.Amin Rayej" Date: Sun, 27 Oct 2024 23:59:40 +0330 Subject: [PATCH 18/39] disable capi for now --- .github/workflows/build.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2dc2e643d99..c3d1362bfd7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -344,14 +344,14 @@ jobs: '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' -s echo 'RUSTC_WRAPPER=${{ runner.tool_cache }}/cargo-sccache/bin/sccache' >> $GITHUB_ENV shell: bash - - name: Build C API headless - shell: bash - run: | - make package-capi-headless - - name: Build C API - shell: bash - run: | - make build-capi + # - name: Build C API headless + # shell: bash + # run: | + # make package-capi-headless + # - name: Build C API + # shell: bash + # run: | + # make build-capi - name: Build Wasmer binary with LLVM if: matrix.use_llvm shell: bash From f3363b2d7ce5a52c6b1b16d2cdebc0d98405e2ee Mon Sep 17 00:00:00 2001 From: "M.Amin Rayej" Date: Mon, 28 Oct 2024 00:02:20 +0330 Subject: [PATCH 19/39] fix capi --- .github/workflows/build.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c3d1362bfd7..9a218f5befe 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -344,14 +344,14 @@ jobs: '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' -s echo 'RUSTC_WRAPPER=${{ runner.tool_cache }}/cargo-sccache/bin/sccache' >> $GITHUB_ENV shell: bash - # - name: Build C API headless - # shell: bash - # run: | - # make package-capi-headless - # - name: Build C API - # shell: bash - # run: | - # make build-capi + - name: Build C API headless + shell: bash + run: | + LLVM_CONFIG_PATH=/usr/bin/llvm-config-18 make package-capi-headless + - name: Build C API + shell: bash + run: | + LLVM_CONFIG_PATH=/usr/bin/llvm-config-18 make build-capi - name: Build Wasmer binary with LLVM if: matrix.use_llvm shell: bash From 856d5f5761c19df1c36fc14c4547484611fb5c7f Mon Sep 17 00:00:00 2001 From: "M.Amin Rayej" Date: Mon, 28 Oct 2024 00:44:47 +0330 Subject: [PATCH 20/39] fix issues with build and conditions --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9a218f5befe..cf632fb4f98 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -217,6 +217,7 @@ jobs: if: startsWith(matrix.build, 'linux-musl-x64') run: | apk add bash mold make curl cmake ninja clang18 zstd-static llvm18-dev clang18-static llvm18-static ncurses-static zlib-static + ln -s /usr/bin/clang-18 /usr/bin/clang - name: Install Linux tools if: startsWith(matrix.build, 'linux-x64') run: | @@ -366,7 +367,6 @@ jobs: - name: Build Wasmer with v8 backend musl if: ${{ endsWith(matrix.build, 'v8') && startsWith(matrix.build, 'linux-musl') }} run: | - ln -s /usr/bin/clang-18 /usr/bin/clang echo "#!/bin/bash" >> /usr/bin/llvm-config echo 'if [ "$1" = "--libs" ]; then' >> /usr/bin/llvm-config echo 'llvm-config-18 "$@" "--link-static"' >> /usr/bin/llvm-config @@ -377,7 +377,7 @@ jobs: chmod +x /usr/bin/llvm-config LLVM_CONFIG_PATH=/usr/bin/llvm-config RUSTFLAGS="-C linker=clang -C link-arg=-fuse-ld=mold -lzstd" make build-wasmer-v8 - name: Build Wasmer with v8 backend - if: ${{ endsWith(matrix.build, 'v8') && !startsWith(matrix.build, 'linux-x64') }} + if: ${{ endsWith(matrix.build, 'v8') && (!startsWith(matrix.build, 'linux-x64') || !startsWith(matrix.build, 'linux-musl') }} run: | echo $LIBCLANG_STATIC_PATH make build-wasmer-v8 From de07ac239bea1ad2dea42c67c9ae9aafd07e88d1 Mon Sep 17 00:00:00 2001 From: "M.Amin Rayej" Date: Mon, 28 Oct 2024 00:46:38 +0330 Subject: [PATCH 21/39] fix syntax issue --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index cf632fb4f98..549af1f4a18 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -377,7 +377,7 @@ jobs: chmod +x /usr/bin/llvm-config LLVM_CONFIG_PATH=/usr/bin/llvm-config RUSTFLAGS="-C linker=clang -C link-arg=-fuse-ld=mold -lzstd" make build-wasmer-v8 - name: Build Wasmer with v8 backend - if: ${{ endsWith(matrix.build, 'v8') && (!startsWith(matrix.build, 'linux-x64') || !startsWith(matrix.build, 'linux-musl') }} + if: ${{ endsWith(matrix.build, 'v8') && (!startsWith(matrix.build, 'linux-x64') || !startsWith(matrix.build, 'linux-musl')) }} run: | echo $LIBCLANG_STATIC_PATH make build-wasmer-v8 From d6f83e509f3024eccd092279d0e6c493037724b7 Mon Sep 17 00:00:00 2001 From: "M.Amin Rayej" Date: Mon, 28 Oct 2024 01:30:13 +0330 Subject: [PATCH 22/39] fix again --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 549af1f4a18..e4afa27693c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -377,7 +377,7 @@ jobs: chmod +x /usr/bin/llvm-config LLVM_CONFIG_PATH=/usr/bin/llvm-config RUSTFLAGS="-C linker=clang -C link-arg=-fuse-ld=mold -lzstd" make build-wasmer-v8 - name: Build Wasmer with v8 backend - if: ${{ endsWith(matrix.build, 'v8') && (!startsWith(matrix.build, 'linux-x64') || !startsWith(matrix.build, 'linux-musl')) }} + if: ${{ endsWith(matrix.build, 'v8') && !startsWith(matrix.build, 'linux-x64') && !startsWith(matrix.build, 'linux-musl') }} run: | echo $LIBCLANG_STATIC_PATH make build-wasmer-v8 @@ -392,7 +392,7 @@ jobs: - name: Build Wasmer with wasmi backend musl if: ${{ endsWith(matrix.build, 'wasmi') && startsWith(matrix.build, 'linux-musl') }} run: | - LLVM_CONFIG_PATH=/usr/bin/llvm-config RUSTFLAGS="-C linker=clang -C link-arg=-fuse-ld=mold -lzstd" make build-wasmer-wasmi + LLVM_CONFIG_PATH=/usr/bin/llvm-config-18 RUSTFLAGS="-C linker=clang -C link-arg=-fuse-ld=mold -lzstd" make build-wasmer-wasmi - name: Build Wasmer binary without LLVM if: matrix.use_llvm != true shell: bash From a45a74feab070ca9d3816aaf1c70368f1b804dff Mon Sep 17 00:00:00 2001 From: "M.Amin Rayej" Date: Mon, 28 Oct 2024 02:25:31 +0330 Subject: [PATCH 23/39] do not build wasmi on alpine for now --- .github/workflows/build.yml | 560 +++++++++++++++++------------------- 1 file changed, 269 insertions(+), 291 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e4afa27693c..b4a5ce6a999 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -46,145 +46,145 @@ jobs: fail-fast: false matrix: include: - # - build: linux-arm64 - # os: arm64-ubuntu-latest-8-cores - # artifact_name: 'wasmer-linux-aarch64' - # cross_compilation_artifact_name: 'cross_compiled_from_linux' - # use_sccache: false - # use_llvm: true - # build_wasm: true - # - build: linux-x64 - # os: ubuntu-22.04 - # artifact_name: 'wasmer-linux-amd64' - # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-amd64.tar.xz' - # cross_compilation_artifact_name: 'cross_compiled_from_linux' - # use_sccache: false - # use_llvm: true - # build_wasm: true - # - build: linux-x64-v8 - # os: ubuntu-22.04 - # artifact_name: 'wasmer-v8-linux-amd64' - # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-amd64.tar.xz' - # cross_compilation_artifact_name: 'cross_compiled_from_linux' - # use_sccache: false - # use_llvm: true - # build_wasm: true - # - build: linux-x64-wamr - # os: ubuntu-22.04 - # artifact_name: 'wasmer-wamr-linux-amd64' - # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-amd64.tar.xz' - # cross_compilation_artifact_name: 'cross_compiled_from_linux' - # use_sccache: false - # use_llvm: true - # build_wasm: true - # - build: linux-x64-wasmi - # os: ubuntu-22.04 - # artifact_name: 'wasmer-wasmi-linux-amd64' - # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-amd64.tar.xz' - # cross_compilation_artifact_name: 'cross_compiled_from_linux' - # use_sccache: false - # use_llvm: true - # build_wasm: true - # - build: macos-x64 - # os: macos-13 - # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-amd64.tar.xz' - # artifact_name: 'wasmer-darwin-amd64' - # cross_compilation_artifact_name: 'cross_compiled_from_mac' - # use_sccache: false - # use_llvm: true - # build_wasm: false - # - build: macos-x64-v8 - # os: macos-13 - # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-amd64.tar.xz' - # artifact_name: 'wasmer-v8-darwin-amd64' - # cross_compilation_artifact_name: 'cross_compiled_from_mac' - # use_sccache: false - # use_llvm: true - # build_wasm: false - # - build: macos-x64-wamr - # os: macos-13 - # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-amd64.tar.xz' - # artifact_name: 'wasmer-wamr-darwin-amd64' - # cross_compilation_artifact_name: 'cross_compiled_from_mac' - # use_sccache: false - # use_llvm: true - # build_wasm: false - # - build: macos-x64-wasmi - # os: macos-13 - # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-amd64.tar.xz' - # artifact_name: 'wasmer-wasmi-darwin-amd64' - # cross_compilation_artifact_name: 'cross_compiled_from_mac' - # use_sccache: false - # use_llvm: true - # build_wasm: false - # - build: macos-arm64 - # os: macos-14 - # target: aarch64-apple-darwin - # artifact_name: 'wasmer-darwin-arm64' - # use_sccache: false - # use_llvm: false - # build_wasm: false - # # [todo] xdoardo: Reinstate when the code we generate for aarch64 is working correctly. - # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-aarch64.tar.xz' - # - build: macos-arm64-v8 - # os: macos-14 - # target: aarch64-apple-darwin - # artifact_name: 'wasmer-v8-darwin-arm64' - # use_sccache: false - # use_llvm: false - # build_wasm: false - # # [todo] xdoardo: Reinstate when the code we generate for aarch64 is working correctly. - # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-aarch64.tar.xz' - # - build: macos-arm64-wamr - # os: macos-14 - # target: aarch64-apple-darwin - # artifact_name: 'wasmer-wamr-darwin-arm64' - # use_sccache: false - # use_llvm: false - # build_wasm: false - # # [todo] xdoardo: Reinstate when the code we generate for aarch64 is working correctly. - # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-aarch64.tar.xz' - # - build: macos-arm64-wasmi - # os: macos-14 - # target: aarch64-apple-darwin - # artifact_name: 'wasmer-wasmi-darwin-arm64' - # use_sccache: false - # use_llvm: false - # build_wasm: false - # # [todo] xdoardo: Reinstate when the code we generate for aarch64 is working correctly. - # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-aarch64.tar.xz' - # - build: windows-x64 - # os: windows-2022 - # artifact_name: 'wasmer-windows-amd64' - # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-windows-amd64.tar.xz' - # cross_compilation_artifact_name: 'cross_compiled_from_win' - # use_sccache: false - # use_llvm: true - # build_wasm: false - # - build: windows-x64-v8 - # os: windows-2022 - # artifact_name: 'wasmer-v8-windows-amd64' - # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-windows-amd64.tar.xz' - # cross_compilation_artifact_name: 'cross_compiled_from_win' - # use_sccache: false - # use_llvm: true - # build_wasm: false - # - build: windows-x64-wamr - # os: windows-2022 - # artifact_name: 'wasmer-wamr-windows-amd64' - # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-windows-amd64.tar.xz' - # cross_compilation_artifact_name: 'cross_compiled_from_win' - # use_sccache: false - # use_llvm: true - # build_wasm: false - # - build: windows-x64-wasmi - # os: windows-2022 - # artifact_name: 'wasmer-wasmi-windows-amd64' - # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-windows-amd64.tar.xz' - # cross_compilation_artifact_name: 'cross_compiled_from_win' - # use_sccache: false - # use_llvm: true - # build_wasm: false + - build: linux-arm64 + os: arm64-ubuntu-latest-8-cores + artifact_name: 'wasmer-linux-aarch64' + cross_compilation_artifact_name: 'cross_compiled_from_linux' + use_sccache: false + use_llvm: true + build_wasm: true + - build: linux-x64 + os: ubuntu-22.04 + artifact_name: 'wasmer-linux-amd64' + llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-amd64.tar.xz' + cross_compilation_artifact_name: 'cross_compiled_from_linux' + use_sccache: false + use_llvm: true + build_wasm: true + - build: linux-x64-v8 + os: ubuntu-22.04 + artifact_name: 'wasmer-v8-linux-amd64' + llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-amd64.tar.xz' + cross_compilation_artifact_name: 'cross_compiled_from_linux' + use_sccache: false + use_llvm: true + build_wasm: true + - build: linux-x64-wamr + os: ubuntu-22.04 + artifact_name: 'wasmer-wamr-linux-amd64' + llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-amd64.tar.xz' + cross_compilation_artifact_name: 'cross_compiled_from_linux' + use_sccache: false + use_llvm: true + build_wasm: true + - build: linux-x64-wasmi + os: ubuntu-22.04 + artifact_name: 'wasmer-wasmi-linux-amd64' + llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-amd64.tar.xz' + cross_compilation_artifact_name: 'cross_compiled_from_linux' + use_sccache: false + use_llvm: true + build_wasm: true + - build: macos-x64 + os: macos-13 + llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-amd64.tar.xz' + artifact_name: 'wasmer-darwin-amd64' + cross_compilation_artifact_name: 'cross_compiled_from_mac' + use_sccache: false + use_llvm: true + build_wasm: false + - build: macos-x64-v8 + os: macos-13 + llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-amd64.tar.xz' + artifact_name: 'wasmer-v8-darwin-amd64' + cross_compilation_artifact_name: 'cross_compiled_from_mac' + use_sccache: false + use_llvm: true + build_wasm: false + - build: macos-x64-wamr + os: macos-13 + llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-amd64.tar.xz' + artifact_name: 'wasmer-wamr-darwin-amd64' + cross_compilation_artifact_name: 'cross_compiled_from_mac' + use_sccache: false + use_llvm: true + build_wasm: false + - build: macos-x64-wasmi + os: macos-13 + llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-amd64.tar.xz' + artifact_name: 'wasmer-wasmi-darwin-amd64' + cross_compilation_artifact_name: 'cross_compiled_from_mac' + use_sccache: false + use_llvm: true + build_wasm: false + - build: macos-arm64 + os: macos-14 + target: aarch64-apple-darwin + artifact_name: 'wasmer-darwin-arm64' + use_sccache: false + use_llvm: false + build_wasm: false + # [todo] xdoardo: Reinstate when the code we generate for aarch64 is working correctly. + llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-aarch64.tar.xz' + - build: macos-arm64-v8 + os: macos-14 + target: aarch64-apple-darwin + artifact_name: 'wasmer-v8-darwin-arm64' + use_sccache: false + use_llvm: false + build_wasm: false + # [todo] xdoardo: Reinstate when the code we generate for aarch64 is working correctly. + llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-aarch64.tar.xz' + - build: macos-arm64-wamr + os: macos-14 + target: aarch64-apple-darwin + artifact_name: 'wasmer-wamr-darwin-arm64' + use_sccache: false + use_llvm: false + build_wasm: false + # [todo] xdoardo: Reinstate when the code we generate for aarch64 is working correctly. + llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-aarch64.tar.xz' + - build: macos-arm64-wasmi + os: macos-14 + target: aarch64-apple-darwin + artifact_name: 'wasmer-wasmi-darwin-arm64' + use_sccache: false + use_llvm: false + build_wasm: false + # [todo] xdoardo: Reinstate when the code we generate for aarch64 is working correctly. + llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-aarch64.tar.xz' + - build: windows-x64 + os: windows-2022 + artifact_name: 'wasmer-windows-amd64' + llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-windows-amd64.tar.xz' + cross_compilation_artifact_name: 'cross_compiled_from_win' + use_sccache: false + use_llvm: true + build_wasm: false + - build: windows-x64-v8 + os: windows-2022 + artifact_name: 'wasmer-v8-windows-amd64' + llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-windows-amd64.tar.xz' + cross_compilation_artifact_name: 'cross_compiled_from_win' + use_sccache: false + use_llvm: true + build_wasm: false + - build: windows-x64-wamr + os: windows-2022 + artifact_name: 'wasmer-wamr-windows-amd64' + llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-windows-amd64.tar.xz' + cross_compilation_artifact_name: 'cross_compiled_from_win' + use_sccache: false + use_llvm: true + build_wasm: false + - build: windows-x64-wasmi + os: windows-2022 + artifact_name: 'wasmer-wasmi-windows-amd64' + llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-windows-amd64.tar.xz' + cross_compilation_artifact_name: 'cross_compiled_from_win' + use_sccache: false + use_llvm: true + build_wasm: false - build: linux-musl-x64 os: ubuntu-latest artifact_name: 'wasmer-linux-musl-amd64' @@ -199,13 +199,6 @@ jobs: use_sccache: false use_llvm: false build_wasm: true - - build: linux-musl-x64-wasmi - os: ubuntu-latest - artifact_name: 'wasmer-wasmi-linux-musl-amd64' - container: alpine:latest - use_sccache: false - use_llvm: false - build_wasm: true container: ${{ matrix.container }} env: SCCACHE_AZURE_BLOB_CONTAINER: wasmerstoragesccacheblob @@ -354,7 +347,7 @@ jobs: run: | LLVM_CONFIG_PATH=/usr/bin/llvm-config-18 make build-capi - name: Build Wasmer binary with LLVM - if: matrix.use_llvm + if: matrix.use_llvm && !endsWith(matrix.build, 'v8') && !endsWith(matrix.build, 'wamr') && !endsWith(matrix.build, 'wasmi') shell: bash run: | make build-wasmer @@ -386,15 +379,11 @@ jobs: run: | make build-wasmer-wamr - name: Build Wasmer with wasmi backend - if: ${{ endsWith(matrix.build, 'wasmi') && !startsWith(matrix.build, 'linux-musl') }} + if: endsWith(matrix.build, 'wasmi') run: | make build-wasmer-wasmi - - name: Build Wasmer with wasmi backend musl - if: ${{ endsWith(matrix.build, 'wasmi') && startsWith(matrix.build, 'linux-musl') }} - run: | - LLVM_CONFIG_PATH=/usr/bin/llvm-config-18 RUSTFLAGS="-C linker=clang -C link-arg=-fuse-ld=mold -lzstd" make build-wasmer-wasmi - name: Build Wasmer binary without LLVM - if: matrix.use_llvm != true + if: matrix.use_llvm != true && !endsWith(matrix.build, 'v8') && !endsWith(matrix.build, 'wamr') && !endsWith(matrix.build, 'wasmi') shell: bash run: | make build-wasmer @@ -439,134 +428,134 @@ jobs: if-no-files-found: error retention-days: 2 - # windows_gnu: - # name: Windows GNU - # runs-on: ubuntu-latest - # steps: - # - uses: actions/checkout@v3 - # - name: Install Windows-GNU linker - # shell: bash - # run: | - # sudo apt install -y mingw-w64 - # - uses: dtolnay/rust-toolchain@stable - # with: - # target: x86_64-pc-windows-gnu - # - name: Install Windows-GNU target - # shell: bash - # run: | - # rustup target add x86_64-pc-windows-gnu - # - name: Install Windows 10 SDK with xwin - # shell: bash - # run: | - # mkdir -p /tmp/xwin - # mkdir -p /tmp/xwindownload - # mkdir -p /tmp/xwincache - # git clone https://github.com/wasmerio/xwin --depth=1 /tmp/xwin - # cargo build --release --manifest-path=/tmp/xwin/Cargo.toml - # /tmp/xwin/target/release/xwin --accept-license --cache-dir /tmp/xwincache splat --output /tmp/xwindownload - # mkdir -p /tmp/winsdk - # cp /tmp/xwindownload/sdk/lib/10.0.20348/um/x86_64/WS2_32.lib /tmp/winsdk/ - # cp /tmp/xwindownload/sdk/lib/10.0.20348/um/x86_64/KERNEL32.lib /tmp/winsdk/ - # cp /tmp/xwindownload/sdk/lib/10.0.20348/um/x86_64/BCRYPT.lib /tmp/winsdk/ - # cp /tmp/xwindownload/sdk/lib/10.0.20348/um/x86_64/ADVAPI32.lib /tmp/winsdk/ - # cp /tmp/xwindownload/sdk/lib/10.0.20348/um/x86_64/USERENV.lib /tmp/winsdk/ - # echo "WinSDK files:" - # ls -laH /tmp/winsdk - # echo "" - # mkdir -p package - # mkdir -p package/winsdk - # cp -r /tmp/winsdk/* package/winsdk - # - name: Build Wasmer C-API without LLVM - # shell: bash - # run: | - # make build-capi - # env: - # RUSTFLAGS: -Cpanic=abort - # CARGO_TARGET: x86_64-pc-windows-gnu - # ENABLE_LLVM: 0 - # - name: Build Wasmer C-API headless without LLVM - # shell: bash - # run: | - # make build-capi-headless - # env: - # RUSTFLAGS: -Cpanic=abort - # CARGO_TARGET: x86_64-pc-windows-gnu - # ENABLE_LLVM: 0 - # - name: Dist - # run: | - # make distribution-gnu - # env: - # CARGO_TARGET: x86_64-pc-windows-gnu - # TARGET_DIR: target/x86_64-pc-windows-gnu/release - # - name: Upload Artifacts - # uses: actions/upload-artifact@v4 - # with: - # name: 'wasmer-windows-gnu64' - # path: dist - # if-no-files-found: error - # retention-days: 2 + windows_gnu: + name: Windows GNU + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Install Windows-GNU linker + shell: bash + run: | + sudo apt install -y mingw-w64 + - uses: dtolnay/rust-toolchain@stable + with: + target: x86_64-pc-windows-gnu + - name: Install Windows-GNU target + shell: bash + run: | + rustup target add x86_64-pc-windows-gnu + - name: Install Windows 10 SDK with xwin + shell: bash + run: | + mkdir -p /tmp/xwin + mkdir -p /tmp/xwindownload + mkdir -p /tmp/xwincache + git clone https://github.com/wasmerio/xwin --depth=1 /tmp/xwin + cargo build --release --manifest-path=/tmp/xwin/Cargo.toml + /tmp/xwin/target/release/xwin --accept-license --cache-dir /tmp/xwincache splat --output /tmp/xwindownload + mkdir -p /tmp/winsdk + cp /tmp/xwindownload/sdk/lib/10.0.20348/um/x86_64/WS2_32.lib /tmp/winsdk/ + cp /tmp/xwindownload/sdk/lib/10.0.20348/um/x86_64/KERNEL32.lib /tmp/winsdk/ + cp /tmp/xwindownload/sdk/lib/10.0.20348/um/x86_64/BCRYPT.lib /tmp/winsdk/ + cp /tmp/xwindownload/sdk/lib/10.0.20348/um/x86_64/ADVAPI32.lib /tmp/winsdk/ + cp /tmp/xwindownload/sdk/lib/10.0.20348/um/x86_64/USERENV.lib /tmp/winsdk/ + echo "WinSDK files:" + ls -laH /tmp/winsdk + echo "" + mkdir -p package + mkdir -p package/winsdk + cp -r /tmp/winsdk/* package/winsdk + - name: Build Wasmer C-API without LLVM + shell: bash + run: | + make build-capi + env: + RUSTFLAGS: -Cpanic=abort + CARGO_TARGET: x86_64-pc-windows-gnu + ENABLE_LLVM: 0 + - name: Build Wasmer C-API headless without LLVM + shell: bash + run: | + make build-capi-headless + env: + RUSTFLAGS: -Cpanic=abort + CARGO_TARGET: x86_64-pc-windows-gnu + ENABLE_LLVM: 0 + - name: Dist + run: | + make distribution-gnu + env: + CARGO_TARGET: x86_64-pc-windows-gnu + TARGET_DIR: target/x86_64-pc-windows-gnu/release + - name: Upload Artifacts + uses: actions/upload-artifact@v4 + with: + name: 'wasmer-windows-gnu64' + path: dist + if-no-files-found: error + retention-days: 2 - # darwin_aarch64_jsc: - # name: macOS aarch64 (JSC) - # runs-on: macos-12 - # steps: - # - uses: actions/checkout@v3 - # - uses: dtolnay/rust-toolchain@stable - # with: - # target: aarch64-apple-darwin - # - name: Install Darwin-aarch64 target - # shell: bash - # run: | - # rustup target add aarch64-apple-darwin - # - name: Build Wasmer C-API (JSC) - # shell: bash - # run: | - # make build-capi-jsc - # env: - # RUSTFLAGS: -Cpanic=abort - # CARGO_TARGET: aarch64-apple-darwin - # - name: Dist - # run: | - # make distribution - # env: - # CARGO_TARGET: aarch64-apple-darwin - # TARGET_DIR: target/aarch64-apple-darwin/release - # - name: Upload Artifacts - # uses: actions/upload-artifact@v4 - # with: - # name: 'aarch64-apple-darwin-jsc' - # path: dist - # if-no-files-found: error - # retention-days: 2 + darwin_aarch64_jsc: + name: macOS aarch64 (JSC) + runs-on: macos-12 + steps: + - uses: actions/checkout@v3 + - uses: dtolnay/rust-toolchain@stable + with: + target: aarch64-apple-darwin + - name: Install Darwin-aarch64 target + shell: bash + run: | + rustup target add aarch64-apple-darwin + - name: Build Wasmer C-API (JSC) + shell: bash + run: | + make build-capi-jsc + env: + RUSTFLAGS: -Cpanic=abort + CARGO_TARGET: aarch64-apple-darwin + - name: Dist + run: | + make distribution + env: + CARGO_TARGET: aarch64-apple-darwin + TARGET_DIR: target/aarch64-apple-darwin/release + - name: Upload Artifacts + uses: actions/upload-artifact@v4 + with: + name: 'aarch64-apple-darwin-jsc' + path: dist + if-no-files-found: error + retention-days: 2 - # darwin_x86_64_jsc: - # name: macOS x86_64 (JSC) - # runs-on: macos-12 - # steps: - # - uses: actions/checkout@v3 - # - uses: dtolnay/rust-toolchain@stable - # with: - # target: x86_64-apple-darwin - # - name: Build Wasmer C-API (JSC) - # shell: bash - # run: | - # make build-capi-jsc - # env: - # RUSTFLAGS: -Cpanic=abort - # CARGO_TARGET: x86_64-apple-darwin - # - name: Dist - # run: | - # make distribution - # env: - # CARGO_TARGET: x86_64-apple-darwin - # TARGET_DIR: target/x86_64-apple-darwin/release - # - name: Upload Artifacts - # uses: actions/upload-artifact@v4 - # with: - # name: 'x86_64-apple-darwin-jsc' - # path: dist - # if-no-files-found: error - # retention-days: 2 + darwin_x86_64_jsc: + name: macOS x86_64 (JSC) + runs-on: macos-12 + steps: + - uses: actions/checkout@v3 + - uses: dtolnay/rust-toolchain@stable + with: + target: x86_64-apple-darwin + - name: Build Wasmer C-API (JSC) + shell: bash + run: | + make build-capi-jsc + env: + RUSTFLAGS: -Cpanic=abort + CARGO_TARGET: x86_64-apple-darwin + - name: Dist + run: | + make distribution + env: + CARGO_TARGET: x86_64-apple-darwin + TARGET_DIR: target/x86_64-apple-darwin/release + - name: Upload Artifacts + uses: actions/upload-artifact@v4 + with: + name: 'x86_64-apple-darwin-jsc' + path: dist + if-no-files-found: error + retention-days: 2 # linux_riscv64: # name: Linux riscv64 @@ -635,8 +624,7 @@ jobs: release: # needs: [setup, build, linux_aarch64, windows_gnu, linux_riscv64] - # needs: [setup, build, windows_gnu] - needs: [setup, build] + needs: [setup, build, windows_gnu] runs-on: ubuntu-latest if: needs.setup.outputs.DOING_RELEASE == '1' || github.event.inputs.release != '' steps: @@ -782,16 +770,6 @@ jobs: asset_path: artifacts/wasmer-v8-linux-musl-amd64/wasmer.tar.gz asset_name: wasmer-v8-linux-musl-amd64.tar.gz asset_content_type: application/gzip - - name: Upload Release Asset Linux amd64 (musl) with wasmi - id: upload-release-asset-linux-musl-amd64-wasmi - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: artifacts/wasmer-wasmi-linux-musl-amd64/wasmer.tar.gz - asset_name: wasmer-wasmi-linux-musl-amd64.tar.gz - asset_content_type: application/gzip - name: Upload Release Asset Mac amd64 uses: actions/upload-release-asset@v1 env: From 5937a9f6f66fae29c03b93b65bca84737bc4fdf1 Mon Sep 17 00:00:00 2001 From: "M.Amin Rayej" Date: Mon, 28 Oct 2024 02:35:38 +0330 Subject: [PATCH 24/39] add musl-dev --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b4a5ce6a999..ed994f044b2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -209,7 +209,7 @@ jobs: - name: Set up base deps on musl if: startsWith(matrix.build, 'linux-musl-x64') run: | - apk add bash mold make curl cmake ninja clang18 zstd-static llvm18-dev clang18-static llvm18-static ncurses-static zlib-static + apk add bash mold make curl cmake ninja clang18 zstd-static llvm18-dev clang18-static llvm18-static ncurses-static zlib-static musl-dev ln -s /usr/bin/clang-18 /usr/bin/clang - name: Install Linux tools if: startsWith(matrix.build, 'linux-x64') From ef91e19d439c3d57000ac788e7dd7e3373bdb901 Mon Sep 17 00:00:00 2001 From: "M.Amin Rayej" Date: Mon, 28 Oct 2024 02:45:12 +0330 Subject: [PATCH 25/39] only use static when target is musl --- lib/api/Cargo.toml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/api/Cargo.toml b/lib/api/Cargo.toml index 8510482de59..9891d417788 100644 --- a/lib/api/Cargo.toml +++ b/lib/api/Cargo.toml @@ -161,13 +161,18 @@ static-artifact-load = ["wasmer-compiler/static-artifact-load"] static-artifact-create = ["wasmer-compiler/static-artifact-create"] [build-dependencies] -bindgen = { version = "0.70.1", default-features = false, features = ["static", "logging", "prettyplease"] } cmake = "0.1.50" tar = "0.4.42" ureq = "2.10.1" xz = "0.1.0" zip = "2.2.0" +[target.'cfg(target_env = "musl")'.build-dependencies] +bindgen = { version = "0.70.1", default-features = false, features = ["static", "logging", "prettyplease"] } + +[target.'cfg(not(target_env = "musl"))'.build-dependencies] +bindgen = { version = "0.70.1" } + [package.metadata.docs.rs] features = [ "compiler", From 40551ddd08c4ec97b4a5dd7b26d8785181c4fd20 Mon Sep 17 00:00:00 2001 From: "M.Amin Rayej" Date: Mon, 28 Oct 2024 02:48:53 +0330 Subject: [PATCH 26/39] update lock file --- Cargo.lock | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 65e7d478673..e8df4515d87 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -369,7 +369,7 @@ dependencies = [ "bitflags 2.6.0", "cexpr", "clang-sys", - "itertools 0.13.0", + "itertools 0.10.5", "log 0.4.22", "prettyplease", "proc-macro2", @@ -710,6 +710,7 @@ checksum = "0b023947811758c97c59bf9d1c188fd619ad4718dcaa767947df1cadb14f39f4" dependencies = [ "glob", "libc", + "libloading", ] [[package]] @@ -2798,15 +2799,6 @@ dependencies = [ "either", ] -[[package]] -name = "itertools" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" -dependencies = [ - "either", -] - [[package]] name = "itoa" version = "1.0.11" @@ -2901,6 +2893,16 @@ dependencies = [ "once_cell", ] +[[package]] +name = "libloading" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4979f22fdb869068da03c9f7528f8297c6fd2606bc3a4affe42e6a823fdb8da4" +dependencies = [ + "cfg-if 1.0.0", + "windows-targets 0.48.5", +] + [[package]] name = "libm" version = "0.2.8" From 403914b2726454e1a7b9a2a228dde30031845063 Mon Sep 17 00:00:00 2001 From: "M.Amin Rayej" Date: Mon, 28 Oct 2024 12:42:45 +0330 Subject: [PATCH 27/39] enable wasmi on musl again --- .github/workflows/build.yml | 323 ++++++++++++++++++++---------------- 1 file changed, 176 insertions(+), 147 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ed994f044b2..d47a5d26abe 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -46,155 +46,162 @@ jobs: fail-fast: false matrix: include: - - build: linux-arm64 - os: arm64-ubuntu-latest-8-cores - artifact_name: 'wasmer-linux-aarch64' - cross_compilation_artifact_name: 'cross_compiled_from_linux' - use_sccache: false - use_llvm: true - build_wasm: true - - build: linux-x64 - os: ubuntu-22.04 - artifact_name: 'wasmer-linux-amd64' - llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-amd64.tar.xz' - cross_compilation_artifact_name: 'cross_compiled_from_linux' - use_sccache: false - use_llvm: true - build_wasm: true - - build: linux-x64-v8 - os: ubuntu-22.04 - artifact_name: 'wasmer-v8-linux-amd64' - llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-amd64.tar.xz' - cross_compilation_artifact_name: 'cross_compiled_from_linux' - use_sccache: false - use_llvm: true - build_wasm: true - - build: linux-x64-wamr - os: ubuntu-22.04 - artifact_name: 'wasmer-wamr-linux-amd64' - llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-amd64.tar.xz' - cross_compilation_artifact_name: 'cross_compiled_from_linux' - use_sccache: false - use_llvm: true - build_wasm: true - - build: linux-x64-wasmi - os: ubuntu-22.04 - artifact_name: 'wasmer-wasmi-linux-amd64' - llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-amd64.tar.xz' - cross_compilation_artifact_name: 'cross_compiled_from_linux' - use_sccache: false - use_llvm: true - build_wasm: true - - build: macos-x64 - os: macos-13 - llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-amd64.tar.xz' - artifact_name: 'wasmer-darwin-amd64' - cross_compilation_artifact_name: 'cross_compiled_from_mac' - use_sccache: false - use_llvm: true - build_wasm: false - - build: macos-x64-v8 - os: macos-13 - llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-amd64.tar.xz' - artifact_name: 'wasmer-v8-darwin-amd64' - cross_compilation_artifact_name: 'cross_compiled_from_mac' - use_sccache: false - use_llvm: true - build_wasm: false - - build: macos-x64-wamr - os: macos-13 - llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-amd64.tar.xz' - artifact_name: 'wasmer-wamr-darwin-amd64' - cross_compilation_artifact_name: 'cross_compiled_from_mac' - use_sccache: false - use_llvm: true - build_wasm: false - - build: macos-x64-wasmi - os: macos-13 - llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-amd64.tar.xz' - artifact_name: 'wasmer-wasmi-darwin-amd64' - cross_compilation_artifact_name: 'cross_compiled_from_mac' - use_sccache: false - use_llvm: true - build_wasm: false - - build: macos-arm64 - os: macos-14 - target: aarch64-apple-darwin - artifact_name: 'wasmer-darwin-arm64' - use_sccache: false - use_llvm: false - build_wasm: false - # [todo] xdoardo: Reinstate when the code we generate for aarch64 is working correctly. - llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-aarch64.tar.xz' - - build: macos-arm64-v8 - os: macos-14 - target: aarch64-apple-darwin - artifact_name: 'wasmer-v8-darwin-arm64' - use_sccache: false - use_llvm: false - build_wasm: false - # [todo] xdoardo: Reinstate when the code we generate for aarch64 is working correctly. - llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-aarch64.tar.xz' - - build: macos-arm64-wamr - os: macos-14 - target: aarch64-apple-darwin - artifact_name: 'wasmer-wamr-darwin-arm64' - use_sccache: false - use_llvm: false - build_wasm: false - # [todo] xdoardo: Reinstate when the code we generate for aarch64 is working correctly. - llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-aarch64.tar.xz' - - build: macos-arm64-wasmi - os: macos-14 - target: aarch64-apple-darwin - artifact_name: 'wasmer-wasmi-darwin-arm64' - use_sccache: false - use_llvm: false - build_wasm: false - # [todo] xdoardo: Reinstate when the code we generate for aarch64 is working correctly. - llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-aarch64.tar.xz' - - build: windows-x64 - os: windows-2022 - artifact_name: 'wasmer-windows-amd64' - llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-windows-amd64.tar.xz' - cross_compilation_artifact_name: 'cross_compiled_from_win' - use_sccache: false - use_llvm: true - build_wasm: false - - build: windows-x64-v8 - os: windows-2022 - artifact_name: 'wasmer-v8-windows-amd64' - llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-windows-amd64.tar.xz' - cross_compilation_artifact_name: 'cross_compiled_from_win' - use_sccache: false - use_llvm: true - build_wasm: false - - build: windows-x64-wamr - os: windows-2022 - artifact_name: 'wasmer-wamr-windows-amd64' - llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-windows-amd64.tar.xz' - cross_compilation_artifact_name: 'cross_compiled_from_win' - use_sccache: false - use_llvm: true - build_wasm: false - - build: windows-x64-wasmi - os: windows-2022 - artifact_name: 'wasmer-wasmi-windows-amd64' - llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-windows-amd64.tar.xz' - cross_compilation_artifact_name: 'cross_compiled_from_win' - use_sccache: false - use_llvm: true - build_wasm: false - - build: linux-musl-x64 + # - build: linux-arm64 + # os: arm64-ubuntu-latest-8-cores + # artifact_name: 'wasmer-linux-aarch64' + # cross_compilation_artifact_name: 'cross_compiled_from_linux' + # use_sccache: false + # use_llvm: true + # build_wasm: true + # - build: linux-x64 + # os: ubuntu-22.04 + # artifact_name: 'wasmer-linux-amd64' + # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-amd64.tar.xz' + # cross_compilation_artifact_name: 'cross_compiled_from_linux' + # use_sccache: false + # use_llvm: true + # build_wasm: true + # - build: linux-x64-v8 + # os: ubuntu-22.04 + # artifact_name: 'wasmer-v8-linux-amd64' + # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-amd64.tar.xz' + # cross_compilation_artifact_name: 'cross_compiled_from_linux' + # use_sccache: false + # use_llvm: true + # build_wasm: true + # - build: linux-x64-wamr + # os: ubuntu-22.04 + # artifact_name: 'wasmer-wamr-linux-amd64' + # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-amd64.tar.xz' + # cross_compilation_artifact_name: 'cross_compiled_from_linux' + # use_sccache: false + # use_llvm: true + # build_wasm: true + # - build: linux-x64-wasmi + # os: ubuntu-22.04 + # artifact_name: 'wasmer-wasmi-linux-amd64' + # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-amd64.tar.xz' + # cross_compilation_artifact_name: 'cross_compiled_from_linux' + # use_sccache: false + # use_llvm: true + # build_wasm: true + # - build: macos-x64 + # os: macos-13 + # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-amd64.tar.xz' + # artifact_name: 'wasmer-darwin-amd64' + # cross_compilation_artifact_name: 'cross_compiled_from_mac' + # use_sccache: false + # use_llvm: true + # build_wasm: false + # - build: macos-x64-v8 + # os: macos-13 + # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-amd64.tar.xz' + # artifact_name: 'wasmer-v8-darwin-amd64' + # cross_compilation_artifact_name: 'cross_compiled_from_mac' + # use_sccache: false + # use_llvm: true + # build_wasm: false + # - build: macos-x64-wamr + # os: macos-13 + # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-amd64.tar.xz' + # artifact_name: 'wasmer-wamr-darwin-amd64' + # cross_compilation_artifact_name: 'cross_compiled_from_mac' + # use_sccache: false + # use_llvm: true + # build_wasm: false + # - build: macos-x64-wasmi + # os: macos-13 + # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-amd64.tar.xz' + # artifact_name: 'wasmer-wasmi-darwin-amd64' + # cross_compilation_artifact_name: 'cross_compiled_from_mac' + # use_sccache: false + # use_llvm: true + # build_wasm: false + # - build: macos-arm64 + # os: macos-14 + # target: aarch64-apple-darwin + # artifact_name: 'wasmer-darwin-arm64' + # use_sccache: false + # use_llvm: false + # build_wasm: false + # # [todo] xdoardo: Reinstate when the code we generate for aarch64 is working correctly. + # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-aarch64.tar.xz' + # - build: macos-arm64-v8 + # os: macos-14 + # target: aarch64-apple-darwin + # artifact_name: 'wasmer-v8-darwin-arm64' + # use_sccache: false + # use_llvm: false + # build_wasm: false + # # [todo] xdoardo: Reinstate when the code we generate for aarch64 is working correctly. + # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-aarch64.tar.xz' + # - build: macos-arm64-wamr + # os: macos-14 + # target: aarch64-apple-darwin + # artifact_name: 'wasmer-wamr-darwin-arm64' + # use_sccache: false + # use_llvm: false + # build_wasm: false + # # [todo] xdoardo: Reinstate when the code we generate for aarch64 is working correctly. + # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-aarch64.tar.xz' + # - build: macos-arm64-wasmi + # os: macos-14 + # target: aarch64-apple-darwin + # artifact_name: 'wasmer-wasmi-darwin-arm64' + # use_sccache: false + # use_llvm: false + # build_wasm: false + # # [todo] xdoardo: Reinstate when the code we generate for aarch64 is working correctly. + # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-aarch64.tar.xz' + # - build: windows-x64 + # os: windows-2022 + # artifact_name: 'wasmer-windows-amd64' + # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-windows-amd64.tar.xz' + # cross_compilation_artifact_name: 'cross_compiled_from_win' + # use_sccache: false + # use_llvm: true + # build_wasm: false + # - build: windows-x64-v8 + # os: windows-2022 + # artifact_name: 'wasmer-v8-windows-amd64' + # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-windows-amd64.tar.xz' + # cross_compilation_artifact_name: 'cross_compiled_from_win' + # use_sccache: false + # use_llvm: true + # build_wasm: false + # - build: windows-x64-wamr + # os: windows-2022 + # artifact_name: 'wasmer-wamr-windows-amd64' + # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-windows-amd64.tar.xz' + # cross_compilation_artifact_name: 'cross_compiled_from_win' + # use_sccache: false + # use_llvm: true + # build_wasm: false + # - build: windows-x64-wasmi + # os: windows-2022 + # artifact_name: 'wasmer-wasmi-windows-amd64' + # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-windows-amd64.tar.xz' + # cross_compilation_artifact_name: 'cross_compiled_from_win' + # use_sccache: false + # use_llvm: true + # build_wasm: false + # - build: linux-musl-x64 + # os: ubuntu-latest + # artifact_name: 'wasmer-linux-musl-amd64' + # container: alpine:latest + # use_sccache: false + # use_llvm: false + # build_wasm: true + - build: linux-musl-x64-v8 os: ubuntu-latest - artifact_name: 'wasmer-linux-musl-amd64' + artifact_name: 'wasmer-v8-linux-musl-amd64' container: alpine:latest use_sccache: false use_llvm: false build_wasm: true - - build: linux-musl-x64-v8 + - build: linux-musl-x64-wasmi os: ubuntu-latest - artifact_name: 'wasmer-v8-linux-musl-amd64' + artifact_name: 'wasmer-wasmi-linux-musl-amd64' container: alpine:latest use_sccache: false use_llvm: false @@ -209,7 +216,7 @@ jobs: - name: Set up base deps on musl if: startsWith(matrix.build, 'linux-musl-x64') run: | - apk add bash mold make curl cmake ninja clang18 zstd-static llvm18-dev clang18-static llvm18-static ncurses-static zlib-static musl-dev + apk add bash mold make curl cmake ninja clang18 zstd-static llvm18-dev clang18-static llvm18-static ncurses-static zlib-static ln -s /usr/bin/clang-18 /usr/bin/clang - name: Install Linux tools if: startsWith(matrix.build, 'linux-x64') @@ -379,9 +386,21 @@ jobs: run: | make build-wasmer-wamr - name: Build Wasmer with wasmi backend - if: endsWith(matrix.build, 'wasmi') + if: endsWith(matrix.build, 'wasmi') && !startsWith(matrix.build, 'linux-musl') run: | make build-wasmer-wasmi + - name: Build Wasmer with wasmi backend musl + if: endsWith(matrix.build, 'wasmi') && startsWith(matrix.build, 'linux-musl') + run: | + echo "#!/bin/bash" >> /usr/bin/llvm-config + echo 'if [ "$1" = "--libs" ]; then' >> /usr/bin/llvm-config + echo 'llvm-config-18 "$@" "--link-static"' >> /usr/bin/llvm-config + echo "else" >> /usr/bin/llvm-config + echo 'llvm-config-18 "$@"' >> /usr/bin/llvm-config + echo 'fi' >> /usr/bin/llvm-config + cat /usr/bin/llvm-config + chmod +x /usr/bin/llvm-config + RUSTFLAGS="-C linker=clang -C link-arg=-fuse-ld=mold -lzstd" make build-wasmer-wasmi - name: Build Wasmer binary without LLVM if: matrix.use_llvm != true && !endsWith(matrix.build, 'v8') && !endsWith(matrix.build, 'wamr') && !endsWith(matrix.build, 'wasmi') shell: bash @@ -393,14 +412,14 @@ jobs: # run: | # make build-wasmer-wasm - name: Install Nightly Rust for Headless - if: matrix.build != 'linux-musl-x64' + if: startsWith(matrix.build, 'linux-musl-x64') uses: dtolnay/rust-toolchain@master with: toolchain: "nightly-2024-07-05" target: ${{ matrix.target }} components: "rust-src" - name: Build Minimal Wasmer Headless - if: matrix.build != 'linux-musl-x64' + if: startsWith(matrix.build, 'linux-musl-x64') run: | cargo install xargo echo "" >> Cargo.toml @@ -770,6 +789,16 @@ jobs: asset_path: artifacts/wasmer-v8-linux-musl-amd64/wasmer.tar.gz asset_name: wasmer-v8-linux-musl-amd64.tar.gz asset_content_type: application/gzip + - name: Upload Release Asset Linux amd64 (musl) With wasmi + id: upload-release-asset-linux-musl-amd64-wasmi + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: artifacts/wasmer-wasmi-linux-musl-amd64/wasmer.tar.gz + asset_name: wasmer-wasmi-linux-musl-amd64.tar.gz + asset_content_type: application/gzip - name: Upload Release Asset Mac amd64 uses: actions/upload-release-asset@v1 env: From a6e1bfa96bf36b7778bb94dfeeb47c053bcbb129 Mon Sep 17 00:00:00 2001 From: "M.Amin Rayej" Date: Mon, 28 Oct 2024 12:44:06 +0330 Subject: [PATCH 28/39] disable others for now --- .github/workflows/build.yml | 252 ++++++++++++++++++------------------ 1 file changed, 126 insertions(+), 126 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d47a5d26abe..44f598d6b45 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -447,134 +447,134 @@ jobs: if-no-files-found: error retention-days: 2 - windows_gnu: - name: Windows GNU - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: Install Windows-GNU linker - shell: bash - run: | - sudo apt install -y mingw-w64 - - uses: dtolnay/rust-toolchain@stable - with: - target: x86_64-pc-windows-gnu - - name: Install Windows-GNU target - shell: bash - run: | - rustup target add x86_64-pc-windows-gnu - - name: Install Windows 10 SDK with xwin - shell: bash - run: | - mkdir -p /tmp/xwin - mkdir -p /tmp/xwindownload - mkdir -p /tmp/xwincache - git clone https://github.com/wasmerio/xwin --depth=1 /tmp/xwin - cargo build --release --manifest-path=/tmp/xwin/Cargo.toml - /tmp/xwin/target/release/xwin --accept-license --cache-dir /tmp/xwincache splat --output /tmp/xwindownload - mkdir -p /tmp/winsdk - cp /tmp/xwindownload/sdk/lib/10.0.20348/um/x86_64/WS2_32.lib /tmp/winsdk/ - cp /tmp/xwindownload/sdk/lib/10.0.20348/um/x86_64/KERNEL32.lib /tmp/winsdk/ - cp /tmp/xwindownload/sdk/lib/10.0.20348/um/x86_64/BCRYPT.lib /tmp/winsdk/ - cp /tmp/xwindownload/sdk/lib/10.0.20348/um/x86_64/ADVAPI32.lib /tmp/winsdk/ - cp /tmp/xwindownload/sdk/lib/10.0.20348/um/x86_64/USERENV.lib /tmp/winsdk/ - echo "WinSDK files:" - ls -laH /tmp/winsdk - echo "" - mkdir -p package - mkdir -p package/winsdk - cp -r /tmp/winsdk/* package/winsdk - - name: Build Wasmer C-API without LLVM - shell: bash - run: | - make build-capi - env: - RUSTFLAGS: -Cpanic=abort - CARGO_TARGET: x86_64-pc-windows-gnu - ENABLE_LLVM: 0 - - name: Build Wasmer C-API headless without LLVM - shell: bash - run: | - make build-capi-headless - env: - RUSTFLAGS: -Cpanic=abort - CARGO_TARGET: x86_64-pc-windows-gnu - ENABLE_LLVM: 0 - - name: Dist - run: | - make distribution-gnu - env: - CARGO_TARGET: x86_64-pc-windows-gnu - TARGET_DIR: target/x86_64-pc-windows-gnu/release - - name: Upload Artifacts - uses: actions/upload-artifact@v4 - with: - name: 'wasmer-windows-gnu64' - path: dist - if-no-files-found: error - retention-days: 2 + # windows_gnu: + # name: Windows GNU + # runs-on: ubuntu-latest + # steps: + # - uses: actions/checkout@v3 + # - name: Install Windows-GNU linker + # shell: bash + # run: | + # sudo apt install -y mingw-w64 + # - uses: dtolnay/rust-toolchain@stable + # with: + # target: x86_64-pc-windows-gnu + # - name: Install Windows-GNU target + # shell: bash + # run: | + # rustup target add x86_64-pc-windows-gnu + # - name: Install Windows 10 SDK with xwin + # shell: bash + # run: | + # mkdir -p /tmp/xwin + # mkdir -p /tmp/xwindownload + # mkdir -p /tmp/xwincache + # git clone https://github.com/wasmerio/xwin --depth=1 /tmp/xwin + # cargo build --release --manifest-path=/tmp/xwin/Cargo.toml + # /tmp/xwin/target/release/xwin --accept-license --cache-dir /tmp/xwincache splat --output /tmp/xwindownload + # mkdir -p /tmp/winsdk + # cp /tmp/xwindownload/sdk/lib/10.0.20348/um/x86_64/WS2_32.lib /tmp/winsdk/ + # cp /tmp/xwindownload/sdk/lib/10.0.20348/um/x86_64/KERNEL32.lib /tmp/winsdk/ + # cp /tmp/xwindownload/sdk/lib/10.0.20348/um/x86_64/BCRYPT.lib /tmp/winsdk/ + # cp /tmp/xwindownload/sdk/lib/10.0.20348/um/x86_64/ADVAPI32.lib /tmp/winsdk/ + # cp /tmp/xwindownload/sdk/lib/10.0.20348/um/x86_64/USERENV.lib /tmp/winsdk/ + # echo "WinSDK files:" + # ls -laH /tmp/winsdk + # echo "" + # mkdir -p package + # mkdir -p package/winsdk + # cp -r /tmp/winsdk/* package/winsdk + # - name: Build Wasmer C-API without LLVM + # shell: bash + # run: | + # make build-capi + # env: + # RUSTFLAGS: -Cpanic=abort + # CARGO_TARGET: x86_64-pc-windows-gnu + # ENABLE_LLVM: 0 + # - name: Build Wasmer C-API headless without LLVM + # shell: bash + # run: | + # make build-capi-headless + # env: + # RUSTFLAGS: -Cpanic=abort + # CARGO_TARGET: x86_64-pc-windows-gnu + # ENABLE_LLVM: 0 + # - name: Dist + # run: | + # make distribution-gnu + # env: + # CARGO_TARGET: x86_64-pc-windows-gnu + # TARGET_DIR: target/x86_64-pc-windows-gnu/release + # - name: Upload Artifacts + # uses: actions/upload-artifact@v4 + # with: + # name: 'wasmer-windows-gnu64' + # path: dist + # if-no-files-found: error + # retention-days: 2 - darwin_aarch64_jsc: - name: macOS aarch64 (JSC) - runs-on: macos-12 - steps: - - uses: actions/checkout@v3 - - uses: dtolnay/rust-toolchain@stable - with: - target: aarch64-apple-darwin - - name: Install Darwin-aarch64 target - shell: bash - run: | - rustup target add aarch64-apple-darwin - - name: Build Wasmer C-API (JSC) - shell: bash - run: | - make build-capi-jsc - env: - RUSTFLAGS: -Cpanic=abort - CARGO_TARGET: aarch64-apple-darwin - - name: Dist - run: | - make distribution - env: - CARGO_TARGET: aarch64-apple-darwin - TARGET_DIR: target/aarch64-apple-darwin/release - - name: Upload Artifacts - uses: actions/upload-artifact@v4 - with: - name: 'aarch64-apple-darwin-jsc' - path: dist - if-no-files-found: error - retention-days: 2 + # darwin_aarch64_jsc: + # name: macOS aarch64 (JSC) + # runs-on: macos-12 + # steps: + # - uses: actions/checkout@v3 + # - uses: dtolnay/rust-toolchain@stable + # with: + # target: aarch64-apple-darwin + # - name: Install Darwin-aarch64 target + # shell: bash + # run: | + # rustup target add aarch64-apple-darwin + # - name: Build Wasmer C-API (JSC) + # shell: bash + # run: | + # make build-capi-jsc + # env: + # RUSTFLAGS: -Cpanic=abort + # CARGO_TARGET: aarch64-apple-darwin + # - name: Dist + # run: | + # make distribution + # env: + # CARGO_TARGET: aarch64-apple-darwin + # TARGET_DIR: target/aarch64-apple-darwin/release + # - name: Upload Artifacts + # uses: actions/upload-artifact@v4 + # with: + # name: 'aarch64-apple-darwin-jsc' + # path: dist + # if-no-files-found: error + # retention-days: 2 - darwin_x86_64_jsc: - name: macOS x86_64 (JSC) - runs-on: macos-12 - steps: - - uses: actions/checkout@v3 - - uses: dtolnay/rust-toolchain@stable - with: - target: x86_64-apple-darwin - - name: Build Wasmer C-API (JSC) - shell: bash - run: | - make build-capi-jsc - env: - RUSTFLAGS: -Cpanic=abort - CARGO_TARGET: x86_64-apple-darwin - - name: Dist - run: | - make distribution - env: - CARGO_TARGET: x86_64-apple-darwin - TARGET_DIR: target/x86_64-apple-darwin/release - - name: Upload Artifacts - uses: actions/upload-artifact@v4 - with: - name: 'x86_64-apple-darwin-jsc' - path: dist - if-no-files-found: error - retention-days: 2 + # darwin_x86_64_jsc: + # name: macOS x86_64 (JSC) + # runs-on: macos-12 + # steps: + # - uses: actions/checkout@v3 + # - uses: dtolnay/rust-toolchain@stable + # with: + # target: x86_64-apple-darwin + # - name: Build Wasmer C-API (JSC) + # shell: bash + # run: | + # make build-capi-jsc + # env: + # RUSTFLAGS: -Cpanic=abort + # CARGO_TARGET: x86_64-apple-darwin + # - name: Dist + # run: | + # make distribution + # env: + # CARGO_TARGET: x86_64-apple-darwin + # TARGET_DIR: target/x86_64-apple-darwin/release + # - name: Upload Artifacts + # uses: actions/upload-artifact@v4 + # with: + # name: 'x86_64-apple-darwin-jsc' + # path: dist + # if-no-files-found: error + # retention-days: 2 # linux_riscv64: # name: Linux riscv64 From 77c34a63e1a62a4ecdfd55333e240ef2dbfe1513 Mon Sep 17 00:00:00 2001 From: "M.Amin Rayej" Date: Mon, 28 Oct 2024 12:44:50 +0330 Subject: [PATCH 29/39] fix deps --- .github/workflows/build.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 44f598d6b45..db1179f7170 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -643,7 +643,8 @@ jobs: release: # needs: [setup, build, linux_aarch64, windows_gnu, linux_riscv64] - needs: [setup, build, windows_gnu] + # needs: [setup, build, windows_gnu] + needs: [setup, build] runs-on: ubuntu-latest if: needs.setup.outputs.DOING_RELEASE == '1' || github.event.inputs.release != '' steps: From f2a947069c948efaf0d61956cfcb531ef8ba966e Mon Sep 17 00:00:00 2001 From: "M.Amin Rayej" Date: Mon, 28 Oct 2024 12:52:20 +0330 Subject: [PATCH 30/39] fix condition --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index db1179f7170..21136fd2aee 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -412,14 +412,14 @@ jobs: # run: | # make build-wasmer-wasm - name: Install Nightly Rust for Headless - if: startsWith(matrix.build, 'linux-musl-x64') + if: $ {{ !startsWith(matrix.build, 'linux-musl-x64') }} uses: dtolnay/rust-toolchain@master with: toolchain: "nightly-2024-07-05" target: ${{ matrix.target }} components: "rust-src" - name: Build Minimal Wasmer Headless - if: startsWith(matrix.build, 'linux-musl-x64') + if: ${{ !startsWith(matrix.build, 'linux-musl-x64') }} run: | cargo install xargo echo "" >> Cargo.toml From c9d4457f365dfc94c25a36ae2cb6ef75071376ef Mon Sep 17 00:00:00 2001 From: "M.Amin Rayej" Date: Mon, 28 Oct 2024 12:53:38 +0330 Subject: [PATCH 31/39] fix syntax --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 21136fd2aee..d985161a664 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -412,7 +412,7 @@ jobs: # run: | # make build-wasmer-wasm - name: Install Nightly Rust for Headless - if: $ {{ !startsWith(matrix.build, 'linux-musl-x64') }} + if: ${{ !startsWith(matrix.build, 'linux-musl-x64') }} uses: dtolnay/rust-toolchain@master with: toolchain: "nightly-2024-07-05" From 3075af8fd34c2ad9c37f52fbe970abb48464ce61 Mon Sep 17 00:00:00 2001 From: "M.Amin Rayej" Date: Mon, 28 Oct 2024 13:32:00 +0330 Subject: [PATCH 32/39] enable other builds --- .github/workflows/build.yml | 547 ++++++++++++++++++------------------ 1 file changed, 273 insertions(+), 274 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d985161a664..693e93ff0fb 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -46,152 +46,152 @@ jobs: fail-fast: false matrix: include: - # - build: linux-arm64 - # os: arm64-ubuntu-latest-8-cores - # artifact_name: 'wasmer-linux-aarch64' - # cross_compilation_artifact_name: 'cross_compiled_from_linux' - # use_sccache: false - # use_llvm: true - # build_wasm: true - # - build: linux-x64 - # os: ubuntu-22.04 - # artifact_name: 'wasmer-linux-amd64' - # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-amd64.tar.xz' - # cross_compilation_artifact_name: 'cross_compiled_from_linux' - # use_sccache: false - # use_llvm: true - # build_wasm: true - # - build: linux-x64-v8 - # os: ubuntu-22.04 - # artifact_name: 'wasmer-v8-linux-amd64' - # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-amd64.tar.xz' - # cross_compilation_artifact_name: 'cross_compiled_from_linux' - # use_sccache: false - # use_llvm: true - # build_wasm: true - # - build: linux-x64-wamr - # os: ubuntu-22.04 - # artifact_name: 'wasmer-wamr-linux-amd64' - # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-amd64.tar.xz' - # cross_compilation_artifact_name: 'cross_compiled_from_linux' - # use_sccache: false - # use_llvm: true - # build_wasm: true - # - build: linux-x64-wasmi - # os: ubuntu-22.04 - # artifact_name: 'wasmer-wasmi-linux-amd64' - # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-amd64.tar.xz' - # cross_compilation_artifact_name: 'cross_compiled_from_linux' - # use_sccache: false - # use_llvm: true - # build_wasm: true - # - build: macos-x64 - # os: macos-13 - # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-amd64.tar.xz' - # artifact_name: 'wasmer-darwin-amd64' - # cross_compilation_artifact_name: 'cross_compiled_from_mac' - # use_sccache: false - # use_llvm: true - # build_wasm: false - # - build: macos-x64-v8 - # os: macos-13 - # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-amd64.tar.xz' - # artifact_name: 'wasmer-v8-darwin-amd64' - # cross_compilation_artifact_name: 'cross_compiled_from_mac' - # use_sccache: false - # use_llvm: true - # build_wasm: false - # - build: macos-x64-wamr - # os: macos-13 - # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-amd64.tar.xz' - # artifact_name: 'wasmer-wamr-darwin-amd64' - # cross_compilation_artifact_name: 'cross_compiled_from_mac' - # use_sccache: false - # use_llvm: true - # build_wasm: false - # - build: macos-x64-wasmi - # os: macos-13 - # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-amd64.tar.xz' - # artifact_name: 'wasmer-wasmi-darwin-amd64' - # cross_compilation_artifact_name: 'cross_compiled_from_mac' - # use_sccache: false - # use_llvm: true - # build_wasm: false - # - build: macos-arm64 - # os: macos-14 - # target: aarch64-apple-darwin - # artifact_name: 'wasmer-darwin-arm64' - # use_sccache: false - # use_llvm: false - # build_wasm: false - # # [todo] xdoardo: Reinstate when the code we generate for aarch64 is working correctly. - # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-aarch64.tar.xz' - # - build: macos-arm64-v8 - # os: macos-14 - # target: aarch64-apple-darwin - # artifact_name: 'wasmer-v8-darwin-arm64' - # use_sccache: false - # use_llvm: false - # build_wasm: false - # # [todo] xdoardo: Reinstate when the code we generate for aarch64 is working correctly. - # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-aarch64.tar.xz' - # - build: macos-arm64-wamr - # os: macos-14 - # target: aarch64-apple-darwin - # artifact_name: 'wasmer-wamr-darwin-arm64' - # use_sccache: false - # use_llvm: false - # build_wasm: false - # # [todo] xdoardo: Reinstate when the code we generate for aarch64 is working correctly. - # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-aarch64.tar.xz' - # - build: macos-arm64-wasmi - # os: macos-14 - # target: aarch64-apple-darwin - # artifact_name: 'wasmer-wasmi-darwin-arm64' - # use_sccache: false - # use_llvm: false - # build_wasm: false - # # [todo] xdoardo: Reinstate when the code we generate for aarch64 is working correctly. - # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-aarch64.tar.xz' - # - build: windows-x64 - # os: windows-2022 - # artifact_name: 'wasmer-windows-amd64' - # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-windows-amd64.tar.xz' - # cross_compilation_artifact_name: 'cross_compiled_from_win' - # use_sccache: false - # use_llvm: true - # build_wasm: false - # - build: windows-x64-v8 - # os: windows-2022 - # artifact_name: 'wasmer-v8-windows-amd64' - # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-windows-amd64.tar.xz' - # cross_compilation_artifact_name: 'cross_compiled_from_win' - # use_sccache: false - # use_llvm: true - # build_wasm: false - # - build: windows-x64-wamr - # os: windows-2022 - # artifact_name: 'wasmer-wamr-windows-amd64' - # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-windows-amd64.tar.xz' - # cross_compilation_artifact_name: 'cross_compiled_from_win' - # use_sccache: false - # use_llvm: true - # build_wasm: false - # - build: windows-x64-wasmi - # os: windows-2022 - # artifact_name: 'wasmer-wasmi-windows-amd64' - # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-windows-amd64.tar.xz' - # cross_compilation_artifact_name: 'cross_compiled_from_win' - # use_sccache: false - # use_llvm: true - # build_wasm: false - # - build: linux-musl-x64 - # os: ubuntu-latest - # artifact_name: 'wasmer-linux-musl-amd64' - # container: alpine:latest - # use_sccache: false - # use_llvm: false - # build_wasm: true + - build: linux-arm64 + os: arm64-ubuntu-latest-8-cores + artifact_name: 'wasmer-linux-aarch64' + cross_compilation_artifact_name: 'cross_compiled_from_linux' + use_sccache: false + use_llvm: true + build_wasm: true + - build: linux-x64 + os: ubuntu-22.04 + artifact_name: 'wasmer-linux-amd64' + llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-amd64.tar.xz' + cross_compilation_artifact_name: 'cross_compiled_from_linux' + use_sccache: false + use_llvm: true + build_wasm: true + - build: linux-x64-v8 + os: ubuntu-22.04 + artifact_name: 'wasmer-v8-linux-amd64' + llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-amd64.tar.xz' + cross_compilation_artifact_name: 'cross_compiled_from_linux' + use_sccache: false + use_llvm: true + build_wasm: true + - build: linux-x64-wamr + os: ubuntu-22.04 + artifact_name: 'wasmer-wamr-linux-amd64' + llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-amd64.tar.xz' + cross_compilation_artifact_name: 'cross_compiled_from_linux' + use_sccache: false + use_llvm: true + build_wasm: true + - build: linux-x64-wasmi + os: ubuntu-22.04 + artifact_name: 'wasmer-wasmi-linux-amd64' + llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-amd64.tar.xz' + cross_compilation_artifact_name: 'cross_compiled_from_linux' + use_sccache: false + use_llvm: true + build_wasm: true + - build: macos-x64 + os: macos-13 + llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-amd64.tar.xz' + artifact_name: 'wasmer-darwin-amd64' + cross_compilation_artifact_name: 'cross_compiled_from_mac' + use_sccache: false + use_llvm: true + build_wasm: false + - build: macos-x64-v8 + os: macos-13 + llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-amd64.tar.xz' + artifact_name: 'wasmer-v8-darwin-amd64' + cross_compilation_artifact_name: 'cross_compiled_from_mac' + use_sccache: false + use_llvm: true + build_wasm: false + - build: macos-x64-wamr + os: macos-13 + llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-amd64.tar.xz' + artifact_name: 'wasmer-wamr-darwin-amd64' + cross_compilation_artifact_name: 'cross_compiled_from_mac' + use_sccache: false + use_llvm: true + build_wasm: false + - build: macos-x64-wasmi + os: macos-13 + llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-amd64.tar.xz' + artifact_name: 'wasmer-wasmi-darwin-amd64' + cross_compilation_artifact_name: 'cross_compiled_from_mac' + use_sccache: false + use_llvm: true + build_wasm: false + - build: macos-arm64 + os: macos-14 + target: aarch64-apple-darwin + artifact_name: 'wasmer-darwin-arm64' + use_sccache: false + use_llvm: false + build_wasm: false + # [todo] xdoardo: Reinstate when the code we generate for aarch64 is working correctly. + llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-aarch64.tar.xz' + - build: macos-arm64-v8 + os: macos-14 + target: aarch64-apple-darwin + artifact_name: 'wasmer-v8-darwin-arm64' + use_sccache: false + use_llvm: false + build_wasm: false + # [todo] xdoardo: Reinstate when the code we generate for aarch64 is working correctly. + llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-aarch64.tar.xz' + - build: macos-arm64-wamr + os: macos-14 + target: aarch64-apple-darwin + artifact_name: 'wasmer-wamr-darwin-arm64' + use_sccache: false + use_llvm: false + build_wasm: false + # [todo] xdoardo: Reinstate when the code we generate for aarch64 is working correctly. + llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-aarch64.tar.xz' + - build: macos-arm64-wasmi + os: macos-14 + target: aarch64-apple-darwin + artifact_name: 'wasmer-wasmi-darwin-arm64' + use_sccache: false + use_llvm: false + build_wasm: false + # [todo] xdoardo: Reinstate when the code we generate for aarch64 is working correctly. + llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-aarch64.tar.xz' + - build: windows-x64 + os: windows-2022 + artifact_name: 'wasmer-windows-amd64' + llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-windows-amd64.tar.xz' + cross_compilation_artifact_name: 'cross_compiled_from_win' + use_sccache: false + use_llvm: true + build_wasm: false + - build: windows-x64-v8 + os: windows-2022 + artifact_name: 'wasmer-v8-windows-amd64' + llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-windows-amd64.tar.xz' + cross_compilation_artifact_name: 'cross_compiled_from_win' + use_sccache: false + use_llvm: true + build_wasm: false + - build: windows-x64-wamr + os: windows-2022 + artifact_name: 'wasmer-wamr-windows-amd64' + llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-windows-amd64.tar.xz' + cross_compilation_artifact_name: 'cross_compiled_from_win' + use_sccache: false + use_llvm: true + build_wasm: false + - build: windows-x64-wasmi + os: windows-2022 + artifact_name: 'wasmer-wasmi-windows-amd64' + llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-windows-amd64.tar.xz' + cross_compilation_artifact_name: 'cross_compiled_from_win' + use_sccache: false + use_llvm: true + build_wasm: false + - build: linux-musl-x64 + os: ubuntu-latest + artifact_name: 'wasmer-linux-musl-amd64' + container: alpine:latest + use_sccache: false + use_llvm: false + build_wasm: true - build: linux-musl-x64-v8 os: ubuntu-latest artifact_name: 'wasmer-v8-linux-musl-amd64' @@ -447,134 +447,134 @@ jobs: if-no-files-found: error retention-days: 2 - # windows_gnu: - # name: Windows GNU - # runs-on: ubuntu-latest - # steps: - # - uses: actions/checkout@v3 - # - name: Install Windows-GNU linker - # shell: bash - # run: | - # sudo apt install -y mingw-w64 - # - uses: dtolnay/rust-toolchain@stable - # with: - # target: x86_64-pc-windows-gnu - # - name: Install Windows-GNU target - # shell: bash - # run: | - # rustup target add x86_64-pc-windows-gnu - # - name: Install Windows 10 SDK with xwin - # shell: bash - # run: | - # mkdir -p /tmp/xwin - # mkdir -p /tmp/xwindownload - # mkdir -p /tmp/xwincache - # git clone https://github.com/wasmerio/xwin --depth=1 /tmp/xwin - # cargo build --release --manifest-path=/tmp/xwin/Cargo.toml - # /tmp/xwin/target/release/xwin --accept-license --cache-dir /tmp/xwincache splat --output /tmp/xwindownload - # mkdir -p /tmp/winsdk - # cp /tmp/xwindownload/sdk/lib/10.0.20348/um/x86_64/WS2_32.lib /tmp/winsdk/ - # cp /tmp/xwindownload/sdk/lib/10.0.20348/um/x86_64/KERNEL32.lib /tmp/winsdk/ - # cp /tmp/xwindownload/sdk/lib/10.0.20348/um/x86_64/BCRYPT.lib /tmp/winsdk/ - # cp /tmp/xwindownload/sdk/lib/10.0.20348/um/x86_64/ADVAPI32.lib /tmp/winsdk/ - # cp /tmp/xwindownload/sdk/lib/10.0.20348/um/x86_64/USERENV.lib /tmp/winsdk/ - # echo "WinSDK files:" - # ls -laH /tmp/winsdk - # echo "" - # mkdir -p package - # mkdir -p package/winsdk - # cp -r /tmp/winsdk/* package/winsdk - # - name: Build Wasmer C-API without LLVM - # shell: bash - # run: | - # make build-capi - # env: - # RUSTFLAGS: -Cpanic=abort - # CARGO_TARGET: x86_64-pc-windows-gnu - # ENABLE_LLVM: 0 - # - name: Build Wasmer C-API headless without LLVM - # shell: bash - # run: | - # make build-capi-headless - # env: - # RUSTFLAGS: -Cpanic=abort - # CARGO_TARGET: x86_64-pc-windows-gnu - # ENABLE_LLVM: 0 - # - name: Dist - # run: | - # make distribution-gnu - # env: - # CARGO_TARGET: x86_64-pc-windows-gnu - # TARGET_DIR: target/x86_64-pc-windows-gnu/release - # - name: Upload Artifacts - # uses: actions/upload-artifact@v4 - # with: - # name: 'wasmer-windows-gnu64' - # path: dist - # if-no-files-found: error - # retention-days: 2 + windows_gnu: + name: Windows GNU + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Install Windows-GNU linker + shell: bash + run: | + sudo apt install -y mingw-w64 + - uses: dtolnay/rust-toolchain@stable + with: + target: x86_64-pc-windows-gnu + - name: Install Windows-GNU target + shell: bash + run: | + rustup target add x86_64-pc-windows-gnu + - name: Install Windows 10 SDK with xwin + shell: bash + run: | + mkdir -p /tmp/xwin + mkdir -p /tmp/xwindownload + mkdir -p /tmp/xwincache + git clone https://github.com/wasmerio/xwin --depth=1 /tmp/xwin + cargo build --release --manifest-path=/tmp/xwin/Cargo.toml + /tmp/xwin/target/release/xwin --accept-license --cache-dir /tmp/xwincache splat --output /tmp/xwindownload + mkdir -p /tmp/winsdk + cp /tmp/xwindownload/sdk/lib/10.0.20348/um/x86_64/WS2_32.lib /tmp/winsdk/ + cp /tmp/xwindownload/sdk/lib/10.0.20348/um/x86_64/KERNEL32.lib /tmp/winsdk/ + cp /tmp/xwindownload/sdk/lib/10.0.20348/um/x86_64/BCRYPT.lib /tmp/winsdk/ + cp /tmp/xwindownload/sdk/lib/10.0.20348/um/x86_64/ADVAPI32.lib /tmp/winsdk/ + cp /tmp/xwindownload/sdk/lib/10.0.20348/um/x86_64/USERENV.lib /tmp/winsdk/ + echo "WinSDK files:" + ls -laH /tmp/winsdk + echo "" + mkdir -p package + mkdir -p package/winsdk + cp -r /tmp/winsdk/* package/winsdk + - name: Build Wasmer C-API without LLVM + shell: bash + run: | + make build-capi + env: + RUSTFLAGS: -Cpanic=abort + CARGO_TARGET: x86_64-pc-windows-gnu + ENABLE_LLVM: 0 + - name: Build Wasmer C-API headless without LLVM + shell: bash + run: | + make build-capi-headless + env: + RUSTFLAGS: -Cpanic=abort + CARGO_TARGET: x86_64-pc-windows-gnu + ENABLE_LLVM: 0 + - name: Dist + run: | + make distribution-gnu + env: + CARGO_TARGET: x86_64-pc-windows-gnu + TARGET_DIR: target/x86_64-pc-windows-gnu/release + - name: Upload Artifacts + uses: actions/upload-artifact@v4 + with: + name: 'wasmer-windows-gnu64' + path: dist + if-no-files-found: error + retention-days: 2 - # darwin_aarch64_jsc: - # name: macOS aarch64 (JSC) - # runs-on: macos-12 - # steps: - # - uses: actions/checkout@v3 - # - uses: dtolnay/rust-toolchain@stable - # with: - # target: aarch64-apple-darwin - # - name: Install Darwin-aarch64 target - # shell: bash - # run: | - # rustup target add aarch64-apple-darwin - # - name: Build Wasmer C-API (JSC) - # shell: bash - # run: | - # make build-capi-jsc - # env: - # RUSTFLAGS: -Cpanic=abort - # CARGO_TARGET: aarch64-apple-darwin - # - name: Dist - # run: | - # make distribution - # env: - # CARGO_TARGET: aarch64-apple-darwin - # TARGET_DIR: target/aarch64-apple-darwin/release - # - name: Upload Artifacts - # uses: actions/upload-artifact@v4 - # with: - # name: 'aarch64-apple-darwin-jsc' - # path: dist - # if-no-files-found: error - # retention-days: 2 + darwin_aarch64_jsc: + name: macOS aarch64 (JSC) + runs-on: macos-12 + steps: + - uses: actions/checkout@v3 + - uses: dtolnay/rust-toolchain@stable + with: + target: aarch64-apple-darwin + - name: Install Darwin-aarch64 target + shell: bash + run: | + rustup target add aarch64-apple-darwin + - name: Build Wasmer C-API (JSC) + shell: bash + run: | + make build-capi-jsc + env: + RUSTFLAGS: -Cpanic=abort + CARGO_TARGET: aarch64-apple-darwin + - name: Dist + run: | + make distribution + env: + CARGO_TARGET: aarch64-apple-darwin + TARGET_DIR: target/aarch64-apple-darwin/release + - name: Upload Artifacts + uses: actions/upload-artifact@v4 + with: + name: 'aarch64-apple-darwin-jsc' + path: dist + if-no-files-found: error + retention-days: 2 - # darwin_x86_64_jsc: - # name: macOS x86_64 (JSC) - # runs-on: macos-12 - # steps: - # - uses: actions/checkout@v3 - # - uses: dtolnay/rust-toolchain@stable - # with: - # target: x86_64-apple-darwin - # - name: Build Wasmer C-API (JSC) - # shell: bash - # run: | - # make build-capi-jsc - # env: - # RUSTFLAGS: -Cpanic=abort - # CARGO_TARGET: x86_64-apple-darwin - # - name: Dist - # run: | - # make distribution - # env: - # CARGO_TARGET: x86_64-apple-darwin - # TARGET_DIR: target/x86_64-apple-darwin/release - # - name: Upload Artifacts - # uses: actions/upload-artifact@v4 - # with: - # name: 'x86_64-apple-darwin-jsc' - # path: dist - # if-no-files-found: error - # retention-days: 2 + darwin_x86_64_jsc: + name: macOS x86_64 (JSC) + runs-on: macos-12 + steps: + - uses: actions/checkout@v3 + - uses: dtolnay/rust-toolchain@stable + with: + target: x86_64-apple-darwin + - name: Build Wasmer C-API (JSC) + shell: bash + run: | + make build-capi-jsc + env: + RUSTFLAGS: -Cpanic=abort + CARGO_TARGET: x86_64-apple-darwin + - name: Dist + run: | + make distribution + env: + CARGO_TARGET: x86_64-apple-darwin + TARGET_DIR: target/x86_64-apple-darwin/release + - name: Upload Artifacts + uses: actions/upload-artifact@v4 + with: + name: 'x86_64-apple-darwin-jsc' + path: dist + if-no-files-found: error + retention-days: 2 # linux_riscv64: # name: Linux riscv64 @@ -643,8 +643,7 @@ jobs: release: # needs: [setup, build, linux_aarch64, windows_gnu, linux_riscv64] - # needs: [setup, build, windows_gnu] - needs: [setup, build] + needs: [setup, build, windows_gnu] runs-on: ubuntu-latest if: needs.setup.outputs.DOING_RELEASE == '1' || github.event.inputs.release != '' steps: From 64a1323635bdaec72955cdce0f7413aae3c51c55 Mon Sep 17 00:00:00 2001 From: "M.Amin Rayej" Date: Mon, 28 Oct 2024 14:26:05 +0330 Subject: [PATCH 33/39] enable other workflows --- .github/workflows/test.yaml | 2176 +++++++++++++------------- .github/workflows/wasmer-config.yaml | 98 +- 2 files changed, 1137 insertions(+), 1137 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 8735dc95b7a..112367d6beb 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -1,1135 +1,1135 @@ -# name: test-sys +name: test-sys -# on: -# push: -# branches: -# - main -# - 'with-ci-.*' -# - 'v3.0.x' -# - 'v3.1.x' -# pull_request: -# workflow_dispatch: -# inputs: -# release: -# description: 'Make release' +on: + push: + branches: + - main + - 'with-ci-.*' + - 'v3.0.x' + - 'v3.1.x' + pull_request: + workflow_dispatch: + inputs: + release: + description: 'Make release' -# # Automatically cancel previous workflow runs when a new commit is pushed. -# concurrency: -# group: ${{ github.workflow }}-${{ github.ref }} -# cancel-in-progress: true +# Automatically cancel previous workflow runs when a new commit is pushed. +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true -# env: -# RUST_BACKTRACE: 1 -# # Sparse will be enabled by dtolnay/rust-toolchain when installing nightly -# # Rust, but it's not stable on 1.69 yet. By explicitly setting the protocol we -# # can override that behaviour -# CARGO_REGISTRIES_CRATES_IO_PROTOCOL: git -# MSRV: "1.81" -# NEXTEST_PROFILE: "ci" -# RUSTUP_WINDOWS_PATH_ADD_BIN: 1 -# WASI_SDK_VERSION: "22" +env: + RUST_BACKTRACE: 1 + # Sparse will be enabled by dtolnay/rust-toolchain when installing nightly + # Rust, but it's not stable on 1.69 yet. By explicitly setting the protocol we + # can override that behaviour + CARGO_REGISTRIES_CRATES_IO_PROTOCOL: git + MSRV: "1.81" + NEXTEST_PROFILE: "ci" + RUSTUP_WINDOWS_PATH_ADD_BIN: 1 + WASI_SDK_VERSION: "22" -# jobs: -# setup: -# name: Set up -# runs-on: ubuntu-22.04 -# outputs: -# VERSION: ${{ steps.setup.outputs.VERSION }} -# DOING_RELEASE: ${{ steps.setup.outputs.DOING_RELEASE }} -# steps: -# - name: Set up env vars -# id: setup -# shell: bash -# run: | -# VERSION=${GITHUB_REF/refs\/tags\//} -# echo "VERSION=${VERSION}" >> $GITHUB_OUTPUT -# DOING_RELEASE=$(echo $VERSION | grep -c '^[0-9]\+\.[0-9]\+\.[0-9]\+\(-\([a-zA-Z]\+\)\?[0-9]*\)\?$' || true) -# echo "DOING_RELEASE=${DOING_RELEASE}" >> $GITHUB_OUTPUT -# echo $VERSION -# echo $DOING_RELEASE +jobs: + setup: + name: Set up + runs-on: ubuntu-22.04 + outputs: + VERSION: ${{ steps.setup.outputs.VERSION }} + DOING_RELEASE: ${{ steps.setup.outputs.DOING_RELEASE }} + steps: + - name: Set up env vars + id: setup + shell: bash + run: | + VERSION=${GITHUB_REF/refs\/tags\//} + echo "VERSION=${VERSION}" >> $GITHUB_OUTPUT + DOING_RELEASE=$(echo $VERSION | grep -c '^[0-9]\+\.[0-9]\+\.[0-9]\+\(-\([a-zA-Z]\+\)\?[0-9]*\)\?$' || true) + echo "DOING_RELEASE=${DOING_RELEASE}" >> $GITHUB_OUTPUT + echo $VERSION + echo $DOING_RELEASE -# lint: -# name: Code lint -# runs-on: ubuntu-22.04 -# steps: -# - uses: actions/checkout@v3 -# - name: Install Rust -# uses: dtolnay/rust-toolchain@stable -# with: -# toolchain: ${{ env.MSRV }} -# components: rustfmt, clippy -# - name: Install libtinfo -# shell: bash -# run: | -# sudo apt install -y libtinfo5 -# - name: Install LLVM (Linux) -# run: | -# curl --proto '=https' --tlsv1.2 -sSf https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-amd64.tar.xz -L -o /opt/llvm.tar.xz -# mkdir -p /opt/llvm-18 -# tar xf /opt/llvm.tar.xz --strip-components=1 -C /opt/llvm-18 -# echo '/opt/llvm-18/bin' >> $GITHUB_PATH -# echo 'LLVM_SYS_180_PREFIX=/opt/llvm-18' >> $GITHUB_ENV -# - name: Cache -# uses: whywaita/actions-cache-s3@v2 -# with: -# path: | -# ~/.cargo/* -# ./target/* -# key: r22-${{ github.repository }}-${{ runner.os }}-${{ hashFiles('Cargo.lock') }}-wasmer-make-lint-linux-x64 -# aws-s3-bucket: wasmer-rust-artifacts-cache -# aws-access-key-id: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_TOKEN }} -# aws-secret-access-key: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_KEY }} -# aws-region: auto -# aws-endpoint: https://1541b1e8a3fc6ad155ce67ef38899700.r2.cloudflarestorage.com -# aws-s3-bucket-endpoint: false -# aws-s3-force-path-style: true -# - run: make lint -# env: -# ENABLE_CRANELIFT: "1" -# ENABLE_LLVM: "1" -# ENABLE_SINGLEPASS: "1" -# - name: Assert no files have changed -# run: | -# git status -# ! [[ $(git status -s) ]] + lint: + name: Code lint + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v3 + - name: Install Rust + uses: dtolnay/rust-toolchain@stable + with: + toolchain: ${{ env.MSRV }} + components: rustfmt, clippy + - name: Install libtinfo + shell: bash + run: | + sudo apt install -y libtinfo5 + - name: Install LLVM (Linux) + run: | + curl --proto '=https' --tlsv1.2 -sSf https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-amd64.tar.xz -L -o /opt/llvm.tar.xz + mkdir -p /opt/llvm-18 + tar xf /opt/llvm.tar.xz --strip-components=1 -C /opt/llvm-18 + echo '/opt/llvm-18/bin' >> $GITHUB_PATH + echo 'LLVM_SYS_180_PREFIX=/opt/llvm-18' >> $GITHUB_ENV + - name: Cache + uses: whywaita/actions-cache-s3@v2 + with: + path: | + ~/.cargo/* + ./target/* + key: r22-${{ github.repository }}-${{ runner.os }}-${{ hashFiles('Cargo.lock') }}-wasmer-make-lint-linux-x64 + aws-s3-bucket: wasmer-rust-artifacts-cache + aws-access-key-id: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_TOKEN }} + aws-secret-access-key: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_KEY }} + aws-region: auto + aws-endpoint: https://1541b1e8a3fc6ad155ce67ef38899700.r2.cloudflarestorage.com + aws-s3-bucket-endpoint: false + aws-s3-force-path-style: true + - run: make lint + env: + ENABLE_CRANELIFT: "1" + ENABLE_LLVM: "1" + ENABLE_SINGLEPASS: "1" + - name: Assert no files have changed + run: | + git status + ! [[ $(git status -s) ]] -# cargo_deny: -# name: cargo-deny -# runs-on: ubuntu-22.04 -# steps: -# - uses: actions/checkout@v3 -# - uses: EmbarkStudios/cargo-deny-action@v1 -# with: -# log-level: error + cargo_deny: + name: cargo-deny + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v3 + - uses: EmbarkStudios/cargo-deny-action@v1 + with: + log-level: error -# test_nodejs: -# name: Test on NodeJS -# runs-on: ubuntu-22.04 -# steps: -# - uses: actions/checkout@v3 -# - name: Install Rust -# uses: dtolnay/rust-toolchain@stable -# with: -# toolchain: ${{ env.MSRV }} -# - name: Install NodeJS -# uses: actions/setup-node@v2 -# with: -# node-version: 16 -# - name: Install wasm-pack -# run: | -# curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh -# - name: make test-js -# run: | -# make test-js + test_nodejs: + name: Test on NodeJS + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v3 + - name: Install Rust + uses: dtolnay/rust-toolchain@stable + with: + toolchain: ${{ env.MSRV }} + - name: Install NodeJS + uses: actions/setup-node@v2 + with: + node-version: 16 + - name: Install wasm-pack + run: | + curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh + - name: make test-js + run: | + make test-js -# test_wasi_fyi: -# name: Test wasi-fyi -# runs-on: ubuntu-22.04 -# steps: -# - uses: actions/checkout@v3 -# - name: Install Rust -# uses: dtolnay/rust-toolchain@stable -# with: -# toolchain: nightly -# targets: "wasm32-wasi" -# - name: Install wasm-pack -# run: | -# curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh -# - name: Install LLVM 18 -# run: | -# curl --proto '=https' --tlsv1.2 -sSf https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-amd64.tar.xz -L -o llvm.tar.xz -# LLVM_DIR=$(pwd)/${{ env.LLVM_DIR }} -# mkdir ${LLVM_DIR} -# tar xf llvm.tar.xz --strip-components=1 -C ${LLVM_DIR} -# echo "ENABLE_LLVM=1" >> $GITHUB_ENV -# echo "${LLVM_DIR}/bin" >> $GITHUB_PATH -# echo "${LLVM_DIR}/usr/bin" >> $GITHUB_PATH -# echo "LLVM_SYS_180_PREFIX=${LLVM_DIR}" >> $GITHUB_ENV -# env: -# LLVM_DIR: .llvm -# - name: make test-wasi-fyi -# run: | -# make test-wasi-fyi + test_wasi_fyi: + name: Test wasi-fyi + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v3 + - name: Install Rust + uses: dtolnay/rust-toolchain@stable + with: + toolchain: nightly + targets: "wasm32-wasi" + - name: Install wasm-pack + run: | + curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh + - name: Install LLVM 18 + run: | + curl --proto '=https' --tlsv1.2 -sSf https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-amd64.tar.xz -L -o llvm.tar.xz + LLVM_DIR=$(pwd)/${{ env.LLVM_DIR }} + mkdir ${LLVM_DIR} + tar xf llvm.tar.xz --strip-components=1 -C ${LLVM_DIR} + echo "ENABLE_LLVM=1" >> $GITHUB_ENV + echo "${LLVM_DIR}/bin" >> $GITHUB_PATH + echo "${LLVM_DIR}/usr/bin" >> $GITHUB_PATH + echo "LLVM_SYS_180_PREFIX=${LLVM_DIR}" >> $GITHUB_ENV + env: + LLVM_DIR: .llvm + - name: make test-wasi-fyi + run: | + make test-wasi-fyi -# # The no_std functionality doesn't work at the moment - no point in testing it. -# # - name: make test-js-core -# # run: | -# # make test-js-core + # The no_std functionality doesn't work at the moment - no point in testing it. + # - name: make test-js-core + # run: | + # make test-js-core -# test_wasix: -# name: Test WASIX -# runs-on: ubuntu-22.04 -# steps: -# - uses: actions/checkout@v3 -# - name: Install Rust -# uses: dtolnay/rust-toolchain@stable -# with: -# toolchain: ${{ env.MSRV }} -# - name: Install Tools -# run: | -# sudo apt-get update -# sudo apt-get install -y git llvm clang make lld curl -# - name: Build wasix sysroot -# run: | -# cd ~ -# git clone --recurse-submodules https://github.com/wasix-org/wasix-libc -# cd wasix-libc -# ./build32.sh -# rm -rf /opt/wasix-sysroot -# cp -r sysroot32 ~/wasix-sysroot -# - name: Install wasi-sdk Tools -# run: | -# cd ~ -# curl -L "https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-${{ env.WASI_SDK_VERSION }}/wasi-sdk-${{ env.WASI_SDK_VERSION }}.0-linux.tar.gz" -o wasi-sdk.tar.gz -# tar -xzf wasi-sdk.tar.gz -# cp -r wasi-sdk-${{ env.WASI_SDK_VERSION }}.0 ~/wasi-sdk -# - name: Install LLVM 18 -# run: | -# curl --proto '=https' --tlsv1.2 -sSf https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-amd64.tar.xz -L -o llvm.tar.xz -# LLVM_DIR=$(pwd)/${{ env.LLVM_DIR }} -# mkdir ${LLVM_DIR} -# tar xf llvm.tar.xz --strip-components=1 -C ${LLVM_DIR} -# echo "ENABLE_LLVM=1" >> $GITHUB_ENV -# echo "${LLVM_DIR}/bin" >> $GITHUB_PATH -# echo "${LLVM_DIR}/usr/bin" >> $GITHUB_PATH -# echo "LLVM_SYS_180_PREFIX=${LLVM_DIR}" >> $GITHUB_ENV -# env: -# LLVM_DIR: .llvm -# - name: Install wasm-opt -# run: | -# sudo apt-get install -y binaryen -# - name: make test-wasix -# run: | -# WASI_SDK=~/wasi-sdk WASIX_SYSROOT=~/wasix-sysroot make test-wasix + test_wasix: + name: Test WASIX + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v3 + - name: Install Rust + uses: dtolnay/rust-toolchain@stable + with: + toolchain: ${{ env.MSRV }} + - name: Install Tools + run: | + sudo apt-get update + sudo apt-get install -y git llvm clang make lld curl + - name: Build wasix sysroot + run: | + cd ~ + git clone --recurse-submodules https://github.com/wasix-org/wasix-libc + cd wasix-libc + ./build32.sh + rm -rf /opt/wasix-sysroot + cp -r sysroot32 ~/wasix-sysroot + - name: Install wasi-sdk Tools + run: | + cd ~ + curl -L "https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-${{ env.WASI_SDK_VERSION }}/wasi-sdk-${{ env.WASI_SDK_VERSION }}.0-linux.tar.gz" -o wasi-sdk.tar.gz + tar -xzf wasi-sdk.tar.gz + cp -r wasi-sdk-${{ env.WASI_SDK_VERSION }}.0 ~/wasi-sdk + - name: Install LLVM 18 + run: | + curl --proto '=https' --tlsv1.2 -sSf https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-amd64.tar.xz -L -o llvm.tar.xz + LLVM_DIR=$(pwd)/${{ env.LLVM_DIR }} + mkdir ${LLVM_DIR} + tar xf llvm.tar.xz --strip-components=1 -C ${LLVM_DIR} + echo "ENABLE_LLVM=1" >> $GITHUB_ENV + echo "${LLVM_DIR}/bin" >> $GITHUB_PATH + echo "${LLVM_DIR}/usr/bin" >> $GITHUB_PATH + echo "LLVM_SYS_180_PREFIX=${LLVM_DIR}" >> $GITHUB_ENV + env: + LLVM_DIR: .llvm + - name: Install wasm-opt + run: | + sudo apt-get install -y binaryen + - name: make test-wasix + run: | + WASI_SDK=~/wasi-sdk WASIX_SYSROOT=~/wasix-sysroot make test-wasix -# test_wasm_build: -# name: Test wasm build -# runs-on: ubuntu-22.04 -# steps: -# - uses: actions/checkout@v3 -# - name: rustup target add wasm32-wasi -# run: rustup target add wasm32-wasi -# - name: make build-wasmer-wasm -# run: make build-wasmer-wasm + test_wasm_build: + name: Test wasm build + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v3 + - name: rustup target add wasm32-wasi + run: rustup target add wasm32-wasi + - name: make build-wasmer-wasm + run: make build-wasmer-wasm -# test_build_jsc: -# name: Test JSC build -# runs-on: ubuntu-22.04 -# steps: -# - uses: actions/checkout@v3 -# - uses: dtolnay/rust-toolchain@stable -# with: -# toolchain: ${{ env.MSRV }} -# target: x86_64-unknown-linux-gnu -# - name: Install NodeJS -# uses: actions/setup-node@v2 -# with: -# node-version: 16 -# - name: Install libjavascriptcoregtk-4.0-dev -# run: sudo apt update && sudo apt install -y libjavascriptcoregtk-4.0-dev -# - name: make build-wasmer-jsc -# run: make build-wasmer-jsc + test_build_jsc: + name: Test JSC build + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v3 + - uses: dtolnay/rust-toolchain@stable + with: + toolchain: ${{ env.MSRV }} + target: x86_64-unknown-linux-gnu + - name: Install NodeJS + uses: actions/setup-node@v2 + with: + node-version: 16 + - name: Install libjavascriptcoregtk-4.0-dev + run: sudo apt update && sudo apt install -y libjavascriptcoregtk-4.0-dev + - name: make build-wasmer-jsc + run: make build-wasmer-jsc -# test_interpreter_api: -# name: ${{ matrix.build-what.name }} on ${{ matrix.metadata.build }} -# runs-on: ${{ matrix.metadata.os }} -# strategy: -# fail-fast: false -# matrix: -# build-what: [ -# { -# key: wamr, -# build-cmd: 'make test-wamr-api', -# name: 'Test API for wamr feature' -# }, -# { -# key: wasmi, -# build-cmd: 'make test-wasmi-api', -# name: 'Test API for wasmi feature' -# }, -# { -# key: v8, -# build-cmd: 'make test-v8-api', -# name: 'Test API for v8 feature' -# } + test_interpreter_api: + name: ${{ matrix.build-what.name }} on ${{ matrix.metadata.build }} + runs-on: ${{ matrix.metadata.os }} + strategy: + fail-fast: false + matrix: + build-what: [ + { + key: wamr, + build-cmd: 'make test-wamr-api', + name: 'Test API for wamr feature' + }, + { + key: wasmi, + build-cmd: 'make test-wasmi-api', + name: 'Test API for wasmi feature' + }, + { + key: v8, + build-cmd: 'make test-v8-api', + name: 'Test API for v8 feature' + } -# ] -# metadata: [ -# { -# build: linux-x64, -# os: ubuntu-22.04, -# }, -# { -# build: macos-arm, -# os: macos-14, -# }, -# { -# build: windows-x64, -# os: windows-2022, -# } -# ] -# container: ${{ matrix.metadata.container }} -# steps: -# - uses: actions/checkout@v3 + ] + metadata: [ + { + build: linux-x64, + os: ubuntu-22.04, + }, + { + build: macos-arm, + os: macos-14, + }, + { + build: windows-x64, + os: windows-2022, + } + ] + container: ${{ matrix.metadata.container }} + steps: + - uses: actions/checkout@v3 -# - name: Setup MSVC (Windows) -# uses: ilammy/msvc-dev-cmd@v1 -# if: matrix.metadata.build == 'windows-x64' + - name: Setup MSVC (Windows) + uses: ilammy/msvc-dev-cmd@v1 + if: matrix.metadata.build == 'windows-x64' -# - uses: dtolnay/rust-toolchain@stable -# with: -# toolchain: ${{ env.MSRV }} + - uses: dtolnay/rust-toolchain@stable + with: + toolchain: ${{ env.MSRV }} -# - name: Install Nextest -# uses: taiki-e/install-action@nextest + - name: Install Nextest + uses: taiki-e/install-action@nextest -# - name: Install `ninja`, clang` and `mold` on Ubuntu -# if: startsWith(matrix.metadata.build, 'linux-') -# shell: bash -# run: | -# sudo apt-get update -y && sudo apt-get install ninja-build clang mold -y + - name: Install `ninja`, clang` and `mold` on Ubuntu + if: startsWith(matrix.metadata.build, 'linux-') + shell: bash + run: | + sudo apt-get update -y && sudo apt-get install ninja-build clang mold -y -# - name: Install `ninja` on macOS -# if: startsWith(matrix.metadata.build, 'macos-') -# shell: bash -# run: | -# brew install ninja + - name: Install `ninja` on macOS + if: startsWith(matrix.metadata.build, 'macos-') + shell: bash + run: | + brew install ninja -# - name: Install `ninja` on Windows -# if: startsWith(matrix.metadata.build, 'windows-') -# shell: bash -# run: | -# choco install ninja + - name: Install `ninja` on Windows + if: startsWith(matrix.metadata.build, 'windows-') + shell: bash + run: | + choco install ninja -# - name: Delete unwanted link to stop it from interfering (Windows) -# shell: bash -# run: rm /usr/bin/link.exe -# if: startsWith(matrix.metadata.build, 'windows-') + - name: Delete unwanted link to stop it from interfering (Windows) + shell: bash + run: rm /usr/bin/link.exe + if: startsWith(matrix.metadata.build, 'windows-') -# - name: Test WAMR API -# if: ${{ matrix.build-what.key == 'wamr' }} -# run: ${{ matrix.build-what.build-cmd }} + - name: Test WAMR API + if: ${{ matrix.build-what.key == 'wamr' }} + run: ${{ matrix.build-what.build-cmd }} -# - name: Test wasmi API -# if: ${{ matrix.build-what.key == 'wasmi' }} -# run: ${{ matrix.build-what.build-cmd }} + - name: Test wasmi API + if: ${{ matrix.build-what.key == 'wasmi' }} + run: ${{ matrix.build-what.build-cmd }} -# - name: Test v8 API (Linux + mold) -# if: ${{ matrix.build-what.key == 'v8' && startsWith(matrix.metadata.build, 'linux-')}} -# run: RUSTFLAGS="-C linker=clang -C link-arg=-fuse-ld=mold" CARGO_TERM_VERBOSE=true cargo nextest run --package=wasmer --release --features=v8 --no-default-features + - name: Test v8 API (Linux + mold) + if: ${{ matrix.build-what.key == 'v8' && startsWith(matrix.metadata.build, 'linux-')}} + run: RUSTFLAGS="-C linker=clang -C link-arg=-fuse-ld=mold" CARGO_TERM_VERBOSE=true cargo nextest run --package=wasmer --release --features=v8 --no-default-features -# - name: Test v8 API -# if: ${{ matrix.build-what.key == 'v8' && !startsWith(matrix.metadata.build, 'linux-')}} -# run: ${{ matrix.build-what.build-cmd }} + - name: Test v8 API + if: ${{ matrix.build-what.key == 'v8' && !startsWith(matrix.metadata.build, 'linux-')}} + run: ${{ matrix.build-what.build-cmd }} -# test_build_docs_rs: -# name: Test build docs rs -# runs-on: ubuntu-22.04 -# steps: -# - uses: actions/checkout@v3 -# - uses: dtolnay/rust-toolchain@master -# with: -# toolchain: "nightly-2024-08-21" -# target: x86_64-unknown-linux-gnu -# - run: cargo install toml-cli # toml-cli is required to run `make test-build-docs-rs` + test_build_docs_rs: + name: Test build docs rs + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v3 + - uses: dtolnay/rust-toolchain@master + with: + toolchain: "nightly-2024-08-21" + target: x86_64-unknown-linux-gnu + - run: cargo install toml-cli # toml-cli is required to run `make test-build-docs-rs` -# - name: Install `ninja` on Ubuntu -# shell: bash -# run: | -# sudo apt-get install ninja-build -y + - name: Install `ninja` on Ubuntu + shell: bash + run: | + sudo apt-get install ninja-build -y -# - name: Install LLVM 18 -# run: | -# curl --proto '=https' --tlsv1.2 -sSf https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-amd64.tar.xz -L -o llvm.tar.xz -# LLVM_DIR=$(pwd)/${{ env.LLVM_DIR }} -# mkdir ${LLVM_DIR} -# tar xf llvm.tar.xz --strip-components=1 -C ${LLVM_DIR} -# echo "ENABLE_LLVM=1" >> $GITHUB_ENV -# echo "${LLVM_DIR}/bin" >> $GITHUB_PATH -# echo "${LLVM_DIR}/usr/bin" >> $GITHUB_PATH -# echo "LLVM_SYS_180_PREFIX=${LLVM_DIR}" >> $GITHUB_ENV -# env: -# LLVM_DIR: .llvm -# - name: make test-build-docs-rs-ci -# run: make test-build-docs-rs-ci + - name: Install LLVM 18 + run: | + curl --proto '=https' --tlsv1.2 -sSf https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-amd64.tar.xz -L -o llvm.tar.xz + LLVM_DIR=$(pwd)/${{ env.LLVM_DIR }} + mkdir ${LLVM_DIR} + tar xf llvm.tar.xz --strip-components=1 -C ${LLVM_DIR} + echo "ENABLE_LLVM=1" >> $GITHUB_ENV + echo "${LLVM_DIR}/bin" >> $GITHUB_PATH + echo "${LLVM_DIR}/usr/bin" >> $GITHUB_PATH + echo "LLVM_SYS_180_PREFIX=${LLVM_DIR}" >> $GITHUB_ENV + env: + LLVM_DIR: .llvm + - name: make test-build-docs-rs-ci + run: make test-build-docs-rs-ci -# build_linux_aarch64: -# name: ${{ matrix.build-what.name }} on linux-aarch64 -# runs-on: ubuntu-22.04 -# strategy: -# fail-fast: false -# matrix: -# build-what: [ -# { -# key: capi, -# build-cmd: 'make build-capi && make package-capi', -# name: 'Build C-API' -# }, -# { -# key: wasmer, -# build-cmd: 'make build-wasmer && make package-wasmer && make tar-wasmer', -# name: 'Build wasmer-cli' -# } -# ] -# steps: -# - uses: actions/checkout@v3 -# - uses: dtolnay/rust-toolchain@stable -# with: -# toolchain: ${{ env.MSRV }} -# target: aarch64-unknown-linux-gnu -# - name: Build cross image -# run: | -# docker build -t wasmer/aarch64 ${GITHUB_WORKSPACE}/.github/cross-linux-aarch64/ -# env: -# CROSS_DOCKER_IN_DOCKER: true -# - name: Build ${{ matrix.build-what.key }} -# run: | -# ${{ matrix.build-what.build-cmd }} -# env: -# CARGO_BINARY: docker run -v /var/run/docker.sock:/var/run/docker.sock -v ${GITHUB_WORKSPACE}:/project -w /project wasmer/aarch64 cross -# CROSS_DOCKER_IN_DOCKER: true -# CARGO_TARGET: aarch64-unknown-linux-gnu -# PKG_CONFIG_PATH: /usr/lib/aarch64-linux-gnu/pkgconfig -# PKG_CONFIG_ALLOW_CROSS: true -# ENABLE_LLVM: 0 -# - name: Dist -# if: ${{ matrix.build-what.key == 'capi' }} -# run: | -# make distribution -# env: -# CARGO_BINARY: docker run -v /var/run/docker.sock:/var/run/docker.sock -v ${GITHUB_WORKSPACE}:/project -w /project wasmer/aarch64 cross -# CROSS_DOCKER_IN_DOCKER: true -# CARGO_TARGET: aarch64-unknown-linux-gnu -# PKG_CONFIG_PATH: /usr/lib/aarch64-linux-gnu/pkgconfig -# PKG_CONFIG_ALLOW_CROSS: true -# TARGET: aarch64-unknown-linux-gnu -# TARGET_DIR: target/aarch64-unknown-linux-gnu/release -# - name: Upload Artifacts -# if: ${{ matrix.build-what.key == 'capi' }} -# uses: actions/upload-artifact@v4 -# with: -# name: capi-linux-aarch64 -# path: dist -# if-no-files-found: error -# retention-days: 2 + build_linux_aarch64: + name: ${{ matrix.build-what.name }} on linux-aarch64 + runs-on: ubuntu-22.04 + strategy: + fail-fast: false + matrix: + build-what: [ + { + key: capi, + build-cmd: 'make build-capi && make package-capi', + name: 'Build C-API' + }, + { + key: wasmer, + build-cmd: 'make build-wasmer && make package-wasmer && make tar-wasmer', + name: 'Build wasmer-cli' + } + ] + steps: + - uses: actions/checkout@v3 + - uses: dtolnay/rust-toolchain@stable + with: + toolchain: ${{ env.MSRV }} + target: aarch64-unknown-linux-gnu + - name: Build cross image + run: | + docker build -t wasmer/aarch64 ${GITHUB_WORKSPACE}/.github/cross-linux-aarch64/ + env: + CROSS_DOCKER_IN_DOCKER: true + - name: Build ${{ matrix.build-what.key }} + run: | + ${{ matrix.build-what.build-cmd }} + env: + CARGO_BINARY: docker run -v /var/run/docker.sock:/var/run/docker.sock -v ${GITHUB_WORKSPACE}:/project -w /project wasmer/aarch64 cross + CROSS_DOCKER_IN_DOCKER: true + CARGO_TARGET: aarch64-unknown-linux-gnu + PKG_CONFIG_PATH: /usr/lib/aarch64-linux-gnu/pkgconfig + PKG_CONFIG_ALLOW_CROSS: true + ENABLE_LLVM: 0 + - name: Dist + if: ${{ matrix.build-what.key == 'capi' }} + run: | + make distribution + env: + CARGO_BINARY: docker run -v /var/run/docker.sock:/var/run/docker.sock -v ${GITHUB_WORKSPACE}:/project -w /project wasmer/aarch64 cross + CROSS_DOCKER_IN_DOCKER: true + CARGO_TARGET: aarch64-unknown-linux-gnu + PKG_CONFIG_PATH: /usr/lib/aarch64-linux-gnu/pkgconfig + PKG_CONFIG_ALLOW_CROSS: true + TARGET: aarch64-unknown-linux-gnu + TARGET_DIR: target/aarch64-unknown-linux-gnu/release + - name: Upload Artifacts + if: ${{ matrix.build-what.key == 'capi' }} + uses: actions/upload-artifact@v4 + with: + name: capi-linux-aarch64 + path: dist + if-no-files-found: error + retention-days: 2 -# build_linux_riscv64: -# name: ${{ matrix.build-what.name }} on linux-riscv64 -# runs-on: ubuntu-22.04 -# strategy: -# fail-fast: false -# matrix: -# build-what: [ -# { -# key: capi, -# build-cmd: 'make build-capi && make package-capi', -# name: 'Build C-API' -# }, -# { -# key: wasmer, -# build-cmd: 'make build-wasmer && make package-wasmer && make tar-wasmer', -# name: 'Build wasmer-cli' -# } -# ] -# steps: -# - uses: actions/checkout@v3 -# #- uses: dtolnay/rust-toolchain@stable -# # with: -# # toolchain: ${{ env.MSRV }} -# # target: riscv64gc-unknown-linux-gnu -# - name: Build cross image -# run: | -# docker build -t wasmer/riscv64 ${GITHUB_WORKSPACE}/.github/cross-linux-riscv64/ -# env: -# CROSS_DOCKER_IN_DOCKER: true -# - name: Build ${{ matrix.build-what.key }} -# run: | -# ${{ matrix.build-what.build-cmd }} -# env: -# CARGO_BINARY: docker run -v /var/run/docker.sock:/var/run/docker.sock -v ${GITHUB_WORKSPACE}:/project -w /project wasmer/riscv64 cargo -# CROSS_DOCKER_IN_DOCKER: true -# CARGO_TARGET: riscv64gc-unknown-linux-gnu -# ENABLE_LLVM: 0 -# - name: Dist -# if: ${{ matrix.build-what.key == 'capi' }} -# run: | -# make distribution -# env: -# CARGO_BINARY: docker run -v /var/run/docker.sock:/var/run/docker.sock -v ${GITHUB_WORKSPACE}:/project -w /project wasmer/riscv64 cargo -# CROSS_DOCKER_IN_DOCKER: true -# CARGO_TARGET: riscv64gc-unknown-linux-gnu -# PKG_CONFIG_PATH: /usr/lib/riscv64-linux-gnu/pkgconfig -# PKG_CONFIG_ALLOW_CROSS: true -# TARGET: riscv64gc-unknown-linux-gnu -# TARGET_DIR: target/riscv64gc-unknown-linux-gnu/release -# - name: Upload Artifacts -# if: ${{ matrix.build-what.key == 'capi' }} -# uses: actions/upload-artifact@v4 -# with: -# name: capi-linux-riscv64 -# path: dist -# if-no-files-found: error -# retention-days: 2 + build_linux_riscv64: + name: ${{ matrix.build-what.name }} on linux-riscv64 + runs-on: ubuntu-22.04 + strategy: + fail-fast: false + matrix: + build-what: [ + { + key: capi, + build-cmd: 'make build-capi && make package-capi', + name: 'Build C-API' + }, + { + key: wasmer, + build-cmd: 'make build-wasmer && make package-wasmer && make tar-wasmer', + name: 'Build wasmer-cli' + } + ] + steps: + - uses: actions/checkout@v3 + #- uses: dtolnay/rust-toolchain@stable + # with: + # toolchain: ${{ env.MSRV }} + # target: riscv64gc-unknown-linux-gnu + - name: Build cross image + run: | + docker build -t wasmer/riscv64 ${GITHUB_WORKSPACE}/.github/cross-linux-riscv64/ + env: + CROSS_DOCKER_IN_DOCKER: true + - name: Build ${{ matrix.build-what.key }} + run: | + ${{ matrix.build-what.build-cmd }} + env: + CARGO_BINARY: docker run -v /var/run/docker.sock:/var/run/docker.sock -v ${GITHUB_WORKSPACE}:/project -w /project wasmer/riscv64 cargo + CROSS_DOCKER_IN_DOCKER: true + CARGO_TARGET: riscv64gc-unknown-linux-gnu + ENABLE_LLVM: 0 + - name: Dist + if: ${{ matrix.build-what.key == 'capi' }} + run: | + make distribution + env: + CARGO_BINARY: docker run -v /var/run/docker.sock:/var/run/docker.sock -v ${GITHUB_WORKSPACE}:/project -w /project wasmer/riscv64 cargo + CROSS_DOCKER_IN_DOCKER: true + CARGO_TARGET: riscv64gc-unknown-linux-gnu + PKG_CONFIG_PATH: /usr/lib/riscv64-linux-gnu/pkgconfig + PKG_CONFIG_ALLOW_CROSS: true + TARGET: riscv64gc-unknown-linux-gnu + TARGET_DIR: target/riscv64gc-unknown-linux-gnu/release + - name: Upload Artifacts + if: ${{ matrix.build-what.key == 'capi' }} + uses: actions/upload-artifact@v4 + with: + name: capi-linux-riscv64 + path: dist + if-no-files-found: error + retention-days: 2 -# build: -# name: ${{ matrix.build-what.name }} on ${{ matrix.metadata.build }} -# runs-on: ${{ matrix.metadata.os }} -# needs: setup -# strategy: -# fail-fast: false -# matrix: -# build-what: [ -# { -# key: capi, -# build-cmd: 'make build-capi && make build-capi-headless && make package-capi && make tar-capi', -# name: 'Build and test C-API' -# }, -# { -# key: wasmer, -# build-cmd: 'make build-wasmer && make package-wasmer && make tar-wasmer', -# name: 'Build wasmer-cli' -# } -# ] -# metadata: [ -# { -# build: linux-x64, -# os: ubuntu-22.04, -# target: x86_64-unknown-linux-gnu, -# exe: '', -# llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-amd64.tar.xz' -# }, -# { -# build: macos-x64, -# os: macos-12, -# target: x86_64-apple-darwin, -# exe: '', -# llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-amd64.tar.xz' + build: + name: ${{ matrix.build-what.name }} on ${{ matrix.metadata.build }} + runs-on: ${{ matrix.metadata.os }} + needs: setup + strategy: + fail-fast: false + matrix: + build-what: [ + { + key: capi, + build-cmd: 'make build-capi && make build-capi-headless && make package-capi && make tar-capi', + name: 'Build and test C-API' + }, + { + key: wasmer, + build-cmd: 'make build-wasmer && make package-wasmer && make tar-wasmer', + name: 'Build wasmer-cli' + } + ] + metadata: [ + { + build: linux-x64, + os: ubuntu-22.04, + target: x86_64-unknown-linux-gnu, + exe: '', + llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-amd64.tar.xz' + }, + { + build: macos-x64, + os: macos-12, + target: x86_64-apple-darwin, + exe: '', + llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-amd64.tar.xz' -# }, -# { -# build: macos-arm, -# os: macos-14, -# target: aarch64-apple-darwin, -# exe: '', -# # [todo] xdoardo: Reinstate when the code we generate for aarch64 is working correctly. -# # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-aarch64.tar.xz' -# }, -# { -# build: windows-x64, -# os: windows-2022, -# target: x86_64-pc-windows-msvc, -# exe: '.exe', -# # For now, disable LLVM in `windows-x64.` -# # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-windows-amd64.tar.xz' -# }, -# { -# build: windows-gnu, -# target: x86_64-pc-windows-gnu, -# os: ubuntu-22.04, -# }, -# { -# build: linux-musl, -# target: x86_64-unknown-linux-musl, -# os: ubuntu-22.04, -# exe: '', -# container: 'alpine:latest' -# } + }, + { + build: macos-arm, + os: macos-14, + target: aarch64-apple-darwin, + exe: '', + # [todo] xdoardo: Reinstate when the code we generate for aarch64 is working correctly. + # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-aarch64.tar.xz' + }, + { + build: windows-x64, + os: windows-2022, + target: x86_64-pc-windows-msvc, + exe: '.exe', + # For now, disable LLVM in `windows-x64.` + # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-windows-amd64.tar.xz' + }, + { + build: windows-gnu, + target: x86_64-pc-windows-gnu, + os: ubuntu-22.04, + }, + { + build: linux-musl, + target: x86_64-unknown-linux-musl, + os: ubuntu-22.04, + exe: '', + container: 'alpine:latest' + } -# ] -# container: ${{ matrix.metadata.container }} -# env: -# SCCACHE_AZURE_BLOB_CONTAINER: wasmerstoragesccacheblob -# SCCACHE_AZURE_CONNECTION_STRING: ${{ secrets.SCCACHE_AZURE_CONNECTION_STRING }} -# steps: -# - uses: actions/checkout@v3 -# - name: Set up libstdc++ on Linux -# if: matrix.metadata.build == 'linux-x64' -# run: | -# sudo apt-get update -y -# sudo apt-get install -y --allow-downgrades libstdc++6 libtinfo5 -# sudo apt-get install --reinstall g++ -# - name: Set up base deps on musl -# if: matrix.metadata.build == 'linux-musl' -# run: ./scripts/alpine-linux-install-deps.sh -# - name: Set up dependencies for Mac OS -# run: | -# brew install automake -# # using gnu-tar is a workaround for https://github.com/actions/cache/issues/403 -# brew install gnu-tar -# echo PATH="/usr/local/opt/gnu-tar/libexec/gnubin:$PATH" >> $GITHUB_ENV -# if: matrix.metadata.os == 'macos-12' -# - name: Install Rust -# uses: dtolnay/rust-toolchain@stable -# with: -# toolchain: ${{ env.MSRV }} -# target: ${{ matrix.metadata.target }} -# - name: Install Nextest -# uses: taiki-e/install-action@nextest -# - name: Install MSVC dev-cmd (Windows) -# uses: ilammy/msvc-dev-cmd@v1 -# if: ${{ matrix.metadata.build == 'windows-x64' }} -# - name: Delete unwanted link to stop it from interfering (Windows) -# shell: bash -# run: rm /usr/bin/link.exe -# if: ${{ matrix.metadata.build == 'windows-x64' }} -# - name: Install Windows-GNU linker -# if: ${{ matrix.metadata.build == 'windows-gnu' }} -# shell: bash -# run: | -# sudo apt install -y mingw-w64 -# - name: Install Windows-GNU target -# if: ${{ matrix.metadata.build == 'windows-gnu' }} -# shell: bash -# run: | -# rustup target add x86_64-pc-windows-gnu -# - name: Install Windows 10 SDK with xwin -# if: ${{ matrix.metadata.build == 'windows-gnu' }} -# shell: bash -# run: | -# mkdir -p /tmp/xwin -# mkdir -p /tmp/xwindownload -# mkdir -p /tmp/xwincache -# git clone https://github.com/wasmerio/xwin --depth=1 /tmp/xwin -# cargo build --release --manifest-path=/tmp/xwin/Cargo.toml -# /tmp/xwin/target/release/xwin --accept-license --cache-dir /tmp/xwincache splat --output /tmp/xwindownload -# mkdir -p /tmp/winsdk -# cp /tmp/xwindownload/sdk/lib/10.0.20348/um/x86_64/WS2_32.lib /tmp/winsdk/ -# cp /tmp/xwindownload/sdk/lib/10.0.20348/um/x86_64/KERNEL32.lib /tmp/winsdk/ -# cp /tmp/xwindownload/sdk/lib/10.0.20348/um/x86_64/BCRYPT.lib /tmp/winsdk/ -# cp /tmp/xwindownload/sdk/lib/10.0.20348/um/x86_64/ADVAPI32.lib /tmp/winsdk/ -# cp /tmp/xwindownload/sdk/lib/10.0.20348/um/x86_64/USERENV.lib /tmp/winsdk/ -# echo "WinSDK files:" -# ls -laH /tmp/winsdk -# echo "" -# mkdir -p package -# mkdir -p package/winsdk -# cp -r /tmp/winsdk/* package/winsdk -# - name: Install LLVM (macOS Apple Silicon) -# if: matrix.metadata.os == 'macos-12' && !matrix.metadata.llvm_url -# run: | -# brew install llvm -# - name: Install LLVM -# shell: bash -# if: matrix.metadata.llvm_url -# run: | -# curl --proto '=https' --tlsv1.2 -sSf ${{ matrix.metadata.llvm_url }} -L -o llvm.tar.xz -# LLVM_DIR=$(pwd)/${{ env.LLVM_DIR }} -# mkdir ${LLVM_DIR} -# tar xf llvm.tar.xz --strip-components=1 -C ${LLVM_DIR} -# echo "ENABLE_LLVM=1" >> $GITHUB_ENV -# echo "${LLVM_DIR}/bin" >> $GITHUB_PATH -# echo "${LLVM_DIR}/usr/bin" >> $GITHUB_PATH -# echo "LLVM_SYS_180_PREFIX=${LLVM_DIR}" >> $GITHUB_ENV -# env: -# LLVM_DIR: .llvm -# - name: Add `brew` libs to `RUSTFLAGS` -# if: matrix.metadata.os == 'macos-14' -# shell: bash -# run: | -# echo "RUSTFLAGS=-L/opt/homebrew/lib" >> $GITHUB_ENV -# - name: Setup Rust target -# shell: bash -# run: | -# mkdir -p .cargo -# cat << EOF > .cargo/config.toml -# [build] -# target = "${{ matrix.metadata.target }}" -# EOF -# if: matrix.metadata.target -# - name: which cargo -# if: ${{ matrix.build-what.key == 'capi' && matrix.metadata.build == 'windows-x64' }} -# run: which cargo -# - name: Set cargo env -# run: echo "CARGO_ROOT_DIR=$(dirname $(dirname $( which cargo )))" >> $GITHUB_ENV -# - name: List root dir -# shell: bash -# if: ${{ matrix.build-what.key == 'capi' && matrix.metadata.build == 'windows-x64' }} -# run: ls -R $CARGO_ROOT_DIR -# - name: Cache -# uses: whywaita/actions-cache-s3@v2 -# with: -# path: | -# ~/.cargo/* -# ./target/* -# $CARGO_ROOT_DIR/* -# key: r22-${{ github.repository }}-${{ runner.os }}-${{ hashFiles('Cargo.lock') }}-wasmer-make-build-wasmer-${{ matrix.build-what.key }}-${{ matrix.metadata.build }} -# aws-s3-bucket: wasmer-rust-artifacts-cache -# aws-access-key-id: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_TOKEN }} -# aws-secret-access-key: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_KEY }} -# aws-region: auto -# aws-endpoint: https://1541b1e8a3fc6ad155ce67ef38899700.r2.cloudflarestorage.com -# aws-s3-bucket-endpoint: false -# aws-s3-force-path-style: true -# - name: Build C-API -# shell: bash -# run: ${{ matrix.build-what.build-cmd }} -# if: ${{ matrix.build-what.key == 'capi' }} -# env: -# TARGET: ${{ matrix.metadata.target }} -# TARGET_DIR: target/${{ matrix.metadata.target }}/release -# CARGO_TARGET: ${{ matrix.metadata.target }} -# - name: Build Wasmer -# shell: bash -# if: ${{ matrix.build-what.key == 'wasmer' && matrix.metadata.build != 'windows-gnu' }} -# run: ${{ matrix.build-what.build-cmd }} -# env: -# TARGET: ${{ matrix.metadata.target }} -# TARGET_DIR: target/${{ matrix.metadata.target }}/release -# CARGO_TARGET: ${{ matrix.metadata.target }} -# - name: Test C-API -# shell: bash -# if: ${{ matrix.build-what.key == 'capi' && !(matrix.metadata.build == 'linux-musl' || matrix.metadata.build == 'windows-gnu') }} -# run: make test-capi-ci -# env: -# TARGET: ${{ matrix.metadata.target }} -# TARGET_DIR: target/${{ matrix.metadata.target }}/release -# CARGO_TARGET: ${{ matrix.metadata.target }} -# # C-API tests were disabled for linux-musl and macos-arm (we can't run them) -# - name: Test C-API integration -# shell: bash -# if: ${{ matrix.build-what.key == 'capi' && !(matrix.metadata.build == 'linux-musl' || matrix.metadata.build == 'windows-gnu') }} -# run: export WASMER_DIR=`pwd`/package && make test-stage-7-capi-integration-tests -# env: -# TARGET: ${{ matrix.metadata.target }} -# TARGET_DIR: target/${{ matrix.metadata.target }}/release -# CARGO_TARGET: ${{ matrix.metadata.target }} -# - name: Archive production artifacts -# uses: actions/upload-artifact@v4 -# with: -# name: wasmer-cli-${{ matrix.metadata.build }} -# path: build-wasmer.tar.gz -# if-no-files-found: ignore -# retention-days: 2 -# - name: Archive production artifacts -# uses: actions/upload-artifact@v4 -# with: -# name: capi-${{ matrix.metadata.build }} -# path: build-capi.tar.gz -# if-no-files-found: ignore -# retention-days: 2 + ] + container: ${{ matrix.metadata.container }} + env: + SCCACHE_AZURE_BLOB_CONTAINER: wasmerstoragesccacheblob + SCCACHE_AZURE_CONNECTION_STRING: ${{ secrets.SCCACHE_AZURE_CONNECTION_STRING }} + steps: + - uses: actions/checkout@v3 + - name: Set up libstdc++ on Linux + if: matrix.metadata.build == 'linux-x64' + run: | + sudo apt-get update -y + sudo apt-get install -y --allow-downgrades libstdc++6 libtinfo5 + sudo apt-get install --reinstall g++ + - name: Set up base deps on musl + if: matrix.metadata.build == 'linux-musl' + run: ./scripts/alpine-linux-install-deps.sh + - name: Set up dependencies for Mac OS + run: | + brew install automake + # using gnu-tar is a workaround for https://github.com/actions/cache/issues/403 + brew install gnu-tar + echo PATH="/usr/local/opt/gnu-tar/libexec/gnubin:$PATH" >> $GITHUB_ENV + if: matrix.metadata.os == 'macos-12' + - name: Install Rust + uses: dtolnay/rust-toolchain@stable + with: + toolchain: ${{ env.MSRV }} + target: ${{ matrix.metadata.target }} + - name: Install Nextest + uses: taiki-e/install-action@nextest + - name: Install MSVC dev-cmd (Windows) + uses: ilammy/msvc-dev-cmd@v1 + if: ${{ matrix.metadata.build == 'windows-x64' }} + - name: Delete unwanted link to stop it from interfering (Windows) + shell: bash + run: rm /usr/bin/link.exe + if: ${{ matrix.metadata.build == 'windows-x64' }} + - name: Install Windows-GNU linker + if: ${{ matrix.metadata.build == 'windows-gnu' }} + shell: bash + run: | + sudo apt install -y mingw-w64 + - name: Install Windows-GNU target + if: ${{ matrix.metadata.build == 'windows-gnu' }} + shell: bash + run: | + rustup target add x86_64-pc-windows-gnu + - name: Install Windows 10 SDK with xwin + if: ${{ matrix.metadata.build == 'windows-gnu' }} + shell: bash + run: | + mkdir -p /tmp/xwin + mkdir -p /tmp/xwindownload + mkdir -p /tmp/xwincache + git clone https://github.com/wasmerio/xwin --depth=1 /tmp/xwin + cargo build --release --manifest-path=/tmp/xwin/Cargo.toml + /tmp/xwin/target/release/xwin --accept-license --cache-dir /tmp/xwincache splat --output /tmp/xwindownload + mkdir -p /tmp/winsdk + cp /tmp/xwindownload/sdk/lib/10.0.20348/um/x86_64/WS2_32.lib /tmp/winsdk/ + cp /tmp/xwindownload/sdk/lib/10.0.20348/um/x86_64/KERNEL32.lib /tmp/winsdk/ + cp /tmp/xwindownload/sdk/lib/10.0.20348/um/x86_64/BCRYPT.lib /tmp/winsdk/ + cp /tmp/xwindownload/sdk/lib/10.0.20348/um/x86_64/ADVAPI32.lib /tmp/winsdk/ + cp /tmp/xwindownload/sdk/lib/10.0.20348/um/x86_64/USERENV.lib /tmp/winsdk/ + echo "WinSDK files:" + ls -laH /tmp/winsdk + echo "" + mkdir -p package + mkdir -p package/winsdk + cp -r /tmp/winsdk/* package/winsdk + - name: Install LLVM (macOS Apple Silicon) + if: matrix.metadata.os == 'macos-12' && !matrix.metadata.llvm_url + run: | + brew install llvm + - name: Install LLVM + shell: bash + if: matrix.metadata.llvm_url + run: | + curl --proto '=https' --tlsv1.2 -sSf ${{ matrix.metadata.llvm_url }} -L -o llvm.tar.xz + LLVM_DIR=$(pwd)/${{ env.LLVM_DIR }} + mkdir ${LLVM_DIR} + tar xf llvm.tar.xz --strip-components=1 -C ${LLVM_DIR} + echo "ENABLE_LLVM=1" >> $GITHUB_ENV + echo "${LLVM_DIR}/bin" >> $GITHUB_PATH + echo "${LLVM_DIR}/usr/bin" >> $GITHUB_PATH + echo "LLVM_SYS_180_PREFIX=${LLVM_DIR}" >> $GITHUB_ENV + env: + LLVM_DIR: .llvm + - name: Add `brew` libs to `RUSTFLAGS` + if: matrix.metadata.os == 'macos-14' + shell: bash + run: | + echo "RUSTFLAGS=-L/opt/homebrew/lib" >> $GITHUB_ENV + - name: Setup Rust target + shell: bash + run: | + mkdir -p .cargo + cat << EOF > .cargo/config.toml + [build] + target = "${{ matrix.metadata.target }}" + EOF + if: matrix.metadata.target + - name: which cargo + if: ${{ matrix.build-what.key == 'capi' && matrix.metadata.build == 'windows-x64' }} + run: which cargo + - name: Set cargo env + run: echo "CARGO_ROOT_DIR=$(dirname $(dirname $( which cargo )))" >> $GITHUB_ENV + - name: List root dir + shell: bash + if: ${{ matrix.build-what.key == 'capi' && matrix.metadata.build == 'windows-x64' }} + run: ls -R $CARGO_ROOT_DIR + - name: Cache + uses: whywaita/actions-cache-s3@v2 + with: + path: | + ~/.cargo/* + ./target/* + $CARGO_ROOT_DIR/* + key: r22-${{ github.repository }}-${{ runner.os }}-${{ hashFiles('Cargo.lock') }}-wasmer-make-build-wasmer-${{ matrix.build-what.key }}-${{ matrix.metadata.build }} + aws-s3-bucket: wasmer-rust-artifacts-cache + aws-access-key-id: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_TOKEN }} + aws-secret-access-key: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_KEY }} + aws-region: auto + aws-endpoint: https://1541b1e8a3fc6ad155ce67ef38899700.r2.cloudflarestorage.com + aws-s3-bucket-endpoint: false + aws-s3-force-path-style: true + - name: Build C-API + shell: bash + run: ${{ matrix.build-what.build-cmd }} + if: ${{ matrix.build-what.key == 'capi' }} + env: + TARGET: ${{ matrix.metadata.target }} + TARGET_DIR: target/${{ matrix.metadata.target }}/release + CARGO_TARGET: ${{ matrix.metadata.target }} + - name: Build Wasmer + shell: bash + if: ${{ matrix.build-what.key == 'wasmer' && matrix.metadata.build != 'windows-gnu' }} + run: ${{ matrix.build-what.build-cmd }} + env: + TARGET: ${{ matrix.metadata.target }} + TARGET_DIR: target/${{ matrix.metadata.target }}/release + CARGO_TARGET: ${{ matrix.metadata.target }} + - name: Test C-API + shell: bash + if: ${{ matrix.build-what.key == 'capi' && !(matrix.metadata.build == 'linux-musl' || matrix.metadata.build == 'windows-gnu') }} + run: make test-capi-ci + env: + TARGET: ${{ matrix.metadata.target }} + TARGET_DIR: target/${{ matrix.metadata.target }}/release + CARGO_TARGET: ${{ matrix.metadata.target }} + # C-API tests were disabled for linux-musl and macos-arm (we can't run them) + - name: Test C-API integration + shell: bash + if: ${{ matrix.build-what.key == 'capi' && !(matrix.metadata.build == 'linux-musl' || matrix.metadata.build == 'windows-gnu') }} + run: export WASMER_DIR=`pwd`/package && make test-stage-7-capi-integration-tests + env: + TARGET: ${{ matrix.metadata.target }} + TARGET_DIR: target/${{ matrix.metadata.target }}/release + CARGO_TARGET: ${{ matrix.metadata.target }} + - name: Archive production artifacts + uses: actions/upload-artifact@v4 + with: + name: wasmer-cli-${{ matrix.metadata.build }} + path: build-wasmer.tar.gz + if-no-files-found: ignore + retention-days: 2 + - name: Archive production artifacts + uses: actions/upload-artifact@v4 + with: + name: capi-${{ matrix.metadata.build }} + path: build-capi.tar.gz + if-no-files-found: ignore + retention-days: 2 -# test: -# name: ${{ matrix.stage.description }} on ${{ matrix.metadata.build }} -# runs-on: ${{ matrix.metadata.os }} -# needs: setup -# strategy: -# fail-fast: false -# matrix: -# stage: [ -# { -# description: 'Run wast test suite for all compilers', -# make: 'test-stage-0-wast', -# }, -# { -# description: 'Unit-test packages on std', -# make: 'test-stage-1-test-all', -# }, -# { -# description: 'Unit-test cranelift on no-std', -# make: 'test-stage-2-test-compiler-cranelift-nostd', -# }, -# { -# description: 'Unit-test singlepass on no-std', -# make: 'test-stage-3-test-compiler-singlepass-nostd', -# }, -# { -# description: 'Unit-test wasmer-cli', -# make: 'test-stage-4-wasmer-cli', -# }, -# { -# description: 'Unit-test examples', -# make: 'test-stage-5-test-examples', -# } -# ] -# metadata: [ -# # We cannot test on macos-arm since we don't have ARM runners -# { -# build: linux-x64, -# os: ubuntu-22.04, -# target: x86_64-unknown-linux-gnu, -# exe: '', -# llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-amd64.tar.xz' -# }, -# { -# build: macos-x64, -# os: macos-12, -# target: x86_64-apple-darwin, -# exe: '', -# llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-amd64.tar.xz' + test: + name: ${{ matrix.stage.description }} on ${{ matrix.metadata.build }} + runs-on: ${{ matrix.metadata.os }} + needs: setup + strategy: + fail-fast: false + matrix: + stage: [ + { + description: 'Run wast test suite for all compilers', + make: 'test-stage-0-wast', + }, + { + description: 'Unit-test packages on std', + make: 'test-stage-1-test-all', + }, + { + description: 'Unit-test cranelift on no-std', + make: 'test-stage-2-test-compiler-cranelift-nostd', + }, + { + description: 'Unit-test singlepass on no-std', + make: 'test-stage-3-test-compiler-singlepass-nostd', + }, + { + description: 'Unit-test wasmer-cli', + make: 'test-stage-4-wasmer-cli', + }, + { + description: 'Unit-test examples', + make: 'test-stage-5-test-examples', + } + ] + metadata: [ + # We cannot test on macos-arm since we don't have ARM runners + { + build: linux-x64, + os: ubuntu-22.04, + target: x86_64-unknown-linux-gnu, + exe: '', + llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-amd64.tar.xz' + }, + { + build: macos-x64, + os: macos-12, + target: x86_64-apple-darwin, + exe: '', + llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-amd64.tar.xz' -# }, -# { -# build: macos-arm, -# os: macos-14, -# target: aarch64-apple-darwin, -# exe: '', -# # [todo] xdoardo: Reinstate when the code we generate for aarch64 is working correctly. -# # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-aarch64.tar.xz' -# }, -# { -# build: windows-x64, -# os: windows-2022, -# target: x86_64-pc-windows-msvc, -# exe: '.exe', -# # For now, disable LLVM in `windows-x64.` -# # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-windows-amd64.tar.xz' -# }, -# { -# build: linux-musl, -# target: x86_64-unknown-linux-musl, -# os: ubuntu-22.04, -# exe: '', -# container: 'alpine:latest' -# } -# ] -# container: ${{ matrix.metadata.container }} -# env: -# SCCACHE_AZURE_BLOB_CONTAINER: wasmerstoragesccacheblob -# SCCACHE_AZURE_CONNECTION_STRING: ${{ secrets.SCCACHE_AZURE_CONNECTION_STRING }} -# steps: -# - uses: actions/checkout@v3 -# - name: Set up libstdc++ on Linux -# if: matrix.metadata.build == 'linux-x64' -# run: | -# sudo apt-get update -y -# sudo apt-get install -y --allow-downgrades libstdc++6 -# sudo apt-get install --reinstall g++ -# - name: Set up base deps on musl -# if: matrix.metadata.build == 'linux-musl' -# run: ./scripts/alpine-linux-install-deps.sh -# - name: Install MSVC dev-cmd (Windows) -# uses: ilammy/msvc-dev-cmd@v1 -# if: ${{ matrix.metadata.build == 'windows-x64' }} -# - name: Delete unwanted link to stop it from interfering (Windows) -# shell: bash -# run: rm /usr/bin/link.exe -# if: ${{ matrix.metadata.build == 'windows-x64' }} + }, + { + build: macos-arm, + os: macos-14, + target: aarch64-apple-darwin, + exe: '', + # [todo] xdoardo: Reinstate when the code we generate for aarch64 is working correctly. + # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-darwin-aarch64.tar.xz' + }, + { + build: windows-x64, + os: windows-2022, + target: x86_64-pc-windows-msvc, + exe: '.exe', + # For now, disable LLVM in `windows-x64.` + # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-windows-amd64.tar.xz' + }, + { + build: linux-musl, + target: x86_64-unknown-linux-musl, + os: ubuntu-22.04, + exe: '', + container: 'alpine:latest' + } + ] + container: ${{ matrix.metadata.container }} + env: + SCCACHE_AZURE_BLOB_CONTAINER: wasmerstoragesccacheblob + SCCACHE_AZURE_CONNECTION_STRING: ${{ secrets.SCCACHE_AZURE_CONNECTION_STRING }} + steps: + - uses: actions/checkout@v3 + - name: Set up libstdc++ on Linux + if: matrix.metadata.build == 'linux-x64' + run: | + sudo apt-get update -y + sudo apt-get install -y --allow-downgrades libstdc++6 + sudo apt-get install --reinstall g++ + - name: Set up base deps on musl + if: matrix.metadata.build == 'linux-musl' + run: ./scripts/alpine-linux-install-deps.sh + - name: Install MSVC dev-cmd (Windows) + uses: ilammy/msvc-dev-cmd@v1 + if: ${{ matrix.metadata.build == 'windows-x64' }} + - name: Delete unwanted link to stop it from interfering (Windows) + shell: bash + run: rm /usr/bin/link.exe + if: ${{ matrix.metadata.build == 'windows-x64' }} -# - name: Set up dependencies for Mac OS -# run: | -# brew install automake -# # using gnu-tar is a workaround for https://github.com/actions/cache/issues/403 -# brew install gnu-tar -# echo PATH="/usr/local/opt/gnu-tar/libexec/gnubin:$PATH" >> $GITHUB_ENV -# if: matrix.metadata.os == 'macos-12' -# - name: Install Rust -# uses: dtolnay/rust-toolchain@stable -# with: -# toolchain: ${{ env.MSRV }} -# target: ${{ matrix.metadata.target }} -# - name: Install Nextest -# uses: taiki-e/install-action@nextest -# - name: Install LLVM (macOS Apple Silicon) -# if: matrix.metadata.os == 'macos-12' && !matrix.metadata.llvm_url -# run: | -# brew install llvm -# - name: Install LLVM -# shell: bash -# if: matrix.metadata.llvm_url -# run: | -# curl --proto '=https' --tlsv1.2 -sSf ${{ matrix.metadata.llvm_url }} -L -o llvm.tar.xz -# LLVM_DIR=$(pwd)/${{ env.LLVM_DIR }} -# mkdir ${LLVM_DIR} -# tar xf llvm.tar.xz --strip-components=1 -C ${LLVM_DIR} -# echo "${LLVM_DIR}/bin" >> $GITHUB_PATH -# echo "${LLVM_DIR}/usr/bin" >> $GITHUB_PATH -# echo "LLVM_SYS_180_PREFIX=${LLVM_DIR}" >> $GITHUB_ENV -# echo "ENABLE_LLVM=1" >> $GITHUB_ENV -# env: -# LLVM_DIR: .llvm -# - name: Add `brew` libs to `RUSTFLAGS` -# if: matrix.metadata.os == 'macos-14' -# shell: bash -# run: | -# echo "RUSTFLAGS=-L/opt/homebrew/lib" >> $GITHUB_ENV -# - name: Setup Rust target -# shell: bash -# run: | -# mkdir -p .cargo -# cat << EOF > .cargo/config.toml -# [build] -# target = "${{ matrix.metadata.target }}" -# EOF -# if: matrix.metadata.target -# - name: Cache -# uses: whywaita/actions-cache-s3@v2 -# with: -# path: | -# ~/.cargo/* -# ./target/* -# key: r22-${{ github.repository }}-${{ runner.os }}-${{ hashFiles('Cargo.lock') }}-wasmer-make-test-stage-${{ matrix.stage.make }}-${{ matrix.metadata.build }} -# aws-s3-bucket: wasmer-rust-artifacts-cache -# aws-access-key-id: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_TOKEN }} -# aws-secret-access-key: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_KEY }} -# aws-region: auto -# aws-endpoint: https://1541b1e8a3fc6ad155ce67ef38899700.r2.cloudflarestorage.com -# aws-s3-bucket-endpoint: false -# aws-s3-force-path-style: true -# - name: ${{ matrix.stage.description }} -# shell: bash -# run: make ${{ matrix.stage.make }} -# env: -# TARGET: ${{ matrix.metadata.target }} -# TARGET_DIR: target/${{ matrix.metadata.target }}/release -# CARGO_TARGET: ${{ matrix.metadata.target }} + - name: Set up dependencies for Mac OS + run: | + brew install automake + # using gnu-tar is a workaround for https://github.com/actions/cache/issues/403 + brew install gnu-tar + echo PATH="/usr/local/opt/gnu-tar/libexec/gnubin:$PATH" >> $GITHUB_ENV + if: matrix.metadata.os == 'macos-12' + - name: Install Rust + uses: dtolnay/rust-toolchain@stable + with: + toolchain: ${{ env.MSRV }} + target: ${{ matrix.metadata.target }} + - name: Install Nextest + uses: taiki-e/install-action@nextest + - name: Install LLVM (macOS Apple Silicon) + if: matrix.metadata.os == 'macos-12' && !matrix.metadata.llvm_url + run: | + brew install llvm + - name: Install LLVM + shell: bash + if: matrix.metadata.llvm_url + run: | + curl --proto '=https' --tlsv1.2 -sSf ${{ matrix.metadata.llvm_url }} -L -o llvm.tar.xz + LLVM_DIR=$(pwd)/${{ env.LLVM_DIR }} + mkdir ${LLVM_DIR} + tar xf llvm.tar.xz --strip-components=1 -C ${LLVM_DIR} + echo "${LLVM_DIR}/bin" >> $GITHUB_PATH + echo "${LLVM_DIR}/usr/bin" >> $GITHUB_PATH + echo "LLVM_SYS_180_PREFIX=${LLVM_DIR}" >> $GITHUB_ENV + echo "ENABLE_LLVM=1" >> $GITHUB_ENV + env: + LLVM_DIR: .llvm + - name: Add `brew` libs to `RUSTFLAGS` + if: matrix.metadata.os == 'macos-14' + shell: bash + run: | + echo "RUSTFLAGS=-L/opt/homebrew/lib" >> $GITHUB_ENV + - name: Setup Rust target + shell: bash + run: | + mkdir -p .cargo + cat << EOF > .cargo/config.toml + [build] + target = "${{ matrix.metadata.target }}" + EOF + if: matrix.metadata.target + - name: Cache + uses: whywaita/actions-cache-s3@v2 + with: + path: | + ~/.cargo/* + ./target/* + key: r22-${{ github.repository }}-${{ runner.os }}-${{ hashFiles('Cargo.lock') }}-wasmer-make-test-stage-${{ matrix.stage.make }}-${{ matrix.metadata.build }} + aws-s3-bucket: wasmer-rust-artifacts-cache + aws-access-key-id: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_TOKEN }} + aws-secret-access-key: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_KEY }} + aws-region: auto + aws-endpoint: https://1541b1e8a3fc6ad155ce67ef38899700.r2.cloudflarestorage.com + aws-s3-bucket-endpoint: false + aws-s3-force-path-style: true + - name: ${{ matrix.stage.description }} + shell: bash + run: make ${{ matrix.stage.make }} + env: + TARGET: ${{ matrix.metadata.target }} + TARGET_DIR: target/${{ matrix.metadata.target }}/release + CARGO_TARGET: ${{ matrix.metadata.target }} -# test_integration_cli: -# name: CLI integration tests on ${{ matrix.build }} -# runs-on: ${{ matrix.os }} -# needs: [build, build_linux_aarch64, build_linux_riscv64] -# strategy: -# fail-fast: false -# matrix: -# include: -# - build: linux-x64 -# os: ubuntu-22.04 -# target: x86_64-unknown-linux-gnu -# llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-amd64.tar.xz' -# - build: macos-x64 -# os: macos-12 -# target: x86_64-apple-darwin -# # we only build the integration-test CLI, we don't run tests -# - build: macos-arm -# os: macos-12 -# target: aarch64-apple-darwin, -# - build: linux-musl -# target: x86_64-unknown-linux-musl -# os: ubuntu-22.04 -# container: alpine:latest -# - build: windows-x64 -# os: windows-2019 -# target: x86_64-pc-windows-msvc -# # For now, disable LLVM in `windows-x64.` -# # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-windows-amd64.tar.xz' + test_integration_cli: + name: CLI integration tests on ${{ matrix.build }} + runs-on: ${{ matrix.os }} + needs: [build, build_linux_aarch64, build_linux_riscv64] + strategy: + fail-fast: false + matrix: + include: + - build: linux-x64 + os: ubuntu-22.04 + target: x86_64-unknown-linux-gnu + llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-linux-amd64.tar.xz' + - build: macos-x64 + os: macos-12 + target: x86_64-apple-darwin + # we only build the integration-test CLI, we don't run tests + - build: macos-arm + os: macos-12 + target: aarch64-apple-darwin, + - build: linux-musl + target: x86_64-unknown-linux-musl + os: ubuntu-22.04 + container: alpine:latest + - build: windows-x64 + os: windows-2019 + target: x86_64-pc-windows-msvc + # For now, disable LLVM in `windows-x64.` + # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/18.x/llvm-windows-amd64.tar.xz' -# container: ${{ matrix.container }} -# env: -# SCCACHE_AZURE_BLOB_CONTAINER: wasmerstoragesccacheblob -# SCCACHE_AZURE_CONNECTION_STRING: ${{ secrets.SCCACHE_AZURE_CONNECTION_STRING }} -# steps: -# - uses: actions/checkout@v3 -# - uses: goto-bus-stop/setup-zig@v2 -# with: -# version: 0.10.0 -# - name: Set up base deps on musl -# if: matrix.build == 'linux-musl' -# run: ./scripts/alpine-linux-install-deps.sh -# - uses: actions/download-artifact@v4 -# id: download -# with: -# name: capi-${{ matrix.build }} -# - uses: actions/download-artifact@v4 -# with: -# name: wasmer-cli-${{ matrix.build }} -# - name: 'Echo download path' -# run: echo ${{steps.download.outputs.download-path}} -# - name: Install Rust -# uses: dtolnay/rust-toolchain@stable -# with: -# toolchain: ${{ env.MSRV }} -# target: ${{ matrix.metadata.target }} -# - name: Install Nextest -# uses: taiki-e/install-action@nextest -# - name: Cache -# uses: whywaita/actions-cache-s3@v2 -# with: -# path: | -# ~/.cargo/* -# ./target/* -# key: r22-${{ github.repository }}-${{ runner.os }}-${{ hashFiles('Cargo.lock') }}-wasmer-make-test-integration-cli-${{ matrix.build }} -# aws-s3-bucket: wasmer-rust-artifacts-cache -# aws-access-key-id: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_TOKEN }} -# aws-secret-access-key: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_KEY }} -# aws-region: auto -# aws-endpoint: https://1541b1e8a3fc6ad155ce67ef38899700.r2.cloudflarestorage.com -# aws-s3-bucket-endpoint: false -# aws-s3-force-path-style: true -# - name: Prepare package directory -# shell: bash -# run: | -# mkdir -p package -# mkdir -p package/cache -# - uses: actions/download-artifact@v4 -# with: -# name: capi-linux-aarch64 -# path: package/cache/wasmercache1 -# - uses: actions/download-artifact@v4 -# with: -# name: capi-windows-x64 -# path: package/cache/wasmercache2 -# - uses: actions/download-artifact@v4 -# with: -# name: capi-macos-arm -# path: package/cache/wasmercache3 -# - uses: actions/download-artifact@v4 -# with: -# name: capi-macos-x64 -# path: package/cache/wasmercache4 -# - uses: actions/download-artifact@v4 -# with: -# name: capi-linux-x64 -# path: package/cache/wasmercache5 -# - uses: actions/download-artifact@v4 -# with: -# name: capi-linux-riscv64 -# path: package/cache/wasmercache6 -# - name: Copy .tar.gz files to proper location -# shell: bash -# run: | -# ls package/cache/wasmercache1 -# ls package/cache/wasmercache2 -# ls package/cache/wasmercache3 -# ls package/cache/wasmercache4 -# ls package/cache/wasmercache5 -# cp package/cache/wasmercache1/wasmer.tar.gz package/cache/wasmer-linux-aarch64.tar.gz -# cp package/cache/wasmercache2/build-capi.tar.gz package/cache/wasmer-windows-gnu64.tar.gz -# cp package/cache/wasmercache3/build-capi.tar.gz package/cache/wasmer-darwin-arm64.tar.gz -# cp package/cache/wasmercache4/build-capi.tar.gz package/cache/wasmer-darwin-amd64.tar.gz -# cp package/cache/wasmercache5/build-capi.tar.gz package/cache/wasmer-linux-amd64.tar.gz -# cp package/cache/wasmercache6/wasmer.tar.gz package/cache/wasmer-linux-riscv64.tar.gz -# - uses: actions/download-artifact@v4 -# if: ${{ matrix.build == 'windows-x64' }} -# with: -# name: capi-windows-x64 -# path: download_link -# - uses: actions/download-artifact@v4 -# if: ${{ matrix.build == 'linux-musl' }} -# with: -# name: capi-linux-musl -# path: download_link -# - uses: actions/download-artifact@v4 -# if: ${{ matrix.build == 'macos-arm' }} -# with: -# name: capi-macos-arm -# path: download_link -# - uses: actions/download-artifact@v4 -# if: ${{ matrix.build == 'macos-x64' }} -# with: -# name: capi-macos-x64 -# path: download_link -# - uses: actions/download-artifact@v4 -# if: ${{ matrix.build == 'linux-x64' }} -# with: -# name: capi-linux-x64 -# path: download_link -# - name: Copy build-capi.tar.gz to link.tar.gz -# shell: bash -# run: | -# cp download_link/build-capi.tar.gz link.tar.gz -# - name: Unzip Artifacts -# shell: bash -# run: | -# make untar-capi -# - name: Unzip Artifacts -# shell: bash -# run: | -# make untar-wasmer + container: ${{ matrix.container }} + env: + SCCACHE_AZURE_BLOB_CONTAINER: wasmerstoragesccacheblob + SCCACHE_AZURE_CONNECTION_STRING: ${{ secrets.SCCACHE_AZURE_CONNECTION_STRING }} + steps: + - uses: actions/checkout@v3 + - uses: goto-bus-stop/setup-zig@v2 + with: + version: 0.10.0 + - name: Set up base deps on musl + if: matrix.build == 'linux-musl' + run: ./scripts/alpine-linux-install-deps.sh + - uses: actions/download-artifact@v4 + id: download + with: + name: capi-${{ matrix.build }} + - uses: actions/download-artifact@v4 + with: + name: wasmer-cli-${{ matrix.build }} + - name: 'Echo download path' + run: echo ${{steps.download.outputs.download-path}} + - name: Install Rust + uses: dtolnay/rust-toolchain@stable + with: + toolchain: ${{ env.MSRV }} + target: ${{ matrix.metadata.target }} + - name: Install Nextest + uses: taiki-e/install-action@nextest + - name: Cache + uses: whywaita/actions-cache-s3@v2 + with: + path: | + ~/.cargo/* + ./target/* + key: r22-${{ github.repository }}-${{ runner.os }}-${{ hashFiles('Cargo.lock') }}-wasmer-make-test-integration-cli-${{ matrix.build }} + aws-s3-bucket: wasmer-rust-artifacts-cache + aws-access-key-id: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_TOKEN }} + aws-secret-access-key: ${{ secrets.CLOUDFLARE_ARTIFACTS_CACHE_ACCESS_KEY }} + aws-region: auto + aws-endpoint: https://1541b1e8a3fc6ad155ce67ef38899700.r2.cloudflarestorage.com + aws-s3-bucket-endpoint: false + aws-s3-force-path-style: true + - name: Prepare package directory + shell: bash + run: | + mkdir -p package + mkdir -p package/cache + - uses: actions/download-artifact@v4 + with: + name: capi-linux-aarch64 + path: package/cache/wasmercache1 + - uses: actions/download-artifact@v4 + with: + name: capi-windows-x64 + path: package/cache/wasmercache2 + - uses: actions/download-artifact@v4 + with: + name: capi-macos-arm + path: package/cache/wasmercache3 + - uses: actions/download-artifact@v4 + with: + name: capi-macos-x64 + path: package/cache/wasmercache4 + - uses: actions/download-artifact@v4 + with: + name: capi-linux-x64 + path: package/cache/wasmercache5 + - uses: actions/download-artifact@v4 + with: + name: capi-linux-riscv64 + path: package/cache/wasmercache6 + - name: Copy .tar.gz files to proper location + shell: bash + run: | + ls package/cache/wasmercache1 + ls package/cache/wasmercache2 + ls package/cache/wasmercache3 + ls package/cache/wasmercache4 + ls package/cache/wasmercache5 + cp package/cache/wasmercache1/wasmer.tar.gz package/cache/wasmer-linux-aarch64.tar.gz + cp package/cache/wasmercache2/build-capi.tar.gz package/cache/wasmer-windows-gnu64.tar.gz + cp package/cache/wasmercache3/build-capi.tar.gz package/cache/wasmer-darwin-arm64.tar.gz + cp package/cache/wasmercache4/build-capi.tar.gz package/cache/wasmer-darwin-amd64.tar.gz + cp package/cache/wasmercache5/build-capi.tar.gz package/cache/wasmer-linux-amd64.tar.gz + cp package/cache/wasmercache6/wasmer.tar.gz package/cache/wasmer-linux-riscv64.tar.gz + - uses: actions/download-artifact@v4 + if: ${{ matrix.build == 'windows-x64' }} + with: + name: capi-windows-x64 + path: download_link + - uses: actions/download-artifact@v4 + if: ${{ matrix.build == 'linux-musl' }} + with: + name: capi-linux-musl + path: download_link + - uses: actions/download-artifact@v4 + if: ${{ matrix.build == 'macos-arm' }} + with: + name: capi-macos-arm + path: download_link + - uses: actions/download-artifact@v4 + if: ${{ matrix.build == 'macos-x64' }} + with: + name: capi-macos-x64 + path: download_link + - uses: actions/download-artifact@v4 + if: ${{ matrix.build == 'linux-x64' }} + with: + name: capi-linux-x64 + path: download_link + - name: Copy build-capi.tar.gz to link.tar.gz + shell: bash + run: | + cp download_link/build-capi.tar.gz link.tar.gz + - name: Unzip Artifacts + shell: bash + run: | + make untar-capi + - name: Unzip Artifacts + shell: bash + run: | + make untar-wasmer -# # Removed in favour of freestanding integration tests -# # -# # - name: Test integration CLI -# # if: false # matrix.build != 'macos-arm' -# # shell: bash -# # run: | -# # export WASMER_PATH=`pwd`/target/${{ matrix.target }}/release/wasmer${{ matrix.exe }} -# # export WASMER_DIR=`pwd`/package && make test-integration-cli-ci -# # env: -# # TARGET: ${{ matrix.target }} -# # TARGET_DIR: target/${{ matrix.target }}/release -# # CARGO_TARGET: ${{ matrix.target }} -# # WAPM_DEV_TOKEN: ${{ secrets.WAPM_DEV_TOKEN }} -# # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # Removed in favour of freestanding integration tests + # + # - name: Test integration CLI + # if: false # matrix.build != 'macos-arm' + # shell: bash + # run: | + # export WASMER_PATH=`pwd`/target/${{ matrix.target }}/release/wasmer${{ matrix.exe }} + # export WASMER_DIR=`pwd`/package && make test-integration-cli-ci + # env: + # TARGET: ${{ matrix.target }} + # TARGET_DIR: target/${{ matrix.target }}/release + # CARGO_TARGET: ${{ matrix.target }} + # WAPM_DEV_TOKEN: ${{ secrets.WAPM_DEV_TOKEN }} + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} -# # ---- -# # Note (xdoardo on 2024/10/07): -# # --- -# # As of now the WAMR, WASMI (and V8) backends are not that mature enough. We will re-enable these tests -# # when they've been used and matured. -# # ---- -# # -# # - name: Test CLI integration (WAMR) -# # shell: bash -# # run: | -# # export WASMER_PATH=`pwd`/target/${{ matrix.target }}/release/wasmer${{ matrix.exe }} -# # export WASMER_DIR=`pwd`/package && make test-integration-cli-wamr-ci -# # env: -# # TARGET: ${{ matrix.target }} -# # TARGET_DIR: target/${{ matrix.target }}/release -# # CARGO_TARGET: ${{ matrix.target }} -# # WAPM_DEV_TOKEN: ${{ secrets.WAPM_DEV_TOKEN }} -# # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # ---- + # Note (xdoardo on 2024/10/07): + # --- + # As of now the WAMR, WASMI (and V8) backends are not that mature enough. We will re-enable these tests + # when they've been used and matured. + # ---- + # + # - name: Test CLI integration (WAMR) + # shell: bash + # run: | + # export WASMER_PATH=`pwd`/target/${{ matrix.target }}/release/wasmer${{ matrix.exe }} + # export WASMER_DIR=`pwd`/package && make test-integration-cli-wamr-ci + # env: + # TARGET: ${{ matrix.target }} + # TARGET_DIR: target/${{ matrix.target }}/release + # CARGO_TARGET: ${{ matrix.target }} + # WAPM_DEV_TOKEN: ${{ secrets.WAPM_DEV_TOKEN }} + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} -# # - name: Test CLI integration (WASMI) -# # shell: bash -# # run: | -# # export WASMER_PATH=`pwd`/target/${{ matrix.target }}/release/wasmer${{ matrix.exe }} -# # export WASMER_DIR=`pwd`/package && make test-integration-cli-wasmi-ci -# # env: -# # TARGET: ${{ matrix.target }} -# # TARGET_DIR: target/${{ matrix.target }}/release -# # CARGO_TARGET: ${{ matrix.target }} -# # WAPM_DEV_TOKEN: ${{ secrets.WAPM_DEV_TOKEN }} -# # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # - name: Test CLI integration (WASMI) + # shell: bash + # run: | + # export WASMER_PATH=`pwd`/target/${{ matrix.target }}/release/wasmer${{ matrix.exe }} + # export WASMER_DIR=`pwd`/package && make test-integration-cli-wasmi-ci + # env: + # TARGET: ${{ matrix.target }} + # TARGET_DIR: target/${{ matrix.target }}/release + # CARGO_TARGET: ${{ matrix.target }} + # WAPM_DEV_TOKEN: ${{ secrets.WAPM_DEV_TOKEN }} + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} -# # there is another set of integration tests in 'wasmer-integration-tests' repo. Run those -# test-wasmer-integration-tests: -# needs: [build] -# runs-on: ubuntu-22.04 -# steps: -# - name: Checkout wasmer-integration-tests repository -# uses: actions/checkout@v3 -# with: -# repository: wasmerio/wasmer-integration-tests -# submodules: true -# token: ${{ secrets.CLONE_WASMER_INTEGRATION_TESTS }} -# - uses: actions/download-artifact@v4 -# with: -# name: wasmer-cli-linux-x64 -# - name: Cargo Registry Cache -# uses: actions/cache@v3 -# with: -# path: | -# ~/.cargo/advisory-db -# ~/.cargo/git -# ~/.cargo/registry -# key: cargo-registry-${{ hashFiles('**/Cargo.lock') }} -# - name: Cargo target cache -# uses: actions/cache@v3 -# with: -# path: | -# target/ -# key: cargo-release-${{ hashFiles('**/Cargo.lock') }} -# - run: | -# # install rust toolchain -# curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y -# . "$HOME/.cargo/env" + # there is another set of integration tests in 'wasmer-integration-tests' repo. Run those + test-wasmer-integration-tests: + needs: [build] + runs-on: ubuntu-22.04 + steps: + - name: Checkout wasmer-integration-tests repository + uses: actions/checkout@v3 + with: + repository: wasmerio/wasmer-integration-tests + submodules: true + token: ${{ secrets.CLONE_WASMER_INTEGRATION_TESTS }} + - uses: actions/download-artifact@v4 + with: + name: wasmer-cli-linux-x64 + - name: Cargo Registry Cache + uses: actions/cache@v3 + with: + path: | + ~/.cargo/advisory-db + ~/.cargo/git + ~/.cargo/registry + key: cargo-registry-${{ hashFiles('**/Cargo.lock') }} + - name: Cargo target cache + uses: actions/cache@v3 + with: + path: | + target/ + key: cargo-release-${{ hashFiles('**/Cargo.lock') }} + - run: | + # install rust toolchain + curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y + . "$HOME/.cargo/env" -# # add wasmer cli to PATH -# tar -xzf build-wasmer.tar.gz + # add wasmer cli to PATH + tar -xzf build-wasmer.tar.gz -# docker build -t tmp . -# docker run -v $PWD:/app -w /app tmp bash -c " \ -# cp ./bin/wasmer /root/.wasmer/bin/wasmer &&\ -# export MYSQL_HOST='${{ vars.INTEGRATION_TEST_MYSQL_HOST }}' &&\ -# export MYSQL_DBNAME='${{ vars.INTEGRATION_TEST_MYSQL_DBNAME }}' &&\ -# export MYSQL_USERNAME='${{ secrets.INTEGRATION_TEST_MYSQL_USERNAME }}' &&\ -# export MYSQL_PASSWORD='${{ secrets.INTEGRATION_TEST_MYSQL_PASSWORD }}' &&\ -# export MYSQL_PORT='${{ vars.INTEGRATION_TEST_MYSQL_PORT }}' &&\ -# export MYSQL_CERT='${{ secrets.INTEGRATION_TEST_MYSQL_CERT }}' &&\ -# export PG_HOST='${{ vars.INTEGRATION_TEST_PG_HOST }}' &&\ -# export PG_DBNAME='${{ vars.INTEGRATION_TEST_PG_DBNAME }}' &&\ -# export PG_USERNAME='${{ secrets.INTEGRATION_TEST_PG_USERNAME }}' &&\ -# export PG_PASSWORD='${{ secrets.INTEGRATION_TEST_PG_PASSWORD }}' &&\ -# export PG_PORT='${{ vars.INTEGRATION_TEST_PG_PORT }}' &&\ -# wasmer config set registry.url https://registry.wasmer.io/graphql &&\ -# wasmer login '${{ secrets.WAPM_PROD_TOKEN }}' &&\ -# wasmer config set registry.url https://registry.wasmer.wtf/graphql &&\ -# wasmer login '${{ secrets.WAPM_DEV_TOKEN }}' &&\ -# cargo test --no-fail-fast" -# - name: notify failure in slack -# if: failure() -# run: | -# curl -X POST -H 'Content-type: application/json' --data '{"text":"Integration tests failed ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"}' ${{ secrets.INTEGRATION_TEST_SLACK_WEBHOOK }} + docker build -t tmp . + docker run -v $PWD:/app -w /app tmp bash -c " \ + cp ./bin/wasmer /root/.wasmer/bin/wasmer &&\ + export MYSQL_HOST='${{ vars.INTEGRATION_TEST_MYSQL_HOST }}' &&\ + export MYSQL_DBNAME='${{ vars.INTEGRATION_TEST_MYSQL_DBNAME }}' &&\ + export MYSQL_USERNAME='${{ secrets.INTEGRATION_TEST_MYSQL_USERNAME }}' &&\ + export MYSQL_PASSWORD='${{ secrets.INTEGRATION_TEST_MYSQL_PASSWORD }}' &&\ + export MYSQL_PORT='${{ vars.INTEGRATION_TEST_MYSQL_PORT }}' &&\ + export MYSQL_CERT='${{ secrets.INTEGRATION_TEST_MYSQL_CERT }}' &&\ + export PG_HOST='${{ vars.INTEGRATION_TEST_PG_HOST }}' &&\ + export PG_DBNAME='${{ vars.INTEGRATION_TEST_PG_DBNAME }}' &&\ + export PG_USERNAME='${{ secrets.INTEGRATION_TEST_PG_USERNAME }}' &&\ + export PG_PASSWORD='${{ secrets.INTEGRATION_TEST_PG_PASSWORD }}' &&\ + export PG_PORT='${{ vars.INTEGRATION_TEST_PG_PORT }}' &&\ + wasmer config set registry.url https://registry.wasmer.io/graphql &&\ + wasmer login '${{ secrets.WAPM_PROD_TOKEN }}' &&\ + wasmer config set registry.url https://registry.wasmer.wtf/graphql &&\ + wasmer login '${{ secrets.WAPM_DEV_TOKEN }}' &&\ + cargo test --no-fail-fast" + - name: notify failure in slack + if: failure() + run: | + curl -X POST -H 'Content-type: application/json' --data '{"text":"Integration tests failed ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"}' ${{ secrets.INTEGRATION_TEST_SLACK_WEBHOOK }} diff --git a/.github/workflows/wasmer-config.yaml b/.github/workflows/wasmer-config.yaml index 90a36b31efd..9091574b1e3 100644 --- a/.github/workflows/wasmer-config.yaml +++ b/.github/workflows/wasmer-config.yaml @@ -1,54 +1,54 @@ -# # Dedicated workflow just for the wasmer-config crate -# name: wasmer-config +# Dedicated workflow just for the wasmer-config crate +name: wasmer-config -# on: -# push: -# branches: -# - main -# pull_request: +on: + push: + branches: + - main + pull_request: -# # Automatically cancel previous workflow runs when a new commit is pushed. -# concurrency: -# group: ${{ github.workflow }}-${{ github.ref }} -# cancel-in-progress: true +# Automatically cancel previous workflow runs when a new commit is pushed. +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true -# env: -# DEFAULT_CRATE_NAME: wasmer_toml +env: + DEFAULT_CRATE_NAME: wasmer_toml -# jobs: -# check: -# name: Compile and Test -# runs-on: ubuntu-latest -# steps: -# - uses: actions/checkout@v2 -# - name: Rust Cache -# uses: Swatinem/rust-cache@v2 -# - name: Setup Rust -# uses: dsherret/rust-toolchain-file@v1 -# - name: Install Nextest -# uses: taiki-e/install-action@nextest -# - name: Type Checking -# run: | -# cd lib/config && cargo check --verbose --locked -# - name: Build -# run: | -# cd lib/config && cargo build --verbose --locked -# - name: Test -# run: | -# cd lib/config && cargo nextest run --verbose --locked +jobs: + check: + name: Compile and Test + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Rust Cache + uses: Swatinem/rust-cache@v2 + - name: Setup Rust + uses: dsherret/rust-toolchain-file@v1 + - name: Install Nextest + uses: taiki-e/install-action@nextest + - name: Type Checking + run: | + cd lib/config && cargo check --verbose --locked + - name: Build + run: | + cd lib/config && cargo build --verbose --locked + - name: Test + run: | + cd lib/config && cargo nextest run --verbose --locked -# lints: -# name: Linting and Formatting -# runs-on: ubuntu-latest -# steps: -# - uses: actions/checkout@v2 -# - name: Rust Cache -# uses: Swatinem/rust-cache@v2 -# - name: Setup Rust -# uses: dsherret/rust-toolchain-file@v1 -# - name: Check Formatting -# run: | -# cd lib/config && cargo fmt --verbose --check -# - name: Clippy -# run: | -# cd lib/config && cargo clippy --verbose + lints: + name: Linting and Formatting + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Rust Cache + uses: Swatinem/rust-cache@v2 + - name: Setup Rust + uses: dsherret/rust-toolchain-file@v1 + - name: Check Formatting + run: | + cd lib/config && cargo fmt --verbose --check + - name: Clippy + run: | + cd lib/config && cargo clippy --verbose From 336c5ce81056b1edb5e98b39412f6c22468c751a Mon Sep 17 00:00:00 2001 From: "M.Amin Rayej" Date: Mon, 28 Oct 2024 14:26:23 +0330 Subject: [PATCH 34/39] do not build on PR --- .github/workflows/build.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 693e93ff0fb..fdedd59560f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -12,9 +12,6 @@ on: tags: # this is _not_ a regex, see: https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#filter-pattern-cheat-sheet - '[0-9]+.[0-9]+.[0-9]+*' - pull_request: - branches: - - 'main' workflow_dispatch: inputs: release: From ac34697a9fa382c6620c1cbd0cc3ea4c6c728413 Mon Sep 17 00:00:00 2001 From: "M.Amin Rayej" Date: Mon, 28 Oct 2024 14:40:41 +0330 Subject: [PATCH 35/39] install llvm-config --- .github/workflows/test.yaml | 1 + scripts/alpine-linux-install-deps.sh | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 112367d6beb..51ec873cd94 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -551,6 +551,7 @@ jobs: - name: Set up base deps on musl if: matrix.metadata.build == 'linux-musl' run: ./scripts/alpine-linux-install-deps.sh + echo "LLVM_CONFIG_PATH=/usr/bin/llvm-config-18" >> $GITHUB_ENV - name: Set up dependencies for Mac OS run: | brew install automake diff --git a/scripts/alpine-linux-install-deps.sh b/scripts/alpine-linux-install-deps.sh index baa2d633868..cca17ea4938 100755 --- a/scripts/alpine-linux-install-deps.sh +++ b/scripts/alpine-linux-install-deps.sh @@ -4,4 +4,4 @@ # This script is used by the CI! apk update -apk add build-base bash musl-dev curl tar make libtool libffi-dev gcc automake autoconf git openssl-dev g++ pkgconfig +apk add build-base bash musl-dev curl tar make libtool libffi-dev gcc automake autoconf git openssl-dev g++ pkgconfig llvm18-dev From 5d48d77b64a96079a06ca908f5a238302f3553db Mon Sep 17 00:00:00 2001 From: "M.Amin Rayej" Date: Mon, 28 Oct 2024 14:43:50 +0330 Subject: [PATCH 36/39] fix syntax --- .github/workflows/test.yaml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 51ec873cd94..a6c58a3d5f0 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -550,8 +550,9 @@ jobs: sudo apt-get install --reinstall g++ - name: Set up base deps on musl if: matrix.metadata.build == 'linux-musl' - run: ./scripts/alpine-linux-install-deps.sh - echo "LLVM_CONFIG_PATH=/usr/bin/llvm-config-18" >> $GITHUB_ENV + run: | + ./scripts/alpine-linux-install-deps.sh + echo "LLVM_CONFIG_PATH=/usr/bin/llvm-config-18" >> $GITHUB_ENV - name: Set up dependencies for Mac OS run: | brew install automake From e79f8c4d2bfa5aef45e717ef3bd62000bfa7fe32 Mon Sep 17 00:00:00 2001 From: "M.Amin Rayej" Date: Mon, 28 Oct 2024 14:51:26 +0330 Subject: [PATCH 37/39] update alpine deps --- scripts/alpine-linux-install-deps.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/alpine-linux-install-deps.sh b/scripts/alpine-linux-install-deps.sh index cca17ea4938..d37c0621085 100755 --- a/scripts/alpine-linux-install-deps.sh +++ b/scripts/alpine-linux-install-deps.sh @@ -4,4 +4,4 @@ # This script is used by the CI! apk update -apk add build-base bash musl-dev curl tar make libtool libffi-dev gcc automake autoconf git openssl-dev g++ pkgconfig llvm18-dev +apk add build-base bash musl-dev curl tar make libtool libffi-dev gcc automake autoconf git openssl-dev g++ pkgconfig llvm18-dev clang18-static From 15a7d53ae84682d3403b480c4e33abc8aa561afd Mon Sep 17 00:00:00 2001 From: "M.Amin Rayej" Date: Mon, 28 Oct 2024 15:02:33 +0330 Subject: [PATCH 38/39] install llvm static --- scripts/alpine-linux-install-deps.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/alpine-linux-install-deps.sh b/scripts/alpine-linux-install-deps.sh index d37c0621085..468612d2039 100755 --- a/scripts/alpine-linux-install-deps.sh +++ b/scripts/alpine-linux-install-deps.sh @@ -4,4 +4,4 @@ # This script is used by the CI! apk update -apk add build-base bash musl-dev curl tar make libtool libffi-dev gcc automake autoconf git openssl-dev g++ pkgconfig llvm18-dev clang18-static +apk add build-base bash musl-dev curl tar make libtool libffi-dev gcc automake autoconf git openssl-dev g++ pkgconfig llvm18-dev clang18-static llvm18-static From fe434457fceec88847f9d527ad67d6329afc738c Mon Sep 17 00:00:00 2001 From: "M.Amin Rayej" Date: Mon, 28 Oct 2024 15:15:43 +0330 Subject: [PATCH 39/39] correctly expose llvm config --- .github/workflows/test.yaml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index a6c58a3d5f0..8b1545862e6 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -798,7 +798,9 @@ jobs: sudo apt-get install --reinstall g++ - name: Set up base deps on musl if: matrix.metadata.build == 'linux-musl' - run: ./scripts/alpine-linux-install-deps.sh + run: | + ./scripts/alpine-linux-install-deps.sh + echo "LLVM_CONFIG_PATH=/usr/bin/llvm-config-18" >> $GITHUB_ENV - name: Install MSVC dev-cmd (Windows) uses: ilammy/msvc-dev-cmd@v1 if: ${{ matrix.metadata.build == 'windows-x64' }} @@ -916,7 +918,9 @@ jobs: version: 0.10.0 - name: Set up base deps on musl if: matrix.build == 'linux-musl' - run: ./scripts/alpine-linux-install-deps.sh + run: | + ./scripts/alpine-linux-install-deps.sh + echo "LLVM_CONFIG_PATH=/usr/bin/llvm-config-18" >> $GITHUB_ENV - uses: actions/download-artifact@v4 id: download with: