Skip to content

Commit 832274d

Browse files
committed
Retry with argfile for rustc/rustdoc
1 parent c832a7a commit 832274d

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

src/cargo/core/compiler/compilation.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,7 @@ impl<'cfg> Compilation<'cfg> {
194194
let rustdoc = ProcessBuilder::new(&*self.config.rustdoc()?);
195195
let cmd = fill_rustc_tool_env(rustdoc, unit);
196196
let mut cmd = self.fill_env(cmd, &unit.pkg, script_meta, unit.kind, true)?;
197+
cmd.retry_with_argfile(true);
197198
unit.target.edition().cmd_edition_arg(&mut cmd);
198199

199200
for crate_type in unit.target.rustc_crate_types() {

src/cargo/util/rustc.rs

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,18 +93,24 @@ impl Rustc {
9393

9494
/// Gets a process builder set up to use the found rustc version, with a wrapper if `Some`.
9595
pub fn process(&self) -> ProcessBuilder {
96-
ProcessBuilder::new(self.path.as_path()).wrapped(self.wrapper.as_ref())
96+
let mut cmd = ProcessBuilder::new(self.path.as_path()).wrapped(self.wrapper.as_ref());
97+
cmd.retry_with_argfile(true);
98+
cmd
9799
}
98100

99101
/// Gets a process builder set up to use the found rustc version, with a wrapper if `Some`.
100102
pub fn workspace_process(&self) -> ProcessBuilder {
101-
ProcessBuilder::new(self.path.as_path())
103+
let mut cmd = ProcessBuilder::new(self.path.as_path())
102104
.wrapped(self.workspace_wrapper.as_ref())
103-
.wrapped(self.wrapper.as_ref())
105+
.wrapped(self.wrapper.as_ref());
106+
cmd.retry_with_argfile(true);
107+
cmd
104108
}
105109

106110
pub fn process_no_wrapper(&self) -> ProcessBuilder {
107-
ProcessBuilder::new(&self.path)
111+
let mut cmd = ProcessBuilder::new(&self.path);
112+
cmd.retry_with_argfile(true);
113+
cmd
108114
}
109115

110116
/// Gets the output for the given command.

0 commit comments

Comments
 (0)