Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Workaround Rust 1.49 breaking macOS processes with a materialized argv0 #11452

Merged
merged 3 commits into from
Jan 13, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion src/rust/engine/process_execution/src/local.rs
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,19 @@ impl CapturedWorkdir for CommandRunner {
_context: Context,
exclusive_spawn: bool,
) -> Result<BoxStream<'c, Result<ChildOutput, String>>, String> {
let mut command = HermeticCommand::new(&req.argv[0]);
// TODO(#11406): Go back to using relative paths, rather than absolutifying them, once Rust
// fixes https://github.com/rust-lang/rust/issues/80819 for macOS.
let argv0 = match RelativePath::new(&req.argv[0]) {
Ok(rel_path) => {
if let Some(ref working_directory) = req.working_directory {
workdir_path.join(working_directory).join(rel_path)
Eric-Arellano marked this conversation as resolved.
Show resolved Hide resolved
} else {
workdir_path.join(rel_path)
}
}
Err(_) => PathBuf::from(&req.argv[0]),
};
let mut command = HermeticCommand::new(argv0);
command
.args(&req.argv[1..])
.current_dir(if let Some(ref working_directory) = req.working_directory {
Expand Down