Skip to content

Rollup of 11 pull requests #54168

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 25 commits into from
Sep 14, 2018
Merged
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
24093a6
Allow for opting out of ThinLTO and clean up LTO related cli flag han…
michaelwoerister Sep 4, 2018
72ba0ba
Replace unwrap calls in example by expect
GuillaumeGomez Sep 5, 2018
e25e2ab
Add Error::description soft-deprecation to RELEASES
passcod Sep 8, 2018
3cb736a
miri loop detector hashing: fix enum hashing to also consider discrim…
RalfJung Sep 9, 2018
5595aeb
Add rustc SHA to released DWARF debuginfo
alexcrichton Aug 30, 2018
09973d2
Add some unit tests for find_best_match_for_name
phansch Sep 11, 2018
dfd04e1
Update stage0 to latest beta
Sep 11, 2018
3d7099a
Do not emit E0277 on incorrect tuple destructured binding
estebank Aug 14, 2018
633a47b
Simplify the recovered tuple ty
estebank Aug 19, 2018
5f8bf91
address review comment, reduce scope
estebank Sep 12, 2018
3d6c260
Add a test that tries to modify static memory at compile-time
agnxy Sep 12, 2018
3c1efcd
Updated 1.29 release notes with --document-private-items flag
Sep 12, 2018
63cd81c
Add comment explaining reasoning
estebank Sep 12, 2018
9af125d
Rollup merge of #53371 - estebank:tuple, r=nikomatsakis
kennytm Sep 13, 2018
f656fe3
COMPILER_TESTS.md has been moved
kzys Sep 13, 2018
2882119
Rollup merge of #53976 - GuillaumeGomez:expect-world, r=steveklabnik
kennytm Sep 13, 2018
74cf074
Rollup merge of #54070 - passcod:patch-1, r=steveklabnik
kennytm Sep 13, 2018
344dc53
Rollup merge of #54076 - RalfJung:miri-snapshot, r=oli-obk
kennytm Sep 13, 2018
8018d63
Rollup merge of #54119 - phansch:unit_test_find_best_match_for_name, …
kennytm Sep 13, 2018
d6421c7
Rollup merge of #54147 - agnxy:const-eval-test, r=oli-obk
kennytm Sep 13, 2018
73a7482
Rollup merge of #54150 - Aaronepower:master, r=Mark-Simulacrum
kennytm Sep 13, 2018
67efb39
Rollup merge of #54163 - parched:stage0, r=Mark-Simulacrum
kennytm Sep 13, 2018
e92f1b9
Rollup merge of #54170 - kzys:contrib-md, r=zackmdavis
kennytm Sep 13, 2018
5db68ba
Rollup merge of #53829 - alexcrichton:release-debuginfo, r=michaelwoe…
kennytm Sep 13, 2018
07dc4b3
Rollup merge of #53950 - michaelwoerister:more-lto-cli, r=alexcrichton
kennytm Sep 13, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -368,8 +368,7 @@ will run all the tests on every platform we support. If it all works out,
[merge-queue]: https://buildbot2.rust-lang.org/homu/queue/rust

Speaking of tests, Rust has a comprehensive test suite. More information about
it can be found
[here](https://github.com/rust-lang/rust/blob/master/src/test/COMPILER_TESTS.md).
it can be found [here][rctd].

### External Dependencies
[external-dependencies]: #external-dependencies
@@ -654,5 +653,5 @@ are:
[rustforge]: https://forge.rust-lang.org/
[tlgba]: http://tomlee.co/2014/04/a-more-detailed-tour-of-the-rust-compiler/
[ro]: http://www.rustaceans.org/
[rctd]: ./src/test/COMPILER_TESTS.md
[rctd]: https://rust-lang-nursery.github.io/rustc-guide/tests/intro.html
[cheatsheet]: https://buildbot2.rust-lang.org/homu/
6 changes: 6 additions & 0 deletions RELEASES.md
Original file line number Diff line number Diff line change
@@ -31,6 +31,8 @@ Cargo
using `--target`][cargo/5614]
- [Added the `cargo-fix` subcommand to automatically move project code from
2015 edition to 2018.][cargo/5723]
- [`cargo doc` can now optionally document private types using the
`--document-private-items` flag.][cargo/5543]

