From 1d0357d014d2acedc3bf6b13b52fc71223fcdb80 Mon Sep 17 00:00:00 2001 From: Mike Hommey Date: Sat, 12 Sep 2015 11:44:53 +0900 Subject: [PATCH] Bug 1204719 - Don't create interfaces.manifest files from the build backend. r=gps --- config/makefiles/xpidl/Makefile.in | 10 ++++++++-- python/mozbuild/mozbuild/action/buildlist.py | 6 +++++- .../mozbuild/mozbuild/backend/recursivemake.py | 16 ++++++++++------ 3 files changed, 23 insertions(+), 9 deletions(-) diff --git a/config/makefiles/xpidl/Makefile.in b/config/makefiles/xpidl/Makefile.in index caac1d98b9b..a952fdfd210 100644 --- a/config/makefiles/xpidl/Makefile.in +++ b/config/makefiles/xpidl/Makefile.in @@ -61,8 +61,14 @@ endif chrome_manifests := @chrome_manifests@ +%/interfaces.manifest: Makefile + $(call py_action,buildlist,$@ $(foreach xpt,$(filter $*/%,$(registered_xpt_files)),'interfaces $(notdir $(xpt))')) + +interfaces_manifests := @interfaces_manifests@ + xpidl_modules := @xpidl_modules@ -xpt_files := @xpt_files@ +registered_xpt_files := @registered_xpt_files@ +xpt_files := $(registered_xpt_files) @xpt_files@ @xpidl_rules@ @@ -70,7 +76,7 @@ depends_files := $(foreach root,$(xpidl_modules),$(idl_deps_dir)/$(root).pp) GARBAGE += $(xpt_files) $(depends_files) -xpidl:: $(xpt_files) $(chrome_manifests) +xpidl:: $(xpt_files) $(chrome_manifests) $(interfaces_manifests) $(xpt_files): $(process_py) $(call mkdir_deps,$(idl_deps_dir) $(dist_include_dir)) diff --git a/python/mozbuild/mozbuild/action/buildlist.py b/python/mozbuild/mozbuild/action/buildlist.py index 6076b6999b9..4c25e09449a 100644 --- a/python/mozbuild/mozbuild/action/buildlist.py +++ b/python/mozbuild/mozbuild/action/buildlist.py @@ -12,12 +12,16 @@ from __future__ import absolute_import, print_function import sys import os -from mozbuild.util import lock_file +from mozbuild.util import ( + ensureParentDir, + lock_file, +) def addEntriesToListFile(listFile, entries): """Given a file |listFile| containing one entry per line, add each entry in |entries| to the file, unless it is already present.""" + ensureParentDir(listFile) lock = lock_file(listFile + ".lck") try: if os.path.exists(listFile): diff --git a/python/mozbuild/mozbuild/backend/recursivemake.py b/python/mozbuild/mozbuild/backend/recursivemake.py index c61f39e0642..d2e8daa743c 100644 --- a/python/mozbuild/mozbuild/backend/recursivemake.py +++ b/python/mozbuild/mozbuild/backend/recursivemake.py @@ -1100,6 +1100,7 @@ INSTALL_TARGETS += %(prefix)s modules = manager.modules xpt_modules = sorted(modules.keys()) xpt_files = set() + registered_xpt_files = set() mk = Makefile() @@ -1131,15 +1132,16 @@ INSTALL_TARGETS += %(prefix)s rules = StringIO() mk.dump(rules, removal_guard=False) - # Write out manifests defining interfaces + interfaces_manifests = [] dist_dir = mozpath.join(self.environment.topobjdir, 'dist') for manifest, entries in manager.interface_manifests.items(): - path = mozpath.join(self.environment.topobjdir, manifest) - with self._write_file(path) as fh: - for xpt in sorted(entries): - fh.write('interfaces %s\n' % xpt) + interfaces_manifests.append(mozpath.join('$(DEPTH)', manifest)) + for xpt in sorted(entries): + registered_xpt_files.add(mozpath.join( + '$(DEPTH)', mozpath.dirname(manifest), xpt)) if install_target.startswith('dist/'): + path = mozpath.join(self.environment.topobjdir, manifest) path = mozpath.relpath(path, dist_dir) prefix, subpath = path.split('/', 1) key = 'dist_%s' % prefix @@ -1162,9 +1164,11 @@ INSTALL_TARGETS += %(prefix)s obj.config = self.environment self._create_makefile(obj, extra=dict( chrome_manifests = ' '.join(chrome_manifests), + interfaces_manifests = ' '.join(interfaces_manifests), xpidl_rules=rules.getvalue(), xpidl_modules=' '.join(xpt_modules), - xpt_files=' '.join(sorted(xpt_files)), + xpt_files=' '.join(sorted(xpt_files - registered_xpt_files)), + registered_xpt_files=' '.join(sorted(registered_xpt_files)), )) def _process_program(self, program, backend_file):