about summary refs log tree commit diff
path: root/src/ci/docker/emscripten
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2017-01-16 23:10:00 -0800
committerAlex Crichton <alex@alexcrichton.com>2017-01-19 13:54:19 -0800
commite8f9d2d43a190074d52a0df40725ebd2c0fb0a9e (patch)
tree3119680164eca5ef18b4ad27d4b964b3f365c002 /src/ci/docker/emscripten
parentaedebfe77de30675826505572f36767e77dfba90 (diff)
downloadrust-e8f9d2d43a190074d52a0df40725ebd2c0fb0a9e.tar.gz
rust-e8f9d2d43a190074d52a0df40725ebd2c0fb0a9e.zip
travis: Get an emscripten builder online
This commit adds a new entry to the Travis matrix which will execute emscripten
test suites. Along the way it updates a few bits of the test suite to continue
passing on emscripten, such as:

* Ignoring i128/u128 tests as they're presumably just not working (didn't
  investigate as to why)
* Disabling a few process tests (not working on emscripten)
* Ignore some num tests in libstd (#39119)
* Fix some warnings when compiling
Diffstat (limited to 'src/ci/docker/emscripten')
-rw-r--r--src/ci/docker/emscripten/Dockerfile41
-rwxr-xr-xsrc/ci/docker/emscripten/build-emscripten.sh19
2 files changed, 60 insertions, 0 deletions
diff --git a/src/ci/docker/emscripten/Dockerfile b/src/ci/docker/emscripten/Dockerfile
new file mode 100644
index 00000000000..84e12eb6c3e
--- /dev/null
+++ b/src/ci/docker/emscripten/Dockerfile
@@ -0,0 +1,41 @@
+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 \
+  lib32stdc++6
+
+ENV SCCACHE_DIGEST=7237e38e029342fa27b7ac25412cb9d52554008b12389727320bd533fd7f05b6a96d55485f305caf95e5c8f5f97c3313e10012ccad3e752aba2518f3522ba783
+RUN curl -L https://api.pub.build.mozilla.org/tooltool/sha512/$SCCACHE_DIGEST | \
+      tar xJf - -C /usr/local/bin --strip-components=1
+
+RUN curl -OL https://github.com/Yelp/dumb-init/releases/download/v1.2.0/dumb-init_1.2.0_amd64.deb && \
+    dpkg -i dumb-init_*.deb && \
+    rm dumb-init_*.deb
+ENTRYPOINT ["/usr/bin/dumb-init", "--"]
+
+WORKDIR /tmp
+COPY build-emscripten.sh /tmp/
+RUN ./build-emscripten.sh
+ENV PATH=$PATH:/tmp/emsdk_portable
+ENV PATH=$PATH:/tmp/emsdk_portable/clang/tag-e1.37.1/build_tag-e1.37.1_32/bin
+ENV PATH=$PATH:/tmp/emsdk_portable/node/4.1.1_32bit/bin
+ENV PATH=$PATH:/tmp/emsdk_portable/emscripten/tag-1.37.1
+ENV EMSCRIPTEN=/tmp/emsdk_portable/emscripten/tag-1.37.1
+
+ENV RUST_CONFIGURE_ARGS --target=asmjs-unknown-emscripten
+
+# Run `emcc` first as it's got a prompt and doesn't actually do anything, after
+# that's done with do the real build.
+ENV SCRIPT emcc && \
+      python2.7 ../x.py test --target asmjs-unknown-emscripten
+
diff --git a/src/ci/docker/emscripten/build-emscripten.sh b/src/ci/docker/emscripten/build-emscripten.sh
new file mode 100755
index 00000000000..2ce7a58ae66
--- /dev/null
+++ b/src/ci/docker/emscripten/build-emscripten.sh
@@ -0,0 +1,19 @@
+#!/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.
+
+set -ex
+
+curl https://s3.amazonaws.com/mozilla-games/emscripten/releases/emsdk-portable.tar.gz | \
+      tar xzf -
+source emsdk_portable/emsdk_env.sh
+emsdk update
+emsdk install --build=Release sdk-tag-1.37.1-32bit
+emsdk activate --build=Release sdk-tag-1.37.1-32bit