<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/buildstream.git/src/buildstream/plugins, branch master</title>
<subtitle>gitlab.com: buildstream/buildstream.git
</subtitle>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/buildstream.git/'/>
<entry>
<title>plugins/elements/stack.py: Require all dependencies be build &amp; run.</title>
<updated>2020-12-10T12:40:20+00:00</updated>
<author>
<name>Tristan van Berkom</name>
<email>tristan@codethink.co.uk</email>
</author>
<published>2020-12-08T07:52:44+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/buildstream.git/commit/?id=61cc93d57d7e2c4780cf23741e240cc56a2a5702'/>
<id>61cc93d57d7e2c4780cf23741e240cc56a2a5702</id>
<content type='text'>
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.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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.
</pre>
</div>
</content>
</entry>
<entry>
<title>plugins/elements/junction.py: Documenting element overrides.</title>
<updated>2020-11-04T05:39:06+00:00</updated>
<author>
<name>Tristan van Berkom</name>
<email>tristan@codethink.co.uk</email>
</author>
<published>2020-10-31T13:15:08+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/buildstream.git/commit/?id=6bf78c0734f0ff22fe0eef090b794f0a1b1a3fb8'/>
<id>6bf78c0734f0ff22fe0eef090b794f0a1b1a3fb8</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Refactor: Lazily instantiate ProvenanceInformation objects</title>
<updated>2020-10-01T04:27:30+00:00</updated>
<author>
<name>Tristan van Berkom</name>
<email>tristan.vanberkom@codethink.co.uk</email>
</author>
<published>2020-08-13T10:01:00+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/buildstream.git/commit/?id=751c80d4938b7c3a798d056134f58844242939b3'/>
<id>751c80d4938b7c3a798d056134f58844242939b3</id>
<content type='text'>
As a rule, throughout the codebase we should not be using internal
ProvenanceInformation objects in our APIs, but rather Node objects.

This is because ProvenanceInformation is generated on the fly from
a Node object, and it is needlessly expensive to instantiate one before
it is absolutely needed.

This patch unilaterally fixes the codebase to pass `provenance_node`
Node objects around as arguments rather than `provenance` ProvenanceInformation
objects.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
As a rule, throughout the codebase we should not be using internal
ProvenanceInformation objects in our APIs, but rather Node objects.

This is because ProvenanceInformation is generated on the fly from
a Node object, and it is needlessly expensive to instantiate one before
it is absolutely needed.

This patch unilaterally fixes the codebase to pass `provenance_node`
Node objects around as arguments rather than `provenance` ProvenanceInformation
objects.
</pre>
</div>
</content>
</entry>
<entry>
<title>filter.py: Combine integration commands in assemble()</title>
<updated>2020-09-24T12:41:10+00:00</updated>
<author>
<name>Jürg Billeter</name>
<email>j@bitron.ch</email>
</author>
<published>2020-09-23T09:24:43+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/buildstream.git/commit/?id=d3e07d90e61cfa3d7cf91012218ed5d45abfc982'/>
<id>d3e07d90e61cfa3d7cf91012218ed5d45abfc982</id>
<content type='text'>
Plugins must not access public data of build dependencies in
`integrate()` as the build dependencies are not guaranteed to be cached
at that stage.

This combines integration commands of the sole build dependency and the
filter element itself at time of assembly instead of integration.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Plugins must not access public data of build dependencies in
`integrate()` as the build dependencies are not guaranteed to be cached
at that stage.

This combines integration commands of the sole build dependency and the
filter element itself at time of assembly instead of integration.
</pre>
</div>
</content>
</entry>
<entry>
<title>source.py: Remove BST_KEY_REQUIRES_STAGE</title>
<updated>2020-09-24T09:09:58+00:00</updated>
<author>
<name>Tristan van Berkom</name>
<email>tristan@codethink.co.uk</email>
</author>
<published>2020-09-23T07:44:36+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/buildstream.git/commit/?id=b583317c7954d29fce60728486537e945e0d9c28'/>
<id>b583317c7954d29fce60728486537e945e0d9c28</id>
<content type='text'>
Refactored this to remove unneeded complexity in the code base,
as described here:

  https://lists.apache.org/thread.html/r4b9517742433f07c79379ba5b67932cfe997c1e64965a9f1a2b613fc%40%3Cdev.buildstream.apache.org%3E

