Bug 1547395 - Allow specific tasks in the use-pgo field; r=tomprince

Some groups of tasks need to share the same profile data. For example,
Android PGO builds and Android Nightly builds both use the
generate-profile-android-api-16/pgo task for profile data. Previously
this was done with a text substitution, but this is a bit hacky and
doesn't easily scale with different build types.

Allowing use_pgo to be a string means we can just directly point to the
generate-profile task that contains the profile data to be used in a PGO
build.

Differential Revision: https://phabricator.services.mozilla.com/D29247

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Mike Shal 2019-04-30 15:55:45 +00:00
Родитель 329acb6ec4
Коммит 4a3296488a
2 изменённых файлов: 10 добавлений и 6 удалений

Просмотреть файл

@ -384,7 +384,7 @@ android-api-16-without-google-play-services/opt:
android-api-16-nightly/opt:
description: "Android 4.0 api-16+ Nightly"
use-pgo: true
use-pgo: android-api-16/pgo
attributes:
nightly: true
enable-full-crashsymbols: true

Просмотреть файл

@ -103,14 +103,18 @@ def mozconfig(config, jobs):
@transforms.add
def use_profile_data(config, jobs):
for job in jobs:
if not job.pop('use-pgo', False):
use_pgo = job.pop('use-pgo', False)
if not use_pgo:
yield job
continue
# Nightlies use the same profile information as a regular PGO build.
name = job['name']
if name.endswith('-nightly/opt'):
name = name.replace('-nightly/opt', '/pgo')
# If use_pgo is True, the task uses the generate-profile task of the
# same name. Otherwise a task can specify a specific generate-profile
# task to use in the use_pgo field.
if use_pgo is True:
name = job['name']
else:
name = use_pgo
dependencies = 'generate-profile-{}'.format(name)
job.setdefault('dependencies', {})['generate-profile'] = dependencies
job.setdefault('fetches', {})['generate-profile'] = ['profdata.tar.xz']