Skip to content

Commit 2b3259e

Browse files
Mark-Simulacrumvivekvpandya
authored andcommittedDec 18, 2019
Revert "Auto merge of rust-lang#67362 - Mark-Simulacrum:par-4-default, r=alexcrichton"
This reverts commit 3ed3b8b, reversing changes made to 99b8953. We will reland a similar patch at a future date but for now we should get a nightly released in a few hours with the parallel patch, so this should be reverted to make sure that the next nightly is not parallel-enabled.
1 parent 8a6f726 commit 2b3259e

File tree

9 files changed

+50
-36
lines changed

9 files changed

+50
-36
lines changed
 

‎src/bootstrap/test.rs

+13-13
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
//! our CI.
55
66
use std::env;
7-
//use std::ffi::OsString;
7+
use std::ffi::OsString;
88
use std::fmt;
99
use std::fs;
10-
//use std::iter;
10+
use std::iter;
1111
use std::path::{Path, PathBuf};
1212
use std::process::Command;
1313

@@ -204,8 +204,8 @@ impl Step for Cargo {
204204
}
205205

206206
/// Runs `cargo test` for `cargo` packaged with Rust.
207-
fn run(self, _builder: &Builder<'_>) {
208-
/*let compiler = builder.compiler(self.stage, self.host);
207+
fn run(self, builder: &Builder<'_>) {
208+
let compiler = builder.compiler(self.stage, self.host);
209209

210210
builder.ensure(tool::Cargo {
211211
compiler,
@@ -235,7 +235,7 @@ impl Step for Cargo {
235235

236236
cargo.env("PATH", &path_for_cargo(builder, compiler));
237237

238-
try_run(builder, &mut cargo.into());*/
238+
try_run(builder, &mut cargo.into());
239239
}
240240
}
241241

@@ -590,14 +590,14 @@ impl Step for Clippy {
590590
}
591591
}
592592

593-
//fn path_for_cargo(builder: &Builder<'_>, compiler: Compiler) -> OsString {
594-
// // Configure PATH to find the right rustc. NB. we have to use PATH
595-
// // and not RUSTC because the Cargo test suite has tests that will
596-
// // fail if rustc is not spelled `rustc`.
597-
// let path = builder.sysroot(compiler).join("bin");
598-
// let old_path = env::var_os("PATH").unwrap_or_default();
599-
// env::join_paths(iter::once(path).chain(env::split_paths(&old_path))).expect("")
600-
//}
593+
fn path_for_cargo(builder: &Builder<'_>, compiler: Compiler) -> OsString {
594+
// Configure PATH to find the right rustc. NB. we have to use PATH
595+
// and not RUSTC because the Cargo test suite has tests that will
596+
// fail if rustc is not spelled `rustc`.
597+
let path = builder.sysroot(compiler).join("bin");
598+
let old_path = env::var_os("PATH").unwrap_or_default();
599+
env::join_paths(iter::once(path).chain(env::split_paths(&old_path))).expect("")
600+
}
601601

602602
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
603603
pub struct RustdocTheme {

‎src/ci/run.sh

+3-2
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,6 @@ if [ "$DIST_SRC" = "" ]; then
3737
RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --disable-dist-src"
3838
fi
3939

40-
RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --set rust.parallel-compiler"
41-
4240
# If we're deploying artifacts then we set the release channel, otherwise if
4341
# we're not deploying then we want to be sure to enable all assertions because
4442
# we'll be running tests
@@ -55,6 +53,9 @@ if [ "$DEPLOY$DEPLOY_ALT" = "1" ]; then
5553
if [ "$NO_LLVM_ASSERTIONS" = "1" ]; then
5654
RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --disable-llvm-assertions"
5755
elif [ "$DEPLOY_ALT" != "" ]; then
56+
if [ "$NO_PARALLEL_COMPILER" = "" ]; then
57+
RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --set rust.parallel-compiler"
58+
fi
5859
RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --enable-llvm-assertions"
5960
RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --set rust.verify-llvm-ir"
6061
fi

‎src/librustc/dep_graph/graph.rs

+7-7
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use rustc_data_structures::stable_hasher::{HashStable, StableHasher};
33
use rustc_data_structures::fx::{FxHashMap, FxHashSet};
44
use rustc_index::vec::{Idx, IndexVec};
55
use smallvec::SmallVec;
6-
use rustc_data_structures::sync::{Lrc, Lock, AtomicU32, AtomicUsize, Ordering};
6+
use rustc_data_structures::sync::{Lrc, Lock, AtomicU32, AtomicU64, Ordering};
77
use rustc_data_structures::sharded::{self, Sharded};
88
use std::sync::atomic::Ordering::SeqCst;
99
use std::env;
@@ -485,8 +485,8 @@ impl DepGraph {
485485
if cfg!(debug_assertions) {
486486
let current_dep_graph = &self.data.as_ref().unwrap().current;
487487

488-
Some((current_dep_graph.total_read_count.load(SeqCst) as u64,
489-
current_dep_graph.total_duplicate_read_count.load(SeqCst) as u64))
488+
Some((current_dep_graph.total_read_count.load(SeqCst),
489+
current_dep_graph.total_duplicate_read_count.load(SeqCst)))
490490
} else {
491491
None
492492
}
@@ -970,8 +970,8 @@ pub(super) struct CurrentDepGraph {
970970

971971
/// These are simple counters that are for profiling and
972972
/// debugging and only active with `debug_assertions`.
973-
total_read_count: AtomicUsize,
974-
total_duplicate_read_count: AtomicUsize,
973+
total_read_count: AtomicU64,
974+
total_duplicate_read_count: AtomicU64,
975975
}
976976

977977
impl CurrentDepGraph {
@@ -1012,8 +1012,8 @@ impl CurrentDepGraph {
10121012
)),
10131013
anon_id_seed: stable_hasher.finish(),
10141014
forbidden_edge,
1015-
total_read_count: AtomicUsize::new(0),
1016-
total_duplicate_read_count: AtomicUsize::new(0),
1015+
total_read_count: AtomicU64::new(0),
1016+
total_duplicate_read_count: AtomicU64::new(0),
10171017
}
10181018
}
10191019

