Bug 1155349 - Set packageFilename in mach properties. r=glandium, a=NPOTB
authorMike Shal <mshal@mozilla.com>
Wed, 13 May 2015 14:26:53 -0400
changeset 274789 13684d4cfb03a655c85f51eb6ea18578eac59fd4
parent 274788 7083715e204c75bcc22aadedf6c4906e173bce6c
child 274790 b1bc93fa8ca21e397c189df759284665cac5d8e9
push id863
push userraliiev@mozilla.com
push dateMon, 03 Aug 2015 13:22:43 +0000
treeherdermozilla-release@f6321b14228d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersglandium, NPOTB
Bug 1155349 - Set packageFilename in mach properties. r=glandium, a=NPOTB
--- a/build/gen_mach_buildprops.py
+++ b/build/gen_mach_buildprops.py
@@ -35,34 +35,33 @@ def getMarProperties(filename, partial=F
     (mar_hash, mar_size) = getFileHashAndSize(filename)
     martype = 'partial' if partial else 'complete'
     return {
         '%sMarFilename' % martype: os.path.basename(filename),
         '%sMarSize' % martype: mar_size,
         '%sMarHash' % martype: mar_hash,
-def getUrlProperties(filename):
+def getUrlProperties(filename, package):
     # let's create a switch case using name-spaces/dict
     # rather than a long if/else with duplicate code
     property_conditions = [
         # key: property name, value: condition
         ('symbolsUrl', lambda m: m.endswith('crashreporter-symbols.zip') or
         ('testsUrl', lambda m: m.endswith(('tests.tar.bz2', 'tests.zip'))),
         ('unsignedApkUrl', lambda m: m.endswith('apk') and
                            'unsigned-unaligned' in m),
         ('robocopApkUrl', lambda m: m.endswith('apk') and 'robocop' in m),
         ('jsshellUrl', lambda m: 'jsshell-' in m and m.endswith('.zip')),
         ('completeMarUrl', lambda m: m.endswith('.complete.mar')),
         ('partialMarUrl', lambda m: m.endswith('.mar') and '.partial.' in m),
         ('codeCoverageURL', lambda m: m.endswith('code-coverage-gcno.zip')),
         ('sdkUrl', lambda m: m.endswith(('sdk.tar.bz2', 'sdk.zip'))),
-        # packageUrl must be last!
-        ('packageUrl', lambda m: True),
+        ('packageUrl', lambda m: m.endswith(package)),
     url_re = re.compile(r'''^(https?://.*?\.(?:tar\.bz2|dmg|zip|apk|rpm|mar|tar\.gz))$''')
     properties = {}
         with open(filename) as f:
             for line in f:
                 m = url_re.match(line)
@@ -95,28 +94,32 @@ if __name__ == '__main__':
                         action="store", dest="partial_mar_file",
                         help="Path to the partial MAR file, relative to the objdir.")
     parser.add_argument("--upload-output", required=True,
                         action="store", dest="upload_output",
                         help="Path to the text output of 'make upload'")
     parser.add_argument("--upload-files", required=True, nargs="+",
                         action="store", dest="upload_files",
                         help="List of files to be uploaded.")
+    parser.add_argument("--package", required=True,
+                        action="store", dest="package",
+                        help="Filename of the build package")
     args = parser.parse_args()
     json_data = getMarProperties(args.complete_mar_file)
-    json_data.update(getUrlProperties(args.upload_output))
+    json_data.update(getUrlProperties(args.upload_output, args.package))
     if args.partial_mar_file:
         json_data.update(getMarProperties(args.partial_mar_file, partial=True))
         # Pull the previous buildid from the partial mar filename.
         res = re.match(r'.*\.([0-9]+)-[0-9]+.mar', args.partial_mar_file)
         if res:
             json_data['previous_buildid'] = res.group(1)
             # Set partialInfo to be a collection of the partial mar properties
             # useful for balrog.
             json_data['partialInfo'] = getPartialInfo(json_data)
     json_data['uploadFiles'] = args.upload_files
+    json_data['packageFilename'] = args.package
     with open('mach_build_properties.json', 'w') as outfile:
         json.dump(json_data, outfile, indent=4)
--- a/build/moz-automation.mk
+++ b/build/moz-automation.mk
@@ -94,17 +94,17 @@ automation/sdk: automation/installer aut
 # conflicts in writing to the same files.
 automation/installer: automation/pretty-installer
 automation/package: automation/pretty-package
 automation/package-tests: automation/pretty-package-tests
 automation/l10n-check: automation/pretty-l10n-check
 automation/update-packaging: automation/pretty-update-packaging
 automation/build: $(addprefix automation/,$(MOZ_AUTOMATION_TIERS))
-	$(PYTHON) $(topsrcdir)/build/gen_mach_buildprops.py --complete-mar-file $(DIST)/$(COMPLETE_MAR) $(addprefix --partial-mar-file ,$(wildcard $(DIST)/$(PARTIAL_MAR))) --upload-output $(AUTOMATION_UPLOAD_OUTPUT) --upload-files $(abspath $(UPLOAD_FILES))
+	$(PYTHON) $(topsrcdir)/build/gen_mach_buildprops.py --complete-mar-file $(DIST)/$(COMPLETE_MAR) $(addprefix --partial-mar-file ,$(wildcard $(DIST)/$(PARTIAL_MAR))) --upload-output $(AUTOMATION_UPLOAD_OUTPUT) --upload-files $(abspath $(UPLOAD_FILES)) --package $(PACKAGE)
 # We need the log from make upload to grep it for urls in order to set
 # properties.
 # Note: We have to force -j1 here, at least until bug 1036563 is fixed.
 AUTOMATION_EXTRA_CMDLINE-pretty-l10n-check = -j1