Skip to content

Commit

Permalink
[beta] Revert scalable jobserver.
Browse files Browse the repository at this point in the history
  • Loading branch information
ehuss committed Jan 31, 2020
1 parent de6c78c commit 77d6a52
Show file tree
Hide file tree
Showing 6 changed files with 170 additions and 510 deletions.
23 changes: 0 additions & 23 deletions src/cargo/core/compiler/context/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,6 @@ pub struct Context<'a, 'cfg> {
/// metadata files in addition to the rlib itself. This is only filled in
/// when `pipelining` above is enabled.
rmeta_required: HashSet<Unit<'a>>,

/// When we're in jobserver-per-rustc process mode, this keeps those
/// jobserver clients for each Unit (which eventually becomes a rustc
/// process).
pub rustc_clients: HashMap<Unit<'a>, Client>,
}

impl<'a, 'cfg> Context<'a, 'cfg> {
Expand Down Expand Up @@ -117,7 +112,6 @@ impl<'a, 'cfg> Context<'a, 'cfg> {
unit_dependencies,
files: None,
rmeta_required: HashSet::new(),
rustc_clients: HashMap::new(),
pipelining,
})
}
Expand Down Expand Up @@ -497,21 +491,4 @@ impl<'a, 'cfg> Context<'a, 'cfg> {
pub fn rmeta_required(&self, unit: &Unit<'a>) -> bool {
self.rmeta_required.contains(unit) || self.bcx.config.cli_unstable().timings.is_some()
}

pub fn new_jobserver(&mut self) -> CargoResult<Client> {
let tokens = self.bcx.build_config.jobs as usize;
let client = Client::new(tokens).chain_err(|| "failed to create jobserver")?;

// Drain the client fully
for i in 0..tokens {
client.acquire_raw().chain_err(|| {
format!(
"failed to fully drain {}/{} token from jobserver at startup",
i, tokens,
)
})?;
}

Ok(client)
}
}
Loading

0 comments on commit 77d6a52

Please sign in to comment.