Skip to content

Commit 59afaf0

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 3ed3b8b commit 59afaf0

File tree

13 files changed

+36
-12
lines changed

13 files changed

+36
-12
lines changed

Cargo.lock

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3151,7 +3151,6 @@ dependencies = [
31513151
"chalk-engine",
31523152
"fmt_macros",
31533153
"graphviz",
3154-
"jobserver",
31553154
"log",
31563155
"measureme",
31573156
"num_cpus",
@@ -3166,6 +3165,7 @@ dependencies = [
31663165
"rustc_feature",
31673166
"rustc_fs_util",
31683167
"rustc_index",
3168+
"rustc_jobserver",
31693169
"rustc_macros",
31703170
"rustc_session",
31713171
"rustc_target",
@@ -3464,7 +3464,6 @@ version = "0.0.0"
34643464
dependencies = [
34653465
"bitflags",
34663466
"cc",
3467-
"jobserver",
34683467
"libc",
34693468
"log",
34703469
"memmap",
@@ -3478,6 +3477,7 @@ dependencies = [
34783477
"rustc_fs_util",
34793478
"rustc_incremental",
34803479
"rustc_index",
3480+
"rustc_jobserver",
34813481
"rustc_session",
34823482
"rustc_target",
34833483
"serialize",
@@ -3511,7 +3511,6 @@ dependencies = [
35113511
"ena",
35123512
"graphviz",
35133513
"indexmap",
3514-
"jobserver",
35153514
"lazy_static 1.3.0",
35163515
"log",
35173516
"measureme",
@@ -3623,6 +3622,7 @@ dependencies = [
36233622
"rustc_data_structures",
36243623
"rustc_errors",
36253624
"rustc_incremental",
3625+
"rustc_jobserver",
36263626
"rustc_lint",
36273627
"rustc_metadata",
36283628
"rustc_mir",
@@ -3643,6 +3643,14 @@ dependencies = [
36433643
"tempfile",
36443644
]
36453645

3646+
[[package]]
3647+
name = "rustc_jobserver"
3648+
version = "0.0.0"
3649+
dependencies = [
3650+
"jobserver",
3651+
"lazy_static 1.3.0",
3652+
]
3653+
36463654
[[package]]
36473655
name = "rustc_lexer"
36483656
version = "0.1.0"
@@ -3859,6 +3867,7 @@ dependencies = [
38593867
"rustc_feature",
38603868
"rustc_fs_util",
38613869
"rustc_index",
3870+
"rustc_jobserver",
38623871
"rustc_target",
38633872
"serialize",
38643873
"syntax_pos",

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
num_cpus = "1.0"
1919
scoped-tls = "1.0"
2020
log = { version = "0.4", features = ["release_max_level_info", "std"] }

src/librustc/ty/query/job.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ use std::ptr;
1212
#[cfg(parallel_compiler)]
1313
use {
1414
parking_lot::{Mutex, Condvar},
15-
rustc_data_structures::{jobserver, OnDrop},
15+
rustc_data_structures::{OnDrop},
16+
rustc_jobserver as jobserver,
1617
rustc_data_structures::fx::FxHashSet,
1718
rustc_data_structures::stable_hasher::{StableHasher, HashStable},
1819
rustc_data_structures::sync::Lock,

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" }
@@ -33,3 +32,4 @@ rustc_index = { path = "../librustc_index" }
3332
rustc_target = { path = "../librustc_target" }
3433
rustc_error_codes = { path = "../librustc_error_codes" }
3534
rustc_session = { path = "../librustc_session" }
35+
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
@@ -30,7 +30,7 @@ use rustc_target::spec::MergeFunctions;
3030
use syntax::attr;
3131
use syntax_pos::hygiene::ExpnId;
3232
use syntax_pos::symbol::{Symbol, sym};
33-
use jobserver::{Client, Acquired};
33+
use rustc_jobserver::{Client, Acquired};
3434

3535
use std::any::Any;
3636
use std::fs;

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
@@ -75,7 +75,6 @@ pub mod flock;
7575
pub mod fx;
7676
pub mod stable_map;
7777
pub mod graph;
78-
pub mod jobserver;
7978
pub mod obligation_forest;
8079
pub mod owning_ref;
8180
pub mod ptr_key;

src/librustc_interface/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ rustc = { path = "../librustc" }
2323
rustc_incremental = { path = "../librustc_incremental" }
2424
rustc_traits = { path = "../librustc_traits" }
2525
rustc_data_structures = { path = "../librustc_data_structures" }
26+
rustc_jobserver = { path = "../librustc_jobserver" }
2627
rustc_codegen_ssa = { path = "../librustc_codegen_ssa" }
2728
rustc_codegen_utils = { path = "../librustc_codegen_utils" }
2829
rustc_codegen_llvm = { path = "../librustc_codegen_llvm", optional = true }

src/librustc_interface/util.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use rustc::ty;
66
use rustc::lint;
77
use rustc_codegen_utils::codegen_backend::CodegenBackend;
88
#[cfg(parallel_compiler)]
9-
use rustc_data_structures::jobserver;
9+
use rustc_jobserver as jobserver;
1010
use rustc_data_structures::sync::{Lock, Lrc};
1111
use rustc_data_structures::stable_hasher::StableHasher;
1212
use rustc_data_structures::fingerprint::Fingerprint;

src/librustc_jobserver/Cargo.toml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
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_crate = { version = "0.1.13", package = "jobserver" }
14+
lazy_static = "1"

0 commit comments

Comments
 (0)