@@ -189,7 +189,8 @@ impl RustwideBuilder {
189
189
build_dir
190
190
. build ( & self . toolchain , & krate, sandbox)
191
191
. run ( |build| {
192
- let res = self . execute_build ( None , build, & limits) ?;
192
+ let metadata = Metadata :: from_source_dir ( & build. host_source_dir ( ) ) ?;
193
+ let res = self . execute_build ( None , build, & limits, & metadata) ?;
193
194
if !res. result . successful {
194
195
bail ! ( "failed to build dummy crate for {}" , self . rustc_version) ;
195
196
}
@@ -312,9 +313,10 @@ impl RustwideBuilder {
312
313
let mut files_list = None ;
313
314
let mut has_docs = false ;
314
315
let mut successful_targets = Vec :: new ( ) ;
316
+ let metadata = Metadata :: from_source_dir ( & build. host_source_dir ( ) ) ?;
315
317
316
318
// Do an initial build and then copy the sources in the database
317
- let res = self . execute_build ( None , & build, & limits) ?;
319
+ let res = self . execute_build ( None , & build, & limits, & metadata ) ?;
318
320
if res. result . successful {
319
321
debug ! ( "adding sources into database" ) ;
320
322
let prefix = format ! ( "sources/{}/{}" , name, version) ;
@@ -352,6 +354,7 @@ impl RustwideBuilder {
352
354
& limits,
353
355
& local_storage. path ( ) ,
354
356
& mut successful_targets,
357
+ & metadata,
355
358
) ?;
356
359
}
357
360
self . upload_docs ( & conn, name, version, local_storage. path ( ) ) ?;
@@ -396,8 +399,9 @@ impl RustwideBuilder {
396
399
limits : & Limits ,
397
400
local_storage : & Path ,
398
401
successful_targets : & mut Vec < String > ,
402
+ metadata : & Metadata ,
399
403
) -> Result < ( ) > {
400
- let target_res = self . execute_build ( Some ( target) , build, limits) ?;
404
+ let target_res = self . execute_build ( Some ( target) , build, limits, metadata ) ?;
401
405
if target_res. result . successful {
402
406
// Cargo is not giving any error and not generating documentation of some crates
403
407
// when we use a target compile options. Check documentation exists before
@@ -416,8 +420,8 @@ impl RustwideBuilder {
416
420
target : Option < & str > ,
417
421
build : & Build ,
418
422
limits : & Limits ,
423
+ metadata : & Metadata ,
419
424
) -> Result < FullBuildResult > {
420
- let metadata = Metadata :: from_source_dir ( & build. host_source_dir ( ) ) ?;
421
425
let cargo_metadata =
422
426
CargoMetadata :: load ( & self . workspace , & self . toolchain , & build. host_source_dir ( ) ) ?;
423
427
0 commit comments