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

replace extra_filename with strict version hash in metrics file names #138950

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

yaahc
Copy link
Member

@yaahc yaahc commented Mar 25, 2025

Should resolve the potential issue of overwriting metrics from the same crate when compiled with different features or flags.

r? @estebank

@rustbot rustbot added 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 Mar 25, 2025
@bjorn3
Copy link
Member

bjorn3 commented Mar 25, 2025

If I compile once, make a small change to the source code and compile again with the same options, is it fine to overwrite the old metrics file or not. If it is fine, you can use the stable crate id. If it must not be overwritten, using the crate hash like you do here is the correct solution.

metrics_file_name.push(metrics_file_stem);
metrics_path.pop();
metrics_path.push(metrics_file_name);
let crate_id = rustc_span::def_id::LOCAL_CRATE;
Copy link
Member

Choose a reason for hiding this comment

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

Maybe add use rustc_span::def_if::LOCAL_CRATE at the top of this file and use LOCAL_CRATE below?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants