Skip to content

stats: expose non-cacheable Rust crate types - #2897

Open
codeandsolder wants to merge 2 commits into
mozilla:mainfrom
codeandsolder:upstream-pr/rust-crate-type-stats
Open

codeandsolder wants to merge 2 commits into
mozilla:mainfrom
codeandsolder:upstream-pr/rust-crate-type-stats

Conversation

@codeandsolder

Copy link
Copy Markdown
Contributor

Summary

Rust's argument parser already attaches the specific non-cacheable crate type to CompilerArguments::CannotCache("crate-type", ...), but server statistics discard that detail and record every case as crate-type.

Keep the existing not_cached statistics map and include the detail in its key for this reason, for example crate-type (bin) and crate-type (proc-macro). Other non-cacheable reasons are unchanged.

When rustc supplies multiple unsupported crate types, sort them before recording the detail so the statistic key is deterministic regardless of input order.

This avoids adding a new serialized statistics field or otherwise changing the statistics schema.

Testing

  • cargo +1.99.0 fmt --all -- --check
  • cargo +1.99.0 test --locked --no-default-features --lib non_cacheable_crate_type
  • cargo +1.99.0 test --locked --no-default-features --lib test_print_non_cacheable_crate_type_details
  • Rust 1.99 through sccache

AI Disclosure: AI developed, human directed and reviewed

@codecov-commenter

codecov-commenter commented Oct 10, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 78.23%. Comparing base (81c2834) to head (f340de5).
⚠️ Report is 5 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2897      +/-   ##
==========================================
+ Coverage   78.18%   78.23%   +0.05%     
==========================================
  Files          72       72              
  Lines       41946    42048     +102     
==========================================
+ Hits        32795    32897     +102     
  Misses       9151     9151              

☔ 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.

Comment thread src/server.rs Outdated
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.

3 participants