Skip to content

Commit 60f1644

Browse files
committed
Merge remote-tracking branch 'upstream/master' into asm-compile-tests
2 parents eeb5f17 + 2c8bbf5 commit 60f1644

File tree

478 files changed

+5342
-4188
lines changed

Some content is hidden

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

478 files changed

+5342
-4188
lines changed

Cargo.lock

+3-3
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ dependencies = [
251251
"fwdansi 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
252252
"git2 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
253253
"git2-curl 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
254-
"glob 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
254+
"glob 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
255255
"hex 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
256256
"home 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
257257
"ignore 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -1009,7 +1009,7 @@ dependencies = [
10091009

10101010
[[package]]
10111011
name = "glob"
1012-
version = "0.2.11"
1012+
version = "0.3.0"
10131013
source = "registry+https://github.com/rust-lang/crates.io-index"
10141014

10151015
[[package]]
@@ -4083,7 +4083,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
40834083
"checksum getopts 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)" = "b900c08c1939860ce8b54dc6a89e26e00c04c380fd0e09796799bd7f12861e05"
40844084
"checksum git2 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c7339329bfa14a00223244311560d11f8f489b453fb90092af97f267a6090ab0"
40854085
"checksum git2-curl 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d58551e903ed7e2d6fe3a2f3c7efa3a784ec29b19d0fbb035aaf0497c183fbdd"
4086-
"checksum glob 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "8be18de09a56b60ed0edf84bc9df007e30040691af7acd1c41874faac5895bfb"
4086+
"checksum glob 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "9b919933a397b79c37e33b77bb2aa3dc8eb6e165ad809e58ff75bc7db2e34574"
40874087
"checksum globset 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "4743617a7464bbda3c8aec8558ff2f9429047e025771037df561d383337ff865"
40884088
"checksum handlebars 0.32.4 (registry+https://github.com/rust-lang/crates.io-index)" = "d89ec99d1594f285d4590fc32bac5f75cdab383f1123d504d27862c644a807dd"
40894089
"checksum handlebars 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d82e5750d8027a97b9640e3fefa66bbaf852a35228e1c90790efd13c4b09c166"

RELEASES.md

+3
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,11 @@ Compatibility Notes
110110
methods instead.
111111
- The `Error::cause` method has been deprecated in favor of `Error::source` which supports
112112
downcasting.
113+
- [Libtest no longer creates a new thread for each test when
114+
`--test-threads=1`. It also runs the tests in deterministic order][56243]
113115

114116
[55982]: https://github.com/rust-lang/rust/pull/55982/
117+
[56243]: https://github.com/rust-lang/rust/pull/56243
115118
[56303]: https://github.com/rust-lang/rust/pull/56303/
116119
[56351]: https://github.com/rust-lang/rust/pull/56351/
117120
[56362]: https://github.com/rust-lang/rust/pull/56362

appveyor.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
environment:
2+
# This is required for at least an AArch64 compiler in one image, and is also
3+
# going to soon be required for compiling LLVM.
4+
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 Preview
25

36
# By default schannel checks revocation of certificates unlike some other SSL
47
# backends, but we've historically had problems on CI where a revocation
@@ -81,7 +84,6 @@ environment:
8184
DIST_REQUIRE_ALL_TOOLS: 1
8285
DEPLOY: 1
8386
CI_JOB_NAME: dist-x86_64-msvc
84-
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 Preview
8587
- RUST_CONFIGURE_ARGS: >
8688
--build=i686-pc-windows-msvc
8789
--target=i586-pc-windows-msvc

src/bootstrap/bin/rustdoc.rs

+8-2
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ fn main() {
3535
.arg("--cfg")
3636
.arg("dox")
3737
.arg("--sysroot")
38-
.arg(sysroot)
38+
.arg(&sysroot)
3939
.env(bootstrap::util::dylib_path_var(),
4040
env::join_paths(&dylib_path).unwrap());
4141

@@ -72,7 +72,13 @@ fn main() {
7272
}
7373

7474
if verbose > 1 {
75-
eprintln!("rustdoc command: {:?}", cmd);
75+
eprintln!(
76+
"rustdoc command: {:?}={:?} {:?}",
77+
bootstrap::util::dylib_path_var(),
78+
env::join_paths(&dylib_path).unwrap(),
79+
cmd,
80+
);
81+
eprintln!("sysroot: {:?}", sysroot);
7682
eprintln!("libdir: {:?}", libdir);
7783
}
7884

src/bootstrap/builder.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -374,6 +374,7 @@ impl<'a> Builder<'a> {
374374
test::MirOpt,
375375
test::Codegen,
376376
test::CodegenUnits,
377+
test::Assembly,
377378
test::Incremental,
378379
test::Debuginfo,
379380
test::UiFullDeps,
@@ -408,12 +409,11 @@ impl<'a> Builder<'a> {
408409
test::RustdocJSStd,
409410
test::RustdocJSNotStd,
410411
test::RustdocTheme,
412+
test::RustdocUi,
411413
// Run bootstrap close to the end as it's unlikely to fail
412414
test::Bootstrap,
413415
// Run run-make last, since these won't pass without make on Windows
414416
test::RunMake,
415-
test::RustdocUi,
416-
test::Assembly,
417417
),
418418
Kind::Bench => describe!(test::Crate, test::CrateLibrustc),
419419
Kind::Doc => describe!(

src/bootstrap/lib.rs

+6
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,8 @@ pub struct Build {
241241
clippy_info: channel::GitInfo,
242242
miri_info: channel::GitInfo,
243243
rustfmt_info: channel::GitInfo,
244+
in_tree_llvm_info: channel::GitInfo,
245+
emscripten_llvm_info: channel::GitInfo,
244246
local_rebuild: bool,
245247
fail_fast: bool,
246248
doc_tests: DocTests,
@@ -363,6 +365,8 @@ impl Build {
363365
let clippy_info = channel::GitInfo::new(&config, &src.join("src/tools/clippy"));
364366
let miri_info = channel::GitInfo::new(&config, &src.join("src/tools/miri"));
365367
let rustfmt_info = channel::GitInfo::new(&config, &src.join("src/tools/rustfmt"));
368+
let in_tree_llvm_info = channel::GitInfo::new(&config, &src.join("src/llvm-project"));
369+
let emscripten_llvm_info = channel::GitInfo::new(&config, &src.join("src/llvm-emscripten"));
366370

367371
let mut build = Build {
368372
initial_rustc: config.initial_rustc.clone(),
@@ -386,6 +390,8 @@ impl Build {
386390
clippy_info,
387391
miri_info,
388392
rustfmt_info,
393+
in_tree_llvm_info,
394+
emscripten_llvm_info,
389395
cc: HashMap::new(),
390396
cxx: HashMap::new(),
391397
ar: HashMap::new(),

src/bootstrap/mk/Makefile.in

-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ check:
4848
$(Q)$(BOOTSTRAP) test $(BOOTSTRAP_ARGS)
4949
check-aux:
5050
$(Q)$(BOOTSTRAP) test \
51-
src/test/pretty \
5251
src/test/run-pass/pretty \
5352
src/test/run-fail/pretty \
5453
src/test/run-pass-valgrind/pretty \

src/bootstrap/native.rs

+21-1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ use build_helper::output;
1818
use cmake;
1919
use cc;
2020

21+
use crate::channel;
2122
use crate::util::{self, exe};
2223
use build_helper::up_to_date;
2324
use crate::builder::{Builder, RunConfig, ShouldRun, Step};
@@ -231,7 +232,26 @@ impl Step for Llvm {
231232
}
232233

233234
if let Some(ref suffix) = builder.config.llvm_version_suffix {
234-
cfg.define("LLVM_VERSION_SUFFIX", suffix);
235+
// Allow version-suffix="" to not define a version suffix at all.
236+
if !suffix.is_empty() {
237+
cfg.define("LLVM_VERSION_SUFFIX", suffix);
238+
}
239+
} else {
240+
let mut default_suffix = format!(
241+
"-rust-{}-{}",
242+
channel::CFG_RELEASE_NUM,
243+
builder.config.channel,
244+
);
245+
let llvm_info = if self.emscripten {
246+
&builder.emscripten_llvm_info
247+
} else {
248+
&builder.in_tree_llvm_info
249+
};
250+
if let Some(sha) = llvm_info.sha_short() {
251+
default_suffix.push_str("-");
252+
default_suffix.push_str(sha);
253+
}
254+
cfg.define("LLVM_VERSION_SUFFIX", default_suffix);
235255
}
236256

237257
if let Some(ref linker) = builder.config.llvm_use_linker {

src/bootstrap/test.rs

+3-9
Original file line numberDiff line numberDiff line change
@@ -897,12 +897,10 @@ host_test!(Rustdoc {
897897
suite: "rustdoc"
898898
});
899899

900-
test!(Pretty {
900+
host_test!(Pretty {
901901
path: "src/test/pretty",
902902
mode: "pretty",
903-
suite: "pretty",
904-
default: false,
905-
host: true
903+
suite: "pretty"
906904
});
907905
test!(RunPassPretty {
908906
path: "src/test/run-pass/pretty",
@@ -999,11 +997,7 @@ impl Step for Compiletest {
999997
});
1000998
}
1001999

1002-
if suite.ends_with("fulldeps") ||
1003-
// FIXME: Does pretty need librustc compiled? Note that there are
1004-
// fulldeps test suites with mode = pretty as well.
1005-
mode == "pretty"
1006-
{
1000+
if suite.ends_with("fulldeps") {
10071001
builder.ensure(compile::Rustc { compiler, target });
10081002
}
10091003

src/ci/docker/dist-x86_64-musl/Dockerfile

+14-9
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
44
g++ \
55
make \
66
file \
7+
wget \
78
curl \
89
ca-certificates \
910
python2.7 \
@@ -18,19 +19,17 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
1819

1920
WORKDIR /build/
2021

21-
COPY scripts/musl.sh /build/
22+
COPY scripts/musl-toolchain.sh /build/
2223
# We need to mitigate rust-lang/rust#34978 when compiling musl itself as well
23-
RUN CC=gcc \
24-
CFLAGS="-Wa,-mrelax-relocations=no" \
25-
CXX=g++ \
24+
RUN CFLAGS="-Wa,-mrelax-relocations=no" \
2625
CXXFLAGS="-Wa,-mrelax-relocations=no" \
27-
bash musl.sh x86_64 && rm -rf /build
26+
bash musl-toolchain.sh x86_64 && rm -rf build
2827

2928
COPY scripts/sccache.sh /scripts/
3029
RUN sh /scripts/sccache.sh
3130

3231
ENV RUST_CONFIGURE_ARGS \
33-
--musl-root-x86_64=/musl-x86_64 \
32+
--musl-root-x86_64=/usr/local/x86_64-linux-musl \
3433
--enable-extended \
3534
--disable-docs
3635

@@ -41,6 +40,12 @@ ENV RUST_CONFIGURE_ARGS \
4140
# See: https://github.com/rust-lang/rust/issues/34978
4241
ENV CFLAGS_x86_64_unknown_linux_musl=-Wa,-mrelax-relocations=no
4342

44-
ENV SCRIPT \
45-
python2.7 ../x.py test --target x86_64-unknown-linux-musl && \
46-
python2.7 ../x.py dist --target x86_64-unknown-linux-musl
43+
ENV HOSTS=x86_64-unknown-linux-musl \
44+
CC_x86_64_unknown_linux_musl=x86_64-linux-musl-gcc \
45+
CXX_x86_64_unknown_linux_musl=x86_64-linux-musl-g++
46+
47+
# Musl defaults to static libs but we need them to be dynamic for host toolchain.
48+
# The toolchain will produce static libs by default.
49+
ENV RUSTFLAGS="-C target-feature=-crt-static"
50+
51+
ENV SCRIPT python2.7 ../x.py dist --host $HOSTS --target $HOSTS
+70
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# This script runs `musl-cross-make` to prepare C toolchain (Binutils, GCC, musl itself)
2+
# and builds static libunwind that we distribute for static target.
3+
#
4+
# Versions of the toolchain components are configurable in `musl-cross-make/Makefile` and
5+
# musl unlike GLIBC is forward compatible so upgrading it shouldn't break old distributions.
6+
# Right now we have: Binutils 2.27, GCC 6.3.0, musl 1.1.18
7+
set -ex
8+
9+
hide_output() {
10+
set +x
11+
on_err="
12+
echo ERROR: An error was encountered with the build.
13+
cat /tmp/build.log
14+
exit 1
15+
"
16+
trap "$on_err" ERR
17+
bash -c "while true; do sleep 30; echo \$(date) - building ...; done" &
18+
PING_LOOP_PID=$!
19+
$@ &> /tmp/build.log
20+
trap - ERR
21+
kill $PING_LOOP_PID
22+
rm /tmp/build.log
23+
set -x
24+
}
25+
26+
ARCH=$1
27+
TARGET=$ARCH-linux-musl
28+
29+
OUTPUT=/usr/local
30+
shift
31+
32+
git clone https://github.com/richfelker/musl-cross-make -b v0.9.7
33+
cd musl-cross-make
34+
35+
hide_output make -j$(nproc) TARGET=$TARGET
36+
hide_output make install TARGET=$TARGET OUTPUT=$OUTPUT
37+
38+
cd -
39+
40+
# Install musl library to make binaries executable
41+
ln -s $OUTPUT/$TARGET/lib/libc.so /lib/ld-musl-$ARCH.so.1
42+
echo $OUTPUT/$TARGET/lib >> /etc/ld-musl-$ARCH.path
43+
44+
45+
export CC=$TARGET-gcc
46+
export CXX=$TARGET-g++
47+
48+
LLVM=70
49+
50+
# may have been downloaded in a previous run
51+
if [ ! -d libunwind-release_$LLVM ]; then
52+
curl -L https://github.com/llvm-mirror/llvm/archive/release_$LLVM.tar.gz | tar xzf -
53+
curl -L https://github.com/llvm-mirror/libunwind/archive/release_$LLVM.tar.gz | tar xzf -
54+
fi
55+
56+
# fixme(mati865): Replace it with https://github.com/rust-lang/rust/pull/59089
57+
mkdir libunwind-build
58+
cd libunwind-build
59+
cmake ../libunwind-release_$LLVM \
60+
-DLLVM_PATH=/build/llvm-release_$LLVM \
61+
-DLIBUNWIND_ENABLE_SHARED=0 \
62+
-DCMAKE_C_COMPILER=$CC \
63+
-DCMAKE_CXX_COMPILER=$CXX \
64+
-DCMAKE_C_FLAGS="$CFLAGS" \
65+
-DCMAKE_CXX_FLAGS="$CXXFLAGS"
66+
67+
hide_output make -j$(nproc)
68+
cp lib/libunwind.a $OUTPUT/$TARGET/lib
69+
cd - && rm -rf libunwind-build
70+

src/ci/docker/test-various/Dockerfile

+15-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
1111
cmake \
1212
sudo \
1313
gdb \
14-
xz-utils
14+
xz-utils \
15+
wget \
16+
patch
1517

1618
# FIXME: build the `ptx-linker` instead.
1719
RUN curl -sL https://github.com/denzp/rust-ptx-linker/releases/download/v0.9.0-alpha.2/rust-ptx-linker.linux64.tar.gz | \
@@ -20,10 +22,16 @@ RUN curl -sL https://github.com/denzp/rust-ptx-linker/releases/download/v0.9.0-a
2022
RUN curl -sL https://nodejs.org/dist/v9.2.0/node-v9.2.0-linux-x64.tar.xz | \
2123
tar -xJ
2224

25+
WORKDIR /build/
26+
COPY scripts/musl-toolchain.sh /build/
27+
RUN bash musl-toolchain.sh x86_64 && rm -rf build
28+
WORKDIR /
29+
2330
COPY scripts/sccache.sh /scripts/
2431
RUN sh /scripts/sccache.sh
2532

2633
ENV RUST_CONFIGURE_ARGS \
34+
--musl-root-x86_64=/usr/local/x86_64-linux-musl \
2735
--set build.nodejs=/node-v9.2.0-linux-x64/bin/node \
2836
--set rust.lld
2937

@@ -48,4 +56,9 @@ ENV NVPTX_SCRIPT python2.7 /checkout/x.py test --target $NVPTX_TARGETS \
4856
src/test/run-make \
4957
src/test/assembly
5058

51-
ENV SCRIPT $WASM_SCRIPT && $NVPTX_SCRIPT
59+
ENV MUSL_TARGETS=x86_64-unknown-linux-musl \
60+
CC_x86_64_unknown_linux_musl=x86_64-linux-musl-gcc \
61+
CXX_x86_64_unknown_linux_musl=x86_64-linux-musl-g++
62+
ENV MUSL_SCRIPT python2.7 /checkout/x.py test --target $MUSL_TARGETS
63+
64+
ENV SCRIPT $WASM_SCRIPT && $NVPTX_SCRIPT && $MUSL_SCRIPT

src/liballoc/prelude.rs

-19
This file was deleted.

src/liballoc/prelude/mod.rs

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
//! The alloc Prelude
2+
//!
3+
//! The purpose of this module is to alleviate imports of commonly-used
4+
//! items of the `alloc` crate by adding a glob import to the top of modules:
5+
//!
6+
//! ```
7+
//! # #![allow(unused_imports)]
8+
//! # #![feature(alloc)]
9+
//! #![feature(alloc_prelude)]
10+
//! extern crate alloc;
11+
//! use alloc::prelude::v1::*;
12+
//! ```
13+
14+
#![unstable(feature = "alloc_prelude", issue = "58935")]
15+
16+
pub mod v1;

0 commit comments

Comments
 (0)