Skip to content

Conversation

dpaoliello
Copy link
Contributor

@dpaoliello dpaoliello commented Sep 4, 2025

For my purposes, contains fixes when compiling the Rust compiler for Arm64EC.

Checked the commits since 1.2.16, and I don't see anything else that may affect Rust?

find-msvc-tools was also factored out from cc to allow updating the use in rustc_codegen_ssa (finding the linker when running the Rust compiler) to be separate from the use in rustc_llvm (building LLVM as part of the Rust compiler).

@rustbot
Copy link
Collaborator

rustbot commented Sep 4, 2025

Failed to set assignee to NobodyXu: invalid assignee

Note: Only org members with at least the repository "read" role, users with write permissions, or people who have commented on the PR may be assigned.

@rustbot rustbot added A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Sep 4, 2025
@rustbot
Copy link
Collaborator

rustbot commented Sep 4, 2025

These commits modify the Cargo.lock file. Unintentional changes to Cargo.lock can be introduced when switching branches and rebasing PRs.

If this was unintentional then you should revert the changes before this PR is merged.
Otherwise, you can ignore this comment.

Some changes occurred in compiler/rustc_codegen_ssa

cc @WaffleLapkin

@jieyouxu jieyouxu self-assigned this Sep 4, 2025
@jieyouxu
Copy link
Member

jieyouxu commented Sep 4, 2025

@bors try jobs=aarch64-msvc-1,aarch64-apple,test-various,dist-apple-various

@rust-bors

This comment has been minimized.

rust-bors bot added a commit that referenced this pull request Sep 4, 2025
Update cc-rs to 1.2.33

try-job: aarch64-msvc-1
try-job: aarch64-apple
try-job: test-various
try-job: dist-apple-various
@rust-bors
Copy link

rust-bors bot commented Sep 4, 2025

☀️ Try build successful (CI)
Build commit: d8ac12e (d8ac12e3b0cef5271092800d62ab852417973355, parent: a1208bf765ba783ee4ebdc4c29ab0a0c215806ef)

@jieyouxu
Copy link
Member

jieyouxu commented Sep 4, 2025

Let me know @dpaoliello if you want to try with find-msvc-tools, otherwise I'm fine with the current change as well.
@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 Sep 4, 2025
@rustbot
Copy link
Collaborator

rustbot commented Sep 4, 2025

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

@rustbot

This comment has been minimized.

@dpaoliello dpaoliello changed the title Update cc-rs to 1.2.33 Update cc-rs to 1.2.33, and switch rustc_codegen_ssa to use find-msvc-tools Sep 4, 2025
@dpaoliello
Copy link
Contributor Author

I switched to find-msvc-tools, since I was here changing things.

@rustbot ready

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Sep 4, 2025
@rust-log-analyzer

This comment has been minimized.

@rustbot rustbot added A-tidy Area: The tidy tool T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) labels Sep 4, 2025
@rustbot
Copy link
Collaborator

rustbot commented Sep 4, 2025

The list of allowed third-party dependencies may have been modified! You must ensure that any new dependencies have compatible licenses before merging.

cc @davidtwco, @wesleywiser

@davidtwco
Copy link
Member

@bors r=davidtwco,jieyouxu

@bors
Copy link
Collaborator

bors commented Sep 4, 2025

📌 Commit 45a0e10 has been approved by davidtwco,jieyouxu

It is now in the queue for this repository.

@bors bors removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Sep 4, 2025
@dpaoliello
Copy link
Contributor Author

@bors2 try jobs=dist-aarch64-linux

rust-bors bot added a commit that referenced this pull request Sep 8, 2025
Update cc-rs to 1.2.33, and switch rustc_codegen_ssa to use find-msvc-tools

try-job: dist-aarch64-linux
@rust-bors

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rust-bors
Copy link

rust-bors bot commented Sep 8, 2025

💔 Test for 083d034 failed: CI. Failed jobs:

@bors
Copy link
Collaborator

bors commented Sep 9, 2025

☔ The latest upstream changes (presumably #146018) made this pull request unmergeable. Please resolve the merge conflicts.

@lambdageek
Copy link
Contributor

@dpaoliello nice cleanup. Please consider cherrypicking lambdageek@797c4b1 which should switch rust_windows_rc to use find-msvc-tools, too

if sess.target.is_like_msvc
&& let Some(ref tool) = msvc_tool
{
cmd.args(tool.args());
Copy link
Contributor

@lambdageek lambdageek Sep 9, 2025

Choose a reason for hiding this comment

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

Why is this ok? It looked to me like cc::windows_registry::find_tool can have extra arguments here, while find_msvc_tools::find_tool cannot

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The old windows_registry::find_tool never set any args, which is why find_msvc_tools dropped it
https://github.com/rust-lang/cc-rs/blob/3c1325b09a78827fb2beb3ea9e8f1e3f84876b64/src/windows/find_tools.rs#L359-L371

@dpaoliello
Copy link
Contributor Author

Please consider cherrypicking lambdageek@797c4b1 which should switch rust_windows_rc to use find-msvc-tools, too

I have concerns with that change: I don't think we can rely on HOST being set.

I will switch rust_windows_rc to use find-msvc-tools, that seems reasonable, but I suggest that we make find-msvc-tools natively know how to find tools that ship in the Windows SDK.

@lambdageek
Copy link
Contributor

I don't think we can rely on HOST being set

From https://doc.rust-lang.org/cargo/reference/environment-variables.html#environment-variables-cargo-sets-for-build-scripts

HOST — the host triple of the Rust compiler.

Is the concern that it might be set to something unexpected when bootstrapping the compiler?

@dpaoliello
Copy link
Contributor Author

... but I suggest that we make find-msvc-tools natively know how to find tools that ship in the Windows SDK.

Decided to implement this myself: rust-lang/cc-rs#1553

@dpaoliello
Copy link
Contributor Author

asked in #t-compiler/help > compiler cc bump failure

Opened another thread in #t-infra

@rust-log-analyzer

This comment has been minimized.

@dpaoliello
Copy link
Contributor Author

@bors2 try jobs=dist-aarch64-linux

rust-bors bot added a commit that referenced this pull request Sep 23, 2025
Update cc-rs to 1.2.33, and switch rustc_codegen_ssa to use find-msvc-tools

try-job: dist-aarch64-linux
@rust-bors

This comment has been minimized.

@dpaoliello
Copy link
Contributor Author

@bors try cancel

@rust-bors
Copy link

rust-bors bot commented Sep 23, 2025

Try build cancelled. Cancelled workflows:

@dpaoliello
Copy link
Contributor Author

@bors2 try jobs=dist-aarch64-linux

rust-bors bot added a commit that referenced this pull request Sep 23, 2025
Update cc-rs to 1.2.33, and switch rustc_codegen_ssa to use find-msvc-tools

try-job: dist-aarch64-linux
@rust-bors

This comment has been minimized.

@dpaoliello
Copy link
Contributor Author

Current test build using a patched version of jemalloc to strip the -flto arg is part the point-of-failure, so submitted an upstream PR: tikv/jemallocator#144

@rust-bors
Copy link

rust-bors bot commented Sep 24, 2025

☀️ Try build successful (CI)
Build commit: 70c9139 (70c9139e1af293ca2c92ec727e21cbdba4170b73, parent: 975e6c8fec280816d24fbde6b8dfe19620f2efe6)

@dpaoliello dpaoliello changed the title Update cc-rs to 1.2.33, and switch rustc_codegen_ssa to use find-msvc-tools Update cc-rs to 1.2.33 Sep 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. A-tidy Area: The tidy tool S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants