Skip to content

Commit c130b83

Browse files
committed
Restore old emscripten.sh for use by asmjs
1 parent 4ad6a95 commit c130b83

File tree

3 files changed

+76
-23
lines changed

3 files changed

+76
-23
lines changed

src/ci/docker/disabled/wasm32/Dockerfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ COPY scripts/dumb-init.sh /scripts/
2020
RUN sh /scripts/dumb-init.sh
2121

2222
# emscripten
23-
COPY scripts/emscripten.sh /scripts/
24-
RUN bash /scripts/emscripten.sh
23+
COPY scripts/emscripten-wasm.sh /scripts/
24+
RUN bash /scripts/emscripten-wasm.sh
2525
COPY disabled/wasm32/node.sh /usr/local/bin/node
2626

2727
# cache
+64
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# Copyright 2017 The Rust Project Developers. See the COPYRIGHT
2+
# file at the top-level directory of this distribution and at
3+
# http://rust-lang.org/COPYRIGHT.
4+
#
5+
# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
# http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
# <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
# option. This file may not be copied, modified, or distributed
9+
# except according to those terms.
10+
11+
set -ex
12+
13+
hide_output() {
14+
set +x
15+
on_err="
16+
echo ERROR: An error was encountered with the build.
17+
cat /tmp/build.log
18+
exit 1
19+
"
20+
trap "$on_err" ERR
21+
bash -c "while true; do sleep 30; echo \$(date) - building ...; done" &
22+
PING_LOOP_PID=$!
23+
$@ &> /tmp/build.log
24+
trap - ERR
25+
kill $PING_LOOP_PID
26+
rm -f /tmp/build.log
27+
set -x
28+
}
29+
30+
# Download emsdk
31+
cd /
32+
curl -L https://s3.amazonaws.com/mozilla-games/emscripten/releases/emsdk-portable.tar.gz | \
33+
tar -xz
34+
35+
# Download last known good emscripten from WebAssembly waterfall
36+
BUILD=$(curl -L https://storage.googleapis.com/wasm-llvm/builds/linux/lkgr.json | \
37+
jq '.build | tonumber')
38+
curl -L https://storage.googleapis.com/wasm-llvm/builds/linux/$BUILD/wasm-binaries.tbz2 | \
39+
hide_output tar xvkj
40+
41+
# node 8 is required to run wasm
42+
cd /
43+
curl -L https://nodejs.org/dist/v8.0.0/node-v8.0.0-linux-x64.tar.xz | \
44+
tar -xJ
45+
46+
cd /emsdk-portable
47+
./emsdk update
48+
hide_output ./emsdk install sdk-1.37.13-64bit
49+
./emsdk activate sdk-1.37.13-64bit
50+
51+
# Make emscripten use wasm-ready node and LLVM tools
52+
echo "NODE_JS='/node-v8.0.0-linux-x64/bin/node'" >> /root/.emscripten
53+
echo "LLVM_ROOT='/wasm-install/bin'" >> /root/.emscripten
54+
55+
# Make emsdk usable by any user
56+
cp /root/.emscripten /emsdk-portable
57+
chmod a+rxw -R /emsdk-portable
58+
59+
# Compile and cache libc
60+
source ./emsdk_env.sh
61+
echo "main(){}" > a.c
62+
HOME=/emsdk-portable/ emcc a.c
63+
HOME=/emsdk-portable/ emcc -s WASM=1 a.c
64+
rm -f a.*

src/ci/docker/scripts/emscripten.sh

+10-21
Original file line numberDiff line numberDiff line change
@@ -27,38 +27,27 @@ exit 1
2727
set -x
2828
}
2929

30-
# Download emsdk
3130
cd /
3231
curl -L https://s3.amazonaws.com/mozilla-games/emscripten/releases/emsdk-portable.tar.gz | \
3332
tar -xz
3433

35-
# Download last known good emscripten from WebAssembly waterfall
36-
BUILD=$(curl -L https://storage.googleapis.com/wasm-llvm/builds/linux/lkgr.json | \
37-
jq '.build | tonumber')
38-
curl -L https://storage.googleapis.com/wasm-llvm/builds/linux/$BUILD/wasm-binaries.tbz2 | \
39-
hide_output tar xvkj
40-
41-
# node 8 is required to run wasm
42-
cd /
43-
curl -L https://nodejs.org/dist/v8.0.0/node-v8.0.0-linux-x64.tar.xz | \
44-
tar -xJ
45-
4634
cd /emsdk-portable
4735
./emsdk update
4836
hide_output ./emsdk install sdk-1.37.13-64bit
4937
./emsdk activate sdk-1.37.13-64bit
5038

51-
# Make emscripten use wasm-ready node and LLVM tools
52-
echo "NODE_JS='/node-v8.0.0-linux-x64/bin/node'" >> /root/.emscripten
53-
echo "LLVM_ROOT='/wasm-install/bin'" >> /root/.emscripten
54-
55-
# Make emsdk usable by any user
56-
cp /root/.emscripten /emsdk-portable
57-
chmod a+rxw -R /emsdk-portable
58-
5939
# Compile and cache libc
6040
source ./emsdk_env.sh
6141
echo "main(){}" > a.c
6242
HOME=/emsdk-portable/ emcc a.c
63-
HOME=/emsdk-portable/ emcc -s WASM=1 a.c
43+
HOME=/emsdk-portable/ emcc -s BINARYEN=1 a.c
6444
rm -f a.*
45+
46+
# Make emsdk usable by any user
47+
cp /root/.emscripten /emsdk-portable
48+
chmod a+rxw -R /emsdk-portable
49+
50+
# node 8 is required to run wasm
51+
cd /
52+
curl -L https://nodejs.org/dist/v8.0.0/node-v8.0.0-linux-x64.tar.xz | \
53+
tar -xJ

0 commit comments

Comments
 (0)