Skip to content
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

Rollup of 25 pull requests #38697

Merged
merged 57 commits into from
Dec 30, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
273cc30
Clarify phrasing of MSYS2 dependencies in README.md.
frewsxcv Dec 21, 2016
292d36f
Add missing doc examples for Builder
GuillaumeGomez Dec 20, 2016
f4bd94f
Add missing urls in Arc docs
GuillaumeGomez Dec 24, 2016
67cc77c
travis: Don't use -9 on gzip
alexcrichton Dec 26, 2016
3907b93
Add missing urls in AtomicBool docs
GuillaumeGomez Dec 26, 2016
917a9af
std: Clamp max read/write sizes on Unix
alexcrichton Dec 26, 2016
20abf05
And suddenly a german word :O
kellerkindt Dec 27, 2016
18d4928
PTX support
Dec 22, 2016
aac5ff7
fix ui test
Dec 23, 2016
fd97f5d
travis: Don't install ccache in containers
alexcrichton Dec 27, 2016
03d4fc5
travis: Remove extraneous /tmp/obj dirs
alexcrichton Dec 27, 2016
5cdf128
Document foreign variadic functions in TRPL and the reference.
frewsxcv Dec 27, 2016
f26e52e
compiletest: Don't limit all suites on Android
alexcrichton Dec 28, 2016
94d58c2
Add missing urls for atomic_int macros types
GuillaumeGomez Dec 28, 2016
ef8d5e1
Add missing urls for AtomicPtr
GuillaumeGomez Dec 27, 2016
88429dc
travis: Use `&&` intead of `;`
alexcrichton Dec 28, 2016
0f8e931
rustbuild: allow overriding list of LLVM targets to build
xen0n Dec 28, 2016
ee2abe8
Add missing apostrophe.
agl Dec 28, 2016
1825f80
Fix default terminfo code for reset (sg0 -> sgr0)
martijnvermaat Dec 28, 2016
57b53fd
Use "an" before "i32"
agl Dec 28, 2016
7046fea
rustbuild: Compile rustc twice, not thrice
alexcrichton Dec 25, 2016
fc3e49b
rustbuild: Move pretty test suites to host-only
alexcrichton Dec 28, 2016
b9038c8
rustdoc: Fix broken CSS for trait items
ollie27 Dec 29, 2016
c8e7b76
Add missing urls for atomic fn docs
GuillaumeGomez Dec 29, 2016
9958021
Add some more repos to cargotest
edunham Oct 13, 2016
a0f3c93
Fixes for new cargo test repos
alexcrichton Dec 29, 2016
900dd8a
rustbuild: Don't run pretty tests by default
alexcrichton Dec 29, 2016
8d50857
Check *all* errors in LLVMRustArchiveIterator* API
Dec 29, 2016
2ec294b
Fix typo in PartialOrd docs
lucis-fluxum Dec 29, 2016
2293ea5
Rollup merge of #37149 - edunham:more-cargotest, r=alexcrichton
alexcrichton Dec 30, 2016
26f28ec
Rollup merge of #38491 - GuillaumeGomez:builder_docs, r=frewsxcv
alexcrichton Dec 30, 2016
4e2e01e
Rollup merge of #38517 - frewsxcv:clarify-msys2-dependencies, r=alexc…
alexcrichton Dec 30, 2016
bcfd504
Rollup merge of #38559 - japaric:ptx2, r=alexcrichton
alexcrichton Dec 30, 2016
fe80a1d
Rollup merge of #38587 - GuillaumeGomez:arc_docs, r=frewsxcv
alexcrichton Dec 30, 2016
a68f886
Rollup merge of #38609 - alexcrichton:less-compress, r=japaric
alexcrichton Dec 30, 2016
41b601e
Rollup merge of #38611 - GuillaumeGomez:atomicbool_docs, r=frewsxcv
alexcrichton Dec 30, 2016
8623907
Rollup merge of #38622 - alexcrichton:read-lengths, r=sfackler
alexcrichton Dec 30, 2016
96c79c9
Rollup merge of #38628 - kellerkindt:patch-1, r=steveklabnik
alexcrichton Dec 30, 2016
1c2a6f9
Rollup merge of #38630 - frewsxcv:variadic, r=steveklabnik
alexcrichton Dec 30, 2016
9bb3543
Rollup merge of #38631 - alexcrichton:supafast, r=brson
alexcrichton Dec 30, 2016
6ccf039
Rollup merge of #38632 - alexcrichton:trim-travis, r=japaric
alexcrichton Dec 30, 2016
8b8ab85
Rollup merge of #38635 - GuillaumeGomez:atomicptr_docs, r=frewsxcv
alexcrichton Dec 30, 2016
332a4cc
Rollup merge of #38647 - alexcrichton:faster-android, r=brson
alexcrichton Dec 30, 2016
3c8a17f
Rollup merge of #38649 - GuillaumeGomez:atomicint_docs, r=frewsxcv
alexcrichton Dec 30, 2016
031aa58
Rollup merge of #38655 - alexcrichton:travis-and-then, r=brson
alexcrichton Dec 30, 2016
7d14e3a
Rollup merge of #38659 - agl:patch-1, r=apasel422
alexcrichton Dec 30, 2016
3f65c5d
Rollup merge of #38660 - martijnvermaat:terminfo-reset-typo, r=alexcr…
alexcrichton Dec 30, 2016
2068e1c
Rollup merge of #38662 - agl:patch-2, r=frewsxcv
alexcrichton Dec 30, 2016
2dc1a0a
Rollup merge of #38665 - alexcrichton:pretty-only-host, r=brson
alexcrichton Dec 30, 2016
1b4acae
Rollup merge of #38671 - ollie27:rustdoc_stab_em_div_fix, r=frewsxcv
alexcrichton Dec 30, 2016
c41256c
Rollup merge of #38674 - GuillaumeGomez:atomic_fn_docs, r=frewsxcv
alexcrichton Dec 30, 2016
3e36dd8
Rollup merge of #38676 - rkruppe:llvm-check-success, r=alexcrichton
alexcrichton Dec 30, 2016
19e187c
Rollup merge of #38693 - lucis-fluxum:partialord-typo-fix, r=stevekla…
alexcrichton Dec 30, 2016
334af88
Rollup merge of #38695 - alexcrichton:debug-appveyor, r=brson
alexcrichton Dec 30, 2016
ebea2ea
Merge branch 'rustbuild-llvm-targets' of https://github.com/xen0n/rus…
alexcrichton Dec 30, 2016
3eb459f
Merge branch 'aux-tests' of https://github.com/alexcrichton/rust into…
alexcrichton Dec 30, 2016
e484197
A few small test fixes and such from rollup
alexcrichton Dec 30, 2016
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
9 changes: 5 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ matrix:
- env: IMAGE=i686-gnu-nopt
- env: IMAGE=x86_64-freebsd
- env: IMAGE=x86_64-gnu
- env: IMAGE=x86_64-gnu-cargotest
- env: IMAGE=x86_64-gnu-full-bootstrap
- env: IMAGE=x86_64-gnu-aux
- env: IMAGE=x86_64-gnu-debug
- env: IMAGE=x86_64-gnu-nopt
- env: IMAGE=x86_64-gnu-make
Expand Down Expand Up @@ -66,10 +67,10 @@ script:
if [ "$ALLOW_PR" = "" ] && [ "$TRAVIS_BRANCH" != "auto" ]; then
echo skipping, not a full build;
elif [ "$TRAVIS_OS_NAME" = "osx" ]; then
git submodule update --init;
git submodule update --init &&
src/ci/run.sh;
else
git submodule update --init;
git submodule update --init &&
src/ci/docker/run.sh $IMAGE;
fi

