Skip to content

Commit d23882c

Browse files
jyn514Joshua Nelson
authored and
Joshua Nelson
committed
Don't upload source files until the build succeeds or fails
1 parent 2809259 commit d23882c

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

src/docbuilder/rustwide_builder.rs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -356,12 +356,6 @@ impl RustwideBuilder {
356356
other_targets,
357357
} = metadata.targets();
358358

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-
365359
// Perform an initial build
366360
let res = self.execute_build(default_target, true, &build, &limits, &metadata)?;
367361
if res.result.successful {
@@ -371,6 +365,7 @@ impl RustwideBuilder {
371365
}
372366
}
373367

368+
let mut algs = HashSet::new();
374369
if has_docs {
375370
debug!("adding documentation for the default target to the database");
376371
self.copy_docs(&build.host_target_dir(), local_storage.path(), "", true)?;
@@ -394,6 +389,13 @@ impl RustwideBuilder {
394389
algs.extend(new_algs);
395390
};
396391

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+
397399
let has_examples = build.host_source_dir().join("examples").is_dir();
398400
if res.result.successful {
399401
crate::web::metrics::SUCCESSFUL_BUILDS.inc();

0 commit comments

Comments
 (0)