Misc
----
@@ -68,6 +70,7 @@ Compatibility Notes
[51178]: https://github.com/rust-lang/rust/pull/51178/
[51122]: https://github.com/rust-lang/rust/pull/51122
[50494]: https://github.com/rust-lang/rust/pull/50494/
[cargo/5543]: https://github.com/rust-lang/cargo/pull/5543
[cargo/5614]: https://github.com/rust-lang/cargo/pull/5614/
[cargo/5723]: https://github.com/rust-lang/cargo/pull/5723/
[cargo/5831]: https://github.com/rust-lang/cargo/pull/5831/
@@ -370,6 +373,8 @@ Compatibility Notes
- [The maximum number for `repr(align(N))` is now 2²⁹.][50378] Previously you
could enter higher numbers but they were not supported by LLVM. Up to 512MB
alignment should cover all use cases.
- The `.description()` method on the `std::error::Error` trait
[has been soft-deprecated][50163]. It is no longer required to implement it.

[48553]: https://github.com/rust-lang/rust/pull/48553/
[48851]: https://github.com/rust-lang/rust/pull/48851/
@@ -383,6 +388,7 @@ Compatibility Notes
[49719]: https://github.com/rust-lang/rust/pull/49719/
[49896]: https://github.com/rust-lang/rust/pull/49896/
[49968]: https://github.com/rust-lang/rust/pull/49968/
[50163]: https://github.com/rust-lang/rust/pull/50163
[50177]: https://github.com/rust-lang/rust/pull/50177/
[50378]: https://github.com/rust-lang/rust/pull/50378/
[50398]: https://github.com/rust-lang/rust/pull/50398/
4 changes: 4 additions & 0 deletions config.toml.example
Original file line number Diff line number Diff line change
@@ -377,6 +377,10 @@
# Whether to verify generated LLVM IR
#verify-llvm-ir = false

# Map all debuginfo paths for libstd and crates to `/rust/$sha/$crate/...`,
# generally only set for releases
#remap-debuginfo = false

