]> git.lizzy.rs Git - rust.git/blob - src/ci/docker/host-x86_64/wasm32/Dockerfile
Rollup merge of #74872 - JohnTitor:ping-risc-v, r=Mark-Simulacrum
[rust.git] / src / ci / docker / host-x86_64 / wasm32 / Dockerfile
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   python3 \
10   git \
11   cmake \
12   sudo \
13   gdb \
14   xz-utils \
15   bzip2
16
17 COPY scripts/emscripten.sh /scripts/
18 RUN bash /scripts/emscripten.sh
19
20 COPY scripts/sccache.sh /scripts/
21 RUN sh /scripts/sccache.sh
22
23 # emcc seems to need python to specifically be "python" and not "python3"
24 RUN ln `which python3` /usr/bin/python
25
26 ENV PATH=$PATH:/emsdk-portable
27 ENV PATH=$PATH:/emsdk-portable/upstream/emscripten/
28
29 # Rust's build system requires NodeJS to be in the path, but the directory in
30 # which emsdk stores it contains the version number. This caused breakages in
31 # the past when emsdk bumped the node version causing the path to point to a
32 # missing directory.
33 #
34 # To avoid the problem this symlinks the latest NodeJs version available to
35 # "latest", and adds that to the path.
36 RUN ln -s /emsdk-portable/node/$(ls /emsdk-portable/node | sort -V | tail -n 1) \
37           /emsdk-portable/node/latest
38 ENV PATH=$PATH:/emsdk-portable/node/latest/bin/
39
40 ENV BINARYEN_ROOT=/emsdk-portable/upstream/
41 ENV EMSDK=/emsdk-portable
42 ENV EM_CONFIG=/emsdk-portable/.emscripten
43 ENV EM_CACHE=/emsdk-portable/upstream/emscripten/cache
44
45 ENV TARGETS=wasm32-unknown-emscripten
46
47 # Use -O1 optimizations in the link step to reduce time spent optimizing.
48 ENV EMCC_CFLAGS=-O1
49
50 # Emscripten installation is user-specific
51 ENV NO_CHANGE_USER=1
52
53 # FIXME: Re-enable these tests once https://github.com/rust-lang/cargo/pull/7476
54 # is picked up by CI
55 ENV SCRIPT python3 ../x.py test --stage 2 --target $TARGETS \
56     --exclude library/core \
57     --exclude library/alloc \
58     --exclude library/proc_macro \
59     --exclude library/std \
60     --exclude library/term \
61     --exclude library/test