Skip to content

Commit 94c020c

Browse files
committed
Update emscripten.
1 parent 160517d commit 94c020c

File tree

5 files changed

+48
-31
lines changed

5 files changed

+48
-31
lines changed

azure-pipelines.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ strategy:
2222
aarch64-unknown-linux-gnu: { TARGET: aarch64-unknown-linux-gnu, CPP: 1, DYLIB: 1, STD: 1, RUN: 1, RUNNERS: qemu-user qemu-system }
2323
arm-unknown-linux-gnueabi: { TARGET: arm-unknown-linux-gnueabi, CPP: 1, DYLIB: 1, STD: 1, RUN: 1 }
2424
arm-unknown-linux-gnueabihf: { TARGET: arm-unknown-linux-gnueabihf, CPP: 1, DYLIB: 1, STD: 1, RUN: 1 }
25-
armv7-unknown-linux-gnueabihf: { TARGET: armv7-unknown-linux-gnueabihf, CPP: 1, DYLIB: 1, STD: 1, RUN: 1, RUNNERS: qemu-user qemu-system }
25+
armv7-unknown-linux-gnueabihf: { TARGET: armv7-unknown-linux-gnueabihf, CPP: 1, DYLIB: 1, STD: 1, RUN: 1, RUNNERS: qemu-user qemu-system }
2626
i586-unknown-linux-gnu: { TARGET: i586-unknown-linux-gnu, CPP: 1, DYLIB: 1, STD: 1, RUN: 1 }
27-
i686-unknown-linux-gnu: { TARGET: i686-unknown-linux-gnu, CPP: 1, DYLIB: 1, STD: 1, RUN: 1, RUNNERS: native qemu-user qemu-system }
27+
i686-unknown-linux-gnu: { TARGET: i686-unknown-linux-gnu, CPP: 1, DYLIB: 1, STD: 1, RUN: 1, RUNNERS: native qemu-user qemu-system }
2828
mips-unknown-linux-gnu: { TARGET: mips-unknown-linux-gnu, CPP: 1, DYLIB: 1, STD: 1, RUN: 1, RUNNERS: qemu-user qemu-system }
2929
mipsel-unknown-linux-gnu: { TARGET: mipsel-unknown-linux-gnu, CPP: 1, DYLIB: 1, STD: 1, RUN: 1, RUNNERS: qemu-user qemu-system }
3030
mips64-unknown-linux-gnuabi64: { TARGET: mips64-unknown-linux-gnuabi64, CPP: 1, DYLIB: 1, STD: 1, RUN: 1 }
@@ -61,9 +61,9 @@ strategy:
6161
x86_64-unknown-netbsd: { TARGET: x86_64-unknown-netbsd, CPP: 1, DYLIB: 1, STD: 1 }
6262
sparcv9-sun-solaris: { TARGET: sparcv9-sun-solaris, CPP: 1, DYLIB: 1, STD: 1 }
6363
x86_64-sun-solaris: { TARGET: x86_64-sun-solaris, CPP: 1, DYLIB: 1, STD: 1 }
64-
asmjs-unknown-emscripten: { TARGET: asmjs-unknown-emscripten, CPP: 1, STD: 1, RUN: 1 }
64+
asmjs-unknown-emscripten: { TARGET: asmjs-unknown-emscripten, STD: 1, RUN: 1 }
6565
# `cargo run` fails with an assertion error (https://github.com/rust-lang/cargo/issues/4689) on `wasm32-unknown-emscripten`.
66-
wasm32-unknown-emscripten: { TARGET: wasm32-unknown-emscripten, CPP: 1, STD: 1 }
66+
wasm32-unknown-emscripten: { TARGET: wasm32-unknown-emscripten, STD: 1 }
6767
thumbv6m-none-eabi: { TARGET: thumbv6m-none-eabi, STD: 1 }
6868
thumbv7em-none-eabi: { TARGET: thumbv7em-none-eabi, STD: 1 }
6969
thumbv7em-none-eabihf: { TARGET: thumbv7em-none-eabihf, STD: 1 }

docker/Dockerfile.asmjs-unknown-emscripten

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,28 @@ RUN /common.sh
66
COPY cmake.sh /
77
RUN /cmake.sh
88

9-
RUN apt-get install -y --no-install-recommends python
9+
COPY xargo.sh /
10+
RUN /xargo.sh
1011

11-
COPY emscripten.sh /
12-
RUN /emscripten.sh
12+
COPY --from=trzeci/emscripten:1.38.46-upstream /emsdk_portable /emsdk_portable
1313

