@@ -47,6 +47,10 @@ codegen-units = 10000
47
47
"# ,
48
48
)
49
49
. unwrap ( ) ;
50
+
51
+ let source_lockfile = RelPath :: PATCHES . to_path ( dirs) . join ( "stdlib-lock.toml" ) ;
52
+ let target_lockfile = STDLIB_SRC . to_path ( dirs) . join ( "Cargo.lock" ) ;
53
+ fs:: copy ( source_lockfile, target_lockfile) . unwrap ( ) ;
50
54
}
51
55
52
56
pub ( crate ) struct GitRepo {
@@ -134,6 +138,15 @@ impl GitRepo {
134
138
}
135
139
}
136
140
141
+ let source_lockfile =
142
+ RelPath :: PATCHES . to_path ( dirs) . join ( format ! ( "{}-lock.toml" , self . patch_name) ) ;
143
+ let target_lockfile = download_dir. join ( "Cargo.lock" ) ;
144
+ if source_lockfile. exists ( ) {
145
+ fs:: copy ( source_lockfile, target_lockfile) . unwrap ( ) ;
146
+ } else {
147
+ assert ! ( target_lockfile. exists( ) ) ;
148
+ }
149
+
137
150
let actual_hash = format ! ( "{:016x}" , hash_dir( & download_dir) ) ;
138
151
if actual_hash != self . content_hash {
139
152
println ! (
@@ -285,12 +298,4 @@ pub(crate) fn apply_patches(dirs: &Dirs, crate_name: &str, source_dir: &Path, ta
285
298
apply_patch_cmd. arg ( patch) . arg ( "-q" ) ;
286
299
spawn_and_wait ( apply_patch_cmd) ;
287
300
}
288
-
289
- let source_lockfile = RelPath :: PATCHES . to_path ( dirs) . join ( format ! ( "{crate_name}-lock.toml" ) ) ;
290
- let target_lockfile = target_dir. join ( "Cargo.lock" ) ;
291
- if source_lockfile. exists ( ) {
292
- fs:: copy ( source_lockfile, target_lockfile) . unwrap ( ) ;
293
- } else {
294
- assert ! ( target_lockfile. exists( ) ) ;
295
- }
296
301
}
0 commit comments