@@ -356,12 +356,6 @@ impl RustwideBuilder {
356
356
other_targets,
357
357
} = metadata. targets ( ) ;
358
358
359
- // Store the sources even if the build fails
360
- debug ! ( "adding sources into database" ) ;
361
- let prefix = format ! ( "sources/{}/{}" , name, version) ;
362
- let ( files_list, mut algs) =
363
- add_path_into_database ( & self . storage , & prefix, build. host_source_dir ( ) ) ?;
364
-
365
359
// Perform an initial build
366
360
let res = self . execute_build ( default_target, true , & build, & limits, & metadata) ?;
367
361
if res. result . successful {
@@ -371,6 +365,7 @@ impl RustwideBuilder {
371
365
}
372
366
}
373
367
368
+ let mut algs = HashSet :: new ( ) ;
374
369
if has_docs {
375
370
debug ! ( "adding documentation for the default target to the database" ) ;
376
371
self . copy_docs ( & build. host_target_dir ( ) , local_storage. path ( ) , "" , true ) ?;
@@ -394,6 +389,13 @@ impl RustwideBuilder {
394
389
algs. extend ( new_algs) ;
395
390
} ;
396
391
392
+ // Store the sources even if the build fails
393
+ debug ! ( "adding sources into database" ) ;
394
+ let prefix = format ! ( "sources/{}/{}" , name, version) ;
395
+ let ( files_list, new_algs) =
396
+ add_path_into_database ( & self . storage , & prefix, build. host_source_dir ( ) ) ?;
397
+ algs. extend ( new_algs) ;
398
+
397
399
let has_examples = build. host_source_dir ( ) . join ( "examples" ) . is_dir ( ) ;
398
400
if res. result . successful {
399
401
crate :: web:: metrics:: SUCCESSFUL_BUILDS . inc ( ) ;
0 commit comments