‎src/librustc_data_structures/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
#![feature(integer_atomics)]
2525
#![feature(test)]
2626
#![feature(associated_type_bounds)]
27-
#![feature(cfg_target_has_atomic)]
2827

2928
#![cfg_attr(unix, feature(libc))]
3029

‎src/librustc_data_structures/sync.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -317,9 +317,7 @@ cfg_if! {
317317
pub use parking_lot::MutexGuard as LockGuard;
318318
pub use parking_lot::MappedMutexGuard as MappedLockGuard;
319319

320-
pub use std::sync::atomic::{AtomicBool, AtomicUsize, AtomicU32};
321-
#[cfg(target_has_atomic = "64")]
322-
pub use std::sync::atomic::{AtomicU64};
320+
pub use std::sync::atomic::{AtomicBool, AtomicUsize, AtomicU32, AtomicU64};
323321

324322
pub use crossbeam_utils::atomic::AtomicCell;
325323

‎src/librustc_session/config.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -1358,11 +1358,11 @@ options! {DebuggingOptions, DebuggingSetter, basic_debugging_options,
13581358
"prints the LLVM optimization passes being run"),
13591359
ast_json: bool = (false, parse_bool, [UNTRACKED],
13601360
"print the AST as JSON and halt"),
1361-
// We default to min(4, vCPUs) here since we want to avoid spawning *too*
1362-
// many threads -- that causes scalability issues due to contention on
1363-
// the jobserver pipe (at least) -- but 4 is a reasonable amount on systems
1364-
// with lots of cores.
1365-
threads: usize = (std::cmp::min(::num_cpus::get(), 4), parse_threads, [UNTRACKED],
1361+
// We default to 1 here since we want to behave like
1362+
// a sequential compiler for now. This'll likely be adjusted
1363+
// in the future. Note that -Zthreads=0 is the way to get
1364+
// the num_cpus behavior.
1365+
threads: usize = (1, parse_threads, [UNTRACKED],
13661366
"use a thread pool with N threads"),
13671367
ast_json_noexpand: bool = (false, parse_bool, [UNTRACKED],
13681368
"print the pre-expansion AST as JSON and halt"),

‎src/librustc_session/session.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ use rustc_errors::ErrorReported;
1414

1515
use rustc_data_structures::base_n;
1616
use rustc_data_structures::sync::{
17-
self, Lrc, Lock, OneThread, Once, AtomicUsize, Ordering,
17+
self, Lrc, Lock, OneThread, Once, AtomicU64, AtomicUsize, Ordering,
1818
Ordering::SeqCst,
1919
};
2020
use rustc_data_structures::impl_stable_hash_via_hash;
@@ -119,7 +119,7 @@ pub struct Session {
119119
/// If `-zprint-fuel=crate`, `Some(crate)`.
120120
pub print_fuel_crate: Option<String>,
121121
/// Always set to zero and incremented so that we can print fuel expended by a crate.
122-
pub print_fuel: AtomicUsize,
122+
pub print_fuel: AtomicU64,
123123

124124
/// Loaded up early on in the initialization of this `Session` to avoid
125125
/// false positives about a job server in our environment.
@@ -1116,7 +1116,7 @@ fn build_session_(
11161116
out_of_fuel: false,
11171117
});
11181118
let print_fuel_crate = sopts.debugging_opts.print_fuel.clone();
1119-
let print_fuel = AtomicUsize::new(0);
1119+
let print_fuel = AtomicU64::new(0);
11201120

11211121
let working_dir = env::current_dir().unwrap_or_else(|e|
11221122
parse_sess.span_diagnostic

‎src/test/ui/traits/cycle-cache-err-60010.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ struct SalsaStorage {
2828
}
2929

3030
impl Database for RootDatabase {
31-
type Storage = SalsaStorage;
31+
type Storage = SalsaStorage; //~ ERROR overflow
3232
}
3333
impl HasQueryGroup for RootDatabase {}
3434
impl<DB> Query<DB> for ParseQuery

‎src/test/ui/traits/cycle-cache-err-60010.stderr

+17-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,22 @@ LL | _parse: <ParseQuery as Query<RootDatabase>>::Data,
66
|
77
= note: required because of the requirements on the impl of `Query<RootDatabase>` for `ParseQuery`
88

9-
error: aborting due to previous error
9+
error[E0275]: overflow evaluating the requirement `Runtime<RootDatabase>: std::panic::RefUnwindSafe`
10+
--> $DIR/cycle-cache-err-60010.rs:31:5
11+
|
12+
LL | type Storage;
13+
| ------- associated type defined here
14+
...
15+
LL | impl Database for RootDatabase {
16+
| ------------------------------ in this `impl` item
17+
LL | type Storage = SalsaStorage;
18+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
19+
|
20+
= note: required because it appears within the type `RootDatabase`
21+
= note: required because of the requirements on the impl of `SourceDatabase` for `RootDatabase`
22+
= note: required because of the requirements on the impl of `Query<RootDatabase>` for `ParseQuery`
23+
= note: required because it appears within the type `SalsaStorage`
24+
25+
error: aborting due to 2 previous errors
1026

1127
For more information about this error, try `rustc --explain E0275`.

0 commit comments

Comments
 (0)
Please sign in to comment.