Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows: Don't link std (and run-make) against advapi32, except on win7 #138233

Merged
merged 2 commits into from
Mar 9, 2025

Conversation

smmalis37
Copy link
Contributor

Std no longer depends on any functionality provided by advapi32, so we can remove it from the list of external libraries we link against. Except, the win7 targets do still rely on advapi32-provided functionality. This PR therefore moves linking against it to only occur on win7 targets, so that no new uses of it slip in without being noticed.

@rustbot
Copy link
Collaborator

rustbot commented Mar 8, 2025

r? @jieyouxu

rustbot has assigned @jieyouxu.
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

@rustbot
Copy link
Collaborator

rustbot commented Mar 8, 2025

The run-make-support library was changed

cc @jieyouxu

@rustbot rustbot added A-run-make Area: port run-make Makefiles to rmake.rs 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 Mar 8, 2025
@smmalis37
Copy link
Contributor Author

@rustbot label +O-windows

@rustbot rustbot added the O-windows Operating system: Windows label Mar 8, 2025
Copy link
Member

@ChrisDenton ChrisDenton left a comment

Choose a reason for hiding this comment

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

If jieyouxu is fine with the run-make changes then this looks good to me. I do have one issue though

@@ -232,7 +232,6 @@ fn make_win_dist(
"libpthread.a",
//Windows import libs
//This should contain only the set of libraries necessary to link the standard library.
"libadvapi32.a",
Copy link
Member

Choose a reason for hiding this comment

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

While we should only distribute the libraries windows-gnu needs for std, we've had problems with people accidentally relying on them being there so I'm reluctant to clean up this list too much. But cc @mati865 as target maintainer

Choose a reason for hiding this comment

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

I was wondering if there were potential backcompat hazards lurking inside this change. I was just going off the comment here though. Maybe it should be reworded if we decide to keep this list longer.

Copy link
Member

Choose a reason for hiding this comment

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

Yes, rewording this comment would make sense to me. Or at least adding a comment that notes the hazard.

Choose a reason for hiding this comment

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

Done

@jieyouxu
Copy link
Member

jieyouxu commented Mar 8, 2025

run-make changes are fine with me.

@ChrisDenton ChrisDenton assigned ChrisDenton and unassigned jieyouxu Mar 8, 2025
@ChrisDenton
Copy link
Member

Thanks!

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Mar 8, 2025

📌 Commit 31e22c6 has been approved by ChrisDenton

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Mar 8, 2025
jieyouxu added a commit to jieyouxu/rust that referenced this pull request Mar 9, 2025
Windows: Don't link std (and run-make) against advapi32, except on win7

Std no longer depends on any functionality provided by advapi32, so we can remove it from the list of external libraries we link against. Except, the win7 targets do still rely on advapi32-provided functionality. This PR therefore moves linking against it to only occur on win7 targets, so that no new uses of it slip in without being noticed.
bors added a commit to rust-lang-ci/rust that referenced this pull request Mar 9, 2025
Rollup of 16 pull requests

Successful merges:

 - rust-lang#122790 (Apply dllimport in ThinLTO)
 - rust-lang#136127 (Allow `*const W<dyn A> -> *const dyn A` ptr cast)
 - rust-lang#136968 (Turn order dependent trait objects future incompat warning into a hard error)
 - rust-lang#137147 (Add exclude to config.toml)
 - rust-lang#137319 (Stabilize `const_vec_string_slice`)
 - rust-lang#137885 (tidy: add triagebot checks)
 - rust-lang#138040 (compiler: Use `size_of` from the prelude instead of imported)
 - rust-lang#138052 (strip `-Wlinker-messages` wrappers from `rust-lld` rmake test)
 - rust-lang#138084 (Use workspace lints for crates in `compiler/`)
 - rust-lang#138158 (Move more layouting logic to `rustc_abi`)
 - rust-lang#138160 (depend more on attr_data_structures and move find_attr! there)
 - rust-lang#138192 (crashes: couple more tests)
 - rust-lang#138216 (bootstrap: Fix stack printing when a step cycle is detected)
 - rust-lang#138232 (Reduce verbosity of GCC build log)
 - rust-lang#138233 (Windows: Don't link std (and run-make) against advapi32, except on win7)
 - rust-lang#138242 (Revert "Don't test new error messages with the stage 0 compiler")

r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit to rust-lang-ci/rust that referenced this pull request Mar 9, 2025
…iaskrgr

Rollup of 7 pull requests

Successful merges:

 - rust-lang#122790 (Apply dllimport in ThinLTO)
 - rust-lang#137650 (Move `fs` into `sys`)
 - rust-lang#138228 (Use `disjoint_bitor` inside `borrowing_sub`)
 - rust-lang#138233 (Windows: Don't link std (and run-make) against advapi32, except on win7)
 - rust-lang#138253 (Continue to check attr if meet empty repr for adt)
 - rust-lang#138263 (Fix `repr128-dwarf` test)
 - rust-lang#138276 (Lazy load NtOpenFile for UWP)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 980a529 into rust-lang:master Mar 9, 2025
6 checks passed
@rustbot rustbot added this to the 1.87.0 milestone Mar 9, 2025
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Mar 9, 2025
Rollup merge of rust-lang#138233 - smmalis37:no-advapi32, r=ChrisDenton

Windows: Don't link std (and run-make) against advapi32, except on win7

Std no longer depends on any functionality provided by advapi32, so we can remove it from the list of external libraries we link against. Except, the win7 targets do still rely on advapi32-provided functionality. This PR therefore moves linking against it to only occur on win7 targets, so that no new uses of it slip in without being noticed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-run-make Area: port run-make Makefiles to rmake.rs O-windows Operating system: Windows S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. 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.

6 participants