-
Notifications
You must be signed in to change notification settings - Fork 13k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #42631 - malbarbo:wasm32, r=alexcrichton
Add a travis builder for wasm32-unknown-emscripten This commits add an entry to travis matrix that will execute wasm32-unknown-emscripten tests suites. - Emscripten for asmjs was updated to sdk-1.37.13-64bit - The tests are run with node 8.0.0 (it can execute wasm) - A wrapper script is used to run each test from the directory where it is (workaround for emscripten-core/emscripten#4542) - Some tests are ignore, see #42629 and #42630
- Loading branch information
Showing
18 changed files
with
182 additions
and
98 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
FROM ubuntu:16.04 | ||
|
||
RUN apt-get update && apt-get install -y --no-install-recommends \ | ||
g++ \ | ||
make \ | ||
file \ | ||
curl \ | ||
ca-certificates \ | ||
python \ | ||
git \ | ||
cmake \ | ||
sudo \ | ||
gdb \ | ||
xz-utils | ||
|
||
# dumb-init | ||
COPY scripts/dumb-init.sh /scripts/ | ||
RUN sh /scripts/dumb-init.sh | ||
|
||
# emscripten | ||
COPY scripts/emscripten.sh /scripts/ | ||
RUN bash /scripts/emscripten.sh | ||
|
||
# env | ||
ENV PATH=$PATH:/emsdk-portable | ||
ENV PATH=$PATH:/emsdk-portable/clang/e1.37.13_64bit/ | ||
ENV PATH=$PATH:/emsdk-portable/emscripten/1.37.13/ | ||
ENV PATH=$PATH:/emsdk-portable/node/4.1.1_64bit/bin/ | ||
ENV EMSCRIPTEN=/emsdk-portable/emscripten/1.37.13/ | ||
ENV BINARYEN_ROOT=/emsdk-portable/clang/e1.37.13_64bit/binaryen/ | ||
ENV EM_CONFIG=/emsdk-portable/.emscripten | ||
|
||
ENV TARGETS=asmjs-unknown-emscripten | ||
|
||
ENV RUST_CONFIGURE_ARGS --target=$TARGETS | ||
|
||
ENV SCRIPT python2.7 ../x.py test --target $TARGETS | ||
|
||
# cache | ||
COPY scripts/sccache.sh /scripts/ | ||
RUN sh /scripts/sccache.sh | ||
|
||
# init | ||
ENTRYPOINT ["/usr/bin/dumb-init", "--"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
FROM ubuntu:16.04 | ||
|
||
RUN apt-get update && apt-get install -y --no-install-recommends \ | ||
g++ \ | ||
make \ | ||
file \ | ||
curl \ | ||
ca-certificates \ | ||
python \ | ||
git \ | ||
cmake \ | ||
sudo \ | ||
gdb \ | ||
xz-utils | ||
|
||
# dumb-init | ||
COPY scripts/dumb-init.sh /scripts/ | ||
RUN sh /scripts/dumb-init.sh | ||
|
||
# emscripten | ||
COPY scripts/emscripten.sh /scripts/ | ||
RUN bash /scripts/emscripten.sh | ||
COPY wasm32/node.sh /usr/local/bin/node | ||
|
||
# env | ||
ENV PATH=$PATH:/emsdk-portable | ||
ENV PATH=$PATH:/emsdk-portable/clang/e1.37.13_64bit/ | ||
ENV PATH=$PATH:/emsdk-portable/emscripten/1.37.13/ | ||
ENV EMSCRIPTEN=/emsdk-portable/emscripten/1.37.13/ | ||
ENV BINARYEN_ROOT=/emsdk-portable/clang/e1.37.13_64bit/binaryen/ | ||
ENV EM_CONFIG=/emsdk-portable/.emscripten | ||
|
||
ENV TARGETS=wasm32-unknown-emscripten | ||
|
||
ENV RUST_CONFIGURE_ARGS --target=$TARGETS | ||
|
||
ENV SCRIPT python2.7 ../x.py test --target $TARGETS | ||
|
||
# cache | ||
COPY scripts/sccache.sh /scripts/ | ||
RUN sh /scripts/sccache.sh | ||
|
||
# init | ||
ENTRYPOINT ["/usr/bin/dumb-init", "--"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/bin/bash | ||
# Copyright 2017 The Rust Project Developers. See the COPYRIGHT | ||
# file at the top-level directory of this distribution and at | ||
# http://rust-lang.org/COPYRIGHT. | ||
# | ||
# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or | ||
# http://www.apache.org/licenses/LICENSE-2.0> or the MIT license | ||
# <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your | ||
# option. This file may not be copied, modified, or distributed | ||
# except according to those terms. | ||
|
||
path="$(dirname $1)" | ||
file="$(basename $1)" | ||
|
||
shift | ||
|
||
cd "$path" | ||
exec /node-v8.0.0-linux-x64/bin/node "$file" "$@" |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# Copyright 2017 The Rust Project Developers. See the COPYRIGHT | ||
# file at the top-level directory of this distribution and at | ||
# http://rust-lang.org/COPYRIGHT. | ||
# | ||
# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or | ||
# http://www.apache.org/licenses/LICENSE-2.0> or the MIT license | ||
# <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your | ||
# option. This file may not be copied, modified, or distributed | ||
# except according to those terms. | ||
|
||
set -ex | ||
|
||
hide_output() { | ||
set +x | ||
on_err=" | ||
echo ERROR: An error was encountered with the build. | ||
cat /tmp/build.log | ||
exit 1 | ||
" | ||
trap "$on_err" ERR | ||
bash -c "while true; do sleep 30; echo \$(date) - building ...; done" & | ||
PING_LOOP_PID=$! | ||
$@ &> /tmp/build.log | ||
trap - ERR | ||
kill $PING_LOOP_PID | ||
rm -f /tmp/build.log | ||
set -x | ||
} | ||
|
||
cd / | ||
curl -L https://s3.amazonaws.com/mozilla-games/emscripten/releases/emsdk-portable.tar.gz | \ | ||
tar -xz | ||
|
||
cd /emsdk-portable | ||
./emsdk update | ||
hide_output ./emsdk install sdk-1.37.13-64bit | ||
./emsdk activate sdk-1.37.13-64bit | ||
|
||
# Compile and cache libc | ||
source ./emsdk_env.sh | ||
echo "main(){}" > a.c | ||
HOME=/emsdk-portable/ emcc a.c | ||
HOME=/emsdk-portable/ emcc -s BINARYEN=1 a.c | ||
rm -f a.* | ||
|
||
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.