Skip to content

Commit aef389c

Browse files
committed
Harden and simplify some path resolutions
1 parent f729331 commit aef389c

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

tests/compiletest.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use colored::*;
22
use regex::Regex;
3-
use std::path::PathBuf;
3+
use std::path::{Path, PathBuf};
44
use std::{env, ffi::OsString};
55
use ui_test::{color_eyre::Result, Config, DependencyBuilder, Mode, OutputConflictHandling};
66

@@ -64,13 +64,10 @@ fn run_tests(mode: Mode, path: &str, target: Option<String>) -> Result<()> {
6464
program: miri_path(),
6565
output_conflict_handling,
6666
dependencies_crate_manifest_path: use_std
67-
.then(|| std::env::current_dir().unwrap().join("test_dependencies").join("Cargo.toml")),
67+
.then(|| Path::new("test_dependencies").join("Cargo.toml")),
6868
dependency_builder: Some(DependencyBuilder {
6969
program: PathBuf::from("bash"),
70-
args: vec![
71-
std::env::current_dir()?.join("miri").display().to_string(),
72-
"cargo".to_string(),
73-
],
70+
args: vec!["miri".to_string(), "cargo".to_string()],
7471
envs: vec![],
7572
}),
7673
};

ui_test/src/dependencies.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,9 @@ pub fn build_dependencies(config: &Config) -> Result<Dependencies> {
104104
let root = metadata
105105
.packages
106106
.iter()
107-
.find(|package| package.manifest_path.as_std_path() == manifest_path)
107+
.find(|package| {
108+
package.manifest_path.as_std_path() == manifest_path.canonicalize().unwrap()
109+
})
108110
.unwrap();
109111

110112
// Then go over all of its dependencies

0 commit comments

Comments
 (0)