Changes:

  * source.py: Added private Source._cache_directory() context manager

    We also move the assertion about nodes which are safe to write to
    a bit lower in Source._set_ref(), as this was unnecessarily early.

    When tracking a workspace, the ref will be none and will turn out
    to be none afterwards, it is not a problem that a workspace's node
    is a synthetic one, as tracking will never affect it.

  * local plugin: Implement get_unique_key() and stage() using
    the new context manager in order to optimize staging and
    cache key calculations here.

  * workspace plugin: Implement get_unique_key() and stage() using
    the new context manager in order to optimize staging and
    cache key calculations here.

  * trackqueue.py: No special casing with Source._is_trackable()
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Refactored this to remove unneeded complexity in the code base,
as described here:

  https://lists.apache.org/thread.html/r4b9517742433f07c79379ba5b67932cfe997c1e64965a9f1a2b613fc%40%3Cdev.buildstream.apache.org%3E

Changes:

  * source.py: Added private Source._cache_directory() context manager

    We also move the assertion about nodes which are safe to write to
    a bit lower in Source._set_ref(), as this was unnecessarily early.

    When tracking a workspace, the ref will be none and will turn out
    to be none afterwards, it is not a problem that a workspace's node
    is a synthetic one, as tracking will never affect it.

  * local plugin: Implement get_unique_key() and stage() using
    the new context manager in order to optimize staging and
    cache key calculations here.

  * workspace plugin: Implement get_unique_key() and stage() using
    the new context manager in order to optimize staging and
    cache key calculations here.

  * trackqueue.py: No special casing with Source._is_trackable()
</pre>
</div>
</content>
</entry>
<entry>
<title>ScriptElement: Porting to new API</title>
<updated>2020-09-18T03:38:49+00:00</updated>
<author>
<name>Tristan van Berkom</name>
<email>tristan@codethink.co.uk</email>
</author>
<published>2020-09-04T09:15:09+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/buildstream.git/commit/?id=e135b78d04dd9688c36bcf97de66419e11c3ed46'/>
<id>e135b78d04dd9688c36bcf97de66419e11c3ed46</id>
<content type='text'>
Instead of relying on Element.search(), use Element.configure_dependencies() to
configure the layout.

Summary of changes:

  * scriptelement.py:

    Change ScriptElement.layout_add() API to take an Element instead of an element name,
    this is now not optional (one cannot specify a `None` element).

    This is an API breaking change

  * plugins/elements/script.py:

    Implement Element.configure_dependencies() in order to call ScriptElement.layout_add().

    This is a breaking YAML format change.

  * tests/integration: Script integration tests updated to use the new YAML format

  * tests/cachekey: Updated for `script` element changes
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Instead of relying on Element.search(), use Element.configure_dependencies() to
configure the layout.

Summary of changes:

  * scriptelement.py:

    Change ScriptElement.layout_add() API to take an Element instead of an element name,
    this is now not optional (one cannot specify a `None` element).

    This is an API breaking change

  * plugins/elements/script.py:

    Implement Element.configure_dependencies() in order to call ScriptElement.layout_add().

    This is a breaking YAML format change.

  * tests/integration: Script integration tests updated to use the new YAML format

  * tests/cachekey: Updated for `script` element changes