Expand All @@ -78,7 +79,7 @@ before_cache:
- docker history -q rust-ci |
grep -v missing |
xargs docker save |
gzip -9 > $HOME/docker/rust-ci.tar.gz
gzip > $HOME/docker/rust-ci.tar.gz
before_install:
- zcat $HOME/docker/rust-ci.tar.gz | docker load || true

Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,9 @@ build.
# Install build tools needed for Rust. If you're building a 32-bit compiler,
# then replace "x86_64" below with "i686". If you've already got git, python,
# or CMake installed and in PATH you can remove them from this list. Note
# that it is important that the `python2` and `cmake` packages **not** used.
# The build has historically been known to fail with these packages.
# that it is important that you do **not** use the 'python2' and 'cmake'
# packages from the 'msys2' subsystem. The build has historically been known
# to fail with these packages.
$ pacman -S git \
make \
diffutils \
Expand Down
9 changes: 8 additions & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ environment:
# MSVC cargotest
- MSYS_BITS: 64
NO_VENDOR: 1
RUST_CHECK_TARGET: check-cargotest
RUST_CHECK_TARGET: check-aux
RUST_CONFIGURE_ARGS: --build=x86_64-pc-windows-msvc

# 32/64-bit MinGW builds.
Expand Down Expand Up @@ -96,6 +96,13 @@ install:
- 7z x -y sccache.tar > nul
- set PATH=%PATH%;%CD%\sccache2

