Skip to content

Commit a4f9744

Browse files
committed
Add wasm32-experimental-emscripten to wasm builder
This modifies the builder to download and use the LLVM tools from the last known good build on the WebAssembly buildbot waterfall, since these tools are built with the WebAssembly LLVM backend enabled.
1 parent 16da303 commit a4f9744

File tree

2 files changed

+28
-18
lines changed

2 files changed

+28
-18
lines changed

src/ci/docker/disabled/wasm32/Dockerfile

+8-6
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
1111
cmake \
1212
sudo \
1313
gdb \
14-
xz-utils
14+
xz-utils \
15+
jq \
16+
bzip2
1517

1618
# dumb-init
1719
COPY scripts/dumb-init.sh /scripts/
@@ -22,6 +24,10 @@ COPY scripts/emscripten.sh /scripts/
2224
RUN bash /scripts/emscripten.sh
2325
COPY disabled/wasm32/node.sh /usr/local/bin/node
2426

27+
# cache
28+
COPY scripts/sccache.sh /scripts/
29+
RUN sh /scripts/sccache.sh
30+
2531
# env
2632
ENV PATH=$PATH:/emsdk-portable
2733
ENV PATH=$PATH:/emsdk-portable/clang/e1.37.13_64bit/
@@ -32,13 +38,9 @@ ENV EM_CONFIG=/emsdk-portable/.emscripten
3238

3339
ENV TARGETS=wasm32-unknown-emscripten,wasm32-experimental-emscripten
3440

35-
ENV RUST_CONFIGURE_ARGS --target=$TARGETS --experimental-targets=WebAssembly
41+
ENV RUST_CONFIGURE_ARGS --target=$TARGETS
3642

3743
ENV SCRIPT python2.7 ../x.py test --target $TARGETS
3844

39-
# cache
40-
COPY scripts/sccache.sh /scripts/
41-
RUN sh /scripts/sccache.sh
42-
4345
# init
4446
ENTRYPOINT ["/usr/bin/dumb-init", "--"]

src/ci/docker/scripts/emscripten.sh

+20-12
Original file line numberDiff line numberDiff line change
@@ -27,30 +27,38 @@ exit 1
2727
set -x
2828
}
2929

30+
# Download emsdk
3031
cd /
3132
curl -L https://s3.amazonaws.com/mozilla-games/emscripten/releases/emsdk-portable.tar.gz | \
3233
tar -xz
3334

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+
3446
cd /emsdk-portable
3547
./emsdk update
3648
hide_output ./emsdk install sdk-1.37.13-64bit
3749
./emsdk activate sdk-1.37.13-64bit
3850

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+
3959
# Compile and cache libc
4060
source ./emsdk_env.sh
4161
echo "main(){}" > a.c
4262
HOME=/emsdk-portable/ emcc a.c
4363
HOME=/emsdk-portable/ emcc -s WASM=1 a.c
4464
rm -f a.*
45-
46-
# Make emscripten use Rust's LLVM
47-
echo "LLVM_ROOT='/checkout/obj/build/x86_64-unknown-linux-gnu/llvm/bin'" >> /root/.emscripten
48-
49-
# Make emsdk usable by any user
50-
cp /root/.emscripten /emsdk-portable
51-
chmod a+rxw -R /emsdk-portable
52-
53-
# node 8 is required to run wasm
54-
cd /
55-
curl -L https://nodejs.org/dist/v8.0.0/node-v8.0.0-linux-x64.tar.xz | \
56-
tar -xJ

0 commit comments

Comments
 (0)