Bug 1244941 - Don't fill install manifest with artifacts. r=nalexander

Since bug 1239217, artifacts builds are using a hybrid build system that
uses the fastermake rules to copy files to dist/bin, which means
artifact files are not removed by the processing of the dist/bin install
manifest. This means we don't need to add them to the recursivemake
install manifest anymore.
This commit is contained in:
Mike Hommey 2016-02-02 09:33:14 +09:00
parent 1632f24fb6
commit 5d5adb69da
2 changed files with 10 additions and 35 deletions

View File

@ -729,7 +729,7 @@ class Artifacts(object):
return urls
return None
def install_from_file(self, filename, distdir, install_callback=None):
def install_from_file(self, filename, distdir):
self.log(logging.INFO, 'artifact',
{'filename': filename},
'Installing from {filename}')
@ -769,19 +769,17 @@ class Artifacts(object):
perms = info.external_attr >> 16 # See http://stackoverflow.com/a/434689.
perms |= stat.S_IWUSR | stat.S_IRUSR | stat.S_IRGRP | stat.S_IROTH # u+w, a+r.
os.chmod(n, perms)
if install_callback:
install_callback(info.filename, file_existed, file_updated)
return 0
def install_from_url(self, url, distdir, install_callback=None):
def install_from_url(self, url, distdir):
self.log(logging.INFO, 'artifact',
{'url': url},
'Installing from {url}')
with self._artifact_cache as artifact_cache: # The with block handles persistence.
filename = artifact_cache.fetch(url)
return self.install_from_file(filename, distdir, install_callback=install_callback)
return self.install_from_file(filename, distdir)
def install_from_hg(self, revset, distdir, install_callback=None):
def install_from_hg(self, revset, distdir):
if not revset:
revset = '.'
rev_pushheads = self._find_pushheads(revset)
@ -797,7 +795,7 @@ class Artifacts(object):
self._job, rev, trees)
if urls:
for url in urls:
if self.install_from_url(url, distdir, install_callback=install_callback):
if self.install_from_url(url, distdir):
return 1
return 0
self.log(logging.ERROR, 'artifact',
@ -805,21 +803,15 @@ class Artifacts(object):
'No built artifacts for {revset} found.')
return 1
def install_from(self, source, distdir, install_callback=None):
def install_from(self, source, distdir):
"""Install artifacts from a ``source`` into the given ``distdir``.
If ``callback`` is given, it is called once with arguments ``(path,
existed, updated)``, where ``path`` is the file path written relative
to ``distdir``; ``existed`` is a boolean indicating whether the file
existed; and ``updated`` is a boolean indicating whether the file was
updated.
"""
if source and os.path.isfile(source):
return self.install_from_file(source, distdir, install_callback=install_callback)
return self.install_from_file(source, distdir)
elif source and urlparse.urlparse(source).scheme:
return self.install_from_url(source, distdir, install_callback=install_callback)
return self.install_from_url(source, distdir)
else:
return self.install_from_hg(source, distdir, install_callback=install_callback)
return self.install_from_hg(source, distdir)
def print_last(self):
self.log(logging.INFO, 'artifact',

View File

@ -1503,24 +1503,7 @@ class PackageFrontend(MachCommandBase):
job = self._compute_platform(job)
artifacts = self._make_artifacts(tree=tree, job=job)
manifest_path = mozpath.join(self.topobjdir, '_build_manifests', 'install', 'dist_bin')
manifest = InstallManifest(manifest_path)
def install_callback(path, file_existed, file_updated):
# Our paths are either under dist/bin or dist/plugins (for test
# plugins). dist/plugins. does not have an install manifest.
if not path.startswith('bin/'):
return
path = path[len('bin/'):]
if path not in manifest:
manifest.add_optional_exists(path)
retcode = artifacts.install_from(source, self.distdir, install_callback=install_callback)
if retcode == 0:
manifest.write(manifest_path)
return retcode
return artifacts.install_from(source, self.distdir)
@ArtifactSubCommand('artifact', 'last',
'Print the last pre-built artifact installed.')