# Help debug some handle issues on AppVeyor
- ps: Invoke-WebRequest -Uri https://download.sysinternals.com/files/Handle.zip -OutFile handle.zip
- mkdir handle
- ps: Expand-Archive handle.zip -dest handle
- set PATH=%PATH%;%CD%\handle
- handle.exe -accepteula -help

test_script:
- git submodule update --init
- set SRC=.
Expand Down
1 change: 1 addition & 0 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -693,6 +693,7 @@ opt_nosave manage-submodules 1 "let the build manage the git submodules"
opt_nosave clang 0 "prefer clang to gcc for building the runtime"
opt_nosave jemalloc 1 "build liballoc with jemalloc"
opt elf-tls 1 "elf thread local storage on platforms where supported"
opt full-bootstrap 0 "build three compilers instead of two"

valopt_nosave prefix "/usr/local" "set installation prefix"
valopt_nosave local-rust-root "/usr/local" "set prefix for local rust binary"
Expand Down
18 changes: 14 additions & 4 deletions src/bootstrap/check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -341,12 +341,22 @@ pub fn krate(build: &Build,
println!("{} {} stage{} ({} -> {})", test_kind, name, compiler.stage,
compiler.host, target);

// If we're not doing a full bootstrap but we're testing a stage2 version of
// libstd, then what we're actually testing is the libstd produced in
// stage1. Reflect that here by updating the compiler that we're working
// with automatically.
let compiler = if build.force_use_stage1(compiler, target) {
Compiler::new(1, compiler.host)
} else {
compiler.clone()
};

// Build up the base `cargo test` command.
//
// Pass in some standard flags then iterate over the graph we've discovered
// in `cargo metadata` with the maps above and figure out what `-p`
// arguments need to get passed.
let mut cargo = build.cargo(compiler, mode, target, test_kind.subcommand());
let mut cargo = build.cargo(&compiler, mode, target, test_kind.subcommand());
cargo.arg("--manifest-path")
.arg(build.src.join(path).join("Cargo.toml"))
.arg("--features").arg(features);
Expand Down Expand Up @@ -380,7 +390,7 @@ pub fn krate(build: &Build,
// Note that to run the compiler we need to run with the *host* libraries,
// but our wrapper scripts arrange for that to be the case anyway.
let mut dylib_path = dylib_path();
dylib_path.insert(0, build.sysroot_libdir(compiler, target));
dylib_path.insert(0, build.sysroot_libdir(&compiler, target));
cargo.env(dylib_path_var(), env::join_paths(&dylib_path).unwrap());

if target.contains("android") {
Expand All @@ -399,10 +409,10 @@ pub fn krate(build: &Build,

if target.contains("android") {
build.run(&mut cargo);
krate_android(build, compiler, target, mode);
krate_android(build, &compiler, target, mode);
} else if target.contains("emscripten") {
build.run(&mut cargo);
krate_emscripten(build, compiler, target, mode);
krate_emscripten(build, &compiler, target, mode);
} else {
cargo.args(&build.flags.cmd.test_args());
build.run(&mut cargo);
Expand Down
114 changes: 61 additions & 53 deletions src/bootstrap/compile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,12 @@ use {Build, Compiler, Mode};
/// This will build the standard library for a particular stage of the build
/// using the `compiler` targeting the `target` architecture. The artifacts
/// created will also be linked into the sysroot directory.
pub fn std<'a>(build: &'a Build, target: &str, compiler: &Compiler<'a>) {
println!("Building stage{} std artifacts ({} -> {})", compiler.stage,
compiler.host, target);

pub fn std(build: &Build, target: &str, compiler: &Compiler) {
let libdir = build.sysroot_libdir(compiler, target);
let _ = fs::remove_dir_all(&libdir);
t!(fs::create_dir_all(&libdir));

// Some platforms have startup objects that may be required to produce the
// libstd dynamic library, for example.
build_startup_objects(build, target, &libdir);
println!("Building stage{} std artifacts ({} -> {})", compiler.stage,
compiler.host, target);

let out_dir = build.cargo_out(compiler, Mode::Libstd, target);
build.clear_if_dirty(&out_dir, &build.compiler_path(compiler));
Expand All @@ -65,29 +60,30 @@ pub fn std<'a>(build: &'a Build, target: &str, compiler: &Compiler<'a>) {

build.run(&mut cargo);
update_mtime(&libstd_stamp(build, &compiler, target));
std_link(build, target, compiler.stage, compiler.host);
}

/// Link all libstd rlibs/dylibs into the sysroot location.
///
/// Links those artifacts generated in the given `stage` for `target` produced
/// by `compiler` into `host`'s sysroot.
/// Links those artifacts generated by `compiler` to a the `stage` compiler's
/// sysroot for the specified `host` and `target`.
///
/// Note that this assumes that `compiler` has already generated the libstd
/// libraries for `target`, and this method will find them in the relevant
/// output directory.
pub fn std_link(build: &Build,
target: &str,
stage: u32,
host: &str) {
let compiler = Compiler::new(stage, &build.config.build);
let target_compiler = Compiler::new(compiler.stage, host);
compiler: &Compiler,
target_compiler: &Compiler,
target: &str) {
println!("Copying stage{} std from stage{} ({} -> {} / {})",
target_compiler.stage,
compiler.stage,
compiler.host,
target_compiler.host,
target);
let libdir = build.sysroot_libdir(&target_compiler, target);
let out_dir = build.cargo_out(&compiler, Mode::Libstd, target);

// If we're linking one compiler host's output into another, then we weren't
// called from the `std` method above. In that case we clean out what's
// already there.
if host != compiler.host {
let _ = fs::remove_dir_all(&libdir);
t!(fs::create_dir_all(&libdir));
}
t!(fs::create_dir_all(&libdir));
add_to_sysroot(&out_dir, &libdir);

if target.contains("musl") && !target.contains("mips") {
Expand All @@ -110,20 +106,23 @@ fn copy_musl_third_party_objects(build: &Build, target: &str, into: &Path) {
/// They don't require any library support as they're just plain old object
/// files, so we just use the nightly snapshot compiler to always build them (as
/// no other compilers are guaranteed to be available).
fn build_startup_objects(build: &Build, target: &str, into: &Path) {
pub fn build_startup_objects(build: &Build, for_compiler: &Compiler, target: &str) {
if !target.contains("pc-windows-gnu") {
return
}

let compiler = Compiler::new(0, &build.config.build);
let compiler_path = build.compiler_path(&compiler);
let into = build.sysroot_libdir(for_compiler, target);
t!(fs::create_dir_all(&into));

for file in t!(fs::read_dir(build.src.join("src/rtstartup"))) {
let file = t!(file);
let mut cmd = Command::new(&compiler_path);
build.run(cmd.env("RUSTC_BOOTSTRAP", "1")
.arg("--target").arg(target)
.arg("--emit=obj")
.arg("--out-dir").arg(into)
.arg("--out-dir").arg(&into)
.arg(file.path()));
}

Expand All @@ -137,7 +136,7 @@ fn build_startup_objects(build: &Build, target: &str, into: &Path) {
/// This will build libtest and supporting libraries for a particular stage of
/// the build using the `compiler` targeting the `target` architecture. The
/// artifacts created will also be linked into the sysroot directory.
pub fn test<'a>(build: &'a Build, target: &str, compiler: &Compiler<'a>) {
pub fn test(build: &Build, target: &str, compiler: &Compiler) {
println!("Building stage{} test artifacts ({} -> {})", compiler.stage,
compiler.host, target);
let out_dir = build.cargo_out(compiler, Mode::Libtest, target);
Expand All @@ -147,19 +146,19 @@ pub fn test<'a>(build: &'a Build, target: &str, compiler: &Compiler<'a>) {
.arg(build.src.join("src/rustc/test_shim/Cargo.toml"));
build.run(&mut cargo);
update_mtime(&libtest_stamp(build, compiler, target));
test_link(build, target, compiler.stage, compiler.host);
}

/// Link all libtest rlibs/dylibs into the sysroot location.
///
/// Links those artifacts generated in the given `stage` for `target` produced
/// by `compiler` into `host`'s sysroot.
/// Same as `std_link`, only for libtest
pub fn test_link(build: &Build,
target: &str,
stage: u32,
host: &str) {
let compiler = Compiler::new(stage, &build.config.build);
let target_compiler = Compiler::new(compiler.stage, host);
compiler: &Compiler,
target_compiler: &Compiler,
target: &str) {
println!("Copying stage{} test from stage{} ({} -> {} / {})",
target_compiler.stage,
compiler.stage,
compiler.host,
target_compiler.host,
target);
let libdir = build.sysroot_libdir(&target_compiler, target);
let out_dir = build.cargo_out(&compiler, Mode::Libtest, target);
add_to_sysroot(&out_dir, &libdir);
Expand All @@ -170,7 +169,7 @@ pub fn test_link(build: &Build,
/// This will build the compiler for a particular stage of the build using
/// the `compiler` targeting the `target` architecture. The artifacts
/// created will also be linked into the sysroot directory.
pub fn rustc<'a>(build: &'a Build, target: &str, compiler: &Compiler<'a>) {
pub fn rustc(build: &Build, target: &str, compiler: &Compiler) {
println!("Building stage{} compiler artifacts ({} -> {})",
compiler.stage, compiler.host, target);

Expand Down Expand Up @@ -222,20 +221,19 @@ pub fn rustc<'a>(build: &'a Build, target: &str, compiler: &Compiler<'a>) {
cargo.env("CFG_DEFAULT_AR", s);
}
build.run(&mut cargo);

rustc_link(build, target, compiler.stage, compiler.host);
}

/// Link all librustc rlibs/dylibs into the sysroot location.
///
/// Links those artifacts generated in the given `stage` for `target` produced
/// by `compiler` into `host`'s sysroot.
/// Same as `std_link`, only for librustc
pub fn rustc_link(build: &Build,
target: &str,
stage: u32,
host: &str) {
let compiler = Compiler::new(stage, &build.config.build);
let target_compiler = Compiler::new(compiler.stage, host);
compiler: &Compiler,
target_compiler: &Compiler,
target: &str) {
println!("Copying stage{} rustc from stage{} ({} -> {} / {})",
target_compiler.stage,
compiler.stage,
compiler.host,
target_compiler.host,
target);
let libdir = build.sysroot_libdir(&target_compiler, target);
let out_dir = build.cargo_out(&compiler, Mode::Librustc, target);
add_to_sysroot(&out_dir, &libdir);
Expand All @@ -259,6 +257,17 @@ fn compiler_file(compiler: &Path, file: &str) -> PathBuf {
PathBuf::from(out.trim())
}

pub fn create_sysroot(build: &Build, compiler: &Compiler) {
// nothing to do in stage0
if compiler.stage == 0 {
return
}

let sysroot = build.sysroot(compiler);
let _ = fs::remove_dir_all(&sysroot);
t!(fs::create_dir_all(&sysroot));
}

/// Prepare a new compiler from the artifacts in `stage`
///
/// This will assemble a compiler in `build/$host/stage$stage`. The compiler
Expand All @@ -269,18 +278,17 @@ pub fn assemble_rustc(build: &Build, stage: u32, host: &str) {
if stage == 0 {
return
}

println!("Copying stage{} compiler ({})", stage, host);

// The compiler that we're assembling
let target_compiler = Compiler::new(stage, host);

// The compiler that compiled the compiler we're assembling
let build_compiler = Compiler::new(stage - 1, &build.config.build);

// Clear out old files
let sysroot = build.sysroot(&target_compiler);
let _ = fs::remove_dir_all(&sysroot);
t!(fs::create_dir_all(&sysroot));

// Link in all dylibs to the libdir
let sysroot = build.sysroot(&target_compiler);
let sysroot_libdir = sysroot.join(libdir(host));
t!(fs::create_dir_all(&sysroot_libdir));
let src_libdir = build.sysroot_libdir(&build_compiler, host);
Expand Down
7 changes: 7 additions & 0 deletions src/bootstrap/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ pub struct Config {
pub docs: bool,
pub vendor: bool,
pub target_config: HashMap<String, Target>,
pub full_bootstrap: bool,

// llvm codegen options
pub llvm_assertions: bool,
Expand All @@ -54,6 +55,7 @@ pub struct Config {
pub llvm_version_check: bool,
pub llvm_static_stdcpp: bool,
pub llvm_link_shared: bool,
pub llvm_targets: Option<String>,

// rust codegen options
pub rust_optimize: bool,
Expand Down Expand Up @@ -134,6 +136,7 @@ struct Build {
vendor: Option<bool>,
nodejs: Option<String>,
python: Option<String>,
full_bootstrap: Option<bool>,
}

/// TOML representation of various global install decisions.
Expand All @@ -152,6 +155,7 @@ struct Llvm {
release_debuginfo: Option<bool>,
version_check: Option<bool>,
static_libstdcpp: Option<bool>,
targets: Option<String>,
}

#[derive(RustcDecodable)]
Expand Down Expand Up @@ -264,6 +268,7 @@ impl Config {
set(&mut config.docs, build.docs);
set(&mut config.submodules, build.submodules);
set(&mut config.vendor, build.vendor);
set(&mut config.full_bootstrap, build.full_bootstrap);

if let Some(ref install) = toml.install {
config.prefix = install.prefix.clone();
Expand All @@ -285,6 +290,7 @@ impl Config {
set(&mut config.llvm_release_debuginfo, llvm.release_debuginfo);
set(&mut config.llvm_version_check, llvm.version_check);
set(&mut config.llvm_static_stdcpp, llvm.static_libstdcpp);
config.llvm_targets = llvm.targets.clone();
}

if let Some(ref rust) = toml.rust {
Expand Down Expand Up @@ -393,6 +399,7 @@ impl Config {
("NINJA", self.ninja),
("CODEGEN_TESTS", self.codegen_tests),
("VENDOR", self.vendor),
("FULL_BOOTSTRAP", self.full_bootstrap),
}

match key {
Expand Down
Loading