# =============================================================================
# Options for specific targets
#
4 changes: 4 additions & 0 deletions src/bootstrap/bin/rustc.rs
Original file line number Diff line number Diff line change
@@ -263,6 +263,10 @@ fn main() {
if env::var_os("RUSTC_FORCE_UNSTABLE").is_some() {
cmd.arg("-Z").arg("force-unstable-if-unmarked");
}

if let Ok(map) = env::var("RUSTC_DEBUGINFO_MAP") {
cmd.arg("--remap-path-prefix").arg(&map);
}
} else {
// Override linker if necessary.
if let Ok(host_linker) = env::var("RUSTC_HOST_LINKER") {
8 changes: 6 additions & 2 deletions src/bootstrap/builder.rs
Original file line number Diff line number Diff line change
@@ -32,7 +32,7 @@ use native;
use test;
use tool;
use util::{add_lib_path, exe, libdir};
use {Build, DocTests, Mode};
use {Build, DocTests, Mode, GitRepo};

pub use Compiler;

@@ -876,6 +876,10 @@ impl<'a> Builder<'a> {
cargo.env("RUSTC_HOST_CRT_STATIC", x.to_string());
}

if let Some(map) = self.build.debuginfo_map(GitRepo::Rustc) {
cargo.env("RUSTC_DEBUGINFO_MAP", map);
}

// Enable usage of unstable features
cargo.env("RUSTC_BOOTSTRAP", "1");
self.add_rust_test_threads(&mut cargo);
@@ -964,7 +968,7 @@ impl<'a> Builder<'a> {
let cc = ccacheify(&self.cc(target));
cargo.env(format!("CC_{}", target), &cc).env("CC", &cc);

let cflags = self.cflags(target).join(" ");
let cflags = self.cflags(target, GitRepo::Rustc).join(" ");
cargo
.env(format!("CFLAGS_{}", target), cflags.clone())
.env("CFLAGS", cflags.clone());
4 changes: 2 additions & 2 deletions src/bootstrap/cc_detect.rs
Original file line number Diff line number Diff line change
@@ -39,7 +39,7 @@ use std::process::Command;
use build_helper::output;
use cc;

use Build;
use {Build, GitRepo};
use config::Target;
use cache::Interned;

@@ -107,7 +107,7 @@ pub fn find(build: &mut Build) {

build.cc.insert(target, compiler);
build.verbose(&format!("CC_{} = {:?}", &target, build.cc(target)));
build.verbose(&format!("CFLAGS_{} = {:?}", &target, build.cflags(target)));
build.verbose(&format!("CFLAGS_{} = {:?}", &target, build.cflags(target, GitRepo::Rustc)));
if let Some(ar) = ar {
build.verbose(&format!("AR_{} = {:?}", &target, ar));
build.ar.insert(target, ar);
4 changes: 2 additions & 2 deletions src/bootstrap/compile.rs
Original file line number Diff line number Diff line change
@@ -30,7 +30,7 @@ use filetime::FileTime;
use serde_json;

use util::{exe, libdir, is_dylib, CiEnv};
use {Compiler, Mode};
use {Compiler, Mode, GitRepo};
use native;
use tool;

@@ -895,7 +895,7 @@ pub fn compiler_file(builder: &Builder,
target: Interned<String>,
file: &str) -> PathBuf {
let mut cmd = Command::new(compiler);
cmd.args(builder.cflags(target));
cmd.args(builder.cflags(target, GitRepo::Rustc));
cmd.arg(format!("-print-file-name={}", file));
let out = output(&mut cmd);
PathBuf::from(out.trim())
3 changes: 3 additions & 0 deletions src/bootstrap/config.rs
Original file line number Diff line number Diff line change
@@ -109,6 +109,7 @@ pub struct Config {
pub rust_codegen_backends: Vec<Interned<String>>,
pub rust_codegen_backends_dir: String,
pub rust_verify_llvm_ir: bool,
pub rust_remap_debuginfo: bool,

pub build: Interned<String>,
pub hosts: Vec<Interned<String>>,
@@ -321,6 +322,7 @@ struct Rust {
deny_warnings: Option<bool>,
backtrace_on_ice: Option<bool>,
verify_llvm_ir: Option<bool>,
remap_debuginfo: Option<bool>,
}

/// TOML representation of how each build target is configured.
@@ -557,6 +559,7 @@ impl Config {
set(&mut config.deny_warnings, rust.deny_warnings.or(flags.warnings));
set(&mut config.backtrace_on_ice, rust.backtrace_on_ice);
set(&mut config.rust_verify_llvm_ir, rust.verify_llvm_ir);
set(&mut config.rust_remap_debuginfo, rust.remap_debuginfo);

if let Some(ref backends) = rust.codegen_backends {
config.rust_codegen_backends = backends.iter()
32 changes: 31 additions & 1 deletion src/bootstrap/lib.rs
Original file line number Diff line number Diff line change
@@ -237,6 +237,11 @@ pub enum DocTests {
Only,
}

pub enum GitRepo {
Rustc,
Llvm,
}

/// Global configuration for the build system.
///
/// This structure transitively contains all configuration for the build system.
@@ -738,14 +743,29 @@ impl Build {
self.config.jobs.unwrap_or_else(|| num_cpus::get() as u32)
}

fn debuginfo_map(&self, which: GitRepo) -> Option<String> {
if !self.config.rust_remap_debuginfo {
return None
}

let path = match which {
GitRepo::Rustc => {
let sha = self.rust_info.sha().expect("failed to find sha");
format!("/rustc/{}", sha)
}
GitRepo::Llvm => format!("/rustc/llvm"),
};
Some(format!("{}={}", self.src.display(), path))
}

/// Returns the path to the C compiler for the target specified.
fn cc(&self, target: Interned<String>) -> &Path {
self.cc[&target].path()
}

/// Returns a list of flags to pass to the C compiler for the target
/// specified.
fn cflags(&self, target: Interned<String>) -> Vec<String> {
fn cflags(&self, target: Interned<String>, which: GitRepo) -> Vec<String> {
// Filter out -O and /O (the optimization flags) that we picked up from
// cc-rs because the build scripts will determine that for themselves.
let mut base = self.cc[&target].args().iter()
@@ -767,6 +787,16 @@ impl Build {
if &*target == "i686-pc-windows-gnu" {
base.push("-fno-omit-frame-pointer".into());
}

if let Some(map) = self.debuginfo_map(which) {
let cc = self.cc(target);
if cc.ends_with("clang") || cc.ends_with("gcc") {
base.push(format!("-fdebug-prefix-map={}", map).into());
} else if cc.ends_with("clang-cl.exe") {
base.push("-Xclang".into());
base.push(format!("-fdebug-prefix-map={}", map).into());
}
}
base
}

7 changes: 4 additions & 3 deletions src/bootstrap/native.rs
Original file line number Diff line number Diff line change
@@ -33,6 +33,7 @@ use util::{self, exe};
use build_helper::up_to_date;
use builder::{Builder, RunConfig, ShouldRun, Step};
use cache::Interned;
use GitRepo;

#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct Llvm {
@@ -373,8 +374,8 @@ fn configure_cmake(builder: &Builder,
}

cfg.build_arg("-j").build_arg(builder.jobs().to_string());
cfg.define("CMAKE_C_FLAGS", builder.cflags(target).join(" "));
let mut cxxflags = builder.cflags(target).join(" ");
cfg.define("CMAKE_C_FLAGS", builder.cflags(target, GitRepo::Llvm).join(" "));
let mut cxxflags = builder.cflags(target, GitRepo::Llvm).join(" ");
if building_dist_binaries {
if builder.config.llvm_static_stdcpp && !target.contains("windows") {
cxxflags.push_str(" -static-libstdc++");
@@ -680,7 +681,7 @@ impl Step for Openssl {
};
configure.arg(os);
configure.env("CC", builder.cc(target));
for flag in builder.cflags(target) {
for flag in builder.cflags(target, GitRepo::Rustc) {
configure.arg(flag);
}
// There is no specific os target for android aarch64 or x86_64,
4 changes: 2 additions & 2 deletions src/bootstrap/test.rs
Original file line number Diff line number Diff line change
@@ -34,7 +34,7 @@ use tool::{self, Tool, SourceType};
use toolstate::ToolState;
use util::{self, dylib_path, dylib_path_var};
use Crate as CargoCrate;
use {DocTests, Mode};
use {DocTests, Mode, GitRepo};

const ADB_TEST_DIR: &str = "/data/tmp/work";

@@ -1142,7 +1142,7 @@ impl Step for Compiletest {
.arg("--cxx")
.arg(builder.cxx(target).unwrap())
.arg("--cflags")
.arg(builder.cflags(target).join(" "))
.arg(builder.cflags(target, GitRepo::Rustc).join(" "))
.arg("--llvm-components")
.arg(llvm_components.trim())
.arg("--llvm-cxxflags")
1 change: 1 addition & 0 deletions src/ci/run.sh
Original file line number Diff line number Diff line change
@@ -55,6 +55,7 @@ export RUST_RELEASE_CHANNEL=nightly
if [ "$DEPLOY$DEPLOY_ALT" != "" ]; then
RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --release-channel=$RUST_RELEASE_CHANNEL"
RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --enable-llvm-static-stdcpp"
RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --set rust.remap-debuginfo"

if [ "$NO_LLVM_ASSERTIONS" = "1" ]; then
RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --disable-llvm-assertions"
Loading