Skip to content

Commit 5a8fb7c

Browse files
committed
Auto merge of #65152 - tmandry:rollup-btn4a01, r=tmandry
Rollup of 18 pull requests This contains changes from all the successful runs that bors marked as timed out, plus a revert of #63649 which appears to be the immediate cause of the timeouts. Successful merges: - #64708 (Stabilize `Option::as_deref` and `Option::as_deref_mut`) - #64728 (Stabilize UdpSocket::peer_addr) - #64765 (std: Reduce checks for `feature = "backtrace"`) - #64909 (When encountering chained operators use heuristics to recover from bad turbofish) - #65011 (Do not ICE when dereferencing non-Copy raw pointer) - #65064 (permit asyncawait-ondeck to be added by anyone) - #65066 ([const-prop] Fix ICE when trying to eval polymorphic promoted MIR) - #65100 (Replace GeneratorSubsts with SubstsRef) - #65105 (Split out some passes from librustc) - #65106 (Allow unused attributes to avoid incremental bug) - #65113 (Fix lonely backtick) - #65116 (Remove unneeded visit_statement definition) - #65118 (Update the documented default of -Z mutable-noalias) - #65123 (Account for macro invocation in `let mut $pat` diagnostic.) - #65124 (Replace some instances of `as *[const | mut] _` with `.cast()`) - #65126 (Fix typo on `now()` comments) - #65130 (lint: extern non-exhaustive types are improper) - #65151 (Revert #63649 - "Upgrade Emscripten targets to use upstream LLVM backend") Failed merges: r? @ghost
2 parents 7870050 + 69598dc commit 5a8fb7c

File tree

240 files changed

+1601
-966
lines changed

Some content is hidden

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

240 files changed

+1601
-966
lines changed

Cargo.lock

+2
Original file line numberDiff line numberDiff line change
@@ -3613,6 +3613,8 @@ dependencies = [
36133613
"rustc",
36143614
"rustc_data_structures",
36153615
"rustc_errors",
3616+
"rustc_index",
3617+
"rustc_target",
36163618
"syntax",
36173619
"syntax_pos",
36183620
]

config.toml.example

-1
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,6 @@
377377
# but you can also optionally enable the "emscripten" backend for asm.js or
378378
# make this an empty array (but that probably won't get too far in the
379379
# bootstrap)
380-
# FIXME: remove the obsolete emscripten backend option.
381380
#codegen-backends = ["llvm"]
382381

383382
# This is the name of the directory in which codegen backends will get installed

src/bootstrap/builder.rs

