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 521619 fc4d0ac00822
parent 521618 d410e91f3699
child 521620 01712a69cb39
push id10867
push userdvarga@mozilla.com
push dateThu, 14 Mar 2019 15:20:45 +0000
treeherdermozilla-beta@abad13547875 [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'] = [