From 68cf23eeb52ef82846a192689650291e81160306 Mon Sep 17 00:00:00 2001 From: Rudra Arora Date: Mon, 28 Aug 2023 18:09:31 +0100 Subject: [PATCH 1/9] update CI for msvc --- .github/workflows/ci.yml | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ab92e9eeffe1a..3272014fe44be 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,7 +2,7 @@ name: CI on: push: branches: - - '**' + - "**" pull_request: workflow_call: jobs: @@ -22,7 +22,7 @@ jobs: repository: wasix-org/wasix-libc ref: main path: wasix-libc - submodules: 'recursive' + submodules: "recursive" - name: OS Setup (Ubuntu) run: | @@ -86,7 +86,7 @@ jobs: uses: actions-rs/toolchain@v1 if: ${{ !contains(matrix.os, 'windows') }} with: - toolchain: stable + toolchain: stable - name: Download wasix-libc artifact uses: actions/download-artifact@v3 @@ -97,7 +97,7 @@ jobs: uses: actions/checkout@v3 with: path: wasix-rust - submodules: 'recursive' + submodules: "recursive" # Don't clean so downloaded LLVM etc can be reused. clean: false @@ -134,7 +134,7 @@ jobs: if: matrix.arch == 'x86' && contains(matrix.os, 'ubuntu') shell: bash env: - WASIX_NO_UPDATE_REPOS: '1' + WASIX_NO_UPDATE_REPOS: "1" WASIX_COMPONENTS: rust WASIX_RUST_HOST: x86_64-unknown-linux-gnu run: | @@ -167,13 +167,13 @@ jobs: shell: bash if: contains(matrix.os, 'macos-12') && matrix.arch == 'x86' env: - WASIX_NO_UPDATE_REPOS: '1' - GITHUB_ACTIONS: 'false' + WASIX_NO_UPDATE_REPOS: "1" + GITHUB_ACTIONS: "false" WASIX_COMPONENTS: rust WASIX_RUST_HOST: x86_64-apple-darwin run: | cd cargo-wasix - # NOTE: must unset GITHUB_ACTIONS env var, because Rst bootstrap checks for it. + # NOTE: must unset GITHUB_ACTIONS env var, because Rust bootstrap checks for it. # (see bootstrap config.rs) GITHUB_ACTIONS=false WASIX_BUILD_DIR=$GITHUB_WORKSPACE cargo run -- wasix build-toolchain @@ -193,8 +193,8 @@ jobs: shell: bash if: contains(matrix.os, 'macos-12') && matrix.arch == 'aarch64' env: - WASIX_NO_UPDATE_REPOS: '1' - GITHUB_ACTIONS: 'false' + WASIX_NO_UPDATE_REPOS: "1" + GITHUB_ACTIONS: "false" WASIX_COMPONENTS: rust WASIX_RUST_HOST: aarch64-apple-darwin run: | @@ -240,10 +240,10 @@ jobs: continue-on-error: true shell: bash env: - WASIX_NO_UPDATE_REPOS: '1' + WASIX_NO_UPDATE_REPOS: "1" WASIX_COMPONENTS: rust - WASIX_RUST_HOST: x86_64-pc-windows-gnu - # WASIX_RUST_HOST: x86_64-pc-windows-msvc + WASIX_RUST_HOST: x86_64-pc-windows-msvc + # WASIX_RUST_HOST: x86_64-pc-windows-gnu run: | cd cargo-wasix # NOTE: must unset GITHUB_ACTIONS env var, because Rst bootstrap checks for it. @@ -254,9 +254,9 @@ jobs: if: contains(matrix.os, 'windows') && matrix.arch == 'x86' uses: actions/upload-artifact@v3 with: - # name: rust-toolchain-x86_64-pc-windows-msvc - name: rust-toolchain-x86_64-pc-windows-gnu + name: rust-toolchain-x86_64-pc-windows-msvc + # name: rust-toolchain-x86_64-pc-windows-gnu path: | - wasix-rust/build/x86_64-pc-windows-gnu/stage2 - !wasix-rust/build/x86_64-pc-windows-gnu/stage2/lib/rustlib/src - !wasix-rust/build/x86_64-pc-windows-gnu/stage2/lib/rustlib/rustc-src + wasix-rust/build/x86_64-pc-windows-msvc/stage2 + !wasix-rust/build/x86_64-pc-windows-msvc/stage2/lib/rustlib/src + !wasix-rust/build/x86_64-pc-windows-msvc/stage2/lib/rustlib/rustc-src From d13d0a015cf0e7962d1a8dd0b74062e3b1e80663 Mon Sep 17 00:00:00 2001 From: Rudra Arora Date: Tue, 29 Aug 2023 11:50:35 +0100 Subject: [PATCH 2/9] add: explicit host for macOS aarch64 --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3272014fe44be..22ddcb2a838dc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -201,7 +201,7 @@ jobs: cd cargo-wasix # NOTE: must unset GITHUB_ACTIONS env var, because Rst bootstrap checks for it. # (see bootstrap config.rs) - GITHUB_ACTIONS=false WASIX_BUILD_DIR=$GITHUB_WORKSPACE cargo run -- wasix build-toolchain + GITHUB_ACTIONS=false WASIX_BUILD_DIR=$GITHUB_WORKSPACE HOST=aarch64-apple-darwin cargo run -- wasix build-toolchain - name: Archive build output (Mac OS - aarch64) uses: actions/upload-artifact@v3 From 268130fd0f89cb4bd46ef5985b70285fdc97a0ae Mon Sep 17 00:00:00 2001 From: Rudra Arora Date: Tue, 29 Aug 2023 12:18:20 +0100 Subject: [PATCH 3/9] add target for aarch64-apple-darwin --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 22ddcb2a838dc..1356323129a4e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -201,7 +201,7 @@ jobs: cd cargo-wasix # NOTE: must unset GITHUB_ACTIONS env var, because Rst bootstrap checks for it. # (see bootstrap config.rs) - GITHUB_ACTIONS=false WASIX_BUILD_DIR=$GITHUB_WORKSPACE HOST=aarch64-apple-darwin cargo run -- wasix build-toolchain + GITHUB_ACTIONS=false WASIX_BUILD_DIR=$GITHUB_WORKSPACE TARGET=aarch64-apple-darwin cargo run -- wasix build-toolchain - name: Archive build output (Mac OS - aarch64) uses: actions/upload-artifact@v3 From e11958fcbd73d2008e1bdd4bac3c5d0c925ed161 Mon Sep 17 00:00:00 2001 From: Rudra Arora Date: Tue, 29 Aug 2023 12:49:59 +0100 Subject: [PATCH 4/9] update: list out the build folder --- .github/workflows/ci.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1356323129a4e..7077968bdff48 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -201,7 +201,7 @@ jobs: cd cargo-wasix # NOTE: must unset GITHUB_ACTIONS env var, because Rst bootstrap checks for it. # (see bootstrap config.rs) - GITHUB_ACTIONS=false WASIX_BUILD_DIR=$GITHUB_WORKSPACE TARGET=aarch64-apple-darwin cargo run -- wasix build-toolchain + GITHUB_ACTIONS=false WASIX_BUILD_DIR=$GITHUB_WORKSPACE cargo run -- wasix build-toolchain - name: Archive build output (Mac OS - aarch64) uses: actions/upload-artifact@v3 @@ -213,6 +213,11 @@ jobs: !wasix-rust/build/aarch64-apple-darwin/stage2/lib/rustlib/src !wasix-rust/build/aarch64-apple-darwin/stage2/lib/rustlib/rustc-src + - name: Print Build Folder recursively (MacOS - aarch64) + if: contains(matrix.os, 'macos-12') && matrix.arch == 'aarch64' + run: | + ls -lhR $GITHUB_WORKSPACE/wasix-rust/build + # Windows # - name: Install chocolatey deps (Windows) From 3c1da001767fd47d964adb09a0bef446cbb1d08a Mon Sep 17 00:00:00 2001 From: Rudra Arora Date: Tue, 29 Aug 2023 14:25:14 +0100 Subject: [PATCH 5/9] update: upload x86 artifacts in aarch64 macOS --- .github/workflows/ci.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7077968bdff48..95b9fc700088a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -213,6 +213,14 @@ jobs: !wasix-rust/build/aarch64-apple-darwin/stage2/lib/rustlib/src !wasix-rust/build/aarch64-apple-darwin/stage2/lib/rustlib/rustc-src + - name: Archive wasi build output (Mac OS - x86_64) + uses: actions/upload-artifact@v3 + if: contains(matrix.os, 'macos-12') && matrix.arch == 'aarch64' + with: + name: rust-toolchain-wasix-builds-aarch64-apple-darwin + path: | + wasix-rust/build/x86_64-apple-darwin/stage2 + - name: Print Build Folder recursively (MacOS - aarch64) if: contains(matrix.os, 'macos-12') && matrix.arch == 'aarch64' run: | From 6e1567a1a25d946829961b2da902bf2221aa15e9 Mon Sep 17 00:00:00 2001 From: Rudra Arora Date: Wed, 30 Aug 2023 00:51:24 +0100 Subject: [PATCH 6/9] CI: copy wasm* builds from x86 apple to aarch64 --- .github/workflows/ci.yml | 28 ++++++++++------------------ 1 file changed, 10 insertions(+), 18 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 95b9fc700088a..aeced29dd7513 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -203,6 +203,12 @@ jobs: # (see bootstrap config.rs) GITHUB_ACTIONS=false WASIX_BUILD_DIR=$GITHUB_WORKSPACE cargo run -- wasix build-toolchain + - name: Copy wasm* builds from x86_64-apple-darwin to aarch64-apple-darwin + shell: bash + if: contains(matrix.os, 'macos-12') && matrix.arch == 'aarch64' + run: | + cp -r wasix-rust/build/x86_64-apple-darwin/stage2/lib/rustlib/wasm* wasix-rust/build/aarch64-apple-darwin/stage2/lib/rustlib + - name: Archive build output (Mac OS - aarch64) uses: actions/upload-artifact@v3 if: contains(matrix.os, 'macos-12') && matrix.arch == 'aarch64' @@ -213,26 +219,12 @@ jobs: !wasix-rust/build/aarch64-apple-darwin/stage2/lib/rustlib/src !wasix-rust/build/aarch64-apple-darwin/stage2/lib/rustlib/rustc-src - - name: Archive wasi build output (Mac OS - x86_64) - uses: actions/upload-artifact@v3 - if: contains(matrix.os, 'macos-12') && matrix.arch == 'aarch64' - with: - name: rust-toolchain-wasix-builds-aarch64-apple-darwin - path: | - wasix-rust/build/x86_64-apple-darwin/stage2 - - - name: Print Build Folder recursively (MacOS - aarch64) - if: contains(matrix.os, 'macos-12') && matrix.arch == 'aarch64' - run: | - ls -lhR $GITHUB_WORKSPACE/wasix-rust/build - # Windows - # - name: Install chocolatey deps (Windows) - # if: contains(matrix.os, 'windows') && matrix.arch == 'x86' - # shell: bash - # run: - # choco install -y git python3 visualstudio2019community cmake + - name: Install chocolatey deps (Windows) + # if: contains(matrix.os, 'windows') && matrix.arch == 'x86' + shell: bash + run: choco install -y git python3 visualstudio2022community cmake - name: Set up MinGW (Windows) if: contains(matrix.os, 'windows') && matrix.arch == 'x86' From ee29995a9afaaeeccad835e4ea3e973611341eaf Mon Sep 17 00:00:00 2001 From: Rudra Arora Date: Wed, 30 Aug 2023 01:51:12 +0100 Subject: [PATCH 7/9] ci: only install vs2019 --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index aeced29dd7513..765c20584b11e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -224,7 +224,7 @@ jobs: - name: Install chocolatey deps (Windows) # if: contains(matrix.os, 'windows') && matrix.arch == 'x86' shell: bash - run: choco install -y git python3 visualstudio2022community cmake + run: choco install -y visualstudio2019community cmake - name: Set up MinGW (Windows) if: contains(matrix.os, 'windows') && matrix.arch == 'x86' From 3c35245c1e6e828322416aea71b2c6f741d72dde Mon Sep 17 00:00:00 2001 From: Rudra Arora Date: Wed, 30 Aug 2023 03:37:09 +0100 Subject: [PATCH 8/9] ci: run choco only on windows --- .github/workflows/ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 765c20584b11e..945e23d324f6a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -222,8 +222,9 @@ jobs: # Windows - name: Install chocolatey deps (Windows) - # if: contains(matrix.os, 'windows') && matrix.arch == 'x86' + if: contains(matrix.os, 'windows') && matrix.arch == 'x86' shell: bash + continue-on-error: true run: choco install -y visualstudio2019community cmake - name: Set up MinGW (Windows) From 42e3c4cb15b6335bcb7d3e109345b3cf82f3798d Mon Sep 17 00:00:00 2001 From: Rudra Arora Date: Wed, 30 Aug 2023 14:26:49 +0100 Subject: [PATCH 9/9] ci: stopping aarch64 build and choco on windows --- .github/workflows/ci.yml | 69 +++++++++++++++++++++------------------- 1 file changed, 37 insertions(+), 32 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 945e23d324f6a..c7f9634a47719 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -189,43 +189,48 @@ jobs: # Mac - aarch64 - - name: Build (Mac Os, aarch64) - shell: bash - if: contains(matrix.os, 'macos-12') && matrix.arch == 'aarch64' - env: - WASIX_NO_UPDATE_REPOS: "1" - GITHUB_ACTIONS: "false" - WASIX_COMPONENTS: rust - WASIX_RUST_HOST: aarch64-apple-darwin - run: | - cd cargo-wasix - # NOTE: must unset GITHUB_ACTIONS env var, because Rst bootstrap checks for it. - # (see bootstrap config.rs) - GITHUB_ACTIONS=false WASIX_BUILD_DIR=$GITHUB_WORKSPACE cargo run -- wasix build-toolchain + # Not running this on GitHub Actions yet, because the underlying runners use x86_64 and not aarch64. + # This results in a cross-compile, which results in an erroneous build. - - name: Copy wasm* builds from x86_64-apple-darwin to aarch64-apple-darwin - shell: bash - if: contains(matrix.os, 'macos-12') && matrix.arch == 'aarch64' - run: | - cp -r wasix-rust/build/x86_64-apple-darwin/stage2/lib/rustlib/wasm* wasix-rust/build/aarch64-apple-darwin/stage2/lib/rustlib + # TODO: Come back to this and enable it once GitHub Actions supports aarch64 runners. - - name: Archive build output (Mac OS - aarch64) - uses: actions/upload-artifact@v3 - if: contains(matrix.os, 'macos-12') && matrix.arch == 'aarch64' - with: - name: rust-toolchain-aarch64-apple-darwin - path: | - wasix-rust/build/aarch64-apple-darwin/stage2 - !wasix-rust/build/aarch64-apple-darwin/stage2/lib/rustlib/src - !wasix-rust/build/aarch64-apple-darwin/stage2/lib/rustlib/rustc-src + # - name: Build (Mac Os, aarch64) + # shell: bash + # if: contains(matrix.os, 'macos-12') && matrix.arch == 'aarch64' + # env: + # WASIX_NO_UPDATE_REPOS: "1" + # GITHUB_ACTIONS: "false" + # WASIX_COMPONENTS: rust + # WASIX_RUST_HOST: aarch64-apple-darwin + # run: | + # cd cargo-wasix + # # NOTE: must unset GITHUB_ACTIONS env var, because Rst bootstrap checks for it. + # # (see bootstrap config.rs) + # GITHUB_ACTIONS=false WASIX_BUILD_DIR=$GITHUB_WORKSPACE cargo run -- wasix build-toolchain + + # - name: Copy wasm* builds from x86_64-apple-darwin to aarch64-apple-darwin + # shell: bash + # if: contains(matrix.os, 'macos-12') && matrix.arch == 'aarch64' + # run: | + # cp -r wasix-rust/build/x86_64-apple-darwin/stage2/lib/rustlib/wasm* wasix-rust/build/aarch64-apple-darwin/stage2/lib/rustlib + + # - name: Archive build output (Mac OS - aarch64) + # uses: actions/upload-artifact@v3 + # if: contains(matrix.os, 'macos-12') && matrix.arch == 'aarch64' + # with: + # name: rust-toolchain-aarch64-apple-darwin + # path: | + # wasix-rust/build/aarch64-apple-darwin/stage2 + # !wasix-rust/build/aarch64-apple-darwin/stage2/lib/rustlib/src + # !wasix-rust/build/aarch64-apple-darwin/stage2/lib/rustlib/rustc-src # Windows - - name: Install chocolatey deps (Windows) - if: contains(matrix.os, 'windows') && matrix.arch == 'x86' - shell: bash - continue-on-error: true - run: choco install -y visualstudio2019community cmake + # - name: Install chocolatey deps (Windows) + # if: contains(matrix.os, 'windows') && matrix.arch == 'x86' + # shell: bash + # continue-on-error: true + # run: choco install -y visualstudio2019community cmake - name: Set up MinGW (Windows) if: contains(matrix.os, 'windows') && matrix.arch == 'x86'