Skip to content

Commit 0961ae8

Browse files
committed
Auto merge of #81821 - nikic:update-wasm32, r=sanxiyn
Upgrade wasm32 image to Ubuntu 20.04 This switches the wasm32 image, which is used to test wasm32-unknown-emscripten, to Ubuntu 20.04. While at it, enable most of the excluded tests, as they seem to work fine with some minor fixes.
2 parents 08fdbd5 + 55e2372 commit 0961ae8

File tree

3 files changed

+10
-11
lines changed

3 files changed

+10
-11
lines changed

library/std/src/lazy/tests.rs

+5
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ fn spawn_and_wait<R: Send + 'static>(f: impl FnOnce() -> R + Send + 'static) ->
4848
}
4949

5050
#[test]
51+
#[cfg_attr(target_os = "emscripten", ignore)]
5152
fn sync_once_cell() {
5253
static ONCE_CELL: SyncOnceCell<i32> = SyncOnceCell::new();
5354

@@ -81,6 +82,7 @@ fn sync_once_cell_get_unchecked() {
8182
}
8283

8384
#[test]
85+
#[cfg_attr(target_os = "emscripten", ignore)]
8486
fn sync_once_cell_drop() {
8587
static DROP_CNT: AtomicUsize = AtomicUsize::new(0);
8688
struct Dropper;
@@ -158,6 +160,7 @@ fn into_inner() {
158160
}
159161

160162
#[test]
163+
#[cfg_attr(target_os = "emscripten", ignore)]
161164
fn sync_lazy_new() {
162165
static CALLED: AtomicUsize = AtomicUsize::new(0);
163166
static SYNC_LAZY: SyncLazy<i32> = SyncLazy::new(|| {
@@ -204,6 +207,7 @@ fn sync_lazy_default() {
204207
}
205208

206209
#[test]
210+
#[cfg_attr(target_os = "emscripten", ignore)]
207211
fn static_sync_lazy() {
208212
static XS: SyncLazy<Vec<i32>> = SyncLazy::new(|| {
209213
let mut xs = Vec::new();
@@ -279,6 +283,7 @@ fn eval_once_macro() {
279283
}
280284

281285
#[test]
286+
#[cfg_attr(target_os = "emscripten", ignore)]
282287
fn sync_once_cell_does_not_leak_partially_constructed_boxes() {
283288
static ONCE_CELL: SyncOnceCell<String> = SyncOnceCell::new();
284289

library/test/src/tests.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ use crate::{
2727
},
2828
time::{TestTimeOptions, TimeThreshold},
2929
};
30-
use std::any::TypeId;
3130
use std::sync::mpsc::channel;
3231
use std::time::Duration;
3332

@@ -198,6 +197,7 @@ fn test_should_panic_bad_message() {
198197
#[cfg(not(target_os = "emscripten"))]
199198
fn test_should_panic_non_string_message_type() {
200199
use crate::tests::TrFailedMsg;
200+
use std::any::TypeId;
201201
fn f() {
202202
std::panic::panic_any(1i32);
203203
}

src/ci/docker/host-x86_64/wasm32/Dockerfile

+4-10
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
FROM ubuntu:16.04
1+
FROM ubuntu:20.04
22

3-
RUN apt-get update && apt-get install -y --no-install-recommends \
3+
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
44
g++ \
55
make \
66
ninja-build \
@@ -51,12 +51,6 @@ ENV EMCC_CFLAGS=-O1
5151
# Emscripten installation is user-specific
5252
ENV NO_CHANGE_USER=1
5353

54-
# FIXME: Re-enable these tests once https://github.com/rust-lang/cargo/pull/7476
55-
# is picked up by CI
54+
# Exclude library/alloc due to OOM in benches.
5655
ENV SCRIPT python3 ../x.py test --stage 2 --host='' --target $TARGETS \
57-
--exclude library/core \
58-
--exclude library/alloc \
59-
--exclude library/proc_macro \
60-
--exclude library/std \
61-
--exclude library/term \
62-
--exclude library/test
56+
--exclude library/alloc

0 commit comments

Comments
 (0)