Skip to content

Commit 5f30655

Browse files
committed
Avoid conflicting with miri's dependencies
1 parent ae34cf1 commit 5f30655

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

miri

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,7 @@ fmt)
187187
| xargs rustfmt +$TOOLCHAIN --edition=2021 --config-path "$MIRIDIR/rustfmt.toml" "$@"
188188
;;
189189
cargo)
190+
find_sysroot
190191
$CARGO run $CARGO_BUILD_FLAGS --manifest-path "$MIRIDIR"/cargo-miri/Cargo.toml -- miri "$@"
191192
;;
192193
clippy)

ui_test/src/dependencies.rs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ use std::{
66

77
use crate::Config;
88

9+
/// Compiles dependencies and returns the crate names and corresponding rmeta files.
910
pub fn build_dependencies(config: &Config) -> Result<Vec<(String, PathBuf)>> {
1011
let manifest_path = match &config.manifest_path {
1112
Some(path) => path,
@@ -16,16 +17,21 @@ pub fn build_dependencies(config: &Config) -> Result<Vec<(String, PathBuf)>> {
1617
None => (Path::new("cargo"), &[]),
1718
};
1819
let mut build = Command::new(program);
20+
build.env_clear();
21+
build.env("PATH", std::env::var_os("PATH").unwrap());
1922
build.args(args);
2023
build.arg("run");
2124
if let Some(target) = &config.target {
2225
build.arg(format!("--target={target}"));
2326
}
24-
let output = build
27+
build
2528
.arg(format!("--manifest-path={}", manifest_path.display()))
29+
.arg("--target-dir=target/test_dependencies")
2630
.arg("--message-format=json")
27-
.arg("-Zunstable-options")
28-
.output()?;
31+
.arg("-Zunstable-options");
32+
33+
let output = build.output()?;
34+
2935
ensure!(output.status.success(), "{output:#?}");
3036
let output = output.stdout;
3137
let output = String::from_utf8(output)?;

0 commit comments

Comments
 (0)