1
Fork 0

Rollup merge of #135330 - bjorn3:respect_sysroot_in_version_printing, r=lqd

Respect --sysroot for rustc -vV and -Cpasses=list

This is necessary when the specified codegen backend is in a custom sysroot.

Fixes https://github.com/rust-lang/rust/issues/135165
This commit is contained in:
Matthias Krüger 2025-01-20 20:58:35 +01:00 committed by GitHub
commit c8c5fa4893
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 31 additions and 19 deletions

View file

@ -1346,8 +1346,12 @@ pub fn build_configuration(sess: &Session, mut user_cfg: Cfg) -> Cfg {
user_cfg
}
pub fn build_target_config(early_dcx: &EarlyDiagCtxt, opts: &Options, sysroot: &Path) -> Target {
match Target::search(&opts.target_triple, sysroot) {
pub fn build_target_config(
early_dcx: &EarlyDiagCtxt,
target: &TargetTuple,
sysroot: &Path,
) -> Target {
match Target::search(target, sysroot) {
Ok((target, warnings)) => {
for warning in warnings.warning_messages() {
early_dcx.early_warn(warning)