Skip to content

Commit 8ade28e

Browse files
authored
Rollup merge of rust-lang#35574 - badboy:emscripten-test-fixes, r=brson
Emscripten test fixes This picks up parts of rust-lang#31623 to disable certain tests that emscripten can't run, as threads/processes are not supported. I re-applied @tomaka's changes manually, I can rebase those commits with his credentials if he wants. It also disables jemalloc for emscripten (at least in Rustbuild, I have to check if there is another setting for the same thing in the old makefile approach). This should not impact anything for normal builds.
2 parents c3cede2 + 60599df commit 8ade28e

Some content is hidden

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

46 files changed

+68
-13
lines changed

src/bootstrap/sanity.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,8 @@ pub fn check(build: &mut Build) {
9898
if target.contains("rumprun") ||
9999
target.contains("bitrig") ||
100100
target.contains("openbsd") ||
101-
target.contains("msvc") {
101+
target.contains("msvc") ||
102+
target.contains("emscripten") {
102103
build.config.use_jemalloc = false;
103104
}
104105

src/libstd/sys/unix/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,11 +83,11 @@ pub fn init() {
8383
}
8484
}
8585

86-
#[cfg(not(target_os = "nacl"))]
86+
#[cfg(not(any(target_os = "nacl", target_os = "emscripten")))]
8787
unsafe fn reset_sigpipe() {
8888
assert!(signal(libc::SIGPIPE, libc::SIG_IGN) != !0);
8989
}
90-
#[cfg(target_os = "nacl")]
90+
#[cfg(any(target_os = "nacl", target_os = "emscripten"))]
9191
unsafe fn reset_sigpipe() {}
9292
}
9393

src/libstd/sys/unix/os.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -551,11 +551,13 @@ pub fn home_dir() -> Option<PathBuf> {
551551

552552
#[cfg(any(target_os = "android",
553553
target_os = "ios",
554-
target_os = "nacl"))]
554+
target_os = "nacl",
555+
target_os = "emscripten"))]
555556
unsafe fn fallback() -> Option<OsString> { None }
556557
#[cfg(not(any(target_os = "android",
557558
target_os = "ios",
558-
target_os = "nacl")))]
559+
target_os = "nacl",
560+
target_os = "emscripten")))]
559561
unsafe fn fallback() -> Option<OsString> {
560562
#[cfg(not(target_os = "solaris"))]
561563
unsafe fn getpwduid_r(me: libc::uid_t, passwd: &mut libc::passwd,

src/libstd/sys/unix/thread.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,7 @@ impl Thread {
8181
}
8282

8383
#[cfg(any(target_os = "linux",
84-
target_os = "android",
85-
target_os = "emscripten"))]
84+
target_os = "android"))]
8685
pub fn set_name(name: &CStr) {
8786
const PR_SET_NAME: libc::c_int = 15;
8887
// pthread wrapper only appeared in glibc 2.12, so we use syscall
@@ -118,9 +117,9 @@ impl Thread {
118117
name.as_ptr() as *mut libc::c_void);
119118
}
120119
}
121-
#[cfg(any(target_env = "newlib", target_os = "solaris"))]
120+
#[cfg(any(target_env = "newlib", target_os = "solaris", target_os = "emscripten"))]
122121
pub fn set_name(_name: &CStr) {
123-
// Newlib and Illumos has no way to set a thread name.
122+
// Newlib, Illumos and Emscripten have no way to set a thread name.
124123
}
125124

