File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -337,7 +337,16 @@ impl RustwideBuilder {
337
337
// If the build fails with the lockfile given, try using only the dependencies listed in Cargo.toml.
338
338
let cargo_lock = build. host_source_dir ( ) . join ( "Cargo.lock" ) ;
339
339
if !res. result . successful && cargo_lock. exists ( ) {
340
+ info ! ( "removing lockfile and reattempting build" ) ;
340
341
std:: fs:: remove_file ( cargo_lock) ?;
342
+ Command :: new ( & self . workspace , self . toolchain . cargo ( ) )
343
+ . cd ( build. host_source_dir ( ) )
344
+ . args ( & [ "generate-lockfile" , "-Zno-index-update" ] )
345
+ . run ( ) ?;
346
+ Command :: new ( & self . workspace , self . toolchain . cargo ( ) )
347
+ . cd ( build. host_source_dir ( ) )
348
+ . args ( & [ "fetch" , "--locked" ] )
349
+ . run ( ) ?;
341
350
res = self . execute_build (
342
351
default_target,
343
352
true ,
@@ -1019,4 +1028,19 @@ mod tests {
1019
1028
Ok ( ( ) )
1020
1029
} ) ;
1021
1030
}
1031
+
1032
+ #[ test]
1033
+ #[ ignore]
1034
+ fn test_locked_fails_unlocked_needs_new_deps ( ) {
1035
+ wrapper ( |env| {
1036
+ env. override_config ( |cfg| cfg. include_default_targets = false ) ;
1037
+
1038
+ let crate_ = "stm32f7xx-hal" ;
1039
+ let version = "0.6.0" ;
1040
+ let mut builder = RustwideBuilder :: init ( env) . unwrap ( ) ;
1041
+ assert ! ( builder. build_package( crate_, version, PackageKind :: CratesIo ) ?) ;
1042
+
1043
+ Ok ( ( ) )
1044
+ } ) ;
1045
+ }
1022
1046
}
You can’t perform that action at this time.
0 commit comments