Bug 1582192 - add a job to build a wasi sysroot; r=glandium
authorNathan Froyd <froydnj@mozilla.com>
Tue, 12 Nov 2019 00:10:38 +0000
changeset 501592 17ccc480d16a4cc7bd6ca9deb7929984c824657a
parent 501591 912ee67e3cf2e3a9891e89abafedfdd18cabf572
child 501593 0ff2c7b2c0fd975231a77777779ab7ce75db2019
push id114172
push userdluca@mozilla.com
push dateTue, 19 Nov 2019 11:31:10 +0000
treeherdermozilla-inbound@b5c5ba07d3db [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersglandium
bugs1582192
milestone72.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1582192 - add a job to build a wasi sysroot; r=glandium When we start compiling things to wasm during the build process, we're going to need a basic sysroot. This new job builds just such a sysroot. Differential Revision: https://phabricator.services.mozilla.com/D50993
taskcluster/ci/fetch/toolchains.yml
taskcluster/ci/toolchain/misc.yml
taskcluster/scripts/misc/build-wasi-sysroot.sh
--- a/taskcluster/ci/fetch/toolchains.yml
+++ b/taskcluster/ci/fetch/toolchains.yml
@@ -410,16 +410,23 @@ clang-8:
 
 clang-9:
     description: clang 9.0.0 source code
     fetch:
         type: git
         repo: https://github.com/llvm/llvm-project
         revision: 0399d5a9682b3cef71c653373e38890c63c4c365
 
+wasi-libc:
+    description: wasi-libc source code
+    fetch:
+        type: git
+        repo: https://github.com/CraneStation/wasi-libc
+        revision: c35f0f5dd64ad982bbad71f3e3a8942a1029c1e6
+
 ninja:
     description: ninja 1.9.0
     fetch:
         type: static-url
         url: https://github.com/ninja-build/ninja/releases/download/v1.9.0/ninja-win.zip
         sha256: 2d70010633ddaacc3af4ffbd21e22fae90d158674a09e132e06424ba3ab036e9
         size: 254497
         artifact-name: ninja.tar.zst
--- a/taskcluster/ci/toolchain/misc.yml
+++ b/taskcluster/ci/toolchain/misc.yml
@@ -153,16 +153,30 @@ browsertime:
         resources:
             - 'tools/browsertime/package.json'
             - 'tools/browsertime/mach_commands.py'
         toolchain-artifact: public/build/browsertime.tar.bz2
     fetches:
         toolchain:
             - linux64-node
 
+wasi-sysroot:
+    description: "wasi sysroot build process"
+    treeherder:
+        symbol: TL(wasi-sysroot)
+    run:
+        script: build-wasi-sysroot.sh
+        sparse-profile: null
+        toolchain-artifact: public/build/wasi-sysroot.tar.xz
+    fetches:
+        fetch:
+            - wasi-libc
+        toolchain:
+            - linux64-clang
+
 wrench-deps:
     description: "Downloads all the crates needed for building wrench"
     treeherder:
         symbol: WR(wrench-deps)
     worker:
         docker-image: {in-tree: webrender}
     run:
         script: wrench-deps-vendoring.sh
new file mode 100755
--- /dev/null
+++ b/taskcluster/scripts/misc/build-wasi-sysroot.sh
@@ -0,0 +1,18 @@
+#!/bin/bash
+set -x -e -v
+
+# This script is for building libc-wasi.
+
+cd $GECKO_PATH
+
+# gets a bit too verbose here
+
+cd $MOZ_FETCHES_DIR/wasi-libc
+make WASM_CC=$MOZ_FETCHES_DIR/clang/bin/clang \
+     WASM_AR=$MOZ_FETCHES_DIR/clang/bin/llvm-ar \
+     WASM_NM=$MOZ_FETCHES_DIR/clang/bin/llvm-nm \
+     SYSROOT=$(pwd)/wasi-sysroot
+
+# Put a tarball in the artifacts dir
+mkdir -p $UPLOAD_DIR
+tar caf $UPLOAD_DIR/wasi-sysroot.tar.xz wasi-sysroot