Skip to content

fix: refuse to trim rlibs without a sibling .rmeta#2685

Open
coredoesdev wants to merge 1 commit intomozilla:mainfrom
coredoesdev:patch-1
Open

fix: refuse to trim rlibs without a sibling .rmeta#2685
coredoesdev wants to merge 1 commit intomozilla:mainfrom
coredoesdev:patch-1

Conversation

@coredoesdev
Copy link
Copy Markdown

Fixes a Rust distributed compilation failure where .rlibs lacking a sibling .rmeta are trimmed to a metadata-only stub that the remote rustc cannot read, leading to extern location for <crate> does not exist errors. Similar mode of failure to https://bugzilla.mozilla.org/show_bug.cgi?id=1760743.

Reproducible while trying to compile tracing_wasm from a Linux client.

Extends the fix from 1760743: updates can_trim_this to refuse to trim rlibs that do not have associated metadata files (so that something is sent to the remote rustc). Resolves the tracing_wasm compilation failures in testing on my team's cluster.

`can_trim_this` erroneously trims rlibs that lack a .rmeta file (which can occur in some instances when cross-compiling to wasm) causing compilation failures on the remote server; updates `can_trim_this` to refuse to trim rlibs that do not have associated metadata. related to 1760743 (similar mode of failure), reproducible by trying to compile `tracing_wasm`
Copy link
Copy Markdown
Collaborator

@sylvestre sylvestre left a comment

Choose a reason for hiding this comment

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

please add a test to make sure we don't regress in the future

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Apr 28, 2026

Codecov Report

❌ Patch coverage is 66.66667% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 60.69%. Comparing base (b81fdbb) to head (9ede862).
⚠️ Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
src/compiler/rust.rs 66.66% 1 Missing ⚠️

❗ There is a different number of reports uploaded between BASE (b81fdbb) and HEAD (9ede862). Click for more details.

HEAD has 6 uploads less than BASE
Flag BASE (b81fdbb) HEAD (9ede862)
10 4
Additional details and impacted files
@@             Coverage Diff             @@
##             main    #2685       +/-   ##
===========================================
- Coverage   73.58%   60.69%   -12.90%     
===========================================
  Files          70       69        -1     
  Lines       38220    37475      -745     
===========================================
- Hits        28125    22746     -5379     
- Misses      10095    14729     +4634     

☔ View full report in Codecov by Sentry.
📢 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.

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