Skip to content

Commit 8ade28e

Browse files
authored
Rollup merge of #35574 - badboy:emscripten-test-fixes, r=brson
Emscripten test fixes This picks up parts of #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;

0 commit comments

Comments
 (0)