From 09d41e54ca799bac62bb22b7095aa3a53c64e6e8 Mon Sep 17 00:00:00 2001 From: tylerjenningsw Date: Thu, 29 Oct 2026 17:27:12 -0400 Subject: [PATCH] CI: bundled LLD also gets the ktmw32, propsys and version import libraries winsafe binds (refs #1886) --- .github/workflows/windows-toolchains.yml | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/.github/workflows/windows-toolchains.yml b/.github/workflows/windows-toolchains.yml index 6d22ffc12..1d00276c8 100644 --- a/.github/workflows/windows-toolchains.yml +++ b/.github/workflows/windows-toolchains.yml @@ -1,8 +1,9 @@ # Windows builds with the toolchains contributors use, not just the MSVC one releases use: build # the desktop app and the CLI with MSVC, with GNU (mingw-w64 from MSYS2, the setup CONTRIBUTING.md -# describes), and with GNU linked by Rust's bundled LLD plus mingw-w64's `libshlwapi.a` (#1886), -# then run each binary with `--version`. Both packages build in one `cargo build`, the way people -# build them, so features unify and the CLI links everything the desktop app pulls in. +# describes), and with GNU linked by Rust's bundled LLD plus the mingw-w64 import libraries its +# self-contained sysroot lacks (#1886), then run each binary with `--version`. Both packages build +# in one `cargo build`, the way people build them, so features unify and the CLI links everything +# the desktop app pulls in. name: Windows toolchains # Nightly on main (a dependency update is what brings in a new system library), and on PRs that @@ -55,13 +56,17 @@ jobs: if: matrix.target == 'x86_64-pc-windows-gnu' && !matrix.rust-lld run: | printf '%s\n' 'C:\msys64\mingw64\bin' >> "$GITHUB_PATH" - # Only libshlwapi.a, in a folder of its own: with all of mingw-w64's lib folder on the search - # path, its C runtime mixes with Rust's bundled one (undefined `DllEntryPoint`). - - name: Link with Rust's bundled LLD and mingw-w64's shlwapi import library + # Only the import libraries the self-contained sysroot lacks, in a folder of its own: with all + # of mingw-w64's lib folder on the search path, its C runtime mixes with Rust's bundled one + # (undefined `DllEntryPoint`). webbrowser, which opens links, binds shlwapi; winsafe, which the + # updater (craft-update) uses, binds shlwapi, ktmw32, propsys and version. + - name: Link with Rust's bundled LLD and mingw-w64's missing import libraries if: matrix.rust-lld run: | mkdir -p /c/gnu-import-libs - cp /c/msys64/mingw64/lib/libshlwapi.a /c/gnu-import-libs/ + for lib in shlwapi ktmw32 propsys version; do + cp "/c/msys64/mingw64/lib/lib$lib.a" /c/gnu-import-libs/ + done echo 'CARGO_TARGET_X86_64_PC_WINDOWS_GNU_LINKER=rust-lld' >> "$GITHUB_ENV" echo 'CARGO_TARGET_X86_64_PC_WINDOWS_GNU_RUSTFLAGS=-C link-self-contained=yes -L native=C:/gnu-import-libs' >> "$GITHUB_ENV" - uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2.9.2