File tree 4 files changed +71
-29
lines changed
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 \
11
11
cmake \
12
12
sudo \
13
13
gdb \
14
- xz-utils \
15
- jq \
16
- bzip2
14
+ xz-utils
17
15
18
16
COPY scripts/dumb-init.sh /scripts/
19
17
RUN sh /scripts/dumb-init.sh
20
18
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
23
22
COPY disabled/wasm32/node.sh /usr/local/bin/node
24
23
25
24
COPY scripts/sccache.sh /scripts/
@@ -32,9 +31,9 @@ ENV EMSCRIPTEN=/emsdk-portable/emscripten/1.37.13/
32
31
ENV BINARYEN_ROOT=/emsdk-portable/clang/e1.37.13_64bit/binaryen/
33
32
ENV EM_CONFIG=/emsdk-portable/.emscripten
34
33
35
- ENV TARGETS=wasm32-unknown-emscripten,wasm32-experimental-emscripten
34
+ ENV TARGETS=wasm32-unknown-emscripten
36
35
37
- ENV RUST_CONFIGURE_ARGS --target=$TARGETS --experimental-targets=WebAssembly
36
+ ENV RUST_CONFIGURE_ARGS --target=$TARGETS
38
37
39
38
ENV SCRIPT python2.7 ../x.py test --target $TARGETS
40
39
Original file line number Diff line number Diff line change @@ -27,11 +27,6 @@ exit 1
27
27
set -x
28
28
}
29
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
30
# Download last known good emscripten from WebAssembly waterfall
36
31
BUILD=$( curl -L https://storage.googleapis.com/wasm-llvm/builds/linux/lkgr.json | \
37
32
jq ' .build | tonumber' )
43
38
curl -L https://nodejs.org/dist/v8.0.0/node-v8.0.0-linux-x64.tar.xz | \
44
39
tar -xJ
45
40
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
41
# 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
53
44
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.*
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