Skip to content

rustc_session: Add a structure for keeping both explicit and default sysroots #142799

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

Merged
merged 1 commit into from
Jun 25, 2025

Conversation

petrochenkov
Copy link
Contributor

Also avoid creating and cloning sysroot unnecessarily.

Implements the suggestion from #142089 (comment).
r? @bjorn3

@rustbot rustbot added A-translation Area: Translation infrastructure, and migrating existing diagnostics to SessionDiagnostic 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. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Jun 20, 2025
@rustbot
Copy link
Collaborator

rustbot commented Jun 20, 2025

rustc_error_messages was changed

cc @davidtwco, @compiler-errors, @TaKO8Ki

Some changes occurred in compiler/rustc_codegen_ssa

cc @WaffleLapkin

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.

@bjorn3
Copy link
Member

bjorn3 commented Jun 21, 2025

I've been meaning to split --sysroot into a host sysroot (for codegen backends and executables) and target sysroot (for the standard library and self-contained libraries) option and then only access the default sysroot when the respective option is not set. The current fallback behavior is necessary because someone may pass --sysroot to override the standard library without copying all host executables and libraries into the passed sysroot. If the host and target sysroot can be configured separately, fallback for missing artifacts shouldn't be necessary anymore. Until that is implemented, I do think this PR is an improvement though.

r=me with the all_paths return type change.

@bjorn3
Copy link
Member

bjorn3 commented Jun 23, 2025

r=me with the unnecesary feature gate removed.

…sysroots

Also avoid creating and cloning sysroot unnecessarily.
@petrochenkov
Copy link
Contributor Author

@bors r=bjorn3

@bors
Copy link
Collaborator

bors commented Jun 24, 2025

📌 Commit 0be37ca has been approved by bjorn3

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jun 24, 2025
workingjubilee added a commit to workingjubilee/rustc that referenced this pull request Jun 24, 2025
rustc_session: Add a structure for keeping both explicit and default sysroots

Also avoid creating and cloning sysroot unnecessarily.

Implements the suggestion from rust-lang#142089 (comment).
r? `@bjorn3`
bors added a commit that referenced this pull request Jun 24, 2025
Rollup of 9 pull requests

Successful merges:

 - #142645 (Also emit suggestions for usages in the `non_upper_case_globals` lint)
 - #142657 (mbe: Clean up code with non-optional `NonterminalKind`)
 - #142799 (rustc_session: Add a structure for keeping both explicit and default sysroots)
 - #142805 (Emit a single error when importing a path with `_`)
 - #142882 (Lazy init diagnostics-only local_names in borrowck)
 - #142883 (Add impl_trait_in_bindings tests from #61773)
 - #142943 (Don't include current rustc version string in feature removed help)
 - #142965 ([RTE-497] Ignore `c-link-to-rust-va-list-fn` test on SGX platform)
 - #142972 (Add a missing mailmap entry)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 03c2197 into rust-lang:master Jun 25, 2025
10 checks passed
@rustbot rustbot added this to the 1.90.0 milestone Jun 25, 2025
rust-timer added a commit that referenced this pull request Jun 25, 2025
Rollup merge of #142799 - petrochenkov:expnop, r=bjorn3

rustc_session: Add a structure for keeping both explicit and default sysroots

Also avoid creating and cloning sysroot unnecessarily.

Implements the suggestion from #142089 (comment).
r? ``@bjorn3``
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-translation Area: Translation infrastructure, and migrating existing diagnostics to SessionDiagnostic S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc 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