Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
docker emscripten tests passing
  • Loading branch information
benjamin-sieffert committed Jul 21, 2023
commit 79959077185e8cc4b91dd092af9e8ead07e8242d
2 changes: 1 addition & 1 deletion ci/emscripten-entry.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ source /emsdk-portable/emsdk_env.sh &> /dev/null

# emsdk-portable provides a node binary, but we need version 8 to run wasm
# NOTE: Do not forget to sync Node.js version with `emscripten.sh`!
export PATH="/node-v14.17.0-linux-x64/bin:$PATH"
export PATH="/node-v16.20.0-linux-x64/bin:$PATH"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change can be omitted after PR #3321 lands.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Adjusted


exec "$@"
6 changes: 2 additions & 4 deletions ci/emscripten.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@

set -ex

# FIXME: 3.1.21 removed a lot of header files (https://github.com/emscripten-core/emscripten/pull/17704).
# We have to tweak libc-test (and deprecate unsupported items, maybe) when updating emsdk.
EMSDK_VERSION=3.1.20
EMSDK_VERSION=3.1.41

git clone https://github.com/emscripten-core/emsdk.git /emsdk-portable
cd /emsdk-portable
Expand All @@ -24,5 +22,5 @@ chmod a+rxw -R /emsdk-portable
# node 8 is required to run wasm
# NOTE: Do not forget to sync Node.js version with `emscripten-entry.sh`!
cd /
curl --retry 5 -L https://nodejs.org/dist/v14.17.0/node-v14.17.0-linux-x64.tar.xz | \
curl --retry 5 -L https://nodejs.org/dist/v16.20.0/node-v16.20.0-linux-x64.tar.xz | \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto.

