diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dd4d66b3b..60f388d0d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -382,13 +382,15 @@ jobs: timeout-minutes: 10 needs: determine_changes if: ${{ !contains(github.event.pull_request.labels.*.name, 'no-test') && (needs.determine_changes.outputs.code == 'true' || github.ref == 'refs/heads/main') }} - runs-on: windows-latest + runs-on: ${{ matrix.runner }} name: "test windows trampoline | ${{ matrix.target-arch }}" strategy: fail-fast: false matrix: - # Note, we exclude `aarch64` because it's not supported by the GitHub runner - target-arch: ["x86_64", "i686"] + include: + - { runner: windows-latest, target-arch: "x86_64" } + - { runner: windows-latest, target-arch: "i686" } + - { runner: windows-11-arm, target-arch: "aarch64" } steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name: Setup Dev Drive diff --git a/crates/uv-trampoline/README.md b/crates/uv-trampoline/README.md index ef53821c1..2e5be82ce 100644 --- a/crates/uv-trampoline/README.md +++ b/crates/uv-trampoline/README.md @@ -13,19 +13,19 @@ LLD and add the `rustup` targets: ```shell sudo apt install llvm clang lld cargo install cargo-xwin -rustup toolchain install nightly-2025-02-16 -rustup component add rust-src --toolchain nightly-2025-02-16-x86_64-unknown-linux-gnu -rustup target add --toolchain nightly-2025-02-16 i686-pc-windows-msvc -rustup target add --toolchain nightly-2025-02-16 x86_64-pc-windows-msvc -rustup target add --toolchain nightly-2025-02-16 aarch64-pc-windows-msvc +rustup toolchain install nightly-2025-03-28 +rustup component add rust-src --toolchain nightly-2025-03-28-x86_64-unknown-linux-gnu +rustup target add --toolchain nightly-2025-03-28 i686-pc-windows-msvc +rustup target add --toolchain nightly-2025-03-28 x86_64-pc-windows-msvc +rustup target add --toolchain nightly-2025-03-28 aarch64-pc-windows-msvc ``` Then, build the trampolines for all supported architectures: ```shell -cargo +nightly-2025-02-16 xwin build --xwin-arch x86 --release --target i686-pc-windows-msvc -cargo +nightly-2025-02-16 xwin build --release --target x86_64-pc-windows-msvc -cargo +nightly-2025-02-16 xwin build --release --target aarch64-pc-windows-msvc +cargo +nightly-2025-03-28 xwin build --xwin-arch x86 --release --target i686-pc-windows-msvc +cargo +nightly-2025-03-28 xwin build --release --target x86_64-pc-windows-msvc +cargo +nightly-2025-03-28 xwin build --release --target aarch64-pc-windows-msvc ``` ### Cross-compiling from macOS @@ -36,19 +36,19 @@ LLVM and add the `rustup` targets: ```shell brew install llvm cargo install cargo-xwin -rustup toolchain install nightly-2025-02-16 -rustup component add rust-src --toolchain nightly-2025-02-16-aarch64-apple-darwin -rustup target add --toolchain nightly-2025-02-16 i686-pc-windows-msvc -rustup target add --toolchain nightly-2025-02-16 x86_64-pc-windows-msvc -rustup target add --toolchain nightly-2025-02-16 aarch64-pc-windows-msvc +rustup toolchain install nightly-2025-03-28 +rustup component add rust-src --toolchain nightly-2025-03-28-aarch64-apple-darwin +rustup target add --toolchain nightly-2025-03-28 i686-pc-windows-msvc +rustup target add --toolchain nightly-2025-03-28 x86_64-pc-windows-msvc +rustup target add --toolchain nightly-2025-03-28 aarch64-pc-windows-msvc ``` Then, build the trampolines for all supported architectures: ```shell -cargo +nightly-2025-02-16 xwin build --release --target i686-pc-windows-msvc -cargo +nightly-2025-02-16 xwin build --release --target x86_64-pc-windows-msvc -cargo +nightly-2025-02-16 xwin build --release --target aarch64-pc-windows-msvc +cargo +nightly-2025-03-28 xwin build --release --target i686-pc-windows-msvc +cargo +nightly-2025-03-28 xwin build --release --target x86_64-pc-windows-msvc +cargo +nightly-2025-03-28 xwin build --release --target aarch64-pc-windows-msvc ``` ### Updating the prebuilt executables diff --git a/crates/uv-trampoline/build.rs b/crates/uv-trampoline/build.rs index 468b458fe..aa7d20fa2 100644 --- a/crates/uv-trampoline/build.rs +++ b/crates/uv-trampoline/build.rs @@ -9,6 +9,7 @@ fn main() { let manifest = new_manifest("uv.Trampoline").remove_dependency("Microsoft.Windows.Common-Controls"); embed_manifest(manifest).expect("unable to embed manifest"); + println!("cargo::rustc-link-lib=ucrt"); // https://github.com/rust-lang/rust/issues/143172 println!("cargo:rerun-if-changed=build.rs"); } } diff --git a/crates/uv-trampoline/rust-toolchain.toml b/crates/uv-trampoline/rust-toolchain.toml index cdc0286ba..3abee9246 100644 --- a/crates/uv-trampoline/rust-toolchain.toml +++ b/crates/uv-trampoline/rust-toolchain.toml @@ -1,2 +1,2 @@ [toolchain] -channel = "nightly-2025-02-16" +channel = "nightly-2025-03-28" diff --git a/crates/uv-trampoline/src/bounce.rs b/crates/uv-trampoline/src/bounce.rs index 8d658bdab..f60f28e97 100644 --- a/crates/uv-trampoline/src/bounce.rs +++ b/crates/uv-trampoline/src/bounce.rs @@ -416,6 +416,7 @@ fn spawn_child(si: &STARTUPINFOA, child_cmdline: CString) -> HANDLE { // processes, by using the .lpReserved2 field. We want to close those file descriptors too. // The UCRT source code has details on the memory layout (see also initialize_inherited_file_handles_nolock): // https://github.com/huangqinjin/ucrt/blob/10.0.19041.0/lowio/ioinit.cpp#L190-L223 +#[allow(clippy::ptr_eq)] fn close_handles(si: &STARTUPINFOA) { // See distlib/PC/launcher.c::cleanup_standard_io() // Unlike cleanup_standard_io(), we don't close STD_ERROR_HANDLE to retain warn! diff --git a/crates/uv-trampoline/trampolines/uv-trampoline-aarch64-console.exe b/crates/uv-trampoline/trampolines/uv-trampoline-aarch64-console.exe index 5f2d6115e..aec8a5eeb 100755 Binary files a/crates/uv-trampoline/trampolines/uv-trampoline-aarch64-console.exe and b/crates/uv-trampoline/trampolines/uv-trampoline-aarch64-console.exe differ diff --git a/crates/uv-trampoline/trampolines/uv-trampoline-aarch64-gui.exe b/crates/uv-trampoline/trampolines/uv-trampoline-aarch64-gui.exe index 3a5a2e348..c79c8e5ce 100755 Binary files a/crates/uv-trampoline/trampolines/uv-trampoline-aarch64-gui.exe and b/crates/uv-trampoline/trampolines/uv-trampoline-aarch64-gui.exe differ diff --git a/crates/uv-trampoline/trampolines/uv-trampoline-i686-console.exe b/crates/uv-trampoline/trampolines/uv-trampoline-i686-console.exe index bdc225e4d..3aca836cd 100755 Binary files a/crates/uv-trampoline/trampolines/uv-trampoline-i686-console.exe and b/crates/uv-trampoline/trampolines/uv-trampoline-i686-console.exe differ diff --git a/crates/uv-trampoline/trampolines/uv-trampoline-i686-gui.exe b/crates/uv-trampoline/trampolines/uv-trampoline-i686-gui.exe index d6753380d..9b978d9a7 100755 Binary files a/crates/uv-trampoline/trampolines/uv-trampoline-i686-gui.exe and b/crates/uv-trampoline/trampolines/uv-trampoline-i686-gui.exe differ diff --git a/crates/uv-trampoline/trampolines/uv-trampoline-x86_64-console.exe b/crates/uv-trampoline/trampolines/uv-trampoline-x86_64-console.exe index b93c242e7..a43976351 100755 Binary files a/crates/uv-trampoline/trampolines/uv-trampoline-x86_64-console.exe and b/crates/uv-trampoline/trampolines/uv-trampoline-x86_64-console.exe differ diff --git a/crates/uv-trampoline/trampolines/uv-trampoline-x86_64-gui.exe b/crates/uv-trampoline/trampolines/uv-trampoline-x86_64-gui.exe index c81d8e4e5..5ab044a64 100755 Binary files a/crates/uv-trampoline/trampolines/uv-trampoline-x86_64-gui.exe and b/crates/uv-trampoline/trampolines/uv-trampoline-x86_64-gui.exe differ