</pre>
</div>
</content>
</entry>
<entry>
<title>filter plugin: Stage the artifacts in Element.stage()</title>
<updated>2020-09-18T03:36:34+00:00</updated>
<author>
<name>Tristan van Berkom</name>
<email>tristan@codethink.co.uk</email>
</author>
<published>2020-09-10T12:34:50+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/buildstream.git/commit/?id=eb0a8c2856f7291b44170dce6f67d9bc8b26b61c'/>
<id>eb0a8c2856f7291b44170dce6f67d9bc8b26b61c</id>
<content type='text'>
Staging artifacts at Element.assemble() time is now illegal
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Staging artifacts at Element.assemble() time is now illegal
</pre>
</div>
</content>
</entry>
<entry>
<title>compose plugin: Stage the artifacts in Element.stage()</title>
<updated>2020-09-18T03:36:34+00:00</updated>
<author>
<name>Tristan van Berkom</name>
<email>tristan@codethink.co.uk</email>
</author>
<published>2020-09-09T08:06:02+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/buildstream.git/commit/?id=4dcc087b1e6db039708c5cb11b37fb6ebd27d2c1'/>
<id>4dcc087b1e6db039708c5cb11b37fb6ebd27d2c1</id>
<content type='text'>
It will now be illegal to call Element.stage_dependency_artifacts() outside
of the Element.stage() abstract method.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
It will now be illegal to call Element.stage_dependency_artifacts() outside
of the Element.stage() abstract method.
</pre>
</div>
</content>
</entry>
<entry>
<title>element.py: Hide dependencies which are irrelevant to the Element</title>
<updated>2020-09-04T09:22:38+00:00</updated>
<author>
<name>Tristan van Berkom</name>
<email>tristan@codethink.co.uk</email>
</author>
<published>2020-08-30T06:57:13+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/buildstream.git/commit/?id=1a3e4e89fc86b29342c9ec62ca8915b6eae084d2'/>
<id>1a3e4e89fc86b29342c9ec62ca8915b6eae084d2</id>
<content type='text'>
This is a large breaking change, a summary of the changes are that:

  * The Scope type is now private, since Element plugins do not have
    the choice to view any other scopes.

  * Element.dependencies() API change

    Now it accepts a "selection" (sequence) of dependency elements, so
    that Element.dependencies() can iterate over a collection of dependencies,
    ensuring that we iterate over every element only once even when we
    need to iterate over multiple element's dependencies.

    The old API is moved to Element._dependencies() and still used internally.

  * Element.stage_dependency_artifacts() API change

    This gets the same treatment as Element.dependencies(), and the old
    API is also preserved as Element._stage_dependency_artifacts(), so
    that the CLI can stage things for `bst artifact checkout` and such.

  * Element.search() API change

    The Scope argument is removed, and the old API is preserved as
    Element._search() temporarily, until we can remove this completely.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is a large breaking change, a summary of the changes are that:

  * The Scope type is now private, since Element plugins do not have
    the choice to view any other scopes.

  * Element.dependencies() API change

    Now it accepts a "selection" (sequence) of dependency elements, so
    that Element.dependencies() can iterate over a collection of dependencies,
    ensuring that we iterate over every element only once even when we
    need to iterate over multiple element's dependencies.

    The old API is moved to Element._dependencies() and still used internally.

  * Element.stage_dependency_artifacts() API change

    This gets the same treatment as Element.dependencies(), and the old
    API is also preserved as Element._stage_dependency_artifacts(), so
    that the CLI can stage things for `bst artifact checkout` and such.

  * Element.search() API change

    The Scope argument is removed, and the old API is preserved as
    Element._search() temporarily, until we can remove this completely.
</pre>
</div>
</content>
</entry>
<entry>
<title>Element.dependencies() now yields ElementProxy wrappers by default.</title>
<updated>2020-09-04T09:22:38+00:00</updated>
<author>
<name>Tristan van Berkom</name>
<email>tristan@codethink.co.uk</email>
</author>
<published>2020-08-24T07:53:06+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/buildstream.git/commit/?id=97812cbb7d295cc3d270be9205cbc12313215028'/>
<id>97812cbb7d295cc3d270be9205cbc12313215028</id>
<content type='text'>
This prepares the ground for policing the dependencies which are visible
to an Element plugin, such that plugins are only allowed to see the
elements in their Scope.BUILD scope, even if they call Element.dependencies()
on a dependency.

This commit does the following:

  * Element.dependencies() is now a user facing frontend which yields
    ElementProxy elements instead of Elements.

  * Various core codepaths have been updated to call the internal
    Element._dependencies() codepath which still returns Elements.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This prepares the ground for policing the dependencies which are visible
to an Element plugin, such that plugins are only allowed to see the
elements in their Scope.BUILD scope, even if they call Element.dependencies()
on a dependency.

This commit does the following:

  * Element.dependencies() is now a user facing frontend which yields
    ElementProxy elements instead of Elements.

  * Various core codepaths have been updated to call the internal
    Element._dependencies() codepath which still returns Elements.
</pre>
</div>
</content>
</entry>
</feed>
