File tree Expand file tree Collapse file tree 4 files changed +71
-29
lines changed Expand file tree Collapse file tree 4 files changed +71
-29
lines changed Original file line number Diff line number Diff line change 1+ FROM ubuntu:16.04
2+
3+ RUN apt-get update && apt-get install -y --no-install-recommends \
4+ g++ \
5+ make \
6+ file \
7+ curl \
8+ ca-certificates \
9+ python \
10+ git \
11+ cmake \
12+ sudo \
13+ gdb \
14+ xz-utils \
15+ jq \
16+ bzip2
17+
18+ # dumb-init
19+ COPY scripts/dumb-init.sh /scripts/
20+ RUN sh /scripts/dumb-init.sh
21+
22+ # emscripten
23+ COPY scripts/emscripten-wasm.sh /scripts/
24+ COPY disabled/wasm32-exp/node.sh /usr/local/bin/node
25+ RUN bash /scripts/emscripten-wasm.sh
26+
27+ # cache
28+ COPY scripts/sccache.sh /scripts/
29+ RUN sh /scripts/sccache.sh
30+
31+ # env
32+ ENV PATH=/wasm-install/emscripten:/wasm-install/bin:$PATH
33+ ENV EM_CONFIG=/root/.emscripten
34+
35+ ENV TARGETS=wasm32-experimental-emscripten
36+
37+ ENV RUST_CONFIGURE_ARGS --target=$TARGETS --experimental-targets=WebAssembly
38+
39+ ENV SCRIPT python2.7 ../x.py test --target $TARGETS
40+
41+ # init
42+ ENTRYPOINT ["/usr/bin/dumb-init" , "--" ]
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+ # Copyright 2017 The Rust Project Developers. See the COPYRIGHT
3+ # file at the top-level directory of this distribution and at
4+ # http://rust-lang.org/COPYRIGHT.
5+ #
6+ # Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
7+ # http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
8+ # <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
9+ # option. This file may not be copied, modified, or distributed
10+ # except according to those terms.
11+
12+ path=" $( dirname $1 ) "
13+ file=" $( basename $1 ) "
14+
15+ shift
16+
17+ cd " $path "
18+ exec /node-v8.0.0-linux-x64/bin/node " $file " " $@ "
Original file line number Diff line number Diff line change @@ -11,15 +11,14 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
1111 cmake \
1212 sudo \
1313 gdb \
14- xz-utils \
15- jq \
16- bzip2
14+ xz-utils
1715
1816COPY scripts/dumb-init.sh /scripts/
1917RUN sh /scripts/dumb-init.sh
2018
21- COPY scripts/emscripten-wasm.sh /scripts/
22- RUN bash /scripts/emscripten-wasm.sh
19+ # emscripten
20+ COPY scripts/emscripten.sh /scripts/
21+ RUN bash /scripts/emscripten.sh
2322COPY disabled/wasm32/node.sh /usr/local/bin/node
2423
2524COPY scripts/sccache.sh /scripts/
@@ -32,9 +31,9 @@ ENV EMSCRIPTEN=/emsdk-portable/emscripten/1.37.13/
3231ENV BINARYEN_ROOT=/emsdk-portable/clang/e1.37.13_64bit/binaryen/
3332ENV EM_CONFIG=/emsdk-portable/.emscripten
3433
35- ENV TARGETS=wasm32-unknown-emscripten,wasm32-experimental-emscripten
34+ ENV TARGETS=wasm32-unknown-emscripten
3635
37- ENV RUST_CONFIGURE_ARGS --target=$TARGETS --experimental-targets=WebAssembly
36+ ENV RUST_CONFIGURE_ARGS --target=$TARGETS
3837
3938ENV SCRIPT python2.7 ../x.py test --target $TARGETS
4039
Original file line number Diff line number Diff line change @@ -27,11 +27,6 @@ exit 1
2727 set -x
2828}
2929
30- # Download emsdk
31- cd /
32- curl -L https://s3.amazonaws.com/mozilla-games/emscripten/releases/emsdk-portable.tar.gz | \
33- tar -xz
34-
3530# Download last known good emscripten from WebAssembly waterfall
3631BUILD=$( curl -L https://storage.googleapis.com/wasm-llvm/builds/linux/lkgr.json | \
3732 jq ' .build | tonumber' )
4338curl -L https://nodejs.org/dist/v8.0.0/node-v8.0.0-linux-x64.tar.xz | \
4439 tar -xJ
4540
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-
5141# Make emscripten use wasm-ready node and LLVM tools
52- echo " NODE_JS='/node-v8.0.0-linux-x64/bin/node'" >> /root/.emscripten
42+ echo " EMSCRIPTEN_ROOT = '/wasm-install/emscripten'" >> /root/.emscripten
43+ echo " NODE_JS='/usr/local/bin/node'" >> /root/.emscripten
5344echo " 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.*
45+ echo " BINARYEN_ROOT = '/wasm-install'" >> /root/.emscripten
46+ echo " COMPILER_ENGINE = NODE_JS" >> /root/.emscripten
47+ echo " JS_ENGINES = [NODE_JS]" >> /root/.emscripten
You can’t perform that action at this time.
0 commit comments