-1
Original file line numberDiff line numberDiff line change
@@ -970,7 +970,6 @@ impl<'a> Builder<'a> {
970970
Some("-Wl,-rpath,@loader_path/../lib")
971971
} else if !target.contains("windows") &&
972972
!target.contains("wasm32") &&
973-
!target.contains("emscripten") &&
974973
!target.contains("fuchsia") {
975974
Some("-Wl,-rpath,$ORIGIN/../lib")
976975
} else {

src/bootstrap/test.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -1047,11 +1047,10 @@ impl Step for Compiletest {
10471047
// Also provide `rust_test_helpers` for the host.
10481048
builder.ensure(native::TestHelpers { target: compiler.host });
10491049

1050-
// As well as the target, except for plain wasm32, which can't build it
1051-
if !target.contains("wasm32") || target.contains("emscripten") {
1050+
// wasm32 can't build the test helpers
1051+
if !target.contains("wasm32") {
10521052
builder.ensure(native::TestHelpers { target });
10531053
}
1054-
10551054
builder.ensure(RemoteCopyLibs { compiler, target });
10561055

10571056
let mut cmd = builder.tool_cmd(Tool::Compiletest);

src/ci/docker/asmjs/Dockerfile

+20-9
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
1111
cmake \
1212
sudo \
1313
gdb \
14-
xz-utils \
15-
bzip2
14+
xz-utils
1615

1716
COPY scripts/emscripten.sh /scripts/
1817
RUN bash /scripts/emscripten.sh
@@ -21,16 +20,28 @@ COPY scripts/sccache.sh /scripts/
2120
RUN sh /scripts/sccache.sh
2221

2322
ENV PATH=$PATH:/emsdk-portable
24-
ENV PATH=$PATH:/emsdk-portable/upstream/emscripten/
25-
ENV PATH=$PATH:/emsdk-portable/node/12.9.1_64bit/bin/
26-
ENV BINARYEN_ROOT=/emsdk-portable/upstream/
23+
ENV PATH=$PATH:/emsdk-portable/clang/e1.38.15_64bit/
24+
ENV PATH=$PATH:/emsdk-portable/emscripten/1.38.15/
25+
ENV PATH=$PATH:/emsdk-portable/node/8.9.1_64bit/bin/
26+
ENV EMSCRIPTEN=/emsdk-portable/emscripten/1.38.15/
27+
ENV BINARYEN_ROOT=/emsdk-portable/clang/e1.38.15_64bit/binaryen/
2728
ENV EM_CONFIG=/emsdk-portable/.emscripten
2829

2930
ENV TARGETS=asmjs-unknown-emscripten
3031

31-
ENV SCRIPT python2.7 ../x.py test --target $TARGETS
32+
ENV RUST_CONFIGURE_ARGS --enable-emscripten --disable-optimize-tests
3233

33-
# This is almost identical to the wasm32-unknown-emscripten target, so
34-
# running with assertions again is not useful
35-
ENV NO_DEBUG_ASSERTIONS=1
34+
ENV SCRIPT python2.7 ../x.py test --target $TARGETS \
35+
src/test/ui \
36+
src/test/run-fail \
37+
src/libstd \
38+
src/liballoc \
39+
src/libcore
40+
41+
# Debug assertions in rustc are largely covered by other builders, and LLVM
42+
# assertions cause this builder to slow down by quite a large amount and don't
43+
# buy us a huge amount over other builders (not sure if we've ever seen an
44+
# asmjs-specific backend assertion trip), so disable assertions for these
45+
# tests.
3646
ENV NO_LLVM_ASSERTIONS=1
47+
ENV NO_DEBUG_ASSERTIONS=1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
FROM ubuntu:16.04
2+
3+
RUN apt-get update && apt-get install -y --no-install-recommends \
4+
g++ \
5+
make \
6+
file \
7+
curl \
8+
ca-certificates \
9+
python \
10+
git \
11+
cmake \
12+
sudo \
13+
gdb \
14+
xz-utils \
15+
jq \
16+
bzip2
17+
18+
# emscripten
19+
COPY scripts/emscripten-wasm.sh /scripts/
20+
COPY wasm32-exp/node.sh /usr/local/bin/node
21+
RUN bash /scripts/emscripten-wasm.sh
22+
23+
# cache
24+
COPY scripts/sccache.sh /scripts/
25+
RUN sh /scripts/sccache.sh
26+
27+
# env
28+
ENV PATH=/wasm-install/emscripten:/wasm-install/bin:$PATH
29+
ENV EM_CONFIG=/root/.emscripten
30+
31+
ENV TARGETS=wasm32-experimental-emscripten
32+
33+
ENV RUST_CONFIGURE_ARGS --experimental-targets=WebAssembly
34+
35+
ENV SCRIPT python2.7 ../x.py test --target $TARGETS
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/usr/bin/env bash
2+
3+
path="$(dirname $1)"
4+
file="$(basename $1)"
5+
6+
shift
7+
8+
cd "$path"
9+
exec /node-v8.0.0-linux-x64/bin/node "$file" "$@"

src/ci/docker/disabled/wasm32/Dockerfile

+8-14
Original file line numberDiff line numberDiff line change
@@ -11,28 +11,22 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
1111
cmake \
1212
sudo \
1313
gdb \
14-
xz-utils \
15-
bzip2
14+
xz-utils
1615

16+
# emscripten
1717
COPY scripts/emscripten.sh /scripts/
1818
RUN bash /scripts/emscripten.sh
1919

2020
COPY scripts/sccache.sh /scripts/
2121
RUN sh /scripts/sccache.sh
2222

2323
ENV PATH=$PATH:/emsdk-portable
24-
ENV PATH=$PATH:/emsdk-portable/upstream/emscripten/
25-
ENV PATH=$PATH:/emsdk-portable/node/12.9.1_64bit/bin/
26-
ENV BINARYEN_ROOT=/emsdk-portable/upstream/
24+
ENV PATH=$PATH:/emsdk-portable/clang/e1.38.15_64bit/
25+
ENV PATH=$PATH:/emsdk-portable/emscripten/1.38.15/
26+
ENV PATH=$PATH:/emsdk-portable/node/8.9.1_64bit/bin/
27+
ENV EMSCRIPTEN=/emsdk-portable/emscripten/1.38.15/
28+
ENV BINARYEN_ROOT=/emsdk-portable/clang/e1.38.15_64bit/binaryen/
2729
ENV EM_CONFIG=/emsdk-portable/.emscripten
2830

2931
ENV TARGETS=wasm32-unknown-emscripten
30-
31-
# FIXME: Re-enable these tests once Cargo stops trying to execute wasms
32-
ENV SCRIPT python2.7 ../x.py test --target $TARGETS \
33-
--exclude src/libcore \
34-
--exclude src/liballoc \
35-
--exclude src/libproc_macro \
36-
--exclude src/libstd \
37-
--exclude src/libterm \
38-
--exclude src/libtest
32+
ENV SCRIPT python2.7 ../x.py test --target $TARGETS
+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
set -ex
2+
3+
hide_output() {
4+
set +x
5+
on_err="
6+
echo ERROR: An error was encountered with the build.
7+
cat /tmp/build.log
8+
exit 1
9+
"
10+
trap "$on_err" ERR
11+
bash -c "while true; do sleep 30; echo \$(date) - building ...; done" &
12+
PING_LOOP_PID=$!
13+
$@ &> /tmp/build.log
14+
trap - ERR
15+
kill $PING_LOOP_PID
16+
rm -f /tmp/build.log
17+
set -x
18+
}
19+
20+
# Download last known good emscripten from WebAssembly waterfall
21+
BUILD=$(curl -fL https://storage.googleapis.com/wasm-llvm/builds/linux/lkgr.json | \
22+
jq '.build | tonumber')
23+
curl -sL https://storage.googleapis.com/wasm-llvm/builds/linux/$BUILD/wasm-binaries.tbz2 | \
24+
hide_output tar xvkj
25+
26+
# node 8 is required to run wasm
27+
cd /
28+
curl -sL https://nodejs.org/dist/v8.0.0/node-v8.0.0-linux-x64.tar.xz | \
29+
tar -xJ
30+
31+
# Make emscripten use wasm-ready node and LLVM tools
32+
echo "EMSCRIPTEN_ROOT = '/wasm-install/emscripten'" >> /root/.emscripten
33+
echo "NODE_JS='/usr/local/bin/node'" >> /root/.emscripten
34+
echo "LLVM_ROOT='/wasm-install/bin'" >> /root/.emscripten
35+
echo "BINARYEN_ROOT = '/wasm-install'" >> /root/.emscripten
36+
echo "COMPILER_ENGINE = NODE_JS" >> /root/.emscripten
37+
echo "JS_ENGINES = [NODE_JS]" >> /root/.emscripten

src/ci/docker/scripts/emscripten.sh

+8-3
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,20 @@ exit 1
1717
set -x
1818
}
1919

20-
git clone https://github.com/emscripten-core/emsdk.git /emsdk-portable
20+
cd /
21+
curl -fL https://mozilla-games.s3.amazonaws.com/emscripten/releases/emsdk-portable.tar.gz | \
22+
tar -xz
23+
2124
cd /emsdk-portable
22-
hide_output ./emsdk install 1.38.46-upstream
23-
./emsdk activate 1.38.46-upstream
25+
./emsdk update
26+
hide_output ./emsdk install sdk-1.38.15-64bit
27+
./emsdk activate sdk-1.38.15-64bit
2428

2529
# Compile and cache libc
2630
source ./emsdk_env.sh
2731
echo "main(){}" > a.c
2832
HOME=/emsdk-portable/ emcc a.c
33+
HOME=/emsdk-portable/ emcc -s BINARYEN=1 a.c
2934
rm -f a.*
3035

3136
# Make emsdk usable by any user

src/liballoc/tests/binary_heap.rs

+6-7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
1+
use std::cmp;
12
use std::collections::BinaryHeap;
23
use std::collections::binary_heap::{Drain, PeekMut};
4+
use std::panic::{self, AssertUnwindSafe};
5+
use std::sync::atomic::{AtomicUsize, Ordering};
6+
7+
use rand::{thread_rng, seq::SliceRandom};
38

49
#[test]
510
fn test_iterator() {
@@ -276,15 +281,9 @@ fn assert_covariance() {
276281
// even if the order may not be correct.
277282
//
278283
// Destructors must be called exactly once per element.
279-
// FIXME: re-enable emscripten once it can unwind again
280284
#[test]
281-
#[cfg(not(any(miri, target_os = "emscripten")))] // Miri does not support catching panics
285+
#[cfg(not(miri))] // Miri does not support catching panics
282286
fn panic_safe() {
283-
use std::cmp;
284-
use std::panic::{self, AssertUnwindSafe};
285-
use std::sync::atomic::{AtomicUsize, Ordering};
286-
use rand::{thread_rng, seq::SliceRandom};
287-
288287
static DROP_COUNTER: AtomicUsize = AtomicUsize::new(0);
289288

290289
#[derive(Eq, PartialEq, Ord, Clone, Debug)]

src/liballoc/tests/str.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,7 @@ mod slice_index {
483483
}
484484

485485
#[test]
486-
#[cfg(not(target_os = "emscripten"))] // hits an OOM
486+
#[cfg(not(target_arch = "asmjs"))] // hits an OOM
487487
#[cfg(not(miri))] // Miri is too slow
488488
fn simple_big() {
489489
fn a_million_letter_x() -> String {

src/liballoc/tests/str.rs.rej

-10
This file was deleted.

src/liballoc/tests/vec.rs

+2-5
Original file line numberDiff line numberDiff line change
@@ -944,10 +944,8 @@ fn drain_filter_complex() {
944944
}
945945
}
946946

947-
// Miri does not support catching panics
948-
// FIXME: re-enable emscripten once it can unwind again
949947
#[test]
950-
#[cfg(not(any(miri, target_os = "emscripten")))]
948+
#[cfg(not(miri))] // Miri does not support catching panics
951949
fn drain_filter_consumed_panic() {
952950
use std::rc::Rc;
953951
use std::sync::Mutex;
@@ -997,9 +995,8 @@ fn drain_filter_consumed_panic() {
997995
}
998996
}
999997

1000-
// FIXME: Re-enable emscripten once it can catch panics
1001998
#[test]
1002-
#[cfg(not(any(miri, target_os = "emscripten")))] // Miri does not support catching panics
999+
#[cfg(not(miri))] // Miri does not support catching panics
10031000
fn drain_filter_unconsumed_panic() {
10041001
use std::rc::Rc;
10051002
use std::sync::Mutex;

0 commit comments

Comments
 (0)