Skip to content

Commit efe68e3

Browse files
committed
Auto merge of rust-lang#16560 - lnicola:sysroot-metadata, r=Veykril
internal: Set channel override when querying the sysroot metadata This is pretty hard to discover, and makes the setting useless, we should probably enable it for now. CC rust-lang#16486
2 parents 113f054 + c738655 commit efe68e3

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

crates/project-model/src/sysroot.rs

+9-1
Original file line numberDiff line numberDiff line change
@@ -254,10 +254,18 @@ impl Sysroot {
254254
.ok()?;
255255
let current_dir =
256256
AbsPathBuf::try_from(&*format!("{sysroot_src_dir}/sysroot")).ok()?;
257+
258+
let mut cargo_config = CargoConfig::default();
259+
// the sysroot uses `public-dependency`, so we make cargo think it's a nightly
260+
cargo_config.extra_env.insert(
261+
"__CARGO_TEST_CHANNEL_OVERRIDE_DO_NOT_USE_THIS".to_owned(),
262+
"nightly".to_owned(),
263+
);
264+
257265
let res = CargoWorkspace::fetch_metadata(
258266
&sysroot_cargo_toml,
259267
&current_dir,
260-
&CargoConfig::default(),
268+
&cargo_config,
261269
None,
262270
&|_| (),
263271
)

xtask/src/metrics.rs

-2
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,6 @@ impl Metrics {
117117
sh,
118118
"./target/release/rust-analyzer -q analysis-stats {path} --query-sysroot-metadata"
119119
)
120-
// the sysroot uses `public-dependency`, so we make cargo think it's a nightly
121-
.env("__CARGO_TEST_CHANNEL_OVERRIDE_DO_NOT_USE_THIS", "nightly")
122120
.read()?;
123121
for (metric, value, unit) in parse_metrics(&output) {
124122
self.report(&format!("analysis-stats/{name}/{metric}"), value, unit.into());

0 commit comments

Comments
 (0)