Skip to content

Commit 6eba306

Browse files
committed
Fix install_to_sysroot doing path concatenation twice
Since the second concatenation was against an absolute path, it didn't do anything. This also makes the interface of install_to_sysroot() similar to that of cargo_cmd()
1 parent 7919999 commit 6eba306

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

miri-script/src/commands.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -604,8 +604,8 @@ impl Command {
604604

605605
fn install(features: Vec<String>, flags: Vec<String>) -> Result<()> {
606606
let e = MiriEnv::new()?;
607-
e.install_to_sysroot(e.miri_dir.clone(), &features, &flags)?;
608-
e.install_to_sysroot(path!(e.miri_dir / "cargo-miri"), &[], &flags)?;
607+
e.install_to_sysroot(".", &features, &flags)?;
608+
e.install_to_sysroot("cargo-miri", &[], &flags)?;
609609
Ok(())
610610
}
611611

miri-script/src/util.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,16 +139,16 @@ impl MiriEnv {
139139
)
140140
}
141141

142-
/// Make sure the `features` you pass here exist for the specified `path`. For example, the
142+
/// Make sure the `features` you pass here exist for the specified `crate_dir`. For example, the
143143
/// "--features" parameter of [crate::Command]s is intended only for the "miri" root crate.
144144
pub fn install_to_sysroot(
145145
&self,
146-
path: impl AsRef<OsStr>,
146+
crate_dir: impl AsRef<OsStr>,
147147
features: &[String],
148148
args: impl IntoIterator<Item = impl AsRef<OsStr>>,
149149
) -> Result<()> {
150150
let MiriEnv { sysroot, toolchain, cargo_extra_flags, .. } = self;
151-
let path = path!(self.miri_dir / path.as_ref());
151+
let path = path!(self.miri_dir / crate_dir.as_ref());
152152
let features = features_to_args(features);
153153
// Install binaries to the miri toolchain's `sysroot` so they do not interact with other toolchains.
154154
// (Not using `cargo_cmd` as `install` is special and doesn't use `--manifest-path`.)

0 commit comments

Comments
 (0)