diff options
| author | Josh Stone <jistone@redhat.com> | 2024-04-08 15:04:44 -0700 |
|---|---|---|
| committer | Josh Stone <jistone@redhat.com> | 2024-04-08 15:04:44 -0700 |
| commit | f7b2e37f7232540d9f2b2dc6e33597fbb74f4f63 (patch) | |
| tree | badbb2a2743edf54978f74d8d20ec9e98bbaaf7f /src/tools | |
| parent | 211518e5fb1336de6a4aab45dc1c05f5d83ce856 (diff) | |
| download | rust-f7b2e37f7232540d9f2b2dc6e33597fbb74f4f63.tar.gz rust-f7b2e37f7232540d9f2b2dc6e33597fbb74f4f63.zip | |
Fix UI tests with dist-vendored dependencies
There is already a workaround in `compiletest` to deal with custom
`CARGO_HOME` using `-Zignore-directory-in-diagnostics-source-blocks={}`.
A similar need exists when dependencies come from the local `vendor`
directory, which distro builds often use, so now we ignore that too.
Also, `issue-21763.rs` was normalizing `hashbrown-` paths, presumably
expecting a version suffix, but the vendored path doesn't include the
version. Now that matches `[\\/]hashbrown` instead.
Diffstat (limited to 'src/tools')
| -rw-r--r-- | src/tools/compiletest/src/runtest.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/tools/compiletest/src/runtest.rs b/src/tools/compiletest/src/runtest.rs index bb8509fe413..770496289e2 100644 --- a/src/tools/compiletest/src/runtest.rs +++ b/src/tools/compiletest/src/runtest.rs @@ -2354,6 +2354,11 @@ impl<'test> TestCx<'test> { "ignore-directory-in-diagnostics-source-blocks={}", home::cargo_home().expect("failed to find cargo home").to_str().unwrap() )); + // Similarly, vendored sources shouldn't be shown when running from a dist tarball. + rustc.arg("-Z").arg(format!( + "ignore-directory-in-diagnostics-source-blocks={}", + self.config.find_rust_src_root().unwrap().join("vendor").display(), + )); // Optionally prevent default --sysroot if specified in test compile-flags. if !self.props.compile_flags.iter().any(|flag| flag.starts_with("--sysroot")) |