tar -xJ
84 changes: 63 additions & 21 deletions libc-test/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2532,7 +2532,6 @@ fn test_emscripten(target: &str) {
cfg.define("_GNU_SOURCE", None); // FIXME: ??

headers! { cfg:
"aio.h",
"ctype.h",
"dirent.h",
"dlfcn.h",
Expand Down Expand Up @@ -2572,32 +2571,21 @@ fn test_emscripten(target: &str) {
"stdio.h",
"stdlib.h",
"string.h",
"sys/epoll.h",
"sys/eventfd.h",
"sys/file.h",
"sys/ioctl.h",
"sys/ipc.h",
"sys/mman.h",
"sys/mount.h",
"sys/msg.h",
"sys/personality.h",
"sys/prctl.h",
"sys/ptrace.h",
"sys/quota.h",
"sys/reboot.h",
"sys/resource.h",
"sys/sem.h",
"sys/shm.h",
"sys/signalfd.h",
"sys/socket.h",
"sys/stat.h",
"sys/statvfs.h",
"sys/swap.h",
"sys/syscall.h",
"sys/sysctl.h",
"sys/sysinfo.h",
"sys/time.h",
"sys/timerfd.h",
"sys/times.h",
"sys/types.h",
"sys/uio.h",
Expand Down Expand Up @@ -2655,8 +2643,9 @@ fn test_emscripten(target: &str) {
// FIXME: is this necessary?
"sighandler_t" => true,

// FIXME: The size has been changed due to musl's time64
"time_t" => true,
// No epoll support
// https://github.com/emscripten-core/emscripten/issues/5033
ty if ty.starts_with("epoll") => true,

_ => false,
}
Expand All @@ -2683,9 +2672,16 @@ fn test_emscripten(target: &str) {
// llvm/llvm-project@d1a96e9
"max_align_t" => true,

// FIXME: The size has been changed due to time64
"utimbuf" | "timeval" | "timespec" | "rusage" | "itimerval" | "sched_param"
| "stat" | "stat64" | "shmid_ds" | "msqid_ds" => true,
// No quota.h
"dqblk" => true,

// No aio.h
"aiocb" => true,

// No epoll support
// https://github.com/emscripten-core/emscripten/issues/5033
ty if ty.starts_with("epoll") => true,
ty if ty.starts_with("signalfd") => true,

_ => false,
}
Expand All @@ -2697,9 +2693,6 @@ fn test_emscripten(target: &str) {
// https://github.com/emscripten-core/emscripten/blob/3.1.30/tools/system_libs.py#L973
"execv" | "execve" | "execvp" | "execvpe" | "fexecve" | "wait4" => true,

// FIXME: Remove after emscripten-core/emscripten#18492 is released (> 3.1.30).
"clearenv" => true,

_ => false,
}
});
Expand All @@ -2713,10 +2706,59 @@ fn test_emscripten(target: &str) {
// FIXME: emscripten uses different constants to constructs these
n if n.contains("__SIZEOF_PTHREAD") => true,

// No epoll support
// https://github.com/emscripten-core/emscripten/issues/5033
n if n.starts_with("EPOLL") => true,
n if n.starts_with("EFD_") => true,
n if n.starts_with("SFD_") => true,

// No reboot.h
n if n.starts_with("RB_") => true,

// No aio.h
n if n.starts_with("AIO_") => true,
n if n.starts_with("LIO_") => true,

// No prctrl.h
n if n.starts_with("PR_") => true,

// No quota.h
n if n.starts_with("QFMT_") => true,

// FIXME: `SYS_gettid` was removed in
// emscripten-core/emscripten@6d6474e
"SYS_gettid" => true,

// No personality.h etc.: https://github.com/emscripten-core/emscripten/pull/17704
// No sysctl.h: https://github.com/emscripten-core/emscripten/pull/18863
n if n.starts_with("PTRACE_") => true,
n if n.starts_with("QIF_") => true,
Comment on lines +2763 to +2766
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should just remove the declaration instead of skipping.


| "ADDR_NO_RANDOMIZE"
| "MMAP_PAGE_ZERO"
| "ADDR_COMPAT_LAYOUT"
| "READ_IMPLIES_EXEC"
| "ADDR_LIMIT_32BIT"
| "SHORT_INODE"
| "WHOLE_SECONDS"
| "STICKY_TIMEOUTS"
| "ADDR_LIMIT_3GB"
=> true,

| "USRQUOTA"
| "GRPQUOTA"
=> true,

| "Q_GETFMT"
| "Q_GETINFO"
| "Q_SETINFO"
| "Q_SYNC"
| "Q_QUOTAON"
| "Q_QUOTAOFF"
| "Q_GETQUOTA"
| "Q_SETQUOTA"
=> true,

// FIXME: These values have been changed
| "POSIX_MADV_DONTNEED" // to 4
| "RLIMIT_NLIMITS" // to 16
Expand Down Expand Up @@ -3700,7 +3742,7 @@ fn test_linux(target: &str) {
"PR_SET_VMA" | "PR_SET_VMA_ANON_NAME" => true,

// present in recent kernels only
"PR_SCHED_CORE" | "PR_SCHED_CORE_CREATE" | "PR_SCHED_CORE_GET" | "PR_SCHED_CORE_MAX" | "PR_SCHED_CORE_SCOPE_PROCESS_GROUP" | "PR_SCHED_CORE_SCOPE_THREAD" | "PR_SCHED_CORE_SCOPE_THREAD_GROUP" | "PR_SCHED_CORE_SHARE_FROM" | "PR_SCHED_CORE_SHARE_TO" => true,
"PR_SCHED_CORE" | "PR_SCHED_CORE_CREATE" | "PR_SCHED_CORE_GET" | "PR_SCHED_CORE_MAX" | "PR_SCHED_CORE_SCOPE_PROCESS_GROUP" | "PR_SCHED_CORE_SCOPE_THREAD" | "PR_SCHED_CORE_SCOPE_THREAD_GROUP" | "PR_SCHED_CORE_SHARE_FROM" | "PR_SCHED_CORE_SHARE_TO" => true,

// present in recent kernels only >= 5.13
"PR_PAC_SET_ENABLED_KEYS" | "PR_PAC_GET_ENABLED_KEYS" => true,
Expand Down
6 changes: 0 additions & 6 deletions src/unix/linux_like/emscripten/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -319,11 +319,8 @@ s! {
pub shm_perm: ::ipc_perm,
pub shm_segsz: ::size_t,
pub shm_atime: ::time_t,
__unused1: ::c_int,
pub shm_dtime: ::time_t,
__unused2: ::c_int,
pub shm_ctime: ::time_t,
__unused3: ::c_int,
pub shm_cpid: ::pid_t,
pub shm_lpid: ::pid_t,
pub shm_nattch: ::c_ulong,
Expand All @@ -334,11 +331,8 @@ s! {
pub struct msqid_ds {
pub msg_perm: ::ipc_perm,
pub msg_stime: ::time_t,
__unused1: ::c_int,
pub msg_rtime: ::time_t,
__unused2: ::c_int,
pub msg_ctime: ::time_t,
__unused3: ::c_int,
__msg_cbytes: ::c_ulong,
pub msg_qnum: ::msgqnum_t,
pub msg_qbytes: ::msglen_t,
Expand Down