Skip to content

dist: Ship more Windows import libs with the rust-mingw package of *-windows-gnullvm targets.#151108

Closed
ColinFinck wants to merge 1 commit intorust-lang:mainfrom
ColinFinck:copy-more-windows-libs-for-gnullvm
Closed

dist: Ship more Windows import libs with the rust-mingw package of *-windows-gnullvm targets.#151108
ColinFinck wants to merge 1 commit intorust-lang:mainfrom
ColinFinck:copy-more-windows-libs-for-gnullvm

Conversation

@ColinFinck
Copy link
Contributor

@ColinFinck ColinFinck commented Jan 14, 2026

This fixes building crates like https://crates.io/crates/blake3, which use cc and depend on additional Windows import libs.

The list of shipped Windows import libs now matches the rust-mingw package of the x86_64-pc-windows-gnu target.

Addendum to #147536

CC @mati865

…`*-windows-gnullvm` targets.

This fixes building crates like https://crates.io/crates/blake3, which use `cc` and depend on additional Windows import libs.

The list of shipped Windows import libs now matches the `rust-mingw` package of the `x86_64-pc-windows-gnu` target.
@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) labels Jan 14, 2026
@rustbot
Copy link
Collaborator

rustbot commented Jan 14, 2026

r? @Mark-Simulacrum

rustbot has assigned @Mark-Simulacrum.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@@ -318,12 +318,38 @@ fn make_win_llvm_dist(plat_root: &Path, target: TargetSelection, builder: &Build
"libmingwex.a",
"libmsvcrt.a",
// Windows import libs, remove them once std transitions to raw-dylib
Copy link
Member

@bjorn3 bjorn3 Jan 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct me if I'm wrong, but if I understand this correctly, the list of import libraries is supposed to be exactly those that are necessary for the standard library. Once the standard library uses raw-dylib all import libraries would be removed from the rust-mingw package.

If you got a crate which uses cc, doesn't that mean you also have to have a Mingw C toolchain installed separately anyway? That toolchain should contain all import libraries C code may need.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct me if I'm wrong, but if I understand this correctly, the list of import libraries is supposed to be exactly those that are necessary for the standard library. Once the standard library uses raw-dylib all import libraries would be removed from the rust-mingw package.

This is correct, even for regular windows-gnu targets rust-mingw is not meant to provide full toolchain. Even less so when it comes to windows-gnullvm.

If you got a crate which uses cc, doesn't that mean you also have to have a Mingw C toolchain installed separately anyway? That toolchain should contain all import libraries C code may need.

BLAKE3 can build without C compiler, but in "degraded" mode - without optimised assembly. The problem here is usage of page_size crate, which depends on winapi. It's abandoned and shouldn't be used for years. This should be easy to solve in BLAKE3 repo.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the explanations! I've recently opened a few PRs in dependency crates to get them to adopt windows-sys 0.61, which makes use of raw-dylib. Once all of these PRs go through and I update my Cargo.toml, we should be good to go without shipping additional import libs. Closing this PR.

@Mark-Simulacrum
Copy link
Member

r? @mati865 (or feel free to suggest someone else with more familiarity with this list)

@rustbot rustbot assigned mati865 and unassigned Mark-Simulacrum Jan 24, 2026
@mati865
Copy link
Member

mati865 commented Jan 26, 2026

I'll mark this as waiting on the author given the review comments in #151108 (review)

@rustbot author

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jan 26, 2026
@rustbot
Copy link
Collaborator

rustbot commented Jan 26, 2026

Reminder, once the PR becomes ready for a review, use @rustbot ready.

@ColinFinck ColinFinck closed this Feb 18, 2026
@rustbot rustbot removed the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Feb 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants