Bug 1241022 - Move GENERATED_FILES. r=gps
authorMike Hommey <mh+mozilla@glandium.org>
Wed, 20 Jan 2016 15:03:46 +0900
changeset 316003 e24d733ce7158706431359a8aabe07cc7bfc5128
parent 316002 b62b1d1fc6d3a57510587ad845919e6919a88dba
child 316004 6bb5987487b5a0825d731279810b7859ccdb9b26
push id5703
push userraliiev@mozilla.com
push dateMon, 07 Mar 2016 14:18:41 +0000
treeherdermozilla-beta@31e373ad5b5f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgps
bugs1241022
milestone46.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 1241022 - Move GENERATED_FILES. r=gps GENERATED_FILES impacts the export tier through the config/rules.mk definitions, now moved to the backend itself, so that everything is close to each other.
config/rules.mk
python/mozbuild/mozbuild/backend/recursivemake.py
python/mozbuild/mozbuild/frontend/context.py
python/mozbuild/mozbuild/test/backend/test_recursivemake.py
--- a/config/rules.mk
+++ b/config/rules.mk
@@ -1576,12 +1576,8 @@ default all:: $(PURGECACHES_FILES)
 
 #############################################################################
 # Derived targets and dependencies
 
 include $(MOZILLA_DIR)/config/makefiles/autotargets.mk
 ifneq ($(NULL),$(AUTO_DEPS))
   default all libs tools export:: $(AUTO_DEPS)
 endif
-
-export:: $(GENERATED_FILES)
-
-GARBAGE += $(GENERATED_FILES)
--- a/python/mozbuild/mozbuild/backend/recursivemake.py
+++ b/python/mozbuild/mozbuild/backend/recursivemake.py
@@ -510,18 +510,20 @@ class RecursiveMakeBackend(CommonBackend
                 else:
                     backend_file.write('%s := %s\n' % (k, v))
         elif isinstance(obj, HostDefines):
             self._process_defines(obj, backend_file, which='HOST_DEFINES')
         elif isinstance(obj, Defines):
             self._process_defines(obj, backend_file)
 
         elif isinstance(obj, GeneratedFile):
+            self._no_skip['export'].add(backend_file.relobjdir)
             dep_file = "%s.pp" % obj.output
-            backend_file.write('GENERATED_FILES += %s\n' % obj.output)
+            backend_file.write('export:: %s\n' % obj.output)
+            backend_file.write('GARBAGE += %s\n' % obj.output)
             backend_file.write('EXTRA_MDDEPEND_FILES += %s\n' % dep_file)
             if obj.script:
                 backend_file.write("""{output}: {script}{inputs}{backend}
 \t$(REPORT_BUILD)
 \t$(call py_action,file_generate,{script} {method} {output} $(MDDEPDIR)/{dep_file}{inputs}{flags})
 
 """.format(output=obj.output,
            dep_file=dep_file,
--- a/python/mozbuild/mozbuild/frontend/context.py
+++ b/python/mozbuild/mozbuild/frontend/context.py
@@ -959,17 +959,17 @@ VARIABLES = {
         into ``script`` can be specified::
 
           GENERATED_FILES += ['bar.c']
           bar = GENERATED_FILES['bar.c']
           bar.script = 'generate.py:make_bar'
 
         The chosen script entry point may optionally return a set of strings,
         indicating extra files the output depends on.
-        """, 'export'),
+        """, None),
 
     'DEFINES': (InitializedDefines, dict,
         """Dictionary of compiler defines to declare.
 
         These are passed in to the compiler as ``-Dkey='value'`` for string
         values, ``-Dkey=value`` for numeric values, or ``-Dkey`` if the
         value is True. Note that for string values, the outer-level of
         single-quotes will be consumed by the shell. If you want to have
--- a/python/mozbuild/mozbuild/test/backend/test_recursivemake.py
+++ b/python/mozbuild/mozbuild/test/backend/test_recursivemake.py
@@ -380,29 +380,32 @@ class TestRecursiveMakeBackend(BackendTe
     def test_generated_files(self):
         """Ensure GENERATED_FILES is handled properly."""
         env = self._consume('generated-files', RecursiveMakeBackend)
 
         backend_path = mozpath.join(env.topobjdir, 'backend.mk')
         lines = [l.strip() for l in open(backend_path, 'rt').readlines()[2:]]
 
         expected = [
-            'GENERATED_FILES += bar.c',
+            'export:: bar.c',
+            'GARBAGE += bar.c',
             'EXTRA_MDDEPEND_FILES += bar.c.pp',
             'bar.c: %s/generate-bar.py' % env.topsrcdir,
             '$(REPORT_BUILD)',
             '$(call py_action,file_generate,%s/generate-bar.py baz bar.c $(MDDEPDIR)/bar.c.pp)' % env.topsrcdir,
             '',
-            'GENERATED_FILES += foo.c',
+            'export:: foo.c',
+            'GARBAGE += foo.c',
             'EXTRA_MDDEPEND_FILES += foo.c.pp',
             'foo.c: %s/generate-foo.py %s/foo-data' % (env.topsrcdir, env.topsrcdir),
             '$(REPORT_BUILD)',
             '$(call py_action,file_generate,%s/generate-foo.py main foo.c $(MDDEPDIR)/foo.c.pp %s/foo-data)' % (env.topsrcdir, env.topsrcdir),
             '',
-            'GENERATED_FILES += quux.c',
+            'export:: quux.c',
+            'GARBAGE += quux.c',
             'EXTRA_MDDEPEND_FILES += quux.c.pp',
         ]
 
         self.maxDiff = None
         self.assertEqual(lines, expected)
 
     def test_exports_generated(self):
         """Ensure EXPORTS that are listed in GENERATED_FILES
@@ -421,23 +424,27 @@ class TestRecursiveMakeBackend(BackendTe
         self.assertIn('mozilla/mozilla2.h', m)
         self.assertIn('mozilla/dom/dom2.h', m)
         self.assertIn('mozilla/dom/dom3.h', m)
         # EXPORTS files that are also GENERATED_FILES should be handled as
         # INSTALL_TARGETS.
         backend_path = mozpath.join(env.topobjdir, 'backend.mk')
         lines = [l.strip() for l in open(backend_path, 'rt').readlines()[2:]]
         expected = [
-            'GENERATED_FILES += bar.h',
+            'export:: bar.h',
+            'GARBAGE += bar.h',
             'EXTRA_MDDEPEND_FILES += bar.h.pp',
-            'GENERATED_FILES += mozilla2.h',
+            'export:: mozilla2.h',
+            'GARBAGE += mozilla2.h',
             'EXTRA_MDDEPEND_FILES += mozilla2.h.pp',
-            'GENERATED_FILES += dom2.h',
+            'export:: dom2.h',
+            'GARBAGE += dom2.h',
             'EXTRA_MDDEPEND_FILES += dom2.h.pp',
-            'GENERATED_FILES += dom3.h',
+            'export:: dom3.h',
+            'GARBAGE += dom3.h',
             'EXTRA_MDDEPEND_FILES += dom3.h.pp',
             'dist_include_FILES += bar.h',
             'dist_include_DEST := $(DEPTH)/dist/include/',
             'dist_include_TARGET := export',
             'INSTALL_TARGETS += dist_include',
             'dist_include_mozilla_FILES += mozilla2.h',
             'dist_include_mozilla_DEST := $(DEPTH)/dist/include/mozilla',
             'dist_include_mozilla_TARGET := export',