Skip to content

Commit 4131ea0

Browse files
Prepare dependencies without locking Cargo.lock
This doesn't pass --locked to Cargo, as that can interfere with upgrading the lockfile format and cause spurious failures on Crater (since generate-lockfile, which will get run in this case, will cause dependencies to get upgraded when this isn't actually necessary). We would always regenerate the lockfile from scratch if it was needed at all, so this isn't really changing anything behavior wise.
1 parent 4328f83 commit 4131ea0

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

src/prepare.rs

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -141,24 +141,19 @@ impl<'a> Prepare<'a> {
141141
}
142142

143143
fn fetch_deps(&mut self) -> Result<(), Error> {
144-
let mut outdated_lockfile = false;
145144
let mut missing_deps = false;
146145
let res = Command::new(self.workspace, self.toolchain.cargo())
147-
.args(&["fetch", "--locked", "--manifest-path", "Cargo.toml"])
146+
.args(&["fetch", "--manifest-path", "Cargo.toml"])
148147
.cd(&self.source_dir)
149148
.process_lines(&mut |line, _| {
150-
if line.ends_with(
151-
"Cargo.lock needs to be updated but --locked was passed to prevent this",
152-
) {
153-
outdated_lockfile = true;
154-
} else if line.contains("failed to load source for dependency") {
149+
if line.contains("failed to load source for dependency") {
155150
missing_deps = true;
156151
}
157152
})
158153
.run();
159154
match res {
160155
Ok(_) => Ok(()),
161-
Err(_) if outdated_lockfile && !self.lockfile_captured => {
156+
Err(_) if !self.lockfile_captured => {
162157
info!("the lockfile is outdated, regenerating it");
163158
// Force-update the lockfile and recursively call this function to fetch
164159
// dependencies again.

0 commit comments

Comments
 (0)