Bug 1315810 - Use tup's internal symlinking instead of build manifests; r=chmanchester

MozReview-Commit-ID: LNsbghIGJvH

--HG--
extra : rebase_source : 475bfbb846910095ae3d8f4b9d3412bd22b0eab5
This commit is contained in:
Mike Shal 2016-09-30 11:16:41 -04:00
parent 86a6edf21c
commit 458dc35b77
2 changed files with 24 additions and 5 deletions

View File

@ -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)

View File

@ -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)/<installed-files>'
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,