Add tests building with emscripten target #2408
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #1695
Adds tests on linux which run
cargo test --all
using--target=asmjs-unknown-emscripten
and--target=wasm32-unknown-emscripten
.The default installation of emscripten (as per https://kripken.github.io/emscripten-site/docs/getting_started/downloads.html) doesn't seem to work on travis. It fails with the error:
/home/travis/emsdk/clang/e1.38.12_64bit/llc: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version 'GLIBCXX_3.4.20' not found (required by /home/travis/emsdk/clang/e1.38.12_64bit/llc)
. I've experienced this problem offline and the solution was to build clang from source, but this takes too long on travis so instead the test uses the docker image recommended on emscripten's website (https://kripken.github.io/emscripten-site/docs/compiling/Travis.html).Note that the build is currently failing with the error
*** Error in '/emsdk_portable/llvm/clang/bin/llc': corrupted double-linked list: 0x0000000003148920 ***
.I've done some testing offline, attempting to build the triangle example. I've encountered the error above, and also the following:
corrupted size vs. prev_size
double free or corruption (!prev)
The error seems to be non deterministic. It also occasionally compiles without error and produces code which seems to work.
Tested on travis:
https://travis-ci.org/stevebob/gfx/jobs/429755777
PR checklist:
make
succeeds (on *nix)make reftests
succeedsrustfmt
run on changed code