Skip to content

Commit 4593e9f

Browse files
authored
Rollup merge of #73885 - pietroalbini:ci-fix-wasm32, r=kennytm
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`.
2 parents 7b2f44a + 844dc31 commit 4593e9f

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/ci/docker/wasm32/Dockerfile

+12-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,18 @@ RUN ln `which python3` /usr/bin/python
2525

2626
ENV PATH=$PATH:/emsdk-portable
2727
ENV PATH=$PATH:/emsdk-portable/upstream/emscripten/
28-
ENV PATH=$PATH:/emsdk-portable/node/12.9.1_64bit/bin/
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+
2940
ENV BINARYEN_ROOT=/emsdk-portable/upstream/
3041
ENV EMSDK=/emsdk-portable
3142
ENV EM_CONFIG=/emsdk-portable/.emscripten

0 commit comments

Comments
 (0)