Skip to content

Commit

Permalink
Merge pull request #7 from rust-lang/master
Browse files Browse the repository at this point in the history
update from origin 2020-06-27
  • Loading branch information
richkadel authored Jun 27, 2020
2 parents 50a6d07 + 394e1b4 commit ad00e53
Show file tree
Hide file tree
Showing 604 changed files with 6,942 additions and 2,793 deletions.
57 changes: 45 additions & 12 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -434,9 +434,9 @@ dependencies = [

[[package]]
name = "chalk-derive"
version = "0.11.0"
version = "0.14.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5b9bd01eab87277d973183a1d2e56bace1c11f8242c52c20636fb7dddf343ac9"
checksum = "d463e01905d607e181de72e8608721d3269f29176c9a14ce037011316ae7131d"
dependencies = [
"proc-macro2 1.0.3",
"quote 1.0.2",
Expand All @@ -446,30 +446,31 @@ dependencies = [

[[package]]
name = "chalk-engine"
version = "0.11.0"
version = "0.14.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6c7a637c3d17ed555aef16e16952a5d1e127bd55178cc30be22afeb92da90c7d"
checksum = "efaf428f5398d36284f79690cf988762b7c091249f50a6c11db613a46c057000"
dependencies = [
"chalk-derive",
"chalk-ir",
"rustc-hash",
"tracing",
]

[[package]]
name = "chalk-ir"
version = "0.11.0"
version = "0.14.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "595e5735ded16c3f3dc348f7b15bbb2521a0080b1863cac38ad5271589944670"
checksum = "fd3fdc1e9f68498ffe80f4a23b0b95f1ca6fb21d5a4c9b0c085fab3ca712bdbe"
dependencies = [
"chalk-derive",
"lazy_static",
]

[[package]]
name = "chalk-solve"
version = "0.11.0"
version = "0.14.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5d9d938139db425867a30cc0cfec0269406d8238d0571d829041eaa7a8455d11"
checksum = "5b9fd4102807b7ebe8fb034fa0f488c5656e1966d3261b558b81a08d519cdb29"
dependencies = [
"chalk-derive",
"chalk-engine",
Expand All @@ -478,6 +479,7 @@ dependencies = [
"itertools 0.9.0",
"petgraph",
"rustc-hash",
"tracing",
]

[[package]]
Expand Down Expand Up @@ -5332,6 +5334,37 @@ dependencies = [
"syn 0.15.35",
]

[[package]]
name = "tracing"
version = "0.1.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a41f40ed0e162c911ac6fcb53ecdc8134c46905fdbbae8c50add462a538b495f"
dependencies = [
"cfg-if",
"tracing-attributes",
"tracing-core",
]

[[package]]
name = "tracing-attributes"
version = "0.1.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "99bbad0de3fd923c9c3232ead88510b783e5a4d16a6154adffa3d53308de984c"
dependencies = [
"proc-macro2 1.0.3",
"quote 1.0.2",
"syn 1.0.11",
]

[[package]]
name = "tracing-core"
version = "0.1.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0aa83a9a47081cd522c09c81b31aec2c9273424976f922ad61c053b58350b715"
dependencies = [
"lazy_static",
]

[[package]]
name = "try-lock"
version = "0.2.2"
Expand Down Expand Up @@ -5405,15 +5438,15 @@ dependencies = [

[[package]]
name = "unicode-script"
version = "0.4.0"
version = "0.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5b2c5c29e805da6817f5af6a627d65adb045cebf05cccd5a3493d6109454391c"
checksum = "58b33414ea8db4b7ea0343548dbdc31d27aef06beacf7044a87e564d9b0feb7d"

[[package]]
name = "unicode-security"
version = "0.0.3"
version = "0.0.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a5f9011bbed9c13372bc8df618b55a38138445199caf3b61d432c6859c36dee0"
checksum = "5d87c28edc5b263377e448d6cdcb935c06b95413d8013ba6fae470558ccab18f"
dependencies = [
"unicode-normalization",
"unicode-script",
Expand Down
38 changes: 28 additions & 10 deletions config.toml.example
Original file line number Diff line number Diff line change
Expand Up @@ -118,18 +118,24 @@
# nightlies are already produced for. The current platform must be able to run
# binaries of this build triple and the nightly will be used to bootstrap the
# first compiler.
#build = "x86_64-unknown-linux-gnu" # defaults to your host platform
#
# Defaults to host platform
#build = "x86_64-unknown-linux-gnu"

# In addition to the build triple, other triples to produce full compiler
# toolchains for. Each of these triples will be bootstrapped from the build
# triple and then will continue to bootstrap themselves. This platform must
# currently be able to run all of the triples provided here.
#host = ["x86_64-unknown-linux-gnu"] # defaults to just the build triple
#
# Defaults to just the build triple
#host = ["x86_64-unknown-linux-gnu"]

# In addition to all host triples, other triples to produce the standard library
# for. Each host triple will be used to produce a copy of the standard library
# for each target triple.
#target = ["x86_64-unknown-linux-gnu"] # defaults to just the build triple
#
# Defaults to just the build triple
#target = ["x86_64-unknown-linux-gnu"]

# Use this directory to store build artifacts.
# You can use "$ROOT" to indicate the root of the git repository.
Expand Down Expand Up @@ -174,7 +180,7 @@
# Python interpreter to use for various tasks throughout the build, notably
# rustdoc tests, the lldb python interpreter, and some dist bits and pieces.
#
# Defaults to the Python interpreter used to execute x.py.
# Defaults to the Python interpreter used to execute x.py
#python = "python"

# Force Cargo to check that Cargo.lock describes the precise dependency
Expand Down Expand Up @@ -313,11 +319,15 @@

# Whether or not debug assertions are enabled for the compiler and standard
# library.
#debug-assertions = debug
#
# Defaults to rust.debug value
#debug-assertions = false

# Whether or not debug assertions are enabled for the standard library.
# Overrides the `debug-assertions` option, if defined.
#debug-assertions-std = debug-assertions
#
# Defaults to rust.debug-assertions value
#debug-assertions-std = false

# Debuginfo level for most of Rust code, corresponds to the `-C debuginfo=N` option of `rustc`.
# `0` - no debug info
Expand All @@ -326,16 +336,24 @@
# Can be overridden for specific subsets of Rust code (rustc, std or tools).
# Debuginfo for tests run with compiletest is not controlled by this option
# and needs to be enabled separately with `debuginfo-level-tests`.
#debuginfo-level = if debug { 2 } else { 0 }
#
# Defaults to 2 if debug is true
#debuginfo-level = 0

# Debuginfo level for the compiler.
#debuginfo-level-rustc = debuginfo-level
#
# Defaults to rust.debuginfo-level value
#debuginfo-level-rustc = 0

# Debuginfo level for the standard library.
#debuginfo-level-std = debuginfo-level
#
# Defaults to rust.debuginfo-level value
#debuginfo-level-std = 0

# Debuginfo level for the tools.
#debuginfo-level-tools = debuginfo-level
#
# Defaults to rust.debuginfo-level value
#debuginfo-level-tools = 0

# Debuginfo level for the test suites run with compiletest.
# FIXME(#61117): Some tests fail when this option is enabled.
Expand Down
6 changes: 6 additions & 0 deletions src/bootstrap/bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ def default_build_triple():
ostype = require(["uname", "-s"], exit=required)
cputype = require(['uname', '-m'], exit=required)

# If we do not have `uname`, assume Windows.
if ostype is None or cputype is None:
return 'x86_64-pc-windows-msvc'

Expand Down Expand Up @@ -236,6 +237,11 @@ def default_build_triple():
if ostype.endswith('WOW64'):
cputype = 'x86_64'
ostype = 'pc-windows-gnu'
elif sys.platform == 'win32':
# Some Windows platforms might have a `uname` command that returns a
# non-standard string (e.g. gnuwin32 tools returns `windows32`). In
# these cases, fall back to using sys.platform.
return 'x86_64-pc-windows-msvc'
else:
err = "unknown OS type: {}".format(ostype)
sys.exit(err)
Expand Down
5 changes: 3 additions & 2 deletions src/bootstrap/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ use crate::install;
use crate::native;
use crate::run;
use crate::test;
use crate::tool;
use crate::tool::{self, SourceType};
use crate::util::{self, add_dylib_path, add_link_lib_path, exe, libdir};
use crate::{Build, DocTests, GitRepo, Mode};

Expand Down Expand Up @@ -759,6 +759,7 @@ impl<'a> Builder<'a> {
&self,
compiler: Compiler,
mode: Mode,
source_type: SourceType,
target: Interned<String>,
cmd: &str,
) -> Cargo {
Expand Down Expand Up @@ -1125,7 +1126,7 @@ impl<'a> Builder<'a> {

cargo.env("RUSTC_VERBOSE", self.verbosity.to_string());

if !mode.is_tool() {
if source_type == SourceType::InTree {
// When extending this list, add the new lints to the RUSTFLAGS of the
// build_bootstrap function of src/bootstrap/bootstrap.py as well as
// some code doesn't go through this `rustc` wrapper.
Expand Down
29 changes: 22 additions & 7 deletions src/bootstrap/check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,13 @@ impl Step for Std {
let target = self.target;
let compiler = builder.compiler(0, builder.config.build);

let mut cargo = builder.cargo(compiler, Mode::Std, target, cargo_subcommand(builder.kind));
let mut cargo = builder.cargo(
compiler,
Mode::Std,
SourceType::InTree,
target,
cargo_subcommand(builder.kind),
);
std_cargo(builder, target, compiler.stage, &mut cargo);

builder.info(&format!("Checking std artifacts ({} -> {})", &compiler.host, target));
Expand Down Expand Up @@ -92,8 +98,13 @@ impl Step for Rustc {

builder.ensure(Std { target });

let mut cargo =
builder.cargo(compiler, Mode::Rustc, target, cargo_subcommand(builder.kind));
let mut cargo = builder.cargo(
compiler,
Mode::Rustc,
SourceType::InTree,
target,
cargo_subcommand(builder.kind),
);
rustc_cargo(builder, &mut cargo, target);

builder.info(&format!("Checking compiler artifacts ({} -> {})", &compiler.host, target));
Expand All @@ -113,7 +124,7 @@ impl Step for Rustc {
}

macro_rules! tool_check_step {
($name:ident, $path:expr) => {
($name:ident, $path:expr, $source_type:expr) => {
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub struct $name {
pub target: Interned<String>,
Expand Down Expand Up @@ -145,7 +156,7 @@ macro_rules! tool_check_step {
target,
cargo_subcommand(builder.kind),
$path,
SourceType::InTree,
$source_type,
&[],
);

Expand Down Expand Up @@ -184,8 +195,12 @@ macro_rules! tool_check_step {
};
}

tool_check_step!(Rustdoc, "src/tools/rustdoc");
tool_check_step!(Clippy, "src/tools/clippy");
tool_check_step!(Rustdoc, "src/tools/rustdoc", SourceType::InTree);
// Clippy is a hybrid. It is an external tool, but uses a git subtree instead
// of a submodule. Since the SourceType only drives the deny-warnings
// behavior, treat it as in-tree so that any new warnings in clippy will be
// rejected.
tool_check_step!(Clippy, "src/tools/clippy", SourceType::InTree);

/// Cargo's output path for the standard library in a given stage, compiled
/// by a particular compiler for the specified target.
Expand Down
31 changes: 9 additions & 22 deletions src/bootstrap/compile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ use filetime::FileTime;
use serde::Deserialize;

use crate::builder::Cargo;
use crate::builder::{Builder, Kind, RunConfig, ShouldRun, Step};
use crate::cache::{Interned, INTERNER};
use crate::dist;
use crate::native;
use crate::tool::SourceType;
use crate::util::{exe, is_dylib, symlink_dir};
use crate::{Compiler, DependencyType, GitRepo, Mode};

use crate::builder::{Builder, Kind, RunConfig, ShouldRun, Step};
use crate::cache::{Interned, INTERNER};

#[derive(Debug, PartialOrd, Ord, Copy, Clone, PartialEq, Eq, Hash)]
pub struct Std {
pub target: Interned<String>,
Expand Down Expand Up @@ -87,7 +87,7 @@ impl Step for Std {
target_deps.extend(copy_third_party_objects(builder, &compiler, target));
target_deps.extend(copy_self_contained_objects(builder, &compiler, target));

let mut cargo = builder.cargo(compiler, Mode::Std, target, "build");
let mut cargo = builder.cargo(compiler, Mode::Std, SourceType::InTree, target, "build");
std_cargo(builder, target, compiler.stage, &mut cargo);

builder.info(&format!(
Expand Down Expand Up @@ -131,26 +131,13 @@ fn copy_third_party_objects(
compiler: &Compiler,
target: Interned<String>,
) -> Vec<(PathBuf, DependencyType)> {
let libdir = builder.sysroot_libdir(*compiler, target);
let mut target_deps = vec![];

// Copies libunwind.a compiled to be linked with x86_64-fortanix-unknown-sgx.
//
// This target needs to be linked to Fortanix's port of llvm's libunwind.
// libunwind requires support for rwlock and printing to stderr,
// which is provided by std for this target.
// FIXME: remove this in 2021
if target == "x86_64-fortanix-unknown-sgx" {
let src_path_env = "X86_FORTANIX_SGX_LIBS";
let src =
env::var(src_path_env).unwrap_or_else(|_| panic!("{} not found in env", src_path_env));
copy_and_stamp(
builder,
&*libdir,
Path::new(&src),
"libunwind.a",
&mut target_deps,
DependencyType::Target,
);
if env::var_os("X86_FORTANIX_SGX_LIBS").is_some() {
builder.info("Warning: X86_FORTANIX_SGX_LIBS environment variable is ignored, libunwind is now compiled as part of rustbuild");
}
}

if builder.config.sanitizers && compiler.stage != 0 {
Expand Down Expand Up @@ -513,7 +500,7 @@ impl Step for Rustc {
target: builder.config.build,
});

let mut cargo = builder.cargo(compiler, Mode::Rustc, target, "build");
let mut cargo = builder.cargo(compiler, Mode::Rustc, SourceType::InTree, target, "build");
rustc_cargo(builder, &mut cargo, target);

builder.info(&format!(
Expand Down
5 changes: 3 additions & 2 deletions src/bootstrap/doc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,8 @@ impl Step for Std {
t!(fs::copy(builder.src.join("src/doc/rust.css"), out.join("rust.css")));

let run_cargo_rustdoc_for = |package: &str| {
let mut cargo = builder.cargo(compiler, Mode::Std, target, "rustdoc");
let mut cargo =
builder.cargo(compiler, Mode::Std, SourceType::InTree, target, "rustdoc");
compile::std_cargo(builder, target, compiler.stage, &mut cargo);

// Keep a whitelist so we do not build internal stdlib crates, these will be
Expand Down Expand Up @@ -534,7 +535,7 @@ impl Step for Rustc {
t!(symlink_dir_force(&builder.config, &out, &out_dir));

// Build cargo command.
let mut cargo = builder.cargo(compiler, Mode::Rustc, target, "doc");
let mut cargo = builder.cargo(compiler, Mode::Rustc, SourceType::InTree, target, "doc");
cargo.env(
"RUSTDOCFLAGS",
"--document-private-items \
Expand Down
Loading

0 comments on commit ad00e53

Please sign in to comment.