bug 1337393 - add a toolchain task for building libdmg-hfsplus tools, build them from a newer branch r?callek draft
authorTed Mielczarek <ted@mielczarek.org>
Tue, 07 Feb 2017 10:57:23 -0500
changeset 480510 84460ed61be86f04e972c0efb414c9f509f1ca6c
parent 479651 af8a2573d0f1e9cc6f2ba0ab67d7a702a197f177
child 480511 bf60e1ec5da339c50069c4d14d7c7660fd3b7a09
push id44562
push userbmo:ted@mielczarek.org
push dateWed, 08 Feb 2017 11:34:17 +0000
reviewerscallek
bugs1337393
milestone54.0a1
bug 1337393 - add a toolchain task for building libdmg-hfsplus tools, build them from a newer branch r?callek There's not a single well-maintained fork of libdmg-hfsplus, but there are scattered forks with various fixes. The fork + branch I've chosen here seems to have collected the most fixes, including a specific fix we need for repacking DMG files on Linux: https://github.com/andreas56/libdmg-hfsplus/commit/5c92af354b279809bc64f8013805ca0b51b29960 MozReview-Commit-ID: 3RB6gfgQmCA
taskcluster/ci/toolchain/linux.yml
taskcluster/scripts/misc/build-libdmg-hfsplus.sh
--- a/taskcluster/ci/toolchain/linux.yml
+++ b/taskcluster/ci/toolchain/linux.yml
@@ -106,8 +106,28 @@ linux64-cctools-port/opt:
     worker:
         implementation: docker-worker
         docker-image: {in-tree: desktop-build}
         max-run-time: 36000
     when:
         files-changed:
             - 'taskcluster/scripts/misc/build-cctools-port.sh'
             - 'taskcluster/taskgraph/transforms/job/toolchain.py'
+
+linux64-libdmg/opt:
+    description: "libdmg-hfsplus toolchain build"
+    treeherder:
+        kind: build
+        platform: linux64/opt
+        symbol: Cc(libdmg)
+        tier: 1
+    run:
+        using: toolchain-script
+        script: build-libdmg-hfsplus.sh
+    worker-type: aws-provisioner-v1/gecko-{level}-b-linux
+    worker:
+        implementation: docker-worker
+        docker-image: {in-tree: desktop-build}
+        max-run-time: 36000
+    when:
+        files-changed:
+            - 'taskcluster/scripts/misc/build-libdmg-hfsplus.sh'
+            - 'taskcluster/taskgraph/transforms/job/toolchain.py'
new file mode 100755
--- /dev/null
+++ b/taskcluster/scripts/misc/build-libdmg-hfsplus.sh
@@ -0,0 +1,35 @@
+#!/bin/bash
+set -x -e -v
+
+# This script is for building libdmg-hfsplus to get the `dmg` and `hfsplus`
+# tools for producing DMG archives on Linux.
+
+WORKSPACE=$HOME/workspace
+STAGE=$WORKSPACE/dmg
+UPLOAD_DIR=$WORKSPACE/artifacts
+
+# There's no single well-maintained fork of libdmg-hfsplus, but this
+# branch currently has some fixes we need.
+: LIBDMG_REPOSITORY    ${LIBDMG_REPOSITORY:=https://github.com/andreas56/libdmg-hfsplus}
+# This is the current head of the `from_zarvox` branch.
+: LIBDMG_REV           ${LIBDMG_REV:=81dd75fd1549b24bf8af9736ac25518b367e6b63}
+
+mkdir -p $UPLOAD_DIR $STAGE
+
+cd $WORKSPACE
+tc-vcs checkout --force-clone libdmg-hfsplus $LIBDMG_REPOSITORY $LIBDMG_REPOSITORY $LIBDMG_REV
+cd libdmg-hfsplus
+# Make a source archive
+git archive ${LIBDMG_REV} | xz > $UPLOAD_DIR/libdmg-hfsplus.tar.xz
+cmake .
+make -j$(getconf _NPROCESSORS_ONLN)
+
+# We only need the dmg and hfsplus tools.
+strip dmg/dmg hfs/hfsplus
+cp dmg/dmg hfs/hfsplus $STAGE
+
+cat >$STAGE/README<<EOF
+Built from ${LIBDMG_REPOSITORY} rev `git rev-parse ${LIBDMG_REV}`.
+Source is available in tooltool, digest `sha512sum $UPLOAD_DIR/libdmg-hfsplus.tar.xz`.
+EOF
+tar cf - -C $WORKSPACE `basename $STAGE` | xz > $UPLOAD_DIR/dmg.tar.xz