Skip to content

Commit aa61304

Browse files
Move jobserver integration into separate crate
Future commits on this branch will make our implementation pretty specific to rustc (i.e., talking to Cargo and such) so coupling ourselves into rustc_data_structures which is intended to be more "agnostic" isn't a great fit. This also removes uses of the jobserver inside rustc that refer directly to the `jobsever` crate (and similar cleanups will follow in the next few commits).
1 parent 21ed505 commit aa61304

File tree

13 files changed

+39
-14
lines changed

13 files changed

+39
-14
lines changed

Cargo.lock

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3113,7 +3113,6 @@ dependencies = [
31133113
"chalk-engine",
31143114
"fmt_macros",
31153115
"graphviz",
3116-
"jobserver",
31173116
"log",
31183117
"measureme",
31193118
"parking_lot 0.9.0",
@@ -3127,6 +3126,7 @@ dependencies = [
31273126
"rustc_feature",
31283127
"rustc_hir",
31293128
"rustc_index",
3129+
"rustc_jobserver",
31303130
"rustc_macros",
31313131
"rustc_session",
31323132
"rustc_span",
@@ -3587,7 +3587,6 @@ version = "0.0.0"
35873587
dependencies = [
35883588
"bitflags",
35893589
"cc",
3590-
"jobserver",
35913590
"libc",
35923591
"log",
35933592
"memmap",
@@ -3602,6 +3601,7 @@ dependencies = [
36023601
"rustc_hir",
36033602
"rustc_incremental",
36043603
"rustc_index",
3604+
"rustc_jobserver",
36053605
"rustc_session",
36063606
"rustc_span",
36073607
"rustc_target",
@@ -3636,7 +3636,6 @@ dependencies = [
36363636
"ena",
36373637
"graphviz",
36383638
"indexmap",
3639-
"jobserver",
36403639
"lazy_static 1.4.0",
36413640
"log",
36423641
"measureme",
@@ -3796,6 +3795,7 @@ dependencies = [
37963795
"rustc_expand",
37973796
"rustc_hir",
37983797
"rustc_incremental",
3798+
"rustc_jobserver",
37993799
"rustc_lint",
38003800
"rustc_metadata",
38013801
"rustc_mir",
@@ -3818,6 +3818,15 @@ dependencies = [
38183818
"winapi 0.3.8",
38193819
]
38203820

3821+
[[package]]
3822+
name = "rustc_jobserver"
3823+
version = "0.0.0"
3824+
dependencies = [
3825+
"jobserver",
3826+
"lazy_static 1.4.0",
3827+
"log",
3828+
]
3829+
38213830
[[package]]
38223831
name = "rustc_lexer"
38233832
version = "0.1.0"
@@ -4055,6 +4064,7 @@ dependencies = [
40554064
"rustc_feature",
40564065
"rustc_fs_util",
40574066
"rustc_index",
4067+
"rustc_jobserver",
40584068
"rustc_span",
40594069
"rustc_target",
40604070
"serialize",

src/librustc/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ arena = { path = "../libarena" }
1414
bitflags = "1.2.1"
1515
fmt_macros = { path = "../libfmt_macros" }
1616
graphviz = { path = "../libgraphviz" }
17-
jobserver = "0.1"
17+
rustc_jobserver = { path = "../librustc_jobserver" }
1818
scoped-tls = "1.0"
1919
log = { version = "0.4", features = ["release_max_level_info", "std"] }
2020
rustc-rayon = "0.3.0"

src/librustc/ty/query/job.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ use {
1818
rustc_data_structures::stable_hasher::{HashStable, StableHasher},
1919
rustc_data_structures::sync::Lock,
2020
rustc_data_structures::sync::Lrc,
21-
rustc_data_structures::{jobserver, OnDrop},
22-
rustc_rayon_core as rayon_core,
21+
rustc_data_structures::OnDrop,
22+
rustc_jobserver as jobserver, rustc_rayon_core as rayon_core,
2323
rustc_span::DUMMY_SP,
2424
std::iter::FromIterator,
2525
std::{mem, process, thread},

src/librustc_codegen_ssa/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ num_cpus = "1.0"
1616
memmap = "0.7"
1717
log = "0.4.5"
1818
libc = "0.2.44"
19-
jobserver = "0.1.11"
2019
tempfile = "3.1"
2120

2221
rustc_serialize = { path = "../libserialize", package = "serialize" }
@@ -34,3 +33,4 @@ rustc_incremental = { path = "../librustc_incremental" }
3433
rustc_index = { path = "../librustc_index" }
3534
rustc_target = { path = "../librustc_target" }
3635
rustc_session = { path = "../librustc_session" }
36+
rustc_jobserver = { path = "../librustc_jobserver" }

src/librustc_codegen_ssa/back/write.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ use crate::{
1010
};
1111

1212
use crate::traits::*;
13-
use jobserver::{Acquired, Client};
1413
use rustc::dep_graph::{WorkProduct, WorkProductFileKind, WorkProductId};
1514
use rustc::middle::cstore::EncodedMetadata;
1615
use rustc::middle::exported_symbols::SymbolExportLevel;
@@ -32,6 +31,7 @@ use rustc_hir::def_id::{CrateNum, LOCAL_CRATE};
3231
use rustc_incremental::{
3332
copy_cgu_workproducts_to_incr_comp_cache_dir, in_incr_comp_dir, in_incr_comp_dir_sess,
3433
};
34+
use rustc_jobserver::{Acquired, Client};
3535
use rustc_session::cgu_reuse_tracker::CguReuseTracker;
3636
use rustc_span::hygiene::ExpnId;
3737
use rustc_span::source_map::SourceMap;

src/librustc_data_structures/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ doctest = false
1313
ena = "0.13.1"
1414
indexmap = "1"
1515
log = "0.4"
16-
jobserver_crate = { version = "0.1.13", package = "jobserver" }
1716
lazy_static = "1"
1817
rustc_serialize = { path = "../libserialize", package = "serialize" }
1918
graphviz = { path = "../libgraphviz" }

src/librustc_data_structures/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ pub mod const_cstr;
6767
pub mod flock;
6868
pub mod fx;
6969
pub mod graph;
70-
pub mod jobserver;
7170
pub mod macros;
7271
pub mod obligation_forest;
7372
pub mod owning_ref;

src/librustc_interface/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ rustc_ast_passes = { path = "../librustc_ast_passes" }
2727
rustc_incremental = { path = "../librustc_incremental" }
2828
rustc_traits = { path = "../librustc_traits" }
2929
rustc_data_structures = { path = "../librustc_data_structures" }
30+
rustc_jobserver = { path = "../librustc_jobserver" }
3031
rustc_codegen_ssa = { path = "../librustc_codegen_ssa" }
3132
rustc_codegen_utils = { path = "../librustc_codegen_utils" }
3233
rustc_codegen_llvm = { path = "../librustc_codegen_llvm", optional = true }

src/librustc_interface/util.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ use rustc::ty;
44
use rustc_codegen_utils::codegen_backend::CodegenBackend;
55
use rustc_data_structures::fingerprint::Fingerprint;
66
use rustc_data_structures::fx::{FxHashMap, FxHashSet};
7-
#[cfg(parallel_compiler)]
8-
use rustc_data_structures::jobserver;
97
use rustc_data_structures::stable_hasher::StableHasher;
108
use rustc_data_structures::sync::{Lock, Lrc};
119
use rustc_errors::registry::Registry;
10+
#[cfg(parallel_compiler)]
11+
use rustc_jobserver as jobserver;
1212
use rustc_metadata::dynamic_lib::DynamicLibrary;
1313
use rustc_resolve::{self, Resolver};
1414
use rustc_session as session;

src/librustc_jobserver/Cargo.toml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
[package]
2+
authors = ["The Rust Project Developers"]
3+
name = "rustc_jobserver"
4+
version = "0.0.0"
5+
edition = "2018"
6+
7+
[lib]
8+
name = "rustc_jobserver"
9+
path = "lib.rs"
10+
doctest = false
11+
12+
[dependencies]
13+
jobserver = "0.1.21"
14+
log = "0.4"
15+
lazy_static = "1"

0 commit comments

Comments
 (0)