summaryrefslogtreecommitdiff
path: root/src/buildstream/buildelement.py
Commit message (Collapse)AuthorAgeFilesLines
* BuildElement: Fix logging regressiontristan/fix-logging-regressionTristan van Berkom2020-09-261-2/+3
| | | | | Staging activities are usually silent nested, this regressed when porting to recently changed APIs.
* buildelement.py: Implement "location" dependency configurationTristan van Berkom2020-09-181-11/+86
| | | | | | | 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
* buildelement.py: Remove legacy command stepsTristan van Berkom2020-09-181-13/+1
| | | | | | | | | | | 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.
* element.py: Hide dependencies which are irrelevant to the ElementTristan van Berkom2020-09-041-5/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* buildelement: Ensure command-subdir is part of the cache keyChandan Singh2020-05-121-3/+7
| | | | | | | | | | `command-subdir` was previously missing from the cache key. This patch makes it a part of the cache key _if_ it was specified. It means that the cache key will not change for elements that had not defined a `command-subdir`. However, it will change for every element that did define it. Fixes #1295.
* element.py: Always expand all variables at element creationBenjamin Schubert2020-05-121-8/+1
| | | | | This will allow all users to not have to care about whether the option is expanded or not, making it easier to use variables everywhere
* Remove documentation references to format_versionTristan Van Berkom2020-04-251-5/+6
| | | | | | | | | | | With BuildStream 2.0, we start with a fresh API, everything that is present at the time of the 2.0 release can implicitly be considered to be available since 2.0. In the future, we will be expressing new API additions using the min-version semantic versioning style instead of format version too (so new YAML configurations will be expressed as "since: 2.2" and so on).
* storage: Add public Directory.exists() methodJürg Billeter2020-03-101-1/+1
|
* _filebaseddirectory.py: Improve _exists() methodJürg Billeter2020-03-101-1/+1
| | | | | | Use similar implementation as in `CasBasedDirectory`. This fixes following symlinks to avoid the host filesystem and adds support for `follow_symlinks=False`.
* buildelement.py: Use marker file to avoid rerunning configureJürg Billeter2020-02-111-4/+28
|
* Reformat code using BlackChandan Singh2019-11-141-32/+27
| | | | | | | 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.
* element.py: change 'substitute_variables' to take a 'ScalarNode' and renameBenjamin Schubert2019-10-161-2/+2
| | | | | | | | | Previously 'substitute_variable' would take a str, which would prevent us from doing nice error reporting. Using a 'ScalarNode' allows us to get our errors nicely. - rename it to 'node_subst_vars'. - add a nicer try-except around it in order to get nicer error reporting to users.
* node: Add 'get_str_list' on 'MappingNode'Benjamin Schubert2019-07-171-1/+1
| | | | | | `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
* _yaml: Remove 'node_validate' and replace by 'MappingNode.validate_keys'Benjamin Schubert2019-07-151-1/+1
| | | | - adapt all call sites to use the new API
* _yaml: Introduce 'get_sequence()' and 'sequence_at()'/'mapping_at()'Benjamin Schubert2019-07-151-8/+5
| | | | | | | | | - 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.
* Move source from 'buildstream' to 'src/buildstream'Chandan Singh2019-05-211-0/+299
This was discussed in #1008. Fixes #1009.