Add an option to upload config.status and old-configure.vars in automation. draft
authorChris Manchester <cmanchester@mozilla.com>
Tue, 23 Aug 2016 16:24:54 -0700
changeset 404731 12a3473b0e04fa3cde1e816eff3b825e3c8f3ad6
parent 404705 474dce563e74bd18669f57f27bd497b7715b887a
child 404732 35452bf2c4fcc8e008a1a4613b273773c3d2e623
push id27277
push userbmo:cmanchester@mozilla.com
push dateTue, 23 Aug 2016 23:29:10 +0000
milestone51.0a1
Add an option to upload config.status and old-configure.vars in automation. MozReview-Commit-ID: Ceyjsk1wiHj
build/mozconfig.common.override
compare_configs.py
configure.py
moz.configure
toolkit/mozapps/installer/upload-files.mk
--- a/build/mozconfig.common.override
+++ b/build/mozconfig.common.override
@@ -4,8 +4,10 @@
 
 # Common mozconfig for all users
 #
 # Add options to this file that will be inherited by all in-tree mozconfigs.
 # This file is included at the *end* of the mozconfigs, and so may be used
 # to override anything done previously.
 #
 # The common expected usage is for try builds with nondefault options.
+
+ac_add_options --enable-upload-config-status
\ No newline at end of file
new file mode 100644
--- /dev/null
+++ b/compare_configs.py
@@ -0,0 +1,28 @@
+import os
+import sys
+import subprocess
+
+def main(a, b):
+    names = ['config.status',
+             'config.status.js',
+             'old-configure.vars',
+             'old-configure.vars.js']
+
+    for name in names:
+        subprocess.check_call(['wget', '%s/%s' % (a, name),
+                               '-O', 'a.%s' % name,
+                               '-o', '/dev/null'])
+        subprocess.check_call(['wget', '%s/%s' % (b, name),
+                               '-O', 'b.%s' % name,
+                               '-o', '/dev/null'])
+        try:
+            subprocess.check_call(['git', 'diff', 'b.%s' % name, 'a.%s' % name])
+        except subprocess.CalledProcessError:
+            pass
+        os.remove('a.%s' % name)
+        os.remove('b.%s' % name)
+        print("Checked: %s" % name)
+
+if __name__ == '__main__':
+    assert len(sys.argv) == 3
+    main(*sys.argv[1:])
--- a/configure.py
+++ b/configure.py
@@ -99,16 +99,21 @@ if __name__ == '__main__':
         if isinstance(v, str):
             return v
         if isinstance(v, unicode):
             return v.encode(encoding)
         if isinstance(v, Iterable):
             return [encode(i) for i in v]
         return v
 
+    if config.get('MOZ_BUILD_APP') == 'js':
+        from shutil import copyfile
+        copyfile('config.status', 'config.status.js')
+        copyfile('old-configure.vars', 'old-configure.vars.js')
+
     # Other things than us are going to run this file, so we need to give it
     # executable permissions.
     os.chmod('config.status', 0o755)
     if config.get('MOZ_BUILD_APP') != 'js' or config.get('JS_STANDALONE'):
         os.environ[b'WRITE_MOZINFO'] = b'1'
         from mozbuild.config_status import config_status
         return config_status(args=[], **encode(sanitized_config))
     return 0
--- a/moz.configure
+++ b/moz.configure
@@ -9,16 +9,22 @@ include('build/moz.configure/init.config
 # Note:
 # - Gecko-specific options and rules should go in toolkit/moz.configure.
 # - Firefox-specific options and rules should go in browser/moz.configure.
 # - Fennec-specific options and rules should go in
 #   mobile/android/moz.configure.
 # - Spidermonkey-specific options and rules should go in js/moz.configure.
 # - etc.
 
+option('--enable-upload-config-status',
+       help='Upload config.status, js/src/config.status, and related files.')
+
+set_config('MOZ_UPLOAD_CONFIG_STATUS',
+           depends_if('--enable-upload-config-status')(lambda _: True))
+
 # Multiprocess Firefox Testing UI - Nightly and Aurora
 # To be removed in Bug 1003313
 @depends(milestone)
 def e10s_testing_only(milestone):
     if not milestone.is_release:
         return True
 
 set_config('E10S_TESTING_ONLY', e10s_testing_only)
--- a/toolkit/mozapps/installer/upload-files.mk
+++ b/toolkit/mozapps/installer/upload-files.mk
@@ -459,16 +459,24 @@ UPLOAD_FILES= \
   $(call QUOTED_WILDCARD,$(MOZ_SOURCESTAMP_FILE)) \
   $(call QUOTED_WILDCARD,$(MOZ_BUILDINFO_FILE)) \
   $(call QUOTED_WILDCARD,$(MOZ_BUILDID_INFO_TXT_FILE)) \
   $(call QUOTED_WILDCARD,$(MOZ_MOZINFO_FILE)) \
   $(call QUOTED_WILDCARD,$(MOZ_TEST_PACKAGES_FILE)) \
   $(call QUOTED_WILDCARD,$(PKG_JSSHELL)) \
   $(if $(UPLOAD_EXTRA_FILES), $(foreach f, $(UPLOAD_EXTRA_FILES), $(wildcard $(DIST)/$(f))))
 
+ifdef MOZ_UPLOAD_CONFIG_STATUS
+  UPLOAD_FILES += \
+    $(call QUOTED_WILDCARD,$(topobjdir)/config.status) \
+    $(call QUOTED_WILDCARD,$(topobjdir)/old-configure.vars) \
+    $(call QUOTED_WILDCARD,$(topobjdir)/js/src/config.status.js) \
+    $(call QUOTED_WILDCARD,$(topobjdir)/js/src/old-configure.vars.js)
+endif
+
 ifdef MOZ_CRASHREPORTER_UPLOAD_FULL_SYMBOLS
   UPLOAD_FILES += \
     $(call QUOTED_WILDCARD,$(DIST)/$(PKG_PATH)$(SYMBOL_FULL_ARCHIVE_BASENAME).zip)
 endif
 
 ifdef MOZ_CODE_COVERAGE
   UPLOAD_FILES += \
     $(call QUOTED_WILDCARD,$(DIST)/$(PKG_PATH)$(CODE_COVERAGE_ARCHIVE_BASENAME).zip)