Bug 861453 - Restore empty substs after bug 857557, but put them in a separate file, unlisted as a dependency for everything. r=gps
☠☠ backed out by 1cadf6ac01be ☠ ☠
authorMike Hommey <mh+mozilla@glandium.org>
Tue, 16 Apr 2013 08:23:18 +0200
changeset 128893 0ff383d4a899769deaebc516451ad985509222ca
parent 128892 65a8f7db264875c2a7a62fdd8a30eda4979b5dea
child 128894 66c01cdf30d23ea0bbe2b365c1572ff0e0c72521
push id26555
push usermh@glandium.org
push dateTue, 16 Apr 2013 06:24:50 +0000
treeherdermozilla-inbound@0ff383d4a899 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgps
bugs861453, 857557
milestone23.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 861453 - Restore empty substs after bug 857557, but put them in a separate file, unlisted as a dependency for everything. r=gps
config/autoconf.mk.in
config/emptyvars.mk.in
config/moz.build
js/src/config/autoconf.mk.in
js/src/config/emptyvars.mk.in
js/src/configure.in
python/mozbuild/mozbuild/backend/configenvironment.py
python/mozbuild/mozbuild/test/backend/test_configenvironment.py
--- a/config/autoconf.mk.in
+++ b/config/autoconf.mk.in
@@ -1,2 +1,3 @@
+include $(DEPTH)/config/emptyvars.mk
 @ALLSUBSTS@
 include $(topsrcdir)/config/baseconfig.mk
new file mode 100644
--- /dev/null
+++ b/config/emptyvars.mk.in
@@ -0,0 +1,1 @@
+@ALLEMPTYSUBSTS@
--- a/config/moz.build
+++ b/config/moz.build
@@ -1,14 +1,15 @@
 # -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
 # vim: set filetype=python:
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 CONFIGURE_SUBST_FILES += [
     'autoconf.mk',
+    'emptyvars.mk',
     'doxygen.cfg',
     'makefiles/test/Makefile',
     'tests/makefiles/autodeps/Makefile',
     'tests/src-simple/Makefile',
 ]
 
--- a/js/src/config/autoconf.mk.in
+++ b/js/src/config/autoconf.mk.in
@@ -1,2 +1,3 @@
+include $(DEPTH)/config/emptyvars.mk
 @ALLSUBSTS@
 include $(topsrcdir)/config/baseconfig.mk
new file mode 100644
--- /dev/null
+++ b/js/src/config/emptyvars.mk.in
@@ -0,0 +1,1 @@
+@ALLEMPTYSUBSTS@
--- a/js/src/configure.in
+++ b/js/src/configure.in
@@ -4379,17 +4379,17 @@ AC_HAVE_FUNCS(localeconv)
 
 AC_SUBST(MOZILLA_VERSION)
 
 AC_SUBST(ac_configure_args)
 
 dnl Spit out some output
 dnl ========================================================
 
-AC_OUTPUT([js-confdefs.h Makefile config/autoconf.mk])
+AC_OUTPUT([js-confdefs.h Makefile config/autoconf.mk config/emptyvars.mk])
 
 # Produce the js-config script at configure time; see the comments for
 # 'js-config' in Makefile.in.
 AC_MSG_RESULT(invoking $MAKE to create js-config script)
 $MAKE js-config
 
 # Build jsctypes if it's enabled.
 if test "$JS_HAS_CTYPES" -a -z "$MOZ_NATIVE_FFI"; then
--- a/python/mozbuild/mozbuild/backend/configenvironment.py
+++ b/python/mozbuild/mozbuild/backend/configenvironment.py
@@ -81,23 +81,25 @@ class ConfigEnvironment(object):
     ConfigEnvironment automatically defines two additional substs variables
     from all the defines not appearing in non_global_defines:
       - ACDEFINES contains the defines in the form -DNAME=VALUE, for use on
         preprocessor command lines. The order in which defines were given
         when creating the ConfigEnvironment is preserved.
       - ALLDEFINES contains the defines in the form #define NAME VALUE, in
         sorted order, for use in config files, for an automatic listing of
         defines.
-    and another additional subst variable from all the other substs:
+    and two other additional subst variables from all the other substs:
       - ALLSUBSTS contains the substs in the form NAME = VALUE, in sorted
         order, for use in autoconf.mk. It includes ACDEFINES, but doesn't
         include ALLDEFINES. Only substs with a VALUE are included, such that
         the resulting file doesn't change when new empty substs are added.
         This results in less invalidation of build dependencies in the case
         of autoconf.mk..
