diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 309231b30..2d95a9e2e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -128,7 +128,7 @@ jobs: working-directory: crates/uv-trampoline run: | rustup target add x86_64-pc-windows-msvc - rustup component add clippy rust-src --toolchain nightly-2024-01-23-x86_64-pc-windows-msvc + rustup component add clippy rust-src --toolchain nightly-2024-03-19-x86_64-pc-windows-msvc - uses: rui314/setup-mold@v1 - uses: Swatinem/rust-cache@v2 with: diff --git a/crates/uv-trampoline/README.md b/crates/uv-trampoline/README.md index 6163ff809..f26055554 100644 --- a/crates/uv-trampoline/README.md +++ b/crates/uv-trampoline/README.md @@ -104,8 +104,10 @@ might not realize that, and still emit references to the unwinding helper `__CxxFrameHandler3`. And then the linker blows up because that symbol doesn't exist. -`cargo build --release --target x86_64-pc-windows-msvc` -or `cargo build --release --target aarch64-pc-windows-msvc` +``` +cargo build --release --target x86_64-pc-windows-msvc +cargo build --release --target aarch64-pc-windows-msvc +``` Hopefully in the future as `#![no_std]` develops, this will get smoother. @@ -123,6 +125,6 @@ rustup target add aarch64-pc-windows-msvc ``` ```shell -cargo +nightly xwin build --release --target x86_64-pc-windows-msvc -cargo +nightly xwin build --release --target aarch64-pc-windows-msvc +cargo +nightly-2024-03-19 xwin build --release --target x86_64-pc-windows-msvc +cargo +nightly-2024-03-19 xwin build --release --target aarch64-pc-windows-msvc ``` diff --git a/crates/uv-trampoline/rust-toolchain.toml b/crates/uv-trampoline/rust-toolchain.toml index d30faf8af..e51a32bf6 100644 --- a/crates/uv-trampoline/rust-toolchain.toml +++ b/crates/uv-trampoline/rust-toolchain.toml @@ -1,2 +1,2 @@ [toolchain] -channel = "nightly-2024-01-23" +channel = "nightly-2024-03-19" diff --git a/crates/uv-trampoline/src/bounce.rs b/crates/uv-trampoline/src/bounce.rs index cfc87ec84..7dad39a59 100644 --- a/crates/uv-trampoline/src/bounce.rs +++ b/crates/uv-trampoline/src/bounce.rs @@ -24,7 +24,7 @@ use windows_sys::Win32::{ }; use crate::helpers::SizeOf; -use crate::{c, eprintln, format}; +use crate::{eprintln, format}; const MAGIC_NUMBER: [u8; 4] = [b'U', b'V', b'U', b'V']; const PATH_LEN_SIZE: usize = mem::size_of::(); @@ -438,8 +438,8 @@ fn clear_app_starting_state(child_handle: HANDLE) { WaitForInputIdle(child_handle, INFINITE); let hwnd = CreateWindowExA( 0, - c!("STATIC").as_ptr() as *const _, - c!("uv Python Trampoline").as_ptr() as *const _, + c"STATIC".as_ptr() as *const _, + c"uv Python Trampoline".as_ptr() as *const _, 0, 0, 0, @@ -474,10 +474,10 @@ pub fn bounce(is_gui: bool) -> ! { // (best effort) Switch to some innocuous directory so we don't hold the original // cwd open. - if let Some(tmp) = getenv(c!("TEMP")) { + if let Some(tmp) = getenv(c"TEMP") { SetCurrentDirectoryA(tmp.as_ptr() as *const _); } else { - SetCurrentDirectoryA(c!("c:\\").as_ptr() as *const _); + SetCurrentDirectoryA(c"c:\\".as_ptr() as *const _); } // We want to ignore control-C/control-Break/logout/etc.; the same event will diff --git a/crates/uv-trampoline/src/diagnostics.rs b/crates/uv-trampoline/src/diagnostics.rs index f4774a918..7ca9a7943 100644 --- a/crates/uv-trampoline/src/diagnostics.rs +++ b/crates/uv-trampoline/src/diagnostics.rs @@ -60,7 +60,7 @@ pub(crate) fn write_diagnostic(message: &str) { MessageBoxA(0, nul_terminated.as_ptr() as *const _, null(), 0); return; } - remaining = &remaining.get_unchecked(written as usize..); + remaining = remaining.get_unchecked(written as usize..); } } } diff --git a/crates/uv-trampoline/src/helpers.rs b/crates/uv-trampoline/src/helpers.rs index 95f3831b8..7f88a01d5 100644 --- a/crates/uv-trampoline/src/helpers.rs +++ b/crates/uv-trampoline/src/helpers.rs @@ -9,11 +9,3 @@ impl SizeOf for T { size_of::() as u32 } } - -// CStr literal: c!("...") -#[macro_export] -macro_rules! c { - ($s:literal) => { - core::ffi::CStr::from_bytes_with_nul_unchecked(concat!($s, "\0").as_bytes()) - }; -} diff --git a/crates/uv-trampoline/trampolines/uv-trampoline-aarch64-console.exe b/crates/uv-trampoline/trampolines/uv-trampoline-aarch64-console.exe index cfbe31139..7a01a6cb5 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 a406b687e..ed8bb9667 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-x86_64-console.exe b/crates/uv-trampoline/trampolines/uv-trampoline-x86_64-console.exe index a1e771a0e..740f31240 100644 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 6a7515b60..fc845efca 100644 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