Skip to content

Commit

Permalink
Rollup merge of rust-lang#73885 - pietroalbini:ci-fix-wasm32, r=kennytm
Browse files Browse the repository at this point in the history
Fix wasm32 being broken due to a NodeJS version bump

Emscripten's SDK [recently bumped the version of NodeJS they shipped](emscripten-core/emsdk#529), but our Dockerfile for the wasm32 builder hardcoded the version number. This will cause consistent CI failures once the currently cached image is rebuilt (either due to a change or due to the cache expiring).

This PR fixes the problem by finding the latest version of NodeJS in the Emscripten SDK and symlinking it to a "latest" directory, which is then added to the `PATH`.
  • Loading branch information
Manishearth authored Jul 2, 2020
2 parents 7b2f44a + 844dc31 commit 4593e9f
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/ci/docker/wasm32/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,18 @@ RUN ln `which python3` /usr/bin/python

ENV PATH=$PATH:/emsdk-portable
ENV PATH=$PATH:/emsdk-portable/upstream/emscripten/
ENV PATH=$PATH:/emsdk-portable/node/12.9.1_64bit/bin/

# Rust's build system requires NodeJS to be in the path, but the directory in
# which emsdk stores it contains the version number. This caused breakages in
# the past when emsdk bumped the node version causing the path to point to a
# missing directory.
#
# To avoid the problem this symlinks the latest NodeJs version available to
# "latest", and adds that to the path.
RUN ln -s /emsdk-portable/node/$(ls /emsdk-portable/node | sort -V | tail -n 1) \
/emsdk-portable/node/latest
ENV PATH=$PATH:/emsdk-portable/node/latest/bin/

ENV BINARYEN_ROOT=/emsdk-portable/upstream/
ENV EMSDK=/emsdk-portable
ENV EM_CONFIG=/emsdk-portable/.emscripten
Expand Down

0 comments on commit 4593e9f

Please sign in to comment.