Skip to content

Commit 3f749f6

Browse files
committed
Ensure non-UTF8 compatibility of argfile arg
1 parent 9155c00 commit 3f749f6

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

crates/cargo-util/src/process_builder.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -413,10 +413,11 @@ impl ProcessBuilder {
413413
.prefix("cargo-argfile.")
414414
.tempfile()?;
415415

416-
let path = tmp.path().display();
416+
let mut arg = OsString::from("@");
417+
arg.push(tmp.path());
417418
let mut cmd = self.build_command_without_args();
418-
cmd.arg(format!("@{path}"));
419-
log::debug!("created argfile at {path} for `{self}`");
419+
cmd.arg(arg);
420+
log::debug!("created argfile at {} for {self}", tmp.path().display());
420421

421422
let cap = self.get_args().map(|arg| arg.len() + 1).sum::<usize>();
422423
let mut buf = Vec::with_capacity(cap);

0 commit comments

Comments
 (0)