| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
| |
* Test scenarios where a junction needs to resolve variables
in order to configure a subproject, but where some other variables
may be derived from the same subproject.
In this scenario we allow partial resolution of variables
for junction elements.
* Enhanced the undefined variables and circular reference tests
to also check for the expected provenances.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Test various scenarios of overriding junctions, including
deep paths as junctions to override, and as junctions to use
to override.
* Test conflicting junction configurations, ensuring that we
report both provenances of where the junctions were declared.
* Test circular references in element paths while declaring overrides,
for instance when trying to override a subproject using a deeper
definition of the same subproject.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit refactors the junctions test to use more parameterization
and to remove copy_subproject(), using statically committed data as
much as possible.
This is because copy_subproject() causes data to be shared among tests
in such a way that when such data get's modified, it easily causes
unintended side effects on adjacent test cases, better to keep this
data separate.
Overview of changes:
* Remove copy_subproject()
* Split up test data into case specific directories, sometimes
reusing a directory among various related tests
* Use @pytest.mark.parameterize() as much as possible for better
coverage and more clearly expressed test cases
* Adds update_project() to modify a project.conf inline, as is
done in some other tests like tests/plugins/loading.py
* Removes tests related to junction name coalescing, this feature
will be removed later in this branch and other tests related
to junction overrides will replace these.
* Removes some redundant tests
* Removes a comment about how junction name coalescing can cause
errors when trying to open a junction but the project.conf is
missing. We continue to test missing project.conf files in a
variety of scenarios, but the comment will be rendered irrelevant
with the removal of junction name coalescing.
* Change the git related tests to use tar instead, this serves
the same purpose, but tar will remain a core plugin in BuildStream 2.
|
|
|
|
|
|
|
|
|
|
|
| |
Instead of raising a customized error message which adds little
value to the provenance, just pass the provenance along.
This is important so that the Loader is aware of the provenance
of loaded junctions, so that it can more precisely report errors
about conflicting junctions when includes cause conflicts.
This commit also adjusts tests/format/includes.py
|
| |
|
|
|
|
|
|
|
|
| |
* Test that we succeed to load links with full path targets
* Test that we get correct provenance information in errors when
linking to non-existing elements in existing subprojects, using
full paths.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Verifying for variables (all used variables defined and no cycle) is
much faster than flattening them. It also uses much less memory. Only
`bst show -f "%{vars}"` requires to flatten all variables. For other
cases we can improve performance by only checking rather than
flattening.
Also flattening very nested variables could lead to very long lists of
empty strings. The memory usage for flattening could be a lot bigger
than the resulting value. Force flattening and caching every
variable definitions can improve intermediate memory consumption and
only consume memory of the size of the result.
Finally, an optimization allowed inifinite cycles leading to
segmentation fault. This was solved by simplifying the code.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This removes:
* The `target` feature from the junction plugin
* Special case code in the loader for the `target` feature
* The `target` related cases in tests/format/junctions.py
This also adjusts the `target` related documentation in
the `junction` element to suggest using a `link` element for
the purpose of using a subproject junction configuration to
access a common sub-subproject.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This fixes a bug introduced by d7d18c1a2e454c507afd9e1d3f1358639dd43871,
where public data integration commands and others would never get their
data expanded and would thus fail to run.
The previous however revelead a previous bug, where variables values in
public data of elements would not be part of the cache key of an element
or it's reverse dependencies, and thus, on variable change, rebuilds
would not happen when they would have been needed.
This ensures that all the public data is always resolved and part of the
element's cache key. This however will bring a rebuild of an element
whenever its integration commands variables change, which is simpler to
handle than to try to push that responsibility on reverse dependencies,
since public data can contain plugin-defined values.
|
|
|
|
|
| |
This ensures that when resolving variables, we do not overwrite the
values for a different element in the case we were using composition.
|
|
|
|
|
|
|
|
| |
Use non-greedy search to ensure that we stop at the next closing brace.
Otherwise, for a string like `%{variable} {variable}`, the second
variable will also get substituted.
Fixes #1307.
|
|
|
|
| |
This new test replaces the test in tests/format/project.py.
|
|
|
|
|
|
|
|
|
| |
So far we were only reporting "No Source plugin registered for kind 'foo'",
without specifying what bst file with line and column information, this
commit fixes it.
Additionally, this patch stores the provenance on the MetaSource to
allow this to happen for sources.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* "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.
|
|
|
|
| |
CI runners sometimes need more time under load.
|
|
|
|
|
|
|
|
|
| |
Unfortunately the options from main project cannot always be processed
in the include processing since project configuration might load
option declarations from a separate file. For that reason the result
of `Include.process` should still be passed through the option
processor. But all options files included from junctioned are already
evaluated.
|
|
|
|
|
|
| |
otherwise, having an optional list append in theh configuration wouldn't work
This also avoids special casing for element and source overrides
|
| |
|
|
|
|
|
|
|
| |
Plugin tests are already accessing this API, but using imports from
private modules. For motivation for this to be exposed publicly, note
that ErrorDomain is an argument for most things in runcli.py, and
LoadErrorReason may be another.
|
|
|
|
|
| |
This is not needed now that we have 'is_resolved' and 'is_cached'.
We can therefore drop all calling places and implementations of it.
|
|
|
|
| |
This stops the tests from being interlinked for BuildStream itself.
|
|
|
|
|
| |
Instead output "junction" in magenta for info. Also include test
in format/junctions.py
|
|
|
|
|
|
|
|
|
|
|
| |
* `uname -m` is unusable in case of IBM AIX 7 as it reports the serial
number of the machine. As a workaround, special case it and use the
reported processor identifier.
* tests/format/optionos.py: Don't use AIX for unsupported architecture
`AIX` is special-cased in BuildStream, so use a different system for
testing unsupported architectures.
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
This fixes a case where, in project overrides, if a user specified
a scalar/sequence instead of a mapping for a given project, the
user would receive an ugly stacktrace instead of an invalid format.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
By avoiding this, loading metaelements of junctions becomes cheap even
for junctions with erroneous dependencies, and we can ignore their
task reporting.
Task reporting for junction metaelement loading is confusing, since
the junction element itself will never be part of the pipeline, so
we'd rather not have this show up as an actual loaded element.
Elements loaded from the junction are loaded separately, therefore
this does not affect their progress display.
|
| |
|
| |
|
| |
|
|
|
|
| |
Signed-off-by: Daniel Silverstone <daniel.silverstone@codethink.co.uk>
|
|
|
|
|
|
|
|
|
|
|
| |
Test that we get the correct provenance from a node which has
been compositied.
This tests asserts that if we forget to include one of the
local plugin's essential keys, we fail and see the appropriate
error message.
Tests issue described in #1059.
|
| |
|
|
|
|
| |
Continuing moving plugins over to bst-plugins-experimental.
|
|
|
|
| |
Continuing moving plugins to bst-plugins-experimental.
|
|
|
|
| |
Signed-off-by: Daniel Silverstone <daniel.silverstone@codethink.co.uk>
|
|
|
|
|
|
|
|
|
|
|
|
| |
It was agreed on the mailing list to move all plugins to a single
repository, before moving them into domain-specific repositories. As
a result it seems reasonable to move everything to the
bst-plugins-experimental repo as this stepping stone, rather than
creating a whole new repo.
This commit starts the process of moving things over by moving only the
cmake plugin to bst-plugins-experimental, and altering the tests to
reflect the new location.
|
|
|
|
|
|
|
| |
When the missing variable was not defined, we would get an exception
as a string doesn't contain provenance information.
- Add a test to prevent regression
|
|
|
|
|
|
| |
`mapping.get_sequence(...).as_str_list()` is a very common
pattern seen both in plugins and the core. Adding a helper to reduce
the number of operations will make usage smoother
|
| |
|
|
|
|
|
| |
Remove completely '_yaml.dump()' and replace all notions and call by
'roundtrip_dump'
|
|
|
|
|
| |
Now that both are equivalent, we can skip the sanitization part before
the yaml call.
|
|
|
|
|
|
|
|
|
| |
- Adding 'get_sequence' on MappingNode to access sequences in a mapping
- Adding 'sequence_at' on SequenceNode to access sequences in a sequence
- Adding 'mapping_at' on SequenceNode to access mappings in a sequence
Using "*_at" in sequences allows us to quickly understand if we are
dealing with a sequence or a mapping.
|
|
|
|
|
|
|
|
|
|
|
| |
- 'as_bool()' casts a ScalarNode into a boolean, understanding both
'True' and 'False' as truthy-falsy values, as per node_get(type=bool)
behavior
- 'is_none()' allwos checking whether the scalar node contains a 'None'
value. Since 'None' cannot be used when working with booleans, we need
to have a way of checking for 'None' when we actually need the
information of whether the value is unset.
- Adapt all call places to use the new API
|
|
|
|
|
|
|
|
|
|
| |
- 'get_scalar()' allows retrieving a scalar node from a mapping.
- 'as_str()' casts a ScalarNode into a string (thus removing the node
information).
Both together, those replace 'node_get(mapping, key, type=str)' but
also allow retrieving the 'Node' itself, which will allow in the future
lazier provenance computation.
|