| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
This allows the frontend to render pending messages.
|
|
|
|
|
|
|
| |
A utility for tests to check if subsecond precision mtime is supported
at a given filesystem path (it will depend on underlying filesystem, so
we cannot have a simple HAVE_SUBSECOND_MTIME variable to check, because
we don't know where tests will operate at this stage).
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When an override is specified, it might be specified using a link
element and that link element might not be otherwise used thus far
to load anything.
This patch makes the following changes to the loader:
* Add Loader._resolve_link()
A new function which updates a projects internal cache of link
elements and targets.
The link cache is updated any time a link element is resolved,
also parent project link caches are updated to have knowledge of
the subproject links.
* Add Loader._expand_link()
A function to expand links in user provided paths, so that
we can transform these to "real paths", i.e. project relative
paths wich any link elements substituted.
* Use Loader._expand_link() when matching a user specified override
from a junction to a real path.
* Add Loader._shallow_load_overrides()
This function simply ensures we perform a shallow load on any
elements specified as keys in the junction override dictionary,
in case they are links.
Shallow loading these elements does not cause them to inadvertently
load unrequired subprojects, nor can it cause any new elements to
be included in the build graph returned to the caller of the Loader
code (as the Loader code only returns dependencies of the specified
toplevels, even if other orthogonal elements happen to get loaded
as a side effect).
This is necessary to ensure we populate the link caches when a link
is used to specify an override, but is otherwise unused.
This fixes #1398
|
|
|
|
|
|
|
| |
called in jobs
This adds some assertions in the code to ensure we are not calling
methods with side effects on the graph of elements in jobs.
|
|
|
|
|
|
|
|
|
|
| |
This removes a call to `__update_cache_key_non_strict()` in the job for
non strict builds. This call has an impact on other elements and should
never be done beforehand.
This however means we need to compute cache keys before, and we
therefore need to re-compute the cache keys as an element become
buildable
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
| |
As per #819, BuildStream should pull missing artifacts by default. The
previous behavior was to only pull missing buildtrees. A top-level
`--no-pull` option can easily be supported in the future.
This change makes it possible to use a single scheduler session (with
concurrent pull and push jobs). This commit also simplifies the code as
it removes the `sched_error_action` emulation, using the regular
frontend code path instead.
|
|
|
|
|
|
| |
This allows proper error handling when pushing an uncached element
should result in a failure (bst artifact push), not a skipped job
(bst build).
|
|
|
|
|
|
| |
This allows proper error handling when pushing an uncached element
should result in a failure (bst artifact push), not a skipped job
(bst build).
|
|
|
|
|
|
|
| |
This replaces `__pull_strong()` and `__pull_weak()` with calls to
`Artifact.pull()`. Besides simplifying code in `element.py`, this
removes the call to `_pull_done()` from the job process, which would
cause issues with the upcoming thread-based scheduler.
|
| |
|
| |
|
|
|
|
|
| |
We want the weak reference to point to the most recent artifact with the
same weak cache key, not the oldest.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This allows declaring multiple dependencies with common properties
in a mode convenient way, e.g.:
depends:
- type: build
junction: subproject.bst
filename:
- foo.bst
- bar.bst
- baz.bst
This was requested during this email thread: https://lists.apache.org/thread.html/r9d716f2734cae5a81731f9a46d73f944a7287ff168f6987e25597c6a%40%3Cdev.buildstream.apache.org%3E
|
|
|
|
|
| |
Staging activities are usually silent nested, this regressed when
porting to recently changed APIs.
|
|
|
|
|
| |
Staging activities are usually silent nested, this regressed when
porting to recently changed APIs.
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
| |
sources
This ensures we get a SKIP message instead of a SUCCESS message when
tracking an element where all of it's sources did not implement track(),
which is the case for sources like `local`, `workspace` or `patch`.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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()
|
|
|
|
|
| |
We don't allow importing symbols from sub-packages of BuildStream, so
any public API must find it's way to the toplevel __init__.py.
|
|
|
|
|
| |
This was a dead codepath, not used by any sandbox implementation
for any reason, and used to be called inconsistently by some elements.
|
|
|
|
| |
That API is useless fluff and does not have any affect on anything.
|
| |
|
|
|
|
| |
This was missing in the initial implementation.
|
| |
|
|
|
|
|
|
|
| |
This addresses the feature request to stage dependencies in sysroots
from a couple years back:
https://mail.gnome.org/archives/buildstream-list/2018-August/msg00009.html
|
|
|
|
|
|
|
|
|
|
|
| |
This was actually deadcode, since node.validate_keys() was called
on the configure dictionary without the legacy command steps. If any
element was using the legacy commands, they would have been met with
a load time error anyway.
This commit also updates the cache key test, since removing these
legacy commands affects BuildElement internally in such a way as
to affect the cache keys.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch implements the essentials of the proposal to extend the
dependency attributes:
https://lists.apache.org/thread.html/r850aeb270200daade44261f16dbad403bf762e553b89dcafa0848fe7%40%3Cdev.buildstream.apache.org%3E
And essentially this will obsolete issue #931 by providing a more
suitable replacement for Element.search().
Summary of changes:
* _loader/loadelement.pyx: The Dependency object now loads the `config` node,
and raises an error if the `config` node is specified on a runtime-only
dependency.
* element.py: Created the new Element.configure_dependencies() virtual method.
If elements implement this method, then a list of all dependencies are
collected at element construction time and given to the implementing
(depending) element.
If a build dependency has more than one `config` specified, then
it will be given to the Element twice, and if there is no `config`
specified, then the tuple will still be given to the element with
a Null `config`.
Elements are provided via a new DependencyConfiguration type.
|
|
|
|
|
| |
This helps simplify the following Element.configure_dependencies()
implementing patch.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When the same element is specified multiple times as a direct dependency,
merge and accumulate the results into the already loaded dependency.
* If the same element is a runtime and build dependency separately, it
will be a single dependency of both runtime and build.
* If either of the dependencies are `strict`, it will be a strict
dependency.
The build graph retains the invariant that an element only ever depends
on another element once directly, only the YAML can express the same
dependency differently more than once, and the results are accumulated.
This consequently remoces LoadErrorReason.DUPLICATE_DEPENDENCY as this is
no longer relevant.
|
|
|
|
|
|
| |
This is a bit nicer than relying on strings in the Symbol enumeration,
and allows for some bitwise operations so we can test for BUILD or
RUNTIME.
|
|
|
|
|
|
|
|
|
|
|
| |
Setup the OverlapCollector in Element.stage() routines, and ensure we
call OverlapCollector.start_session() and OverlapCollector.end_session()
in the right places.
This adds the OverlapAction `action` parameter to the Element.stage_artifact()
and Element.stage_dependency_artifacts() APIs so that Elements can choose
how to behave when multiple artifact staging calls overlap with files staged
by previous artifact staging calls.
|
| |
|
|
|
|
|
| |
Makes the warning fatal if we fail to stage a file because it would have
otherwise overwritten a non-empty directory.
|
|
|
|
|
| |
Used to define the behavior of multiple calls to Element.stage_artifact()
and Element.stage_dependency_artifacts()
|
|
|
|
| |
Staging artifacts at Element.assemble() time is now illegal
|
|
|
|
|
| |
It will now be illegal to call Element.stage_dependency_artifacts() outside
of the Element.stage() abstract method.
|
|
|
|
|
|
| |
This allows plugins to keep making statements such as `element in dependencies`
or `elementA is elementB`, which was currently broken due to creating proxies
on demand.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
In non-strict mode, `Element._pull_pending()` checked whether the strict
artifact is already in the local cache to determine whether to attempt
pulling the strict artifact from a remote cache. However, when staging a
cached element, BuildStream always used the weak cache key. The weak
cache key is not guaranteed to point to the same artifact as the strict
cache key even if the strict artifact is cached.
This removes the `Element.__strict_artifact` instance member to keep
strict artifact handling contained in `__update_artifact_state()`.
|
|
|
|
|
|
|
|
|
|
| |
We can always calculate the weak cache key if we can calculate the
strict cache key and having the weak cache key available without the
strict cache key doesn't provide any benefits.
With this change each element either has both of these cache keys
calculated or neither of them. This reduces the number of states an
element can be in, reducing the risk of state handling bugs.
|
|
|
|
|
|
| |
As `bst build --track` and unstable workspace cache keys have been
removed, dynamic cache key updates across the element graph are no
longer needed.
|
|
|
|
|
|
| |
As `bst build --track` and unstable workspace cache keys have been
removed, dynamic cache key updates across the element graph are no
longer needed.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
`State.add_task()` required the job name to be unique in the session.
However, the tuple `(action_name, full_name)` is not guaranteed to be
unique. E.g., multiple `ArtifactElement` objects with the same element
name may participate in a single session. Use a separate task identifier
to fix this.
|
|
|
|
|
|
| |
The `None` check in `_calculate_cache_key()` was working for the strict
cache key calculation but not for the strong cache key in non-strict
mode.
|