14-
COPY emscripten-entry.sh /
15-
ENTRYPOINT ["/emscripten-entry.sh"]
14+
ENV EMSDK /emsdk_portable
15+
ENV EMSCRIPTEN=${EMSDK}/emscripten/sdk
16+
17+
ENV EM_DATA ${EMSDK}/.data
18+
ENV EM_CONFIG ${EMSDK}/.emscripten
19+
ENV EM_CACHE ${EM_DATA}/cache
20+
ENV EM_PORTS ${EM_DATA}/ports
21+
22+
ENV PATH="${EMSDK}:${EMSDK}/emscripten/sdk:${EMSDK}/llvm/clang/bin:${EMSDK}/node/current/bin:${EMSDK}/binaryen/bin:${PATH}"
23+
24+
ENTRYPOINT ["/emsdk_portable/entrypoint"]
25+
26+
RUN apt-get update && apt-get install -y --no-install-recommends \
27+
libxml2 \
28+
python
1629

1730
ENV CARGO_TARGET_ASMJS_UNKNOWN_EMSCRIPTEN_RUNNER=node
31+
32+
# Prevent 'wasm2js does not support source maps yet' error.
33+
ENV RUSTFLAGS='-C debuginfo=0'

docker/Dockerfile.wasm32-unknown-emscripten

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,26 @@ RUN /common.sh
66
COPY cmake.sh /
77
RUN /cmake.sh
88

9-
RUN apt-get install -y --no-install-recommends python
9+
COPY xargo.sh /
10+
RUN /xargo.sh
1011

11-
COPY emscripten.sh /
12-
RUN /emscripten.sh
12+
COPY --from=trzeci/emscripten:1.38.46-upstream /emsdk_portable /emsdk_portable
1313

14-
COPY emscripten-entry.sh /
15-
ENTRYPOINT ["/emscripten-entry.sh"]
14+
ENV EMSDK /emsdk_portable
15+
ENV EMSCRIPTEN=${EMSDK}/emscripten/sdk
16+
17+
ENV EM_DATA ${EMSDK}/.data
18+
ENV EM_CONFIG ${EMSDK}/.emscripten
19+
ENV EM_CACHE ${EM_DATA}/cache
20+
ENV EM_PORTS ${EM_DATA}/ports
21+
22+
ENV PATH="${EMSDK}:${EMSDK}/emscripten/sdk:${EMSDK}/llvm/clang/bin:${EMSDK}/node/current/bin:${EMSDK}/binaryen/bin:${PATH}"
23+
24+
ENTRYPOINT ["/emsdk_portable/entrypoint"]
25+
26+
RUN apt-get update && apt-get install -y --no-install-recommends \
27+
libxml2 \
28+
python
1629

1730
COPY node-wasm /usr/local/bin/
1831
ENV CARGO_TARGET_WASM32_UNKNOWN_EMSCRIPTEN_RUNNER=node-wasm

docker/emscripten-entry.sh

Lines changed: 0 additions & 9 deletions
This file was deleted.

docker/emscripten.sh

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ main() {
88
ca-certificates
99
curl
1010
git
11+
libxml2
1112
python
1213
)
1314

@@ -24,14 +25,11 @@ main() {
2425
git clone https://github.com/emscripten-core/emsdk.git /emsdk-portable
2526
cd /emsdk-portable
2627

27-
export HOME=/emsdk-portable/
28-
29-
./emsdk install sdk-1.38.15-64bit
30-
./emsdk activate sdk-1.38.15-64bit
28+
./emsdk install 1.38.46-upstream
29+
./emsdk activate 1.38.46-upstream
3130

3231
# Compile and cache libc
33-
source ./emsdk_env.sh
34-
echo "main(){}" > a.c
32+
echo 'int main() {}' > a.c
3533
emcc a.c
3634
emcc -s BINARYEN=1 a.c
3735
echo -e "#include <iostream>\n void hello(){ std::cout << std::endl; }" > a.cpp
@@ -40,8 +38,7 @@ main() {
4038
rm -f a.*
4139

4240
# Make emsdk usable by any user
43-
chmod a+rw -R /emsdk-portable/
44-
find /emsdk-portable/ -executable -print0 | xargs -0 chmod a+x
41+
chmod a+rwX -R "${EMSDK}"
4542

4643
if (( ${#purge_list[@]} )); then
4744
apt-get purge --auto-remove -y ${purge_list[@]}

0 commit comments

Comments
 (0)