Skip to content

Conversation

lambdageek
Copy link
Contributor

Adds Windows resources with the rust version information to rustc-main.exe and rustc_driver.dll

Invokes rc.exe directly, rather than using one of the crates from the ecosystem to avoid adding dependencies.

A new internal rustc_windows_rc crate has the common build script machinery for locating rc.exe and constructing the resource script

@rustbot
Copy link
Collaborator

rustbot commented Aug 29, 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 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 Aug 29, 2025
@rustbot
Copy link
Collaborator

rustbot commented Aug 29, 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

@lambdageek
Copy link
Contributor Author

Here's what this looks like:

Screenshot 2025-08-29 at 17 33 56

@bjorn3
Copy link
Member

bjorn3 commented Aug 29, 2025

Why is the rustc version included in the product name? At most including the release channel would make sense to me (given that nightly genuinely behaves differently from stable by allowing unstable features), but the exaxt version is duplicated with the product version field.

@rust-log-analyzer

This comment has been minimized.

@lambdageek
Copy link
Contributor Author

Why is the rustc version included in the product name?

I don't have a good justification for the first iteration of this PR. Happy to update the names/descriptions to whatever makes the most sense

@rustbot rustbot added the T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) label Aug 29, 2025
lambdageek and others added 2 commits August 29, 2025 19:25
Adds Windows resources with the rust version information to rustc-main.exe and rustc_driver.dll
@rustbot
Copy link
Collaborator

rustbot commented Aug 29, 2025

This PR was rebased onto a different master commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

set product description to "Rust Compiler" or "Rust Compiler (channel)" for non-stable channels
@lambdageek
Copy link
Contributor Author

Updated the Product Description to be just "Rust Compiler" or "Rust Compiler (channel)" for non-stable

@rust-log-analyzer

This comment has been minimized.

@jieyouxu
Copy link
Member

jieyouxu commented Aug 30, 2025

This needs someone who actually have some clues about windows resources to review... I'll ask about a reviewer

@rustbot

This comment has been minimized.

@jieyouxu jieyouxu added the O-windows Operating system: Windows label Aug 30, 2025
@jieyouxu
Copy link
Member

jieyouxu commented Aug 30, 2025

Adds Windows resources with the rust version information to rustc-main.exe and rustc_driver.dll

I'm not familiar with Windows resources. But can you say more on the motivation for this change?

EDIT: okay I found #t-compiler/windows > version resources on rustc.exe and rustc_driver.dll, but it's still not super obvious to me the motivation for the change.

@jieyouxu jieyouxu assigned jieyouxu and unassigned ChrisDenton Aug 30, 2025
@lambdageek
Copy link
Contributor Author

lambdageek commented Aug 30, 2025

In many ways this is a cosmetic change: as you can see in the screenshot in the comment above, Windows shows the version info in the file explorer when you right click on the .exe or .dll and look at the details

However this info is also used by some other tools on Windows such as debuggers or crash reporters when collecting diagnostic information.

For our internal builds of Rust at Microsoft having version info available would allow us to collect better automated crash reports from our users.
I could just add this only in our internal builds, but it seemed like it would be useful to upstream it.

@jieyouxu
Copy link
Member

Ok thanks for the clarification, that makes sense. I'll ask internally for another reviewer who has at least slightly more clues about this than I do.

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. O-windows Operating system: Windows 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) 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.

7 participants