From 4a497d0294d675173eb26b3935fed063d4f86d27 Mon Sep 17 00:00:00 2001 From: Abderrahim Kitouni Date: Thu, 29 Jan 2026 18:11:50 +0100 Subject: [PATCH 1/2] _stream: Don't require runtime deps when building with --deps none Before this change, running a build with `--deps none` would also build / pull runtime dependencies. This commit changes the elements on the command line to not require their runtime dependencies if we're using `--deps none` --- src/buildstream/_stream.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/buildstream/_stream.py b/src/buildstream/_stream.py index 5b28002c0..a33f8b440 100644 --- a/src/buildstream/_stream.py +++ b/src/buildstream/_stream.py @@ -1775,8 +1775,13 @@ def _load( if not required_elements: required_elements = selected + if selection == _PipelineSelection.NONE: + scope = _Scope.NONE + else: + scope = _Scope.RUN + for element in required_elements: - element._set_required() + element._set_required(scope) return selected From 7a771c6163133af5ef9db8d44be14304eacbe2b8 Mon Sep 17 00:00:00 2001 From: Abderrahim Kitouni Date: Thu, 29 Jan 2026 20:35:25 +0100 Subject: [PATCH 2/2] Add config option for `dependencies: run` In addition to `none` and `all`, this commit adds `run` and makes it the default instead of `none`. The previous commit changed the meaning of `--deps none` to be different from `--deps run`, so we change the default to be `run`. --- doc/source/using_config.rst | 1 + src/buildstream/_context.py | 4 ++-- src/buildstream/_stream.py | 2 +- src/buildstream/data/userconfig.yaml | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/doc/source/using_config.rst b/doc/source/using_config.rst index 8911e3f70..3010eb0b7 100644 --- a/doc/source/using_config.rst +++ b/doc/source/using_config.rst @@ -381,6 +381,7 @@ Attributes values for this attribute are: * ``none``: Only build elements required to generate the expected target artifacts + * ``run``: Build required elements and their their runtime dependencies * ``all``: Build elements even if they are build dependencies of artifacts which are already cached diff --git a/src/buildstream/_context.py b/src/buildstream/_context.py index d11c906d7..48e8eff43 100644 --- a/src/buildstream/_context.py +++ b/src/buildstream/_context.py @@ -465,10 +465,10 @@ def load(self, config: Optional[str] = None) -> None: self.build_retry_failed = build.get_bool("retry-failed") dependencies = build.get_str("dependencies") - if dependencies not in ["none", "all"]: + if dependencies not in ["none", "run", "all"]: provenance = build.get_scalar("dependencies").get_provenance() raise LoadError( - "{}: Invalid value for 'dependencies'. Choose 'none' or 'all'.".format(provenance), + "{}: Invalid value for 'dependencies'. Choose 'none', 'run', or 'all'.".format(provenance), LoadErrorReason.INVALID_DATA, ) self.build_dependencies = _PipelineSelection(dependencies) diff --git a/src/buildstream/_stream.py b/src/buildstream/_stream.py index a33f8b440..a475bdb41 100644 --- a/src/buildstream/_stream.py +++ b/src/buildstream/_stream.py @@ -1766,7 +1766,7 @@ def _load( # rely on state changes during processing to determine which elements # must be processed. # - if selection == _PipelineSelection.NONE: + if selection in (_PipelineSelection.NONE, _PipelineSelection.RUN): required_elements = elements elif selection == _PipelineSelection.BUILD: required_elements = list(_pipeline.dependencies(elements, _Scope.BUILD, recurse=False)) diff --git a/src/buildstream/data/userconfig.yaml b/src/buildstream/data/userconfig.yaml index a84da10ae..76af0d6c8 100644 --- a/src/buildstream/data/userconfig.yaml +++ b/src/buildstream/data/userconfig.yaml @@ -93,7 +93,7 @@ build: # # Control which dependencies to build # - dependencies: none + dependencies: run #