From 61cc93d57d7e2c4780cf23741e240cc56a2a5702 Mon Sep 17 00:00:00 2001
From: Tristan van Berkom <tristan@codethink.co.uk>
Date: Tue, 8 Dec 2020 16:52:44 +0900
Subject: plugins/elements/stack.py: Require all dependencies be build & run.

Stack elements cannot be build-only dependencies, as this would defeat
the purpose of using stack elements in order to directly build-depend on
them.

Stack element dependencies must all be built in order to build depend
on them, and as such we gain no build parallelism by allowing runtime-only
dependencies on stack elements. Declaring a runtime-only dependency on
a stack element as a whole might still be useful, but still requires the
entire stack to be built at the time we need that stack.

Instead, it is more useful to ensure that a stack element is a logical
group of all dependencies, including runtime dependencies, such that we
can guarantee cache key alignment with all stack dependencies.

This allows for stronger reliability in commands such as
`bst artifact checkout`, which can now reliably download and checkout
a fully built stack as a result, without any uncertainty about possible
runtime-only dependencies which might exist in the project where that
artifact was created.

This consequently closes #1075

This also fixes the following tests such that the no longer
require build-depends or runtime-depends to work in stack elements:

 * tests/frontend/default_target.py: Was not necessary to check results of show,
   these stacks were set to runtime-depends so that they would have the same
   buildable state as their dependencies when shown.

 * tests/format/dependencies.py: tests/frontend/pull.py, test/frontend/show.py,
   tests/integration/compose.py:
   These tests were using specific build/runtime dependencies in stacks, but
   for no particular reason.
---
 tests/format/dependencies1/elements/builddep-list.bst | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

(limited to 'tests/format/dependencies1/elements/builddep-list.bst')

diff --git a/tests/format/dependencies1/elements/builddep-list.bst b/tests/format/dependencies1/elements/builddep-list.bst
index a0cbcaf23..eb216a127 100644
--- a/tests/format/dependencies1/elements/builddep-list.bst
+++ b/tests/format/dependencies1/elements/builddep-list.bst
@@ -1,4 +1,4 @@
-kind: stack
+kind: manual
 description: This element has a build-only dependency specified via build-depends
 build-depends:
-  - firstdep.bst
+- firstdep.bst
-- 
cgit v1.2.1

