Skip to content

rust: treat the -C profile-use file as an input, not an output - #2961

Open
feder-cr wants to merge 2 commits into
mozilla:mainfrom
feder-cr:rust-profile-use-is-an-input
Open

feder-cr wants to merge 2 commits into
mozilla:mainfrom
feder-cr:rust-profile-use-is-an-input

Conversation

@feder-cr

@feder-cr feder-cr commented Oct 28, 2026 •

Copy link
Copy Markdown

Fixes #2960.

#2306 added the file of -C profile-use to a Rust compilation's outputs, so every cache hit rewrote the profile and gave it a new mtime, and cargo then rebuilt every crate that reads it. The profile is an input: it is in rustc's dep-info, so its contents already reach the hash key and the dist inputs. This removes it from the outputs.

The new test checks that the profile is not an output and that changing its contents still changes the key. It fails on main with merged.profdata among the outputs.

Ran cargo fmt -- --check, the clippy command from AGENTS.md on 1.91.0, and cargo test --locked --lib --bins --tests locally; the CI on my fork passes apart from the Codecov and CodSpeed uploads, which need tokens the fork does not have.

rustc lists the profile in its dep-info, so its contents already reach the hash key. Listing it as an output made every cache hit write it back, and the new mtime made cargo rebuild every crate that reads it.

Fixes mozilla#2960
@feder-cr
feder-cr force-pushed the rust-profile-use-is-an-input branch from 260aee4 to f8ba006 Compare October 28, 2026 06:48
@codecov-commenter

codecov-commenter commented Oct 28, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 78.54%. Comparing base (dac6c80) to head (bacfa0a).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2961      +/-   ##
==========================================
- Coverage   78.54%   78.54%   -0.01%     
==========================================
  Files          74       74              
  Lines       44039    44082      +43     
==========================================
+ Hits        34591    34624      +33     
- Misses       9448     9458      +10     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

The match's fallback arm only runs when parsing fails, so it was a line of
the patch no test could cover. The arguments need no working directory
(no response file, no -L path), which is what parses! assumes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

rust: the -C profile-use file is treated as a compile output

2 participants