From 458dc35b773092b96a50ddb047345392530bf42a Mon Sep 17 00:00:00 2001 From: Mike Shal Date: Fri, 30 Sep 2016 11:16:41 -0400 Subject: [PATCH] Bug 1315810 - Use tup's internal symlinking instead of build manifests; r=chmanchester MozReview-Commit-ID: LNsbghIGJvH --HG-- extra : rebase_source : 475bfbb846910095ae3d8f4b9d3412bd22b0eab5 --- Makefile.in | 2 +- python/mozbuild/mozbuild/backend/tup.py | 27 +++++++++++++++++++++---- 2 files changed, 24 insertions(+), 5 deletions(-) diff --git a/Makefile.in b/Makefile.in index f196af545029..de5a471d189f 100644 --- a/Makefile.in +++ b/Makefile.in @@ -175,7 +175,7 @@ endif tup: $(call BUILDSTATUS,TIERS make tup) $(call BUILDSTATUS,TIER_START make) - $(MAKE) install-manifests buildid.h source-repo.h + $(MAKE) buildid.h source-repo.h $(call BUILDSTATUS,TIER_FINISH make) $(call BUILDSTATUS,TIER_START tup) @$(TUP) $(if $(findstring s,$(filter-out --%,$(MAKEFLAGS))),,--verbose) diff --git a/python/mozbuild/mozbuild/backend/tup.py b/python/mozbuild/mozbuild/backend/tup.py index 0f7250eb0155..084166bcf037 100644 --- a/python/mozbuild/mozbuild/backend/tup.py +++ b/python/mozbuild/mozbuild/backend/tup.py @@ -80,6 +80,19 @@ class BackendTupfile(object): 'extra_outputs': ' | ' + ' '.join(extra_outputs) if extra_outputs else '', }) + def symlink_rule(self, source, output_group=None): + outputs = [mozpath.basename(source)] + if output_group: + outputs.append(output_group) + + # The !tup_ln macro does a symlink or file copy (depending on the + # platform) without shelling out to a subprocess. + self.rule( + cmd=['!tup_ln'], + inputs=[source], + outputs=outputs, + ) + def export_shell(self): if not self.shell_exported: # These are used by mach/mixin/process.py to determine the current @@ -106,6 +119,10 @@ class TupOnly(CommonBackend, PartialBackend): self._backend_files = {} self._cmd = MozbuildObject.from_environment() + # This is a 'group' dependency - All rules that list this as an output + # will be built before any rules that list this as an input. + self._installed_files = '$(MOZ_OBJ_ROOT)/' + def _get_backend_file(self, relativedir): objdir = mozpath.join(self.environment.topobjdir, relativedir) srcdir = mozpath.join(self.environment.topsrcdir, relativedir) @@ -133,11 +150,8 @@ class TupOnly(CommonBackend, PartialBackend): return False consumed = CommonBackend.consume_object(self, obj) - - # Even if CommonBackend acknowledged the object, we still need to let - # the RecursiveMake backend also handle these objects. if consumed: - return False + return True backend_file = self._get_backend_file_for(obj) @@ -250,6 +264,10 @@ class TupOnly(CommonBackend, PartialBackend): destdir=mozpath.join(self.environment.topobjdir, obj.install_target, path)) def _handle_idl_manager(self, manager): + dist_idl_backend_file = self._get_backend_file('dist/idl') + for idl in manager.idls.values(): + dist_idl_backend_file.symlink_rule(idl['source'], output_group=self._installed_files) + backend_file = self._get_backend_file('xpcom/xpidl') backend_file.export_shell() @@ -275,6 +293,7 @@ class TupOnly(CommonBackend, PartialBackend): inputs=[ '$(MOZ_OBJ_ROOT)/xpcom/idl-parser/xpidl/xpidllex.py', '$(MOZ_OBJ_ROOT)/xpcom/idl-parser/xpidl/xpidlyacc.py', + self._installed_files, ], display='XPIDL %s' % module, cmd=cmd,