| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit enriches the metadata we store on artifacts in the
new detatched low/high diversity metadata files:
* The SandboxConfig is now stored in the artifact, allowing
one to perform activities such as launching sandboxes on
artifacts downloaded via artifact name (without backing
project data).
* The environment variables is now stored in the artifact,
similarly allowing one to shell into a downloaded artifacts
which are unrelated to a loaded project.
* The element variables are now stored in the artifact, allowing
more flexibility in what the core can do with a downloaded
ArtifactElement
* The element's strict key
All of these of course can additionally enhance traceability
in the UI with commands such as `bst artifact show`.
Summary of changes:
* _artifact.py:
- Store new data in the new proto digests.
- Added new accessors to extract these new aspects from loaded artifacts.
- Bump the proto version number for compatibility
* _artifactcache.py: Adjusted to push and pull the new blobs and digests.
* element.py:
- Call Artifact.cache() with new parameters
- Expect the strict key from Artifact.get_meta_keys()
- Always specify the strict key when constructing an Artifact
instance which will later be used to cache the artifact
(i.e. the self.__artifact Artifact).
* _versions.py: Bump the global artifact version number, as this breaks
the artifact format.
* tests/cachekey: Updated cache key test for new keys.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit changes SandboxConfig such that it now has a simple constructor
and a new SandboxConfig.new_from_node() classmethod to load it from a YAML
configuration node. The new version of SandboxConfig now uses type annotations.
SandboxConfig also now sports a to_dict() method to help in serialization in
artifacts, this replaces SandboxConfig.get_unique_key() since it does exactly
the same thing, but uses the same names as expected in the YAML configuration
to achieve it.
The element.py code has been updated to use the classmethod, and to
use the to_dict() method when constructing cache keys.
This refactor is meant to allow instantiating a SandboxConfig without
any MappingNode, such that we can later load a SandboxConfig from an
Artifact instead of from an parsed Element.
This commit also updates the cache keys in the cache key test, as
the cache key format is slightly changed by the to_dict() method.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The `directory` value determines where a source is staged within the
build root of an element, however, it does not directly affect
individual sources.
With this change the sources will individually be cached in CAS
independent of the value of `directory`. `ElementSources` will use the
value of `directory` when staging all element sources into the build
root.
This results in a cache key change as the `directory` value is moved
from the unique key of individual sources to the unique key of
`ElementSources`.
This is in preparation for #1274.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The goal was to include the source plugin kind in the element cache key
as the unique key of a source may not be unique across different source
plugins. This is the source equivalent of the `element-plugin-name`
value in the element cache key.
However, `Source._get_source_name()` was the wrong method for this as
that also includes the key itself, which may not even be set yet.
This results in a cache key change.
Fixes: 3953bcc6 ("element.py: clobber sources with workspace")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
unconditionally
Not all elements use the "build-root" variable, but it is the standard
variable to use for the build directory, and the build directory must
be considered in the cache key.
Handling this unilaterally in the core is safer than delegating this
to element implementations, as we have less chance of plugin authors
missing this detail and possibly introducing binary variance for
artifacts where only the build directory differs (something which
happens when the project name or element names change).
This commit also updates the hard coded cache keys in the cache key
test, so as to ensure every commit passes it's own tests.
This fixes #1386.
|
|
|
|
|
|
|
|
| |
In the test_cache_key_fatal_warnings() test, use the same project name
in both generated project directories in order to pass the tests in
the case that elements are guaranteed to have differing cache keys
for differeing element/project names (which is the case when we consider
the "build-root" in the cache key unconditionally).
|
|
|
|
|
| |
This allows plugin authors to implement cache keys tests
more easily
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* "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 matches the REAPI platform lexicon.
|
| |
|
|
|
|
|
|
|
| |
As discussed over the mailing list, reformat code using Black. This is a
one-off change to reformat all our codebase. Moving forward, we
shouldn't expect such blanket reformats. Rather, we expect each change
to already comply with the Black formatting style.
|
|
|
|
|
|
|
| |
tests:
* local sources are cached
* use git sources instead of local when removing objects
* update expected cache keys
|
|
|
|
|
|
|
| |
Remove call to Element._source_cached() in _calculate_cache_key and
do not recalculate workspace keys.
tests: shell browsing of workspaces is currently broken
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Check that sources are cached even if they are workspaced and do not
reset workspace cache data
partially reverts !1470
closes #1088
element.py: remove workspaces in cache key calc
Using the workspace source plugin, workspaces should now be handled like
sources for the purpose of calculating element cache keys.
partially reverts !1470
works towards #1073
Since the source keys are now calculated using the unique keys of the
workspace source, this change will break external tracking for open
workspaces. In future attempting to track an open workspace might raise
a SourceError. The test is rewritten to close the workspace before
tracking.
|
|
|
|
|
|
|
|
|
| |
We also need to store the project name of dependencies in
the proto in order to reconstruct the graph.
This also means that we must include the project name of the
dependencies in the cache key, otherwise the proto and the
cache keys may fall out of sync.
|
|
|
|
|
| |
We store the build dependency names in the artifact proto. This
should be reflected in the cache key dict.
|
|
|
|
| |
add name to sources in cache key dict
|
|
|
|
| |
Return if there is no result from parsing the element
|
|
|
|
|
| |
If this is not present in the env the cli will throw an exception
closes #1074
|
|
|
|
|
| |
Now that both are equivalent, we can skip the sanitization part before
the yaml call.
|
|
|
|
| |
relates to #1073
|
|
|
|
|
|
| |
Calling '_yaml.dump' will itself call '_yaml.node_sanitize', therefore
we can remove all calls to it in places where we directly after call
dump.
|
|
|
|
|
|
|
|
| |
We currently have two sites file containing redundant information.
- tests/testutils/site.py: Remove IS_{LINUX,WSL,WINDOWS}
- rest: Change imports to import those from
buildstream/tests/_utils/site.py
|
|
|
|
|
|
|
| |
We have two different 'site' files that are redundant and both
define some variables in BuildStream environment.
Moving the MACHINE_ARCH to a single place.
|
|
|
|
|
|
|
| |
We have two different 'site' files that are redundant and both define
some variables in BuildStream environment.
Moving all the git related ones in a single place.
|
|
|
|
|
|
|
| |
We have two different 'site' files that are redundant and both define
some variables in BuildStream environment.
This is a first step in consolidating them in a single file
|
| |
|
|
|
|
|
|
|
|
|
| |
- Rename plugintestutils to testing.
- Don't run the tests from bst-plugins-template. This imports
buildstream.plugintestutils so will have to be disabled to get
through CI. This can be re nabled once bst-plugins-template has been
patched.
|
|
|
|
|
| |
This allows pytest to show a better report of the difference between
the two lists and not just tell that one entry is wrong.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Replace some popular copypasta.
This important-looking invocation:
os.path.join(datafiles.dirname, datafiles.basename)
is equivalent to this shorter invocation:
project = str(datafiles)
It seems like it's very popular copypasta, replace it with the shorter
one thus:
# Use 'gsed' or 'sed' etc. as appropriate for your system.
git config --global alias.sub '!f() { git grep --name-only --null "$1" | gxargs --null gsed --in-place --expression "s/$1/$2/g" ; }; f'
git sub 'os.path.join(datafiles.dirname, datafiles.basename)' 'str(datafiles)'
|
|
|
|
|
| |
Pylint can't know that pytest's fixtures are used in a file and
therefore reports false positives. Silencing all those errors
|
|
|
|
|
| |
Pylint doesn't play well with pytest fixtures, we therefore need to
silence this error.
|
| |
|
| |
|
|
|
|
|
| |
- Remove all wrong-import-order from pylint
- Order some subgroups of imports
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
This affects the cache key version (updated to 7) and introduces
a dependency on `ujson` which is BSD licenced as of the version
locked in `requirements.txt`
Signed-off-by: Daniel Silverstone <daniel.silverstone@codethink.co.uk>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Returning only empty directories leads to inconsistencies when computing
a manifest by combining results from multiple list_relative_paths()
calls as done by the compose plugin.
I.e., the same directory may be empty in one dependency and non-empty in
another dependency. The merged file list will still contain that
directory even though it's no longer empty.
This inconsistency causes problems when calculating differences between
manifests. Returning all directories fixes these inconsistencies.
This is a change in API behavior.
|
|
|
|
|
|
|
|
|
| |
Most split rules already included the relevant directories themselves in
addition to the directory contents. Add the missing bin, sbin, and
libexec directories.
This is required to fix tests with the following commit that changes
list_relative_paths() to return all directories.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We want external plugins to be able to make use of the core testing utils.
This commit exposes the basic utilities which are currently in use in
bst-external plugins. If necessary, more utilities could be exposed in the
future.
Moves the following files from tests/testutils/ to
buildstream/plugintestingutils/:
o runcli.py
o integration.py
As part of this, this commit makes the following changes to runcli.py
and integration.py:
o runcli.py: Fix linting errors
o runcli.py: Add user facing documentation
o Integration.py: Add user facing documentation
|
| |
|
|
|
|
|
|
|
|
|
| |
They are too specific to be included by default
Recommendation is if you are building in Linux is to use the
ones begin used in the freedesktop-sdk project, for example
See #645
|
|
|
|
| |
Also update tests to be consistent with this
|
|
|
|
|
|
| |
In element, platform asks for host os and architecture to default to when
SandboxConfig is initialised.
This changes element cache keys so those have been updated in the tests.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
shallow repository
Instead of tag information being fetched which can change with time,
they are tracked and saved in the projects.refs/.bst. Then we re-tag
automatically the closest tag so that `git describe` works and is
reproducible.
This new feature is opt-in with the new `track-tags` configuration,
and must be used to fix modules which are broken by our new policy
of omitting the `.git/` repository when staging git sources.
This fixes issue #487
|
| |
|