Skip to content

Commit 791cccc

Browse files
authored
Merge pull request #5 from rust-lang/master
update from origin 2020-06-19
2 parents 7ef9eb3 + 72417d8 commit 791cccc

File tree

301 files changed

+3915
-1882
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

301 files changed

+3915
-1882
lines changed

Cargo.toml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,19 @@ debug-assertions = false
4242
debug = false
4343
debug-assertions = false
4444

45+
[profile.release.package.compiler_builtins]
46+
# For compiler-builtins we always use a high number of codegen units.
47+
# The goal here is to place every single intrinsic into its own object
48+
# file to avoid symbol clashes with the system libgcc if possible. Note
49+
# that this number doesn't actually produce this many object files, we
50+
# just don't create more than this number of object files.
51+
#
52+
# It's a bit of a bummer that we have to pass this here, unfortunately.
53+
# Ideally this would be specified through an env var to Cargo so Cargo
54+
# knows how many CGUs are for this specific crate, but for now
55+
# per-crate configuration isn't specifiable in the environment.
56+
codegen-units = 10000
57+
4558
# We want the RLS to use the version of Cargo that we've got vendored in this
4659
# repository to ensure that the same exact version of Cargo is used by both the
4760
# RLS and the Cargo binary itself. The RLS depends on Cargo as a git repository

config.toml.example

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,8 @@
209209
# Build the sanitizer runtimes
210210
#sanitizers = false
211211

212-
# Build the profiler runtime
212+
# Build the profiler runtime (required when compiling with options that depend
213+
# on this runtime, such as `-C profile-generate` or `-Z instrument-coverage`).
213214
#profiler = false
214215

215216
# Indicates whether the native libraries linked into Cargo will be statically

src/bootstrap/bootstrap.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -894,7 +894,7 @@ def bootstrap(help_triggered):
894894
build.clean = args.clean
895895

896896
try:
897-
toml_path = args.config or 'config.toml'
897+
toml_path = os.getenv('RUST_BOOTSTRAP_CONFIG') or args.config or 'config.toml'
898898
if not os.path.exists(toml_path):
899899
toml_path = os.path.join(build.rust_root, toml_path)
900900

@@ -947,6 +947,7 @@ def bootstrap(help_triggered):
947947
env["SRC"] = build.rust_root
948948
env["BOOTSTRAP_PARENT_ID"] = str(os.getpid())
949949
env["BOOTSTRAP_PYTHON"] = sys.executable
950+
env["BOOTSTRAP_CONFIG"] = toml_path
950951
env["BUILD_DIR"] = build.build_dir
951952
env["RUSTC_BOOTSTRAP"] = '1'
952953
env["CARGO"] = build.cargo()

src/bootstrap/builder.rs

Lines changed: 41 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,21 @@ struct StepDescription {
9999
name: &'static str,
100100
}
101101

102+
/// Collection of paths used to match a task rule.
102103
#[derive(Debug, Clone, PartialOrd, Ord, PartialEq, Eq)]
103104
pub enum PathSet {
105+
/// A collection of individual paths.
106+
///
107+
/// These are generally matched as a path suffix. For example, a
108+
/// command-line value of `libstd` will match if `src/libstd` is in the
109+
/// set.
104110
Set(BTreeSet<PathBuf>),
111+
/// A "suite" of paths.
112+
///
113+
/// These can match as a path suffix (like `Set`), or as a prefix. For
114+
/// example, a command-line value of `src/test/ui/abi/variadic-ffi.rs`
115+
/// will match `src/test/ui`. A command-line value of `ui` would also
116+
/// match `src/test/ui`.
105117
Suite(PathBuf),
106118
}
107119

@@ -251,21 +263,33 @@ impl<'a> ShouldRun<'a> {
251263
self
252264
}
253265

254-
// Unlike `krate` this will create just one pathset. As such, it probably shouldn't actually
255-
// ever be used, but as we transition to having all rules properly handle passing krate(...) by
256-
// actually doing something different for every crate passed.
266+
/// Indicates it should run if the command-line selects the given crate or
267+
/// any of its (local) dependencies.
268+
///
269+
/// Compared to `krate`, this treats the dependencies as aliases for the
270+
/// same job. Generally it is preferred to use `krate`, and treat each
271+
/// individual path separately. For example `./x.py test src/liballoc`
272+
/// (which uses `krate`) will test just `liballoc`. However, `./x.py check
273+
/// src/liballoc` (which uses `all_krates`) will check all of `libtest`.
274+
/// `all_krates` should probably be removed at some point.
257275
pub fn all_krates(mut self, name: &str) -> Self {
258276
let mut set = BTreeSet::new();
259277
for krate in self.builder.in_tree_crates(name) {
260-
set.insert(PathBuf::from(&krate.path));
278+
let path = krate.local_path(self.builder);
279+
set.insert(path);
261280
}
262281
self.paths.insert(PathSet::Set(set));
263282
self
264283
}
265284

285+
/// Indicates it should run if the command-line selects the given crate or
286+
/// any of its (local) dependencies.
287+
///
288+
/// `make_run` will be called separately for each matching command-line path.
266289
pub fn krate(mut self, name: &str) -> Self {
267290
for krate in self.builder.in_tree_crates(name) {
268-
self.paths.insert(PathSet::one(&krate.path));
291+
let path = krate.local_path(self.builder);
292+
self.paths.insert(PathSet::one(path));
269293
}
270294
self
271295
}
@@ -488,13 +512,19 @@ impl<'a> Builder<'a> {
488512
should_run = (desc.should_run)(should_run);
489513
}
490514
let mut help = String::from("Available paths:\n");
515+
let mut add_path = |path: &Path| {
516+
help.push_str(&format!(" ./x.py {} {}\n", subcommand, path.display()));
517+
};
491518
for pathset in should_run.paths {
492-
if let PathSet::Set(set) = pathset {
493-
set.iter().for_each(|path| {
494-
help.push_str(
495-
format!(" ./x.py {} {}\n", subcommand, path.display()).as_str(),
496-
)
497-
})
519+
match pathset {
520+
PathSet::Set(set) => {
521+
for path in set {
522+
add_path(&path);
523+
}
524+
}
525+
PathSet::Suite(path) => {
526+
add_path(&path.join("..."));
527+
}
498528
}
499529
}
500530
Some(help)

0 commit comments

Comments
 (0)