Bug 1534500 - Allow diffoscope tasks to work on unpacked builds. r=dustin
authorMike Hommey <mh+mozilla@glandium.org>
Tue, 12 Mar 2019 20:21:20 +0000
changeset 524617 fc4d0ac008223e2d800819892e660aaceb271db6
parent 524616 d410e91f369943daafd53906ee15357f795b06ff
child 524618 01712a69cb3960e602d452a39ed71396d60bfc80
push id2032
push userffxbld-merge
push dateMon, 13 May 2019 09:36:57 +0000
treeherdermozilla-release@455c1065dcbe [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdustin
bugs1534500
milestone67.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 1534500 - Allow diffoscope tasks to work on unpacked builds. r=dustin Depends on D23073 Differential Revision: https://phabricator.services.mozilla.com/D23074
taskcluster/docker/diffoscope/get_and_diffoscope
taskcluster/taskgraph/transforms/diffoscope.py
--- a/taskcluster/docker/diffoscope/get_and_diffoscope
+++ b/taskcluster/docker/diffoscope/get_and_diffoscope
@@ -43,23 +43,40 @@ case "$ORIG_URL" in
 	curl -sL "$NEW_URL" > b.dmg
 	for i in a b; do
 		dmg/dmg extract $i.dmg $i.hfs
 		dmg/hfsplus $i.hfs extractall / $i
 	done
 	;;
 esac
 
+case "$ORIG_URL" in
+*/target.apk)
+	OMNIJAR=assets/omni.ja
+	;;
+*)
+	OMNIJAR=omni.ja
+	;;
+esac
+
 # Builds are 99% of the time differing in some small ways, so it's not
 # really useful to report a failure (at least not until we actually
 # care about the builds being 100% identical).
 POST=true
 
 for option; do
 	case "$option" in
+	--unpack)
+		CURDIR=$PWD
+		for dir in a b; do
+			# Need to run mach python from inside the gecko source.
+			# See bug #1533642.
+			(cd $GECKO_PATH && ./mach python toolkit/mozapps/installer/unpack.py --omnijar $OMNIJAR $CURDIR/$dir)
+		done
+		;;
 	--fail)
 		POST="exit 1"
 		;;
 	*)
 		echo "Unsupported option: $option" >&2
 		exit 1
 	esac
 done
--- a/taskcluster/taskgraph/transforms/diffoscope.py
+++ b/taskcluster/taskgraph/transforms/diffoscope.py
@@ -42,16 +42,21 @@ diff_description_schema = Schema({
     # taskcluster/ci/diffoscope/kind.yml
     Optional('args'): basestring,
 
     # Extra arguments to pass to diffoscope, that can be set per job.
     Optional('extra-args'): basestring,
 
     # Fail the task when differences are detected.
     Optional('fail-on-diff'): bool,
+
+    # Whether to unpack first. Diffoscope can normally work without unpacking,
+    # but when one needs to --exclude some contents, that doesn't work out well
+    # if said content is packed (e.g. in omni.ja).
+    Optional('unpack'): bool,
 })
 
 transforms = TransformSequence()
 transforms.add_validate(diff_description_schema)
 
 
 @transforms.add
 def fill_template(config, tasks):
@@ -134,18 +139,19 @@ def fill_template(config, tasks):
                     'NEW_URL': urls['new'],
                     'DIFFOSCOPE_ARGS': ' '.join(
                         task[k] for k in ('args', 'extra-args') if k in task)
                 },
                 'max-run-time': 1800,
             },
             'run': {
                 'using': 'run-task',
-                'checkout': False,
-                'command': '/builds/worker/bin/get_and_diffoscope{}'.format(
+                'checkout': task.get('unpack', False),
+                'command': '/builds/worker/bin/get_and_diffoscope{}{}'.format(
+                    ' --unpack' if task.get('unpack') else '',
                     ' --fail' if task.get('fail-on-diff') else '',
                 ),
             },
             'dependencies': deps,
         }
 
         if artifact.endswith('.dmg'):
             taskdesc['toolchains'] = [