@@ -3,7 +3,7 @@ use crate::db::{
3
3
add_build_into_database, add_doc_coverage, add_package_into_database,
4
4
add_path_into_remote_archive, update_crate_data_in_database, Pool ,
5
5
} ;
6
- use crate :: docbuilder:: { crates :: crates_from_path , Limits } ;
6
+ use crate :: docbuilder:: Limits ;
7
7
use crate :: error:: Result ;
8
8
use crate :: repositories:: RepositoryStatsUpdater ;
9
9
use crate :: storage:: { rustdoc_archive_path, source_archive_path} ;
@@ -64,7 +64,6 @@ pub struct RustwideBuilder {
64
64
index : Arc < Index > ,
65
65
rustc_version : String ,
66
66
repository_stats_updater : Arc < RepositoryStatsUpdater > ,
67
- skip_build_if_exists : bool ,
68
67
}
69
68
70
69
impl RustwideBuilder {
@@ -102,14 +101,9 @@ impl RustwideBuilder {
102
101
index : context. index ( ) ?,
103
102
rustc_version : String :: new ( ) ,
104
103
repository_stats_updater : context. repository_stats_updater ( ) ?,
105
- skip_build_if_exists : false ,
106
104
} )
107
105
}
108
106
109
- pub fn set_skip_build_if_exists ( & mut self , should : bool ) {
110
- self . skip_build_if_exists = should;
111
- }
112
-
113
107
fn prepare_sandbox ( & self , limits : & Limits ) -> SandboxBuilder {
114
108
SandboxBuilder :: new ( )
115
109
. cpu_limit ( self . config . build_cpu_limit . map ( |limit| limit as f32 ) )
@@ -314,22 +308,6 @@ impl RustwideBuilder {
314
308
Ok ( ( ) )
315
309
}
316
310
317
- pub fn build_world ( & mut self ) -> Result < ( ) > {
318
- crates_from_path (
319
- & self . config . registry_index_path . clone ( ) ,
320
- & mut |name, version| {
321
- let registry_url = self . config . registry_url . clone ( ) ;
322
- let package_kind = registry_url
323
- . as_ref ( )
324
- . map ( |r| PackageKind :: Registry ( r. as_str ( ) ) )
325
- . unwrap_or ( PackageKind :: CratesIo ) ;
326
- if let Err ( err) = self . build_package ( name, version, package_kind) {
327
- warn ! ( "failed to build package {} {}: {}" , name, version, err) ;
328
- }
329
- } ,
330
- )
331
- }
332
-
333
311
pub fn build_local_package ( & mut self , path : & Path ) -> Result < bool > {
334
312
self . update_toolchain ( ) ?;
335
313
let metadata = CargoMetadata :: load_from_rustwide ( & self . workspace , & self . toolchain , path)
@@ -348,10 +326,6 @@ impl RustwideBuilder {
348
326
) -> Result < bool > {
349
327
let mut conn = self . db . get ( ) ?;
350
328
351
- if !self . should_build ( & mut conn, name, version) ? {
352
- return Ok ( false ) ;
353
- }
354
-
355
329
self . update_toolchain ( ) ?;
356
330
357
331
info ! ( "building package {} {}" , name, version) ;
@@ -859,23 +833,6 @@ impl RustwideBuilder {
859
833
copy_dir_all ( source, dest) . map_err ( Into :: into)
860
834
}
861
835
862
- fn should_build ( & self , conn : & mut Client , name : & str , version : & str ) -> Result < bool > {
863
- if self . skip_build_if_exists {
864
- // Check whether no successful builds are present in the database.
865
- Ok ( conn
866
- . query (
867
- "SELECT 1 FROM crates, releases, builds
868
- WHERE crates.id = releases.crate_id AND releases.id = builds.rid
869
- AND crates.name = $1 AND releases.version = $2
870
- AND builds.build_status = TRUE;" ,
871
- & [ & name, & version] ,
872
- ) ?
873
- . is_empty ( ) )
874
- } else {
875
- Ok ( true )
876
- }
877
- }
878
-
879
836
fn get_repo ( & self , metadata : & MetadataPackage ) -> Result < Option < i32 > > {
880
837
self . repository_stats_updater
881
838
. load_repository ( metadata)
0 commit comments