+      - ALLEMPTYSUBSTS contains the substs with an empty value, in the form
+        NAME =.
 
     ConfigEnvironment expects a "top_srcdir" subst to be set with the top
     source directory, in msys format on windows. It is used to derive a
     "srcdir" subst when treating config files. It can either be an absolute
     path or a path relative to the topobjdir.
     """
 
     def __init__(self, topsrcdir, topobjdir, defines=[], non_global_defines=[],
@@ -108,16 +110,18 @@ class ConfigEnvironment(object):
         self.topsrcdir = topsrcdir
         self.topobjdir = topobjdir
         global_defines = [name for name, value in defines
             if not name in non_global_defines]
         self.substs['ACDEFINES'] = ' '.join(['-D%s=%s' % (name,
             shell_escape(self.defines[name])) for name in global_defines])
         self.substs['ALLSUBSTS'] = '\n'.join(sorted(['%s = %s' % (name,
             self.substs[name]) for name in self.substs if self.substs[name]]))
+        self.substs['ALLEMPTYSUBSTS'] = '\n'.join(sorted(['%s =' % name
+            for name in self.substs if not self.substs[name]]))
         self.substs['ALLDEFINES'] = '\n'.join(sorted(['#define %s %s' % (name,
             self.defines[name]) for name in global_defines]))
 
     @staticmethod
     def from_config_status(path):
         config = BuildConfig.from_config_status(path)
 
         return ConfigEnvironment(config.topsrcdir, config.topobjdir,
--- a/python/mozbuild/mozbuild/test/backend/test_configenvironment.py
+++ b/python/mozbuild/mozbuild/test/backend/test_configenvironment.py
@@ -17,24 +17,24 @@ class ConfigEnvironment(ConfigStatus.Con
             if os.path.isabs(self.topsrcdir):
                 self.substs['top_srcdir'] = self.topsrcdir.replace(os.sep, '/')
             else:
                 self.substs['top_srcdir'] = os.path.relpath(self.topsrcdir, self.topobjdir).replace(os.sep, '/')
 
 
 class TestEnvironment(unittest.TestCase):
     def test_auto_substs(self):
-        '''Test the automatically set values of ACDEFINES, ALLDEFINES
-        and ALLSUBSTS.
+        '''Test the automatically set values of ACDEFINES, ALLDEFINES,
+        ALLSUBSTS and ALLEMPTYSUBSTS.
         '''
         env = ConfigEnvironment('.', '.',
                   defines = [ ('foo', 'bar'), ('baz', 'qux 42'),
                               ('abc', 'def'), ('extra', 'foobar') ],
                   non_global_defines = ['extra', 'ignore'],
-                  substs = [ ('FOO', 'bar'), ('ABC', 'def'),
+                  substs = [ ('FOO', 'bar'), ('FOOBAR', ''), ('ABC', 'def'),
                              ('bar', 'baz qux'), ('zzz', '"abc def"'),
                              ('qux', '') ])
         # non_global_defines should be filtered out in ACDEFINES and
         # ALLDEFINES.
         # Original order of the defines need to be respected in ACDEFINES
         self.assertEqual(env.substs['ACDEFINES'], '''-Dfoo=bar -Dbaz=qux\ 42 -Dabc=def''')
         # ALLDEFINES, on the other hand, needs to be sorted
         self.assertEqual(env.substs['ALLDEFINES'], '''#define abc def
@@ -42,16 +42,19 @@ class TestEnvironment(unittest.TestCase)
 #define foo bar''')
         # Likewise for ALLSUBSTS, which also mustn't contain ALLDEFINES
         # but contain ACDEFINES
         self.assertEqual(env.substs['ALLSUBSTS'], '''ABC = def
 ACDEFINES = -Dfoo=bar -Dbaz=qux\ 42 -Dabc=def
 FOO = bar
 bar = baz qux
 zzz = "abc def"''')
+        # ALLEMPTYSUBSTS contains all substs with no value.
+        self.assertEqual(env.substs['ALLEMPTYSUBSTS'], '''FOOBAR =
+qux =''')
 
     def test_config_file(self):
         '''Test the creation of config files.
         '''
         with MockedOpen({'file.in': '''#ifdef foo
 @foo@
 @bar@
 '''}):