Skip to content

Commit

Permalink
Auto merge of #81821 - nikic:update-wasm32, r=sanxiyn
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
bors committed Feb 7, 2021
2 parents 08fdbd5 + 55e2372 commit 0961ae8
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 11 deletions.
5 changes: 5 additions & 0 deletions library/std/src/lazy/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ fn spawn_and_wait<R: Send + 'static>(f: impl FnOnce() -> R + Send + 'static) ->
}

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

Expand Down Expand Up @@ -81,6 +82,7 @@ fn sync_once_cell_get_unchecked() {
}

#[test]
#[cfg_attr(target_os = "emscripten", ignore)]
fn sync_once_cell_drop() {
static DROP_CNT: AtomicUsize = AtomicUsize::new(0);
struct Dropper;
Expand Down Expand Up @@ -158,6 +160,7 @@ fn into_inner() {
}

#[test]
#[cfg_attr(target_os = "emscripten", ignore)]
fn sync_lazy_new() {
static CALLED: AtomicUsize = AtomicUsize::new(0);
static SYNC_LAZY: SyncLazy<i32> = SyncLazy::new(|| {
Expand Down Expand Up @@ -204,6 +207,7 @@ fn sync_lazy_default() {
}

#[test]
#[cfg_attr(target_os = "emscripten", ignore)]
fn static_sync_lazy() {
static XS: SyncLazy<Vec<i32>> = SyncLazy::new(|| {
let mut xs = Vec::new();
Expand Down Expand Up @@ -279,6 +283,7 @@ fn eval_once_macro() {
}

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

Expand Down
2 changes: 1 addition & 1 deletion library/test/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ use crate::{
},
time::{TestTimeOptions, TimeThreshold},
};
use std::any::TypeId;
use std::sync::mpsc::channel;
use std::time::Duration;

Expand Down Expand Up @@ -198,6 +197,7 @@ fn test_should_panic_bad_message() {
#[cfg(not(target_os = "emscripten"))]
fn test_should_panic_non_string_message_type() {
use crate::tests::TrFailedMsg;
use std::any::TypeId;
fn f() {
std::panic::panic_any(1i32);
}
Expand Down
14 changes: 4 additions & 10 deletions src/ci/docker/host-x86_64/wasm32/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM ubuntu:16.04
FROM ubuntu:20.04

RUN apt-get update && apt-get install -y --no-install-recommends \
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
g++ \
make \
ninja-build \
Expand Down Expand Up @@ -51,12 +51,6 @@ ENV EMCC_CFLAGS=-O1
# Emscripten installation is user-specific
ENV NO_CHANGE_USER=1

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

0 comments on commit 0961ae8

Please sign in to comment.