Bug 1580356 - Pre: Allow no download information in informulate.py. r=mshal
authorNick Alexander <nalexander@mozilla.com>
Fri, 04 Oct 2019 20:56:29 +0000
changeset 496410 6f7cf55ea8692e0a8970395944c851a084eb90cc
parent 496409 def6f90657bd767d1086373a0df6409218bb20be
child 496411 2009acbb8bfa1d69b65821620b799c82450eef69
push id97224
push usernalexander@mozilla.com
push dateFri, 04 Oct 2019 21:00:04 +0000
treeherderautoland@1ffe2e3d6e19 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmshal
bugs1580356
milestone71.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 1580356 - Pre: Allow no download information in informulate.py. r=mshal GeckoView builds produce artifact for download by Mozilla's regular consumer audience. It's not clear what, if anything, depends on this download information, but this is a reasonable way to find out! Differential Revision: https://phabricator.services.mozilla.com/D46535
toolkit/mozapps/installer/informulate.py
toolkit/mozapps/installer/packager.mk
--- a/toolkit/mozapps/installer/informulate.py
+++ b/toolkit/mozapps/installer/informulate.py
@@ -18,16 +18,18 @@ import os
 
 def main():
     parser = ArgumentParser()
     parser.add_argument('output_json', help='Output JSON file')
     parser.add_argument('buildhub_json', help='Output buildhub JSON file')
     parser.add_argument('output_txt', help='Output text file')
     # TODO: Move package-name.mk variables into moz.configure.
     parser.add_argument('pkg_platform', help='Package platform identifier')
+    parser.add_argument('--no-download', action='store_true',
+                        help='Do not include download information')
     parser.add_argument('--package', help='Path to application package file')
     parser.add_argument('--installer', help='Path to application installer file')
     args = parser.parse_args()
     mozinfo.find_and_update_from_json()
 
     important_substitutions = [
         'target_alias', 'target_cpu', 'target_os', 'target_vendor',
         'host_alias', 'host_cpu', 'host_os', 'host_vendor',
@@ -45,23 +47,17 @@ def main():
         'moz_pkg_platform': args.pkg_platform,
     })
 
     with open(args.output_json, 'wb') as f:
         json.dump(all_key_value_pairs, f, indent=2, sort_keys=True)
         f.write('\n')
 
     with open(args.buildhub_json, 'wb') as f:
-        if args.installer and os.path.exists(args.installer):
-            package = args.installer
-        else:
-            package = args.package
         build_time = datetime.datetime.strptime(build_id, '%Y%m%d%H%M%S')
-        st = os.stat(package)
-        mtime = datetime.datetime.fromtimestamp(st.st_mtime)
         s = buildconfig.substs
         record = {
             'build': {
                 'id': build_id,
                 'date': build_time.isoformat() + 'Z',
                 'as': s['AS'],
                 'cc': s['CC'],
                 'cxx': s['CXX'],
@@ -77,24 +73,35 @@ def main():
             'target': {
                 'platform': args.pkg_platform,
                 'os': mozinfo.info['os'],
                 # This would be easier if the locale was specified at configure time.
                 'locale': os.environ.get('AB_CD', 'en-US'),
                 'version': s['MOZ_APP_VERSION_DISPLAY'] or s['MOZ_APP_VERSION'],
                 'channel': s['MOZ_UPDATE_CHANNEL'],
             },
-            'download': {
+        }
+
+        if args.no_download:
+            package = None
+        elif args.installer and os.path.exists(args.installer):
+            package = args.installer
+        else:
+            package = args.package
+        if package:
+            st = os.stat(package)
+            mtime = datetime.datetime.fromtimestamp(st.st_mtime)
+            record['download'] = {
                 # The release pipeline will update these keys.
                 'url': os.path.basename(package),
                 'mimetype': 'application/octet-stream',
                 'date': mtime.isoformat() + 'Z',
                 'size': st.st_size,
             }
-        }
+
         json.dump(record, f, indent=2, sort_keys=True)
         f.write('\n')
 
     with open(args.output_txt, 'wb') as f:
         f.write('buildID={}\n'.format(build_id))
 
 
 if __name__ == '__main__':
--- a/toolkit/mozapps/installer/packager.mk
+++ b/toolkit/mozapps/installer/packager.mk
@@ -111,18 +111,20 @@ ifeq ($(MOZ_PKG_FORMAT),ZIP)
 	$(MAKE) -C windows ZIP_IN='$(ABS_DIST)/$(PACKAGE)' installer
 endif
 endif
 ifdef MOZ_AUTOMATION
 	cp $(DEPTH)/mozinfo.json $(MOZ_MOZINFO_FILE)
 	$(PYTHON) $(MOZILLA_DIR)/toolkit/mozapps/installer/informulate.py \
 		$(MOZ_BUILDINFO_FILE) $(MOZ_BUILDHUB_JSON) $(MOZ_BUILDID_INFO_TXT_FILE) \
 		$(MOZ_PKG_PLATFORM) \
-		--package=$(DIST)/$(PACKAGE) \
-		--installer=$(INSTALLER_PACKAGE)
+		$(if $(or $(filter-out mobile/android,$(MOZ_BUILD_APP)),$(MOZ_ANDROID_WITH_FENNEC)), \
+		--package=$(DIST)/$(PACKAGE) --installer=$(INSTALLER_PACKAGE), \
+		--no-download \
+	  )
 endif
 	$(TOUCH) $@
 
 GARBAGE += make-package
 
 make-sourcestamp-file::
 	$(NSINSTALL) -D $(DIST)/$(PKG_PATH)
 	@awk '$$2 == "MOZ_BUILDID" {print $$3}' $(DEPTH)/buildid.h > $(MOZ_SOURCESTAMP_FILE)