about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPietro Albini <pietro@pietroalbini.org>2020-06-30 09:13:15 +0200
committerPietro Albini <pietro@pietroalbini.org>2020-06-30 09:13:15 +0200
commit844dc31494ad130169477c57c9ba10acd5e8923f (patch)
tree0a85c4f8611382857b2eca60a7320dd85a2477fa
parenta1528c432e45339d9b5602a19ac3571e2900d37b (diff)
downloadrust-844dc31494ad130169477c57c9ba10acd5e8923f.tar.gz
rust-844dc31494ad130169477c57c9ba10acd5e8923f.zip
ci: fix wasm32 broken due to a NodeJS version bump
Emscripten's SDK recently bumped the version of NodeJS they shipped, 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 commit 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.
-rw-r--r--src/ci/docker/wasm32/Dockerfile13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/ci/docker/wasm32/Dockerfile b/src/ci/docker/wasm32/Dockerfile
index 8232539edda..92461305320 100644
--- a/src/ci/docker/wasm32/Dockerfile
+++ b/src/ci/docker/wasm32/Dockerfile
@@ -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