Bug 1429669 - Group url and sha256 of dsc file in package definitions. r=dustin
authorMike Hommey <mh+mozilla@glandium.org>
Thu, 11 Jan 2018 07:35:32 +0900
changeset 453192 03f2c77c78c66b265b60dd9e93f2f4026d84d107
parent 453191 52100437f9b37345a286f048349f6f3f6d4298a5
child 453193 8210a2bd7a4c1cdab9363a965c9470723bf19b2f
push id1648
push usermtabara@mozilla.com
push dateThu, 01 Mar 2018 12:45:47 +0000
treeherdermozilla-release@cbb9688c2eeb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdustin
bugs1429669
milestone59.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 1429669 - Group url and sha256 of dsc file in package definitions. r=dustin This will be useful two patches down the road.
taskcluster/ci/packages/kind.yml
taskcluster/taskgraph/transforms/job/debian_package.py
--- a/taskcluster/ci/packages/kind.yml
+++ b/taskcluster/ci/packages/kind.yml
@@ -20,32 +20,35 @@ job-defaults:
 
 jobs:
   deb7-python:
     description: "Python backport for Debian wheezy"
     treeherder:
       symbol: Deb7(python)
     run:
       using: debian-package
-      dsc: "http://snapshot.debian.org/archive/debian/20160813T164221Z/pool/main/p/python2.7/python2.7_2.7.9-2+deb8u1.dsc"
-      dsc-sha256: 274c293e7156edf59cb9f0a9d8cedcd94fa801df35adf39b8a9f3d776a250ead
+      dsc:
+        url: http://snapshot.debian.org/archive/debian/20160813T164221Z/pool/main/p/python2.7/python2.7_2.7.9-2+deb8u1.dsc
+        sha256: 274c293e7156edf59cb9f0a9d8cedcd94fa801df35adf39b8a9f3d776a250ead
       patch: python-wheezy.diff
       pre-build-command: debian/rules control-file
 
   deb7-cmake:
     description: "Cmake backport for Debian wheezy"
     treeherder:
       symbol: Deb7(cmake)
     run:
       using: debian-package
-      dsc: "http://snapshot.debian.org/archive/debian-debug/20161204T031605Z/pool/main/c/cmake/cmake_3.7.1-1.dsc"
-      dsc-sha256: 406a12c0d0a2e92d44a8d444fd1b32bcc29a8810e9631427161a7cb411f60172
+      dsc:
+        url: http://snapshot.debian.org/archive/debian-debug/20161204T031605Z/pool/main/c/cmake/cmake_3.7.1-1.dsc
+        sha256: 406a12c0d0a2e92d44a8d444fd1b32bcc29a8810e9631427161a7cb411f60172
       patch: cmake-wheezy.diff
 
   deb7-ninja:
     description: "Ninja backport for Debian wheezy"
     treeherder:
       symbol: Deb7(ninja)
     run:
       using: debian-package
-      dsc: "http://snapshot.debian.org/archive/debian-debug/20160209T034956Z/pool/main/n/ninja-build/ninja-build_1.6.0-1.dsc"
-      dsc-sha256: 25cd62b011d669c31bcd51d36d454dd826bc50af6a3af8d87bcab8948ec21626
+      dsc:
+        url: http://snapshot.debian.org/archive/debian-debug/20160209T034956Z/pool/main/n/ninja-build/ninja-build_1.6.0-1.dsc
+        sha256: 25cd62b011d669c31bcd51d36d454dd826bc50af6a3af8d87bcab8948ec21626
       patch: ninja-wheezy.diff
--- a/taskcluster/taskgraph/transforms/job/debian_package.py
+++ b/taskcluster/taskgraph/transforms/job/debian_package.py
@@ -14,31 +14,33 @@ from voluptuous import Optional, Require
 
 from taskgraph.transforms.job import run_job_using
 from taskgraph.transforms.job.common import add_public_artifacts
 
 from taskgraph.util.hash import hash_paths
 from taskgraph import GECKO
 from taskgraph.util.cached_tasks import add_optimization
 
+source_definition = {
+    Required('url'): basestring,
+    Required('sha256'): basestring,
+}
+
 run_schema = Schema({
     Required('using'): 'debian-package',
     # Debian distribution
     Optional('dist'): basestring,
 
     # Date of the snapshot (from snapshot.debian.org) to use, in the format
     # YYYYMMDDTHHMMSSZ. The same date is used for the base docker-image name
     # (only the YYYYMMDD part).
     Optional('snapshot'): basestring,
 
-    # URL of the source control (.dsc) file to build.
-    Required('dsc'): basestring,
-
-    # SHA256 of the source control (.dsc) file.
-    Required('dsc-sha256'): basestring,
+    # URL/SHA256 of the source control (.dsc) file to build.
+    Required('dsc'): source_definition,
 
     # Patch to apply to the extracted source.
     Optional('patch'): basestring,
 
     # Command to run before dpkg-buildpackage.
     Optional('pre-build-command'): basestring,
 })
 
@@ -52,17 +54,17 @@ def docker_worker_debian_package(config,
     worker = taskdesc['worker']
     worker['artifacts'] = []
     worker['docker-image'] = 'debian:{dist}-{date}'.format(
         dist=run['dist'],
         date=run['snapshot'][:8])
 
     add_public_artifacts(config, job, taskdesc, path='/tmp/artifacts')
 
-    dsc_file = os.path.basename(run['dsc'])
+    dsc_file = os.path.basename(run['dsc']['url'])
     package = dsc_file[:dsc_file.index('_')]
 
     adjust = ''
     if 'patch' in run:
         # We can't depend on docker images, so we don't have robustcheckout
         # or run-task to get a checkout. So for this one file we'd need
         # from a checkout, download it.
         adjust += ('curl -sL {head_repo}/raw-file/{head_rev}'
@@ -110,29 +112,30 @@ def docker_worker_debian_package(config,
         'apt-ftparchive sources debian | gzip -c9 > debian/Sources.gz && '
         'apt-ftparchive packages debian | gzip -c9 > debian/Packages.gz && '
         'apt-ftparchive release -o APT::FTPArchive::Release::Codename={dist} debian > Release && '
         'mv Release debian/'
         .format(
             package=package,
             snapshot=run['snapshot'],
             dist=run['dist'],
-            dsc=run['dsc'],
+            dsc=run['dsc']['url'],
             dsc_file=dsc_file,
-            dsc_sha256=run['dsc-sha256'],
+            dsc_sha256=run['dsc']['sha256'],
             adjust=adjust,
             artifacts='/tmp/artifacts',
         )
     ]
 
     name = taskdesc['label'].replace('{}-'.format(config.kind), '', 1)
     files = [
         # This file
         'taskcluster/taskgraph/transforms/job/debian_package.py',
     ]
     if 'patch' in run:
         files.append('build/debian-packages/{}'.format(run['patch']))
     data = [hash_paths(GECKO, files)]
-    for k in ('snapshot', 'dist', 'dsc-sha256', 'pre-build-command'):
+    for k in ('snapshot', 'dist', 'pre-build-command'):
         if k in run:
             data.append(run[k])
+    data.append(run['dsc']['sha256'])
     add_optimization(config, taskdesc, cache_type='packages.v1',
                      cache_name=name, digest_data=data)