Commit 1ec80edc authored by Tristan Van Berkom's avatar Tristan Van Berkom

_frontend/cli.py: Fetch all elements when tracking a build plan

It makes not sense to type `bst fetch --track --deps all <targets>`,
because tracking will inevitably modify the build plan.

Stream initialization will not cope with this either, instead of
silently doing something which does not make any sense, we add an
assertion that this should not happen.

Unfortunately since `plan` is the default deps type for `bst fetch`,
this is likely to happen so it's important to correct.

This patch adds a warning in the case tracking of the build plan
elements is requested, and converts the request to track all elements
instead.
parent 5bdc0a79
Pipeline #21693133 passed with stages
in 17 minutes and 17 seconds
......@@ -275,10 +275,17 @@ def fetch(app, elements, deps, track_, except_, track_cross_junctions):
plan: Only dependencies required for the build plan
all: All dependencies
"""
from .._pipeline import PipelineSelection
if track_cross_junctions and not track_:
click.echo("ERROR: The --track-cross-junctions option can only be used with --track", err=True)
sys.exit(-1)
if track_ and deps == PipelineSelection.PLAN:
click.echo("WARNING: --track specified for tracking of a build plan\n\n"
"Since tracking modifies the build plan, all elements will be tracked.", err=True)
deps = PipelineSelection.ALL
with app.initialized(session_name="Fetch"):
app.stream.fetch(elements,
selection=deps,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment