| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
| |
Replaces Pipeline method `track_cross_junction_filter()`.
This changes the error domain for invalid cross junction tracking, so
updating the following two test cases:
* testing/_sourcetests/track.py
* tests/frontend/track.py
|
|
|
|
|
|
|
|
|
|
|
| |
This test was broken from the following commits:
98c807002cf3beb2110695083450a42fe8feefd0
9a124386a0ba8995e7cfd92e2c7d8fb23854f7e4
As of these commits, a Cli() instance requires it's directory to not
be created in advance, this was not caught in CI because we skip the
tests in CI where the runners lack proper subsecond mtime precision.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When instantiating an ArtifactElement, use an ArtifactProject to ensure
that the Element does not accidentally have access to any incidentally
existing project loaded from the current working directory.
Also pass along the Artifact to the Element's initializer directly, and
conditionally instantiate the element based on it's artifact instead of
based on loading YAML configuration.
Fixes #1410
Summary of changes:
* _artifactelement.py:
- Now load the Artifact and pass it along to the Element constructor
- Now use an ArtifactProject for the element's project
- Remove overrides of Element methods, instead of behaving differently,
now we just fill in all the blanks for an Element to behave more
naturally when loaded from an artifact.
- Avoid redundantly loading the same artifact twice, if the artifact
was cached then we will load only one artifact.
* element.py:
- Conditionally instantiate from the passed Artifact instead of
considering any YAML loading.
- Error out early in _prepare_sandbox() in case that we are trying
to instantiate a sandbox for an uncached artifact, in which case
we don't have any SandboxConfig at hand to do so.
* _stream.py:
- Clear the ArtifactProject cache after loading artifacts
- Ensure we load a list of unique artifacts without any duplicates
* tests/frontend/buildcheckout.py: Expect a different error when trying
to checkout an uncached artifact
* tests/frontend/push.py, tests/frontend/artifact_show.py: No longer expect
duplicates to show up with wild card statements which would capture multiple
versions of the same artifact (this changes because of #1410 being fixed)
|
|
|
|
|
| |
Skip an artifact expiry test in the case we don't have subsecond mtime
precision.
|
| |
|
|
|
|
|
|
| |
This tests a few glob patterns through `bst artifact show` and also
asserts that globs which match both elements and artifacts will produce
an error.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We should not have a different globbing behavior than split rules for
the command line.
This should also make artifact globbing slightly more performant, as
the regular expression under the hood need not be recompiled for each
file being checked.
This commit also updates tests/frontend/artifact_list_contents.py to
use a double star `**` (globstar syntax) in order to match path
separators as well as all other characters in the list contents command.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The patch does the following things:
* Ensure that we only ever try to match artifacts to user provided
glob patterns if we are performing a command which tries to load
artifacts.
* Stops being selective about glob patterns, if the user provides
a pattern which does not end in ".bst", we still try to match it
against elements.
* Provide a warning when the provided globs did not match anything,
previously this code only provided this warning if artifacts were
not matched to globs, but not elements.
* tests/frontend/artifact_delete.py, tests/frontend/push.py,
tests/frontend/buildcheckout.py:
Fixed tests to to not try to determine success by examining the
wording of a user facing message, use the machine readable errors
instead.
Fixes #959
|
|
|
|
|
|
|
|
|
|
|
|
| |
When printing log lines to the master log, we ensure that log lines are
printed with the element name and cache key which are related to the task
from which the messages are being issued.
When printing log lines to task specific log lines, we prefer to print
the element names and cache keys which pertain to the element from which
the log line was actually issued.
This new tests asserts this behavior.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This behavior has regressed a while back when introducing the messenger
object in 0026e379 from merge request !1500.
Main behavior change:
- Messages in the master log always appear with the task element's
element name and cache key, even if the element or plugin issuing
the log line is not the primary task element.
- Messages logged in the task specific log, retain the context of the
element names and cache keys which are issuing the log lines.
Changes include:
* _message.py: Added the task element name & key members
* _messenger.py: Log the element key as well if it is provided
* _widget.py: Prefer the task name & key when logging, we fallback
to the element name & key in case messages are being logged outside
of any ongoing task (main process/context)
* job.py: Unconditionally stamp messages with the task name & key
Also removed some unused parameters here, clearing up an XXX comment
* plugin.py: Add new `_message_kwargs` instance property, it is the responsibility
of the core base class to maintain the base keyword arguments which
are to be used as kwargs for Message() instances created on behalf
of the issuing plugin.
Use this method to construct messages in Plugin.__message() and to
pass kwargs along to Messenger.timed_activity().
* element.py: Update the `_message_kwargs` when the cache key is updated
* tests/frontend/logging.py: Fix test to expect the cache key in the logline
* tests/frontend/artifact_log.py: Fix test to expect the cache key in the logline
Fixes #1393
|
|
|
|
|
|
| |
Skip a test which relies on mtimes differing within a short timespan,
this will fail if it happens fast enough (which it should) on systems
which do not support subsecond precision mtimes.
|
|
|
|
|
|
|
|
|
|
|
| |
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 test checks that:
* We get SKIP messages for tracking local sources
* We get SKIP messages for tracking workspaced elements
* We go no messages at all for elemenents which have no sources
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Element.stage_dependency_artifacts()
This patch adds a new test plugin which implements
Element.configure_dependencies() in order to offer better flexibility for
testing overlaps.
Newly added tests:
* Test overlap warnings and errors when staging elsewhere than
in the sandbox root.
* Test unstaged files failure modes when staging elsewhere than
in the sandbox root.
* Test various overlap behaviors of OverlapAction, when different
calls to Element.stage_dependency_artifacts() cause overlaps to
occur after staging files into separate directories.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit:
* Removes testing of the deprecated `fail-on-overlap` project configuration
option, this is going away soon and unneeded.
* Tests that warnings are issued whenever they should be (some tests
were happy to see a successful run but failed to check for an
expected warning).
* Test error/warning more evenly across tests, some were missing the
warning mode.
* Use `bst show` instead of `bst build` for the undefined_variable
test, it should fail without needing a build.
|
|
|
|
|
|
| |
This tests that, in non-strict mode, a cached artifact matching the
strict cache key is preferred to a more recent artifact matching only
the weak cache key.
|
| |
|
| |
|
|
|
|
|
| |
This is a regression test for the previously broken dependency cache key
check in non-strict mode.
|
|
|
|
|
|
|
|
|
|
|
|
| |
ruamel.yaml <= 0.16.6 suffers from a bug where ruamel's yaml dumper
crashes when used on a sequence that has comments before it. In
BuildStream, this manifests in form of issues like #1265.
See upstream issue at https://sourceforge.net/p/ruamel-yaml/tickets/335.
Also, add a regression test for it.
Fixes #1265.
|
|
|
|
|
|
|
| |
This is part of #1349. This patch will conclude the first part of that
issue, i.e. ensuring that the possible options for `--deps` are
consistent across all commands (with the exception of `--deps plan` that
we will handle separately).
|
| |
|
|
|
|
|
|
|
|
| |
Use a separate Cli instance with a separate local cache for the second
pull in `test_recently_pulled_artifact_does_not_expire()` to ensure the
complete artifact is pulled. If only a part of the artifact is pulled,
there is no guarantee that the other blobs of that artifact won't
expire.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When no arguments are passed to `artifact checkout` command, it
currently crashes. We actually have a check of this, but we crash before
that becasue this method tries to read the value of `target` before
we've had time to check for it.
That can only be done correctly after the app has been initialized. So,
refactor that bit of the method to run after we've checked that we are
working with a non-empty target.
Also, add a regression test for it.
Fixes #1367.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This ensures that important calls to this function do give some
thought to providing a reasonable shortname, which will be used
as a display name in errors.
This continues to support `None` as a shortname, which is used
in various tests which don't need to provide a reasonable user
facing error.
The buildstream.testing module now exports a `load_yaml` function
which only takes a filename and no shortname.
|
|
|
|
|
|
| |
This was a workaround for inconsistent error handling in the frontend.
As the error handling is now fixed, drop these cache checks after
tracking.
|
|
|
|
|
| |
Ensure that we get the expected provenance when expanding a variable
included in an overlap whitelist entry.
|
|
|
|
|
| |
This fixes a bug where buildstream would ignore the opened workspace on a
cross-junction element.
|
|
|
|
|
| |
Use `bst source push` in a new test instead of manually deleting parts
of a remote cache.
|
| |
|
|
|
|
|
| |
This is a regression test to skip push only if server has identical
artifact.
|
| |
|
|
|
|
|
|
| |
Remove tests which check for a user message to be issued upon closing
a workspace who's metadata was used to launch BuildStream and find
the BuildStream project directory.
|
|
|
|
|
| |
Do not copy file mode from casd object file. Do not change
non-executable mode bits if file is executable.
|
|
|
|
| |
Make sure build-only dependencies are pulled only when necessary.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When we are not recursing, `Element.dependencies()` uses a much more
light weight codepath since it just needs to print the direct
dependencies. However, this simple codepath was not accounting for
duplicates, in case something is both a build time and run time
dependency.
One way this manifested itself was in `bst show --format %{deps}`, but
it would also affect anything that was using this method to iterate on
the dependencies.
Fixes #1308.
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
This can be quite handy when one is preparing to open a build shell.
This originally came up in
https://gitlab.com/BuildStream/buildstream/-/issues/685#note_105460896.
|
|
|
|
| |
Also fix linting errors coming with new version of pylint
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The BST_MIN_VERSION guards assert that the BuildStream core which
loaded the plugin is compatible with the plugin itself.
This commit adds BST_MIN_VERSION to the base plugin.py with documentation
informing Plugin authors how to set the minimum version, and also adds
the assertions at plugin loading time in pluginfactory.py.
This commit also:
* Adds the BST_MIN_VERSION specification to all current core plugins
* Adds the BST_MIN_VERSION specification to plugins used in test cases
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Plugin format versioning was decided to be removed for local
plugins and any plugins for which we do not load an explicitly
provided plugin. For pip, this will be handled with a standard
distutils/setuptools approach, allowing users to specify pip
style version boundaries in the plugin origins.
This patch refactors plugin loading so that all related code
goes into the private _pluginfactory module, a new small
PluginOrigin type was added to better manipulate loaded
origins.
Test cases have been removed and will be readded in a following
commit, adjusted to new expectations.
|
|
|
|
| |
`Sandbox.get_directory()` no longer exists.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* "min-version" is specified as a <major>.<minor> point version
and uses the installed BuildStream version instead of having
a separate versioning number for the format.
* The presence of "format-version" is now used to indicate
that we might be loading a BuildStream 1 project.
* For now, where parsing the version at startup is concerned, and
also where `bst init` is concerned, we artificially bump the
detected BuildStream version to 2.0 if we detect a version < 2.0,
these exceptions can be removed once 2.0 is tagged and released.
Summary of changes:
_project.py: Now parse "min-version" and detect "format-version" to
warn about loading a BuildStream 1 project
_versions.py: Remove obsolete BST_FORMAT_VERSION numbers from here
data/projectconfig.yaml: Remove old "format-version" from defaults
utils.py: Added new private _parse_version() helper function, and another
_get_bst_api_version() to get an adjusted API version.
frontend/app.py, frontend/cli.py: Updated `bst init` implementation
testing (buildstream.testing): Updated testing utilities to generate
and use projects with min-version instead of format-version.
tests and examples: Updated to use min-version across the board.
|
|
|
|
|
|
|
| |
This ensures we do not leak resources during our tests and that we close
everything nicely.
This removes multiple warnings that is thrown by our code.
|
|
|
|
|
| |
Using "" as a directory is invalid starting from pytest 5.4.0, let's
use the __file__ name instead
|
| |
|