Bug 1604881 - fail if user attempts to set CC or CXX with "mk_add_options" in .mozconfig r=firefox-build-system-reviewers,chmanchester
authorRicky Stewart <rstewart@mozilla.com>
Thu, 19 Dec 2019 21:00:43 +0000
changeset 507918 19faafe628bdf0fdbfa2e8b963c8f804c6c42eb9
parent 507917 78569ad3903317268d0f3361db1970f770175a53
child 507919 de5881f3d6ceae7b2818153019420354e1faa712
push id36933
push useraciure@mozilla.com
push dateFri, 20 Dec 2019 04:15:17 +0000
treeherdermozilla-central@c8ce8b91465a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfirefox-build-system-reviewers, chmanchester
bugs1604881
milestone73.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 1604881 - fail if user attempts to set CC or CXX with "mk_add_options" in .mozconfig r=firefox-build-system-reviewers,chmanchester Differential Revision: https://phabricator.services.mozilla.com/D57656
build/moz.configure/old.configure
--- a/build/moz.configure/old.configure
+++ b/build/moz.configure/old.configure
@@ -17,16 +17,25 @@ def autoconf(mozconfig, autoconf):
     if mozconfig['path']:
         make_extra = mozconfig['make_extra']
         if make_extra:
             for assignment in make_extra:
                 m = re.match('(?:export\s+)?AUTOCONF\s*:?=\s*(.+)$',
                              assignment)
                 if m:
                     mozconfig_autoconf = m.group(1)
+                # Check whether we've exported any known-broken variables.
+                m = re.match('(?:export\s+)?(?:CC|CXX)\s*:?=\s*(?:.+)$',
+                             assignment)
+                if m:
+                    die('Setting the value of CC or CXX with "mk_add_options" '
+                        'can cause the build to fail unexpectedly. Please '
+                        'change your mozconfig to instead use '
+                        '"ac_add_options", e.g. ac_add_options '
+                        'CC=my-custom-cc".')
 
     autoconf = autoconf[0] if autoconf else None
 
     for ac in (mozconfig_autoconf, autoconf, 'autoconf-2.13', 'autoconf2.13',
                'autoconf213'):
         if ac:
             autoconf = find_program(ac)
             if autoconf: