Bug 1420449: Add mach taskgraph -F/--fast r=ahal

Initially this will skip toolchain task optimizations, which avoids hashing
local directory contents and speeds up taskgraph generation by about 25%.

MozReview-Commit-ID: B4LB5BV86nw

--HG--
extra : rebase_source : c41e4d838e8920b865cd62bb8de38e64b85b2d84
This commit is contained in:
Chris AtLee 2017-11-30 12:07:02 -05:00
parent f0c6dabd84
commit 7bdb7826e2
3 changed files with 28 additions and 15 deletions

View File

@ -51,7 +51,9 @@ class ShowTaskGraphSubCommand(SubCommand):
"index (a.k.a. optimize the graph)"),
CommandArgument('--tasks-regex', '--tasks', default=None,
help="only return tasks with labels matching this regular "
"expression.")
"expression."),
CommandArgument('-F', '--fast', dest='fast', default=False, action='store_true',
help="enable fast task generation for local debugging.")
]
for arg in args:
@ -316,6 +318,9 @@ class MachCommands(MachCommandBase):
import taskgraph.parameters
import taskgraph.target_tasks
import taskgraph.generator
import taskgraph
if options['fast']:
taskgraph.fast = True
try:
self.setup_logging(quiet=options['quiet'], verbose=options['verbose'])

View File

@ -7,3 +7,8 @@ from __future__ import absolute_import, print_function, unicode_literals
import os
GECKO = os.path.realpath(os.path.join(__file__, '..', '..', '..'))
# Enable fast task generation for local debugging
# This is normally switched on via the --fast/-F flag to `mach taskgraph`
# Currently this skips toolchain task optimizations
fast = False

View File

@ -22,6 +22,7 @@ from taskgraph.transforms.job.common import (
from taskgraph.util.hash import hash_paths
from taskgraph import GECKO
from taskgraph.util.cached_tasks import add_optimization
import taskgraph
CACHE_TYPE = 'toolchains.v2'
@ -155,13 +156,14 @@ def docker_worker_toolchain(config, job, taskdesc):
if 'toolchain-alias' in run:
attributes['toolchain-alias'] = run['toolchain-alias']
name = taskdesc['label'].replace('{}-'.format(config.kind), '', 1)
add_optimization(
config, taskdesc,
cache_type=CACHE_TYPE,
cache_name=name,
digest_data=get_digest_data(config, run, taskdesc),
)
if not taskgraph.fast:
name = taskdesc['label'].replace('{}-'.format(config.kind), '', 1)
add_optimization(
config, taskdesc,
cache_type=CACHE_TYPE,
cache_name=name,
digest_data=get_digest_data(config, run, taskdesc),
)
@run_job_using("generic-worker", "toolchain-script", schema=toolchain_run_schema)
@ -217,10 +219,11 @@ def windows_toolchain(config, job, taskdesc):
if 'toolchain-alias' in run:
attributes['toolchain-alias'] = run['toolchain-alias']
name = taskdesc['label'].replace('{}-'.format(config.kind), '', 1)
add_optimization(
config, taskdesc,
cache_type=CACHE_TYPE,
cache_name=name,
digest_data=get_digest_data(config, run, taskdesc),
)
if not taskgraph.fast:
name = taskdesc['label'].replace('{}-'.format(config.kind), '', 1)
add_optimization(
config, taskdesc,
cache_type=CACHE_TYPE,
cache_name=name,
digest_data=get_digest_data(config, run, taskdesc),
)