]> git.lizzy.rs Git - rust.git/blob - src/ci/docker/scripts/emscripten.sh
resolve: Remove an incorrect assert
[rust.git] / src / ci / docker / scripts / emscripten.sh
1 set -ex
2
3 hide_output() {
4   set +x
5   on_err="
6 echo ERROR: An error was encountered with the build.
7 cat /tmp/build.log
8 exit 1
9 "
10   trap "$on_err" ERR
11   bash -c "while true; do sleep 30; echo \$(date) - building ...; done" &
12   PING_LOOP_PID=$!
13   $@ &> /tmp/build.log
14   trap - ERR
15   kill $PING_LOOP_PID
16   rm -f /tmp/build.log
17   set -x
18 }
19
20 git clone https://github.com/emscripten-core/emsdk.git /emsdk-portable
21 cd /emsdk-portable
22 hide_output ./emsdk install 1.38.46-upstream
23 ./emsdk activate 1.38.46-upstream
24
25 # Compile and cache libc
26 source ./emsdk_env.sh
27 echo "main(){}" > a.c
28 HOME=/emsdk-portable/ emcc a.c
29 rm -f a.*
30
31 # Make emsdk usable by any user
32 cp /root/.emscripten /emsdk-portable
33 chmod a+rxw -R /emsdk-portable