about summary refs log tree commit diff
path: root/src/ci/docker/scripts
diff options
context:
space:
mode:
authorThomas Lively <tlively@google.com>2017-06-22 18:04:20 -0700
committerThomas Lively <tlively@google.com>2017-06-22 18:34:56 -0700
commita4f97449b0a3043ecf91cdcc75ee69018cda6176 (patch)
tree65b09f44408c072e64c50a87888a4bda3d2a5826 /src/ci/docker/scripts
parent16da303209dc7d4ec84b10322c9f7d34f72b2985 (diff)
downloadrust-a4f97449b0a3043ecf91cdcc75ee69018cda6176.tar.gz
rust-a4f97449b0a3043ecf91cdcc75ee69018cda6176.zip
Add wasm32-experimental-emscripten to wasm builder
This modifies the builder to download and use the LLVM tools from the
last known good build on the WebAssembly buildbot waterfall, since these
tools are built with the WebAssembly LLVM backend enabled.
Diffstat (limited to 'src/ci/docker/scripts')
-rw-r--r--src/ci/docker/scripts/emscripten.sh32
1 files changed, 20 insertions, 12 deletions
diff --git a/src/ci/docker/scripts/emscripten.sh b/src/ci/docker/scripts/emscripten.sh
index 516ef0ae0d2..e693f975f69 100644
--- a/src/ci/docker/scripts/emscripten.sh
+++ b/src/ci/docker/scripts/emscripten.sh
@@ -27,30 +27,38 @@ exit 1
   set -x
 }
 
+# Download emsdk
 cd /
 curl -L https://s3.amazonaws.com/mozilla-games/emscripten/releases/emsdk-portable.tar.gz | \
     tar -xz
 
+# Download last known good emscripten from WebAssembly waterfall
+BUILD=$(curl -L https://storage.googleapis.com/wasm-llvm/builds/linux/lkgr.json | \
+    jq '.build | tonumber')
+curl -L https://storage.googleapis.com/wasm-llvm/builds/linux/$BUILD/wasm-binaries.tbz2 | \
+    hide_output tar xvkj
+
+# node 8 is required to run wasm
+cd /
+curl -L https://nodejs.org/dist/v8.0.0/node-v8.0.0-linux-x64.tar.xz | \
+    tar -xJ
+
 cd /emsdk-portable
 ./emsdk update
 hide_output ./emsdk install sdk-1.37.13-64bit
 ./emsdk activate sdk-1.37.13-64bit
 
+# Make emscripten use wasm-ready node and LLVM tools
+echo "NODE_JS='/node-v8.0.0-linux-x64/bin/node'" >> /root/.emscripten
+echo "LLVM_ROOT='/wasm-install/bin'" >> /root/.emscripten
+
+# Make emsdk usable by any user
+cp /root/.emscripten /emsdk-portable
+chmod a+rxw -R /emsdk-portable
+
 # Compile and cache libc
 source ./emsdk_env.sh
 echo "main(){}" > a.c
 HOME=/emsdk-portable/ emcc a.c
 HOME=/emsdk-portable/ emcc -s WASM=1 a.c
 rm -f a.*
-
-# Make emscripten use Rust's LLVM
-echo "LLVM_ROOT='/checkout/obj/build/x86_64-unknown-linux-gnu/llvm/bin'" >> /root/.emscripten
-
-# Make emsdk usable by any user
-cp /root/.emscripten /emsdk-portable
-chmod a+rxw -R /emsdk-portable
-
-# node 8 is required to run wasm
-cd /
-curl -L https://nodejs.org/dist/v8.0.0/node-v8.0.0-linux-x64.tar.xz | \
-    tar -xJ