summaryrefslogtreecommitdiff
path: root/src/buildstream/source.py
Commit message (Collapse)AuthorAgeFilesLines
* skip stage in stage previous sourcesstraveltissues/1161-3Darius Makovsky2019-10-231-0/+2
|
* Extend Source APIDarius Makovsky2019-10-231-2/+12
| | | | | Add `_stage_into_cas()` private method. Calls `self._stage` on a `CasBasedDirectory`.
* source.py: add BST_NO_PRESTAGE_KEYDarius Makovsky2019-10-231-1/+12
|
* Remove unnecessary parameter in Source._get_unique_keyDarius Makovsky2019-10-231-10/+4
|
* node.pyx: Make 'strip_node_info' publicBenjamin Schubert2019-10-161-2/+2
| | | | | 'strip_node_info' would be useful for multiple plugins. We should therefore allow users to use it.
* workspace.py: Do not close gRPC channelsJürg Billeter2019-10-151-2/+0
| | | | This is now handled in Context.prepare_fork().
* cascache.py: Rename close_channel() to close_grpc_channels()Jürg Billeter2019-10-151-1/+1
| | | | This aligns the method name with has_open_grpc_channels().
* Defer committing workspace files to cachetraveltissues/1159Darius Makovsky2019-10-081-0/+6
| | | | | | | | | Remove XFAIL mark from test_workspace_visible and remove the explicit SourceCache.commit() in the workspace source plugin. Allow buildstream to handle the commit logic. Add handling for non-cached workspace sources in `source.Source._generate_keys()`.
* Add initial mypy configuration and typesChandan Singh2019-09-021-43/+66
| | | | | | | | | | As a first step, add type hints to variables whose type `mypy` cannot infer automatically. This is the minimal set of type hints that allow running `mypy` without any arguments, and having it not fail. We currently ignore C extensions that mypy can't process directly. Later, we can look into generating stubs for such modules (potentially automatically).
* _message.py: Use element_name & element_key instead of unique_idtpollard/messageobjectTom Pollard2019-08-081-1/+6
| | | | | | | | | | | | | Adding the element full name and display key into all element related messages removes the need to look up the plugintable via a plugin unique_id just to retrieve the same values for logging and widget frontend display. Relying on plugintable state is also incompatible if the frontend will be running in a different process, as it will exist in multiple states. The element full name is now displayed instead of the unique_id, such as in the debugging widget. It is also displayed in place of 'name' (i.e including any junction prepend) to be more informative.
* Make ChildJobs and friends picklableAngelos Evripiotis2019-07-241-0/+26
| | | | | | | | | Pave the way toward supporting the 'spawn' method of creating jobs, by adding support for pickling ChildJobs. Introduce a new 'jobpickler' module that provides an entrypoint for this functionality. This also makes replays of jobs possible, which has made the debugging of plugins much easier for me.
* source: Cache mirror_directory instead of computing it everytimeBenjamin Schubert2019-07-171-5/+10
| | | | | This variable is accessed multiple times per run and can be slow on slow file systems.
* plugins: Update public documentation to be correct with the new NodesBenjamin Schubert2019-07-151-3/+3
| | | | | We need to update every place where we were passing a yaml 'dict' to now pass a 'MappingNode'
* node: Rename 'copy' to 'clone'Benjamin Schubert2019-07-151-1/+1
| | | | | | | | A 'clone' operation has an implicit understanding that it is expensive, which is not the case of a 'copy' operation, which is more usually a shallow copy. Therefore renaming to 'clone'
* _yaml: Mark 'strip_node_info' as buildstream-privateBenjamin Schubert2019-07-151-2/+2
|
* _yaml: Set 'MappingNode' public-private APIBenjamin Schubert2019-07-151-1/+1
| | | | | | | - _composite -> __composite (internal) - composite -> _composite (BuildStream private) - composite_under -> _composite_under (BuildStream private) - get -> _get (internal)
* _yaml: Mark attributes in ProvenanceInformation as Buildstream-privateBenjamin Schubert2019-07-151-11/+11
| | | | | Users should not need to get access to any of those, and should only need access to the ProvenanceInformation to print it.
* _yaml: Remove 'node_get_provenance' and add 'Node.get_provenance'Benjamin Schubert2019-07-151-3/+3
| | | | | | | | This replaces the helper method by adding a 'get_provenance' on the node directly - Adapt all call sites - Delay getting provenance wherever possible without major refactor
* _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: Move 'node_composite' to a method on 'MappingNode'Benjamin Schubert2019-07-151-1/+1
| | | | | - Also take care of node_composite_move in the same way. - Adapt all calling places
* _yaml: Move 'node_final_assertions' to 'Node._assert_fully_composited'Benjamin Schubert2019-07-151-1/+1
|
* _yaml: remove node_sanitizeBenjamin Schubert2019-07-151-2/+3
| | | | | | | | | Some call places do not need calls to 'node_sanitize' anymore, therefore removing the call entirely. Other still use it for convenience, but that doesn't seem the right way to do it for consistency. Those places have been replaced by calls to 'Node.strip_node_info()'.
* _yaml: Remove 'node_find_target' and replace by 'MappingNode.find'Benjamin Schubert2019-07-151-2/+2
|
* _yaml: Remove 'key' from node_find_targetBenjamin Schubert2019-07-151-1/+3
| | | | | | | - node_find_target with 'key' is only used once in the codebase. We can remove and simplify this function - Allow 'MappingNode.get_node()' to be called without any 'expected_types'
* _yaml: Remove 'node_copy' and add 'Node.copy()'Benjamin Schubert2019-07-151-1/+1
| | | | Also adaprt every part of the code calling it
* _yaml: add 'get_mapping()' to MappingNodeBenjamin Schubert2019-07-151-6/+4
| | | | | | | | This allows to get a mapping node from another 'MappingNode', replacing 'node_get(my_mapping, key, type=dict)' Also changes all places where 'node_get' was called like that by the new API.
* source: rm unused _cache(), __source_cacheAngelos Evripiotis2019-07-091-6/+0
|
* Source cache uses new proto methodsRaoul Hidalgo Charman2019-07-081-2/+1
| | | | | | | | | This changes the location of source refs from `cache/cas/refs` to `cache/sources_protos` and fixes tests that looked in the old reference place. Source cache now uses the new protocol buffer and grpc methods defined, for storing locally, and pushing and pulling to remotes. Part of #1038
* Refactor, use context.messenger directlyAngelos Evripiotis2019-07-051-3/+3
| | | | | | Instead of having methods in Context forward calls on to the Messenger, have folks call the Messenger directly. Remove the forwarding methods in Context.
* _yaml.pyx: Forbid expected_type=Mapping, and remove isinstance checkBenjamin Schubert2019-06-031-3/+2
| | | | | | | | | | | Calls to `isinstance` can be particularily costly. Using type() is much faster. The only known case where the `isinstance` was useful is for dictionnaries where we would ask for a 'Mapping' instead. Disallowing 'Mapping' for expected_type considerably speeds up the calls to this functions. Also add into NEWS
* Add BST_STAGE_VIRTUAL_DIRECTORY optionRaoul Hidalgo Charman2019-05-221-16/+58
| | | | | | | | Add flag to indicate whether sources can stage directly to a virtual directory. Adds `__stage_previous_sources` method which stages previous sources taking into account whether they use virtual directories or not. Part of #983
* Move source from 'buildstream' to 'src/buildstream'Chandan Singh2019-05-211-0/+1274
This was discussed in #1008. Fixes #1009.