126125
pub fn sleep(dur: Duration) {

src/libunwind/libunwind.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ pub const unwinder_private_data_size: usize = 2;
6060
pub const unwinder_private_data_size: usize = 2;
6161

6262
#[cfg(target_arch = "asmjs")]
63-
// FIXME: Copied from arm. Need to confirm.
6463
pub const unwinder_private_data_size: usize = 20;
6564

6665
#[repr(C)]

src/test/run-pass-fulldeps/linkage-visibility.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
// ignore-android: FIXME(#10356)
1313
// ignore-windows: std::dynamic_lib does not work on Windows well
1414
// ignore-musl
15+
// ignore-emscripten no dynamic linking
1516

1617
extern crate linkage_visibility as foo;
1718

src/test/run-pass-fulldeps/logging-enabled.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
// except according to those terms.
1010

1111
// exec-env:RUST_LOG=logging_enabled=info
12+
// ignore-emscripten: FIXME(#31622)
1213

1314

1415
#![feature(rustc_private)]

src/test/run-pass-fulldeps/logging-separate-lines.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
// ignore-windows
1212
// exec-env:RUST_LOG=debug
1313
// compile-flags:-C debug-assertions=y
14+
// ignore-emscripten: FIXME(#31622)
1415

1516
#![feature(rustc_private)]
1617

src/test/run-pass/backtrace-debuginfo.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
// compile-flags:-g -Cllvm-args=-enable-tail-merge=0
1919
// ignore-pretty as this critically relies on line numbers
20+
// ignore-emscripten spawning processes is not supported
2021

2122
use std::io;
2223
use std::io::prelude::*;

src/test/run-pass/backtrace.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
// no-pretty-expanded FIXME #15189
1212
// ignore-android FIXME #17520
13+
// ignore-emscripten spawning processes is not supported
1314
// compile-flags:-g
1415

1516
use std::env;

src/test/run-pass/command-before-exec.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
// except according to those terms.
1010

1111
// ignore-windows - this is a unix-specific test
12+
// ignore-emscripten
1213

1314
#![feature(process_exec, libc)]
1415

src/test/run-pass/command-exec.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
// except according to those terms.
1010

1111
// ignore-windows - this is a unix-specific test
12+
// ignore-emscripten
1213
// ignore-pretty
1314

1415
#![feature(process_exec)]

src/test/run-pass/drop-flag-sanity-check.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
// except according to those terms.
1010

1111
// compile-flags: -Z force-dropflag-checks=on
12+
// ignore-emscripten
1213

1314
// Quick-and-dirty test to ensure -Z force-dropflag-checks=on works as
1415
// expected. Note that the inlined drop-flag is slated for removal

src/test/run-pass/drop-trait-enum.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
// ignore-emscripten no threads support
12+
1113
#![allow(unknown_features)]
1214
#![feature(box_syntax)]
1315

src/test/run-pass/env-args-reverse-iterator.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
// ignore-emscripten
12+
1113
use std::env::args;
1214
use std::process::Command;
1315

src/test/run-pass/env-home-dir.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
// ignore-emscripten
1112

1213
#![feature(path)]
1314

src/test/run-pass/exec-env.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
// except according to those terms.
1010

1111
// exec-env:TEST_EXEC_ENV=22
12-
12+
// ignore-emscripten FIXME: issue #31622
1313

1414
use std::env;
1515

src/test/run-pass/hashmap-memory.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
// ignore-emscripten No support for threads
12+
1113
#![allow(unknown_features)]
1214
#![feature(std_misc)]
1315

src/test/run-pass/intrinsic-alignment.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ mod rusti {
2424
target_os = "dragonfly",
2525
target_os = "netbsd",
2626
target_os = "openbsd",
27-
target_os = "solaris"))]
27+
target_os = "solaris",
28+
target_os = "emscripten"))]
2829
mod m {
2930
#[main]
3031
#[cfg(target_arch = "x86")]

src/test/run-pass/issue-10626.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
// ignore-emscripten
1112

1213
// Make sure that if a process doesn't have its stdio/stderr descriptors set up
1314
// that we don't die in a large ball of fire

src/test/run-pass/issue-12133-3.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
// aux-build:issue-12133-dylib.rs
1313
// aux-build:issue-12133-dylib2.rs
1414
// ignore-musl
15+
// ignore-emscripten no dylib support
1516

1617
// pretty-expanded FIXME #23616
1718

src/test/run-pass/issue-13304.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
// except according to those terms.
1010

1111
// ignore-aarch64
12+
// ignore-emscripten
1213
#![feature(io, process_capture)]
1314

1415
use std::env;

src/test/run-pass/issue-14456.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
// ignore-emscripten
1112

1213
#![feature(io, process_capture)]
1314

src/test/run-pass/issue-14940.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
// ignore-emscripten
1112

1213
use std::env;
1314
use std::process::Command;

src/test/run-pass/issue-16272.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
// except according to those terms.
1010

1111
// ignore-aarch64
12+
// ignore-emscripten
1213

1314
use std::process::Command;
1415
use std::env;

src/test/run-pass/issue-20091.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
// except according to those terms.
1010

1111
// ignore-aarch64
12+
// ignore-emscripten
1213
#![feature(std_misc, os)]
1314

1415
#[cfg(unix)]

src/test/run-pass/issue-2190-1.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
// except according to those terms.
1010

1111
// pretty-expanded FIXME #23616
12+
// ignore-emscripten
1213

1314
use std::thread::Builder;
1415

src/test/run-pass/issue-24313.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
// ignore-emscripten
12+
1113
use std::thread;
1214
use std::env;
1315
use std::process::Command;

src/test/run-pass/issue-28950.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
// ignore-emscripten
1112
// compile-flags: -Z orbit=off
1213
// (blows the stack with MIR trans and no optimizations)
1314

src/test/run-pass/issue-29485.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
// except according to those terms.
1010

1111
// aux-build:issue-29485.rs
12+
// ignore-emscripten
1213

1314
#[feature(recover)]
1415

src/test/run-pass/issue-30490.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
// ignore-emscripten
12+
1113
// Previously libstd would set stdio descriptors of a child process
1214
// by `dup`ing the requested descriptors to inherit directly into the
1315
// stdio descriptors. This, however, would incorrectly handle cases

src/test/run-pass/issue-33770.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
// ignore-emscripten
12+
1113
use std::process::{Command, Stdio};
1214
use std::env;
1315
use std::sync::{Mutex, RwLock};

src/test/run-pass/linkage1.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
// ignore-windows
1212
// ignore-macos
13+
// ignore-emscripten
1314
// aux-build:linkage1.rs
1415

1516
#![feature(linkage)]

src/test/run-pass/multi-panic.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
// ignore-emscripten
12+
1113
fn check_for_no_backtrace(test: std::process::Output) {
1214
assert!(!test.status.success());
1315
let err = String::from_utf8_lossy(&test.stderr);

src/test/run-pass/no-stdio.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
// ignore-emscripten
12+
1113
#![feature(libc)]
1214

1315
extern crate libc;

src/test/run-pass/panic-handler-chain.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
10+
11+
// ignore-emscripten no threads support
12+
1013
#![feature(panic_handler, const_fn, std_panic)]
1114

1215
use std::sync::atomic::{AtomicUsize, Ordering};

src/test/run-pass/process-exit.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
// ignore-emscripten
12+
1113
use std::env;
1214
use std::process::{self, Command, Stdio};
1315

src/test/run-pass/process-remove-from-env.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
// ignore-emscripten
1112

1213
use std::process::Command;
1314
use std::env;

src/test/run-pass/process-spawn-with-unicode-params.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
// intact.
1818

1919
// ignore-aarch64
20+
// ignore-emscripten
2021

2122
use std::io::prelude::*;
2223
use std::io;

src/test/run-pass/rec-align-u64.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ struct Outer {
4242
target_os = "dragonfly",
4343
target_os = "netbsd",
4444
target_os = "openbsd",
45-
target_os = "solaris"))]
45+
target_os = "solaris",
46+
target_os = "emscripten"))]
4647
mod m {
4748
#[cfg(target_arch = "x86")]
4849
pub mod m {

src/test/run-pass/running-with-no-runtime.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
// ignore-emscripten
12+
1113
#![feature(start)]
1214

1315
use std::ffi::CStr;

src/test/run-pass/segfault-no-out-of-stack.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
// ignore-emscripten can't run commands
12+
1113
#![feature(libc)]
1214

1315
extern crate libc;

src/test/run-pass/signal-exit-status.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
// except according to those terms.
1010

1111
// ignore-windows
12+
// ignore-emscripten
1213

1314
use std::env;
1415
use std::process::Command;

src/test/run-pass/sigpipe-should-be-ignored.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
// doesn't die in a ball of fire, but rather it's gracefully handled.
1313

1414
// ignore-aarch64
15+
// ignore-emscripten
1516

1617
use std::env;
1718
use std::io::prelude::*;

0 commit comments

Comments
 (0)