@@ -13,7 +13,6 @@ pub(crate) struct Prepare<'a> {
13
13
toolchain : & ' a Toolchain ,
14
14
krate : & ' a Crate ,
15
15
source_dir : & ' a Path ,
16
- lockfile_captured : bool ,
17
16
patches : Vec < CratePatch > ,
18
17
}
19
18
@@ -30,7 +29,6 @@ impl<'a> Prepare<'a> {
30
29
toolchain,
31
30
krate,
32
31
source_dir,
33
- lockfile_captured : false ,
34
32
patches,
35
33
}
36
34
}
@@ -40,7 +38,7 @@ impl<'a> Prepare<'a> {
40
38
self . validate_manifest ( ) ?;
41
39
self . remove_override_files ( ) ?;
42
40
self . tweak_toml ( ) ?;
43
- self . capture_lockfile ( false ) ?;
41
+ self . capture_lockfile ( ) ?;
44
42
self . fetch_deps ( ) ?;
45
43
46
44
Ok ( ( ) )
@@ -94,8 +92,8 @@ impl<'a> Prepare<'a> {
94
92
Ok ( ( ) )
95
93
}
96
94
97
- fn capture_lockfile ( & mut self , force : bool ) -> Result < ( ) , Error > {
98
- if !force && self . source_dir . join ( "Cargo.lock" ) . exists ( ) {
95
+ fn capture_lockfile ( & mut self ) -> Result < ( ) , Error > {
96
+ if self . source_dir . join ( "Cargo.lock" ) . exists ( ) {
99
97
info ! (
100
98
"crate {} already has a lockfile, it will not be regenerated" ,
101
99
self . krate
@@ -136,7 +134,6 @@ impl<'a> Prepare<'a> {
136
134
}
137
135
other => other?,
138
136
}
139
- self . lockfile_captured = true ;
140
137
Ok ( ( ) )
141
138
}
142
139
@@ -153,13 +150,6 @@ impl<'a> Prepare<'a> {
153
150
. run ( ) ;
154
151
match res {
155
152
Ok ( _) => Ok ( ( ) ) ,
156
- Err ( _) if !self . lockfile_captured => {
157
- info ! ( "the lockfile is outdated, regenerating it" ) ;
158
- // Force-update the lockfile and recursively call this function to fetch
159
- // dependencies again.
160
- self . capture_lockfile ( true ) ?;
161
- self . fetch_deps ( )
162
- }
163
153
Err ( _) if missing_deps => Err ( PrepareError :: MissingDependencies . into ( ) ) ,
164
154
err => err. map_err ( |e| e. into ( ) ) ,
165
155
}
0 commit comments