Skip to content

Commit e327487

Browse files
authored
Rollup merge of rust-lang#110115 - jyn514:remap-path-prefix-ci, r=compiler-errors
compiletest: Use remap-path-prefix only in CI This makes jump-to-definition work in most IDEs, as well as being easier to understand for contributors. Fixes rust-lang#109725. cc `@TimNN`
2 parents b6633ff + 464a24e commit e327487

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/tools/compiletest/src/header.rs

+7-2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ use std::io::BufReader;
66
use std::path::{Path, PathBuf};
77
use std::process::Command;
88

9+
use build_helper::ci::CiEnv;
910
use tracing::*;
1011

1112
use crate::common::{Config, Debugger, FailMode, Mode, PassMode};
@@ -276,8 +277,12 @@ impl TestProps {
276277
/// `//[foo]`), then the property is ignored unless `cfg` is
277278
/// `Some("foo")`.
278279
fn load_from(&mut self, testfile: &Path, cfg: Option<&str>, config: &Config) {
279-
// Mode-dependent defaults.
280-
self.remap_src_base = config.mode == Mode::Ui && !config.suite.contains("rustdoc");
280+
// In CI, we've sometimes encountered non-determinism related to truncating very long paths.
281+
// Set a consistent (short) prefix to avoid issues, but only in CI to avoid regressing the
282+
// contributor experience.
283+
if CiEnv::is_ci() {
284+
self.remap_src_base = config.mode == Mode::Ui && !config.suite.contains("rustdoc");
285+
}
281286

282287
let mut has_edition = false;
283288
if !testfile.is_dir() {

0 commit comments

Comments
 (0)