From 13175a8170715547a6cbfbc27eae986dcd9e2af7 Mon Sep 17 00:00:00 2001 From: Thomas Lively Date: Fri, 16 Aug 2019 19:12:55 -0700 Subject: [PATCH 01/10] Update Emscripten system types These changes bring the types up to parity with recent Emscripten versions using the upstream LLVM wasm backend. These changes should be coordinated with the upgrade of rustc's Emscripten support. See https://internals.rust-lang.org/t/upgrading-rust-s-emscripten-support/10684 --- src/unix/linux_like/emscripten/mod.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/unix/linux_like/emscripten/mod.rs b/src/unix/linux_like/emscripten/mod.rs index 67631fccf0892..e415f589e2a8a 100644 --- a/src/unix/linux_like/emscripten/mod.rs +++ b/src/unix/linux_like/emscripten/mod.rs @@ -5,8 +5,8 @@ pub type dev_t = u32; pub type socklen_t = u32; pub type pthread_t = c_ulong; pub type mode_t = u32; -pub type ino64_t = u32; -pub type off64_t = i32; +pub type ino64_t = u64; +pub type off64_t = i64; pub type blkcnt64_t = i32; pub type rlim64_t = u64; pub type shmatt_t = ::c_ulong; @@ -16,14 +16,14 @@ pub type msglen_t = ::c_ulong; pub type nfds_t = ::c_ulong; pub type nl_item = ::c_int; pub type idtype_t = ::c_uint; -pub type loff_t = i32; +pub type loff_t = i64; pub type pthread_key_t = ::c_uint; pub type clock_t = c_long; pub type time_t = c_long; pub type suseconds_t = c_long; pub type ino_t = u32; -pub type off_t = i32; +pub type off_t = i64; pub type blkcnt_t = i32; pub type blksize_t = c_long; From a5a5a90e2fafdc0719c40db6c459ad3aceabcf94 Mon Sep 17 00:00:00 2001 From: Thomas Lively Date: Mon, 19 Aug 2019 11:49:50 -0700 Subject: [PATCH 02/10] Update emscripten version --- ci/emscripten.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/ci/emscripten.sh b/ci/emscripten.sh index db3132325503d..5dafb7bc54cfd 100644 --- a/ci/emscripten.sh +++ b/ci/emscripten.sh @@ -34,8 +34,8 @@ curl --retry 5 -L https://s3.amazonaws.com/mozilla-games/emscripten/releases/ems cd /emsdk-portable ./emsdk update -hide_output ./emsdk install sdk-1.38.15-64bit -./emsdk activate sdk-1.38.15-64bit +hide_output ./emsdk install sdk-1.38.40-64bit +./emsdk activate sdk-1.38.40-64bit # Compile and cache libc # shellcheck disable=SC1091 @@ -53,4 +53,3 @@ chmod a+rxw -R /emsdk-portable cd / curl --retry 5 -L https://nodejs.org/dist/v12.3.1/node-v12.3.1-linux-x64.tar.xz | \ tar -xJ - From d3c7de896f443e18d2430c110ac401f917654f27 Mon Sep 17 00:00:00 2001 From: Thomas Lively Date: Mon, 19 Aug 2019 14:40:46 -0700 Subject: [PATCH 03/10] Update emscripten, take 2 --- ci/emscripten.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ci/emscripten.sh b/ci/emscripten.sh index 5dafb7bc54cfd..4666a1212e45a 100644 --- a/ci/emscripten.sh +++ b/ci/emscripten.sh @@ -34,8 +34,8 @@ curl --retry 5 -L https://s3.amazonaws.com/mozilla-games/emscripten/releases/ems cd /emsdk-portable ./emsdk update -hide_output ./emsdk install sdk-1.38.40-64bit -./emsdk activate sdk-1.38.40-64bit +hide_output ./emsdk install 1.38.37 +./emsdk activate 1.38.37 # Compile and cache libc # shellcheck disable=SC1091 From e0113654521a2f1ea890706e468aa0554dbed81d Mon Sep 17 00:00:00 2001 From: Thomas Lively Date: Mon, 26 Aug 2019 13:14:38 -0700 Subject: [PATCH 04/10] Use git to acquire emsdk --- ci/emscripten.sh | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/ci/emscripten.sh b/ci/emscripten.sh index 4666a1212e45a..acec4ca26f87f 100644 --- a/ci/emscripten.sh +++ b/ci/emscripten.sh @@ -28,21 +28,18 @@ exit 1 set -x } -cd / -curl --retry 5 -L https://s3.amazonaws.com/mozilla-games/emscripten/releases/emsdk-portable.tar.gz | \ - tar -xz - +git clone https://github.com/emscripten-core/emsdk.git /emsdk-portable cd /emsdk-portable -./emsdk update -hide_output ./emsdk install 1.38.37 -./emsdk activate 1.38.37 +# TODO: switch to an upstream install once +# https://github.com/rust-lang/rust/pull/63649 lands +hide_output ./emsdk install 1.38.42 +./emsdk activate 1.38.42 # Compile and cache libc # shellcheck disable=SC1091 source ./emsdk_env.sh echo "main(){}" > a.c HOME=/emsdk-portable/ emcc a.c -HOME=/emsdk-portable/ emcc -s BINARYEN=1 a.c rm -f a.* # Make emsdk usable by any user From b7884dbe51f7dfe422288d929eed2c0a820ef46c Mon Sep 17 00:00:00 2001 From: Thomas Lively Date: Mon, 26 Aug 2019 13:53:14 -0700 Subject: [PATCH 05/10] Add libxml2, a new Fastcomp dependency --- ci/docker/asmjs-unknown-emscripten/Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/ci/docker/asmjs-unknown-emscripten/Dockerfile b/ci/docker/asmjs-unknown-emscripten/Dockerfile index 6c08340eb98b3..64f73aa6a00b9 100644 --- a/ci/docker/asmjs-unknown-emscripten/Dockerfile +++ b/ci/docker/asmjs-unknown-emscripten/Dockerfile @@ -7,6 +7,7 @@ RUN apt-get update && \ gcc \ git \ libc6-dev \ + libxml2 \ python \ xz-utils From 89e8ae6ab999460cdbb75e2472775b25166e4ce1 Mon Sep 17 00:00:00 2001 From: Thomas Lively Date: Mon, 26 Aug 2019 19:03:20 -0700 Subject: [PATCH 06/10] Add extra debug info in emscripten-entry.sh --- ci/emscripten-entry.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ci/emscripten-entry.sh b/ci/emscripten-entry.sh index 0016f5660b0eb..8d0b350ed3436 100755 --- a/ci/emscripten-entry.sh +++ b/ci/emscripten-entry.sh @@ -12,9 +12,11 @@ set -ex # shellcheck disable=SC1091 -source /emsdk-portable/emsdk_env.sh &> /dev/null +echo "IN EMSCRIPTEN ENTRY" +source /emsdk-portable/emsdk_env.sh # emsdk-portable provides a node binary, but we need version 8 to run wasm export PATH="/node-v12.3.1-linux-x64/bin:$PATH" +echo "RUNNING with PATH=$PATH" exec "$@" From cd617d78819ca6a5d06a4d33f5db372994151ddb Mon Sep 17 00:00:00 2001 From: Thomas Lively Date: Tue, 27 Aug 2019 10:12:14 -0700 Subject: [PATCH 07/10] Revert "Add extra debug info in emscripten-entry.sh" This reverts commit 89e8ae6ab999460cdbb75e2472775b25166e4ce1. --- ci/emscripten-entry.sh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/ci/emscripten-entry.sh b/ci/emscripten-entry.sh index 8d0b350ed3436..0016f5660b0eb 100755 --- a/ci/emscripten-entry.sh +++ b/ci/emscripten-entry.sh @@ -12,11 +12,9 @@ set -ex # shellcheck disable=SC1091 -echo "IN EMSCRIPTEN ENTRY" -source /emsdk-portable/emsdk_env.sh +source /emsdk-portable/emsdk_env.sh &> /dev/null # emsdk-portable provides a node binary, but we need version 8 to run wasm export PATH="/node-v12.3.1-linux-x64/bin:$PATH" -echo "RUNNING with PATH=$PATH" exec "$@" From 71e47b8dced7c7584b51dbb632db9a337ce45257 Mon Sep 17 00:00:00 2001 From: Thomas Lively Date: Tue, 27 Aug 2019 10:14:44 -0700 Subject: [PATCH 08/10] Add libxml2 to wasm32 to be safe --- ci/docker/wasm32-unknown-emscripten/Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/ci/docker/wasm32-unknown-emscripten/Dockerfile b/ci/docker/wasm32-unknown-emscripten/Dockerfile index c0ce825ed7443..4de9e7475559d 100644 --- a/ci/docker/wasm32-unknown-emscripten/Dockerfile +++ b/ci/docker/wasm32-unknown-emscripten/Dockerfile @@ -10,6 +10,7 @@ RUN apt-get update && \ gcc \ git \ libc6-dev \ + libxml2 \ python \ cmake \ sudo \ From ccb0e403ead913a32e73485fef8fcca560409012 Mon Sep 17 00:00:00 2001 From: Thomas Lively Date: Wed, 28 Aug 2019 20:46:24 -0700 Subject: [PATCH 09/10] Update ino_t --- libc-test/Cargo.toml | 3 +++ src/unix/linux_like/emscripten/mod.rs | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/libc-test/Cargo.toml b/libc-test/Cargo.toml index 8d2d9033308b7..87dd7af7df819 100644 --- a/libc-test/Cargo.toml +++ b/libc-test/Cargo.toml @@ -1,3 +1,6 @@ +[build] +rustc = "~/code/rust/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" + [package] name = "libc-test" version = "0.1.0" diff --git a/src/unix/linux_like/emscripten/mod.rs b/src/unix/linux_like/emscripten/mod.rs index e415f589e2a8a..acce2c1d41fed 100644 --- a/src/unix/linux_like/emscripten/mod.rs +++ b/src/unix/linux_like/emscripten/mod.rs @@ -22,7 +22,7 @@ pub type pthread_key_t = ::c_uint; pub type clock_t = c_long; pub type time_t = c_long; pub type suseconds_t = c_long; -pub type ino_t = u32; +pub type ino_t = u64; pub type off_t = i64; pub type blkcnt_t = i32; From 06c980ef754bc6c814e044ab1c6f70e09b08bbd6 Mon Sep 17 00:00:00 2001 From: Thomas Lively Date: Thu, 29 Aug 2019 09:50:49 -0700 Subject: [PATCH 10/10] Remove accidental debugging config change --- libc-test/Cargo.toml | 3 --- 1 file changed, 3 deletions(-) diff --git a/libc-test/Cargo.toml b/libc-test/Cargo.toml index 87dd7af7df819..8d2d9033308b7 100644 --- a/libc-test/Cargo.toml +++ b/libc-test/Cargo.toml @@ -1,6 +1,3 @@ -[build] -rustc = "~/code/rust/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" - [package] name = "libc-test" version = "0.1.0"