From 8b63b8e18107d7fe75417869d2a7ad6040d54263 Mon Sep 17 00:00:00 2001 From: Rain Date: Tue, 22 Sep 2026 11:06:56 -0700 Subject: [PATCH] build and release the CLI for Windows on ARM64 Adds aarch64-pc-windows-msvc to the dist targets -- with this there will be a `oxide-cli-aarch64-pc-windows-msvc.zip`. Noticed this while trying out `winget install OxideComputer.OxideCLI` on a Surface tablet. --- .cargo/config.toml | 5 +++++ .github/build-setup.yml | 14 ++++++++++++++ .github/manylinux.yml | 5 ----- .github/workflows/release.yml | 6 ++++++ .github/workflows/rust.yml | 9 +++++++-- dist-workspace.toml | 9 +++++---- 6 files changed, 37 insertions(+), 11 deletions(-) create mode 100644 .github/build-setup.yml delete mode 100644 .github/manylinux.yml diff --git a/.cargo/config.toml b/.cargo/config.toml index c634d7e8..b82f1a22 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -1,6 +1,11 @@ [alias] xtask = "run --package xtask --" +[target.aarch64-pc-windows-msvc] +rustflags = [ + "-C", "link-args=/STACK:8388608", +] + [target.x86_64-pc-windows-msvc] rustflags = [ "-C", "link-args=/STACK:8388608", diff --git a/.github/build-setup.yml b/.github/build-setup.yml new file mode 100644 index 00000000..7cfa5f57 --- /dev/null +++ b/.github/build-setup.yml @@ -0,0 +1,14 @@ +# Install `perl-IPC-Cmd` on manylinux as required to build OpenSSL. +- name: Install perl-IPC-Cmd on manylinux + if: contains(matrix.container.image, 'manylinux') + run: | + yum install -y perl-IPC-Cmd perl-Time-Piece + git config --global --add safe.directory /__w/oxide.rs/oxide.rs +# The windows-11-arm image's rustup defaults to an x86_64 host -- force it to be +# aarch64-pc-windows-msvc. +- name: Use native aarch64 Rust toolchain on Windows ARM64 + if: runner.os == 'Windows' && runner.arch == 'ARM64' + shell: bash + run: | + rustup set default-host aarch64-pc-windows-msvc + rustc -vV diff --git a/.github/manylinux.yml b/.github/manylinux.yml deleted file mode 100644 index 2094d3de..00000000 --- a/.github/manylinux.yml +++ /dev/null @@ -1,5 +0,0 @@ -- name: Install perl-IPC-Cmd on manylinux - if: contains(matrix.container.image, 'manylinux') - run: | - yum install -y perl-IPC-Cmd perl-Time-Piece - git config --global --add safe.directory /__w/oxide.rs/oxide.rs diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 696a4fc0..4ca1421c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -140,6 +140,12 @@ jobs: run: | yum install -y perl-IPC-Cmd perl-Time-Piece git config --global --add safe.directory /__w/oxide.rs/oxide.rs + - name: "Use native aarch64 Rust toolchain on Windows ARM64" + if: "runner.os == 'Windows' && runner.arch == 'ARM64'" + run: | + rustup set default-host aarch64-pc-windows-msvc + rustc -vV + shell: "bash" - name: Install dist run: ${{ matrix.install_dist.run }} # Get the dist-manifest diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 136cc9c5..43eeeda6 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -54,17 +54,22 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-22.04, windows-2022, macos-latest] + os: [ubuntu-22.04, windows-2022, windows-11-arm, macos-latest] features: [ all, default ] include: - features: all feature_flags: --all-features steps: - uses: actions/checkout@v4 + # TODO-RAINCLAUDE: without this, windows-11-arm builds and tests an emulated x64 binary; keep in sync with .github/build-setup.yml + - name: Use native aarch64 Rust toolchain on Windows ARM64 + if: runner.os == 'Windows' && runner.arch == 'ARM64' + shell: bash + run: rustup set default-host aarch64-pc-windows-msvc - name: Report cargo version run: cargo --version - name: Report rustc version - run: rustc --version + run: rustc -vV - name: Build run: cargo build ${{ matrix.feature_flags }} --locked --all-targets --verbose - name: Run tests diff --git a/dist-workspace.toml b/dist-workspace.toml index 29751595..7074373e 100644 --- a/dist-workspace.toml +++ b/dist-workspace.toml @@ -10,11 +10,11 @@ ci = "github" # The installers to generate for each app installers = [] # Target platforms to build apps for (Rust target-triple syntax) -targets = ["aarch64-apple-darwin", "x86_64-apple-darwin", "x86_64-unknown-linux-gnu", "x86_64-unknown-linux-musl", "x86_64-pc-windows-msvc"] +targets = ["aarch64-apple-darwin", "aarch64-pc-windows-msvc", "x86_64-apple-darwin", "x86_64-pc-windows-msvc", "x86_64-unknown-linux-gnu", "x86_64-unknown-linux-musl"] # Which actions to run on pull requests pr-run-mode = "plan" -# Install `perl-IPC-Cmd` on manylinux as required to build OpenSSL -github-build-setup = "../manylinux.yml" +# See .github/build-setup.yml for what this does. +github-build-setup = "../build-setup.yml" # Whether to sign macOS executables macos-sign = true # Whether to sign Windows executables @@ -35,5 +35,6 @@ image = "quay.io/pypa/manylinux_2_28_x86_64" host = "x86_64-unknown-linux-musl" [dist.github-custom-runners] -x86_64-apple-darwin = "macos-14" aarch64-apple-darwin = "macos-14" +aarch64-pc-windows-msvc = "windows-11-arm" +x86_64-apple-darwin = "macos-14"