]> git.proxmox.com Git - rustc.git/blob - src/ci/docker/host-x86_64/wasm32/Dockerfile
878c4e341589d8e52598f71d4440e3023febb825
[rustc.git] / src / ci / docker / host-x86_64 / wasm32 / Dockerfile
1 FROM ubuntu:20.04
2
3 RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
4 g++ \
5 make \
6 ninja-build \
7 file \
8 curl \
9 ca-certificates \
10 python3 \
11 git \
12 cmake \
13 sudo \
14 gdb \
15 xz-utils \
16 bzip2
17
18 COPY scripts/emscripten.sh /scripts/
19 RUN bash /scripts/emscripten.sh
20
21 COPY scripts/sccache.sh /scripts/
22 RUN sh /scripts/sccache.sh
23
24 # emcc seems to need python to specifically be "python" and not "python3"
25 RUN ln `which python3` /usr/bin/python
26
27 ENV PATH=$PATH:/emsdk-portable
28 ENV PATH=$PATH:/emsdk-portable/upstream/emscripten/
29
30 # Rust's build system requires NodeJS to be in the path, but the directory in
31 # which emsdk stores it contains the version number. This caused breakages in
32 # the past when emsdk bumped the node version causing the path to point to a
33 # missing directory.
34 #
35 # To avoid the problem this symlinks the latest NodeJs version available to
36 # "latest", and adds that to the path.
37 RUN ln -s /emsdk-portable/node/$(ls /emsdk-portable/node | sort -V | tail -n 1) \
38 /emsdk-portable/node/latest
39 ENV PATH=$PATH:/emsdk-portable/node/latest/bin/
40
41 ENV BINARYEN_ROOT=/emsdk-portable/upstream/
42 ENV EMSDK=/emsdk-portable
43 ENV EM_CONFIG=/emsdk-portable/.emscripten
44 ENV EM_CACHE=/emsdk-portable/upstream/emscripten/cache
45
46 ENV TARGETS=wasm32-unknown-emscripten
47
48 # Use -O1 optimizations in the link step to reduce time spent optimizing.
49 ENV EMCC_CFLAGS=-O1
50
51 # Emscripten installation is user-specific
52 ENV NO_CHANGE_USER=1
53
54 # Exclude library/alloc due to OOM in benches.
55 ENV SCRIPT python3 ../x.py test --stage 2 --host='' --target $TARGETS \
56 --exclude library/alloc