summaryrefslogtreecommitdiff
path: root/buildstream
Commit message (Collapse)AuthorAgeFilesLines
...
* _artifactcache: Add bool return value to pull()Jürg Billeter2018-05-113-6/+11
| | | | | Calling pull() for a potentially unavailable artifact is no longer considered an error.
* _stream.py: Remove unused downloadable parameter from load_selection()Jürg Billeter2018-05-111-4/+1
|
* _frontend/cli.py: Remove bst show --downloadable optionJürg Billeter2018-05-111-5/+2
| | | | This is in preparation for moving away from summary files.
* _pipeline.py: Allow pulling strict artifacts in non-strict modeJürg Billeter2018-05-111-3/+7
| | | | | | | | | | | Remotely cached artifacts matching the strict cache key take precedence over locally cached artifacts matching only the weak cache key. However, locally cached artifacts were excluded from the build plan, which means that BuildStream never even checked whether the strict artifact is available in the remote artifact cache. This changes planning to keep cached elements in the build plan in non-strict mode if a remote artifact cache is used.
* _pipeline.py: Remove unused ignore_cache parameter from _PlannerJürg Billeter2018-05-111-7/+7
|
* _artifactcache/ostreecache.py: Fix global remotesJürg Billeter2018-05-111-2/+2
| | | | | | Counter-intuitively, Python list += mutates the list. Use explicit copy() and extend() instead of += to avoid adding project-specific remotes to the global remote list.
* _project.py: Remove unused internal function _extract_plugin_paths()Chandan Singh2018-05-111-8/+0
| | | | | | For reference, this method was added in commit c41f1093d83eb32606f81005227542699f756b0a, but since commit 4912ed5f8922b47c1a16c3752eb92a3f1dea76b2 it has been unused.
* Add soft reset functionality for workspacesTristan Van Berkom2018-05-102-4/+13
| | | | | | | | | | | Add `--soft` option to `bst workspace reset` which would allow uses to reset workspace-related state without affecting its contents. This will be useful in case when an user wants to re-run configure-commands for a workspaced element. Patch originally by Chandan Singh, rebased against recent refactor. Fixes #375.
* buildstream/plugins/sources/_downloadablefilesource.py: Store etag along ↵Valentin David2018-05-101-23/+42
| | | | | | with cache. Fixes #377.
* _frontend/app.py: Fixed ordering of initialization sequence.Tristan Van Berkom2018-05-101-14/+14
| | | | | We need the logging handler setup before creating the Stream(), as the Stream() will expect logging to be already functional.
* _frontend/cli.py: Fetch all elements when tracking a build plantristan/pipeline-refactorTristan Van Berkom2018-05-081-0/+7
| | | | | | | | | | | | | | | | It makes not sense to type `bst fetch --track --deps all <targets>`, because tracking will inevitably modify the build plan. Stream initialization will not cope with this either, instead of silently doing something which does not make any sense, we add an assertion that this should not happen. Unfortunately since `plan` is the default deps type for `bst fetch`, this is likely to happen so it's important to correct. This patch adds a warning in the case tracking of the build plan elements is requested, and converts the request to track all elements instead.
* _stream.py, _pipeline.py: Refactoring of the pipeline itselfTristan Van Berkom2018-05-085-540/+649
| | | | | | | | | | | | | | | | | | | Here the pipeline becomes essentially stateless, some dangling state remains to be factored out because of frontend accesses which will be changed in a later commit. Essentially, the Pipeline.load() method no longer has any knowledge of the specific purposes of the loaded targets, and now takes a list of target groups and returns a corresponding list of element groups. The Stream() business logic methods now use other pipeline helper methods to create and filter lists from the loaded target elements. The Stream() also finally absorbs the Scheduler frontend facing APIs. However Queues are still exposed on the Stream object for logging purposes and through callbacks such that the frontend can retry elements.
* _artifactcache: Added ArtifactCache.setup_remotes()Tristan Van Berkom2018-05-086-101/+128
| | | | | | | This removes some additional initialization code from Pipeline(). Some symbols have changed here, the initialization is now called from Stream(), and a test case was also adjusted for this.
* _frontend/app.py: Remove partially_initialized()Tristan Van Berkom2018-05-081-67/+42
| | | | There is no more need for this distinction.
* Moving 'fetch_subprojects' configuration to stream <--> loaderTristan Van Berkom2018-05-086-44/+53
| | | | | | | | | This was previously decided in CLI, but knowledge of what to initialize has been moved to Stream(). Now there is no more point to store this configuration in the Context, we just have the Stream() decide it when asking the Pipeline() to invoke the Loader().
* _stream.py, _frontend: Call Stream() APIs with CLI arguments directly.Tristan Van Berkom2018-05-084-319/+552
| | | | | | This shifts the whole responsibility of interpreting command line targets etc to the Stream() object itself. With this commit, the Pipeline() truly becomes slaved to the Stream().
* _frontend: Early logging initializationTristan Van Berkom2018-05-083-147/+120
| | | | | | | | o This makes logging independent from the Pipeline() o Removed size_request Widget() method, add context to Widget() initializer o Make the Status() widget derive anything it needs through the Context()
* _stream.py: Absorb workspace functionality from App.Tristan Van Berkom2018-05-083-157/+214
|
* _stream.py: Add StreamError exceptionTristan Van Berkom2018-05-083-33/+44
| | | | Use Stream error for Stream errors.
* _stream.py: New Stream object, main calling interface for BuildStream coreTristan Van Berkom2018-05-086-380/+427
| | | | | | This is the first part of the pipeline refactor, at this stage all calling interfaces remain the same, except that invocation of the scheduler has been moved from Pipline to Stream.
* Replace bwrap checks with calls to check_bwrap_versionmilloni2018-05-071-18/+2
| | | | See: #373
* _site.py: Add check_bwrap_version() functionmilloni2018-05-071-0/+49
| | | | | | | Lazily parse the version of bwrap the first time the function is called. On subsequent calls, used cached version info. See: #373
* app.py: Ensure an elements sub-dir is created upon project initialisationJames Ennis2018-05-071-0/+8
|
* Fix provenance in error message for undefined variables.Valentin David2018-05-062-4/+19
|
* element.py: Fix buildable check in non-strict modejuerg/non-strict-buildableJürg Billeter2018-05-031-1/+6
| | | | | | | | | | | | | | | Ensure that the strong cache key of each build dependency is available before an element is built. Otherwise the strong cache key of the element cannot be calculated and caching the artifact produces an AssertionError. In non-strict mode an element's strong cache key may not be available yet even though an artifact is available in the local cache. This can happen if the pull job is still pending as the remote cache may have an artifact that matches the strict cache key, which is preferred over a locally cached artifact with a weak cache key match. Fixes #383.
* _artifactcache/pushreceive.py: Modified incorrect error messagePhillip Smyth2018-05-011-1/+1
| | | | | | | changed encode_message push exception from 'Command must by GLib.Variant' to 'Command must be PushCommand'
* element.py: Print info message when artifact was actually pushedJürg Billeter2018-04-301-1/+8
| | | | This matches the pull code path.
* _artifactcache/pushreceive.py: Do not return True for skipped pushJürg Billeter2018-04-301-1/+1
|
* _artifactcache/pushreceive.py: Fix commit object check in send_info()Jürg Billeter2018-04-301-1/+1
| | | | Fixes #325.
* _versions.py: Bumping format version for changes project.refs behaviorTristan Van Berkom2018-04-261-1/+1
| | | | | | | | If we want to depend on being able to revision junction.refs and project.refs separately, then we are better off just considering the project.refs feature as available since the new version 8. This will not harm projects which depended on it since version 5 instead.
* _loader.py: Removing special case error for junctions depending on elementsTristan Van Berkom2018-04-261-4/+0
| | | | | | Leave this error to be handled by preflight. Updated test case to expect the new ElementError instead of a LoadError
* plugins/elements/junction.py: Forbid dependenciesTristan Van Berkom2018-04-261-0/+4
| | | | | Move this logic into the junction element itself, instead of special case erroring for this in the loader.
* element.py: Added BST_FORBID_BDEPENDS to compliment BST_FORBID_RDEPENDSTristan Van Berkom2018-04-261-1/+18
|
* Use versioneer instead of setuptools_scmTristan Van Berkom2018-04-264-4/+540
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Using setuptools_scm had a couple of bad problems: o Unexpected versioning semantics, setuptools_scm would increment the micro version by itself in the case that we derive a version number from something that is not a tag, making the assumption that we are "leading up to" the next micro version. People mostly dont expect this. o When installing in developer mode, i.e. with `pip3 install --user -e .`, then we were always picking the generated version at install time and never again dynamically resolving it. Many of our users install this way and update through git, so it's important that we report more precise versions all the time. This commit needs to make a series of changes at the same time: o Adds versioneer.py to the toplevel, this is used by setup.py for various activities. This is modified only to inform the linter to skip o Adds buildstream/_version.py, which is generated by versioneer and gives us the machinery to automatically derive the correct version This is modified only to inform the linter to skip o Adds a .gitattributes file which informs git to substitute the buildstream/_version.py file, this is just to ensure that the versioning output would work if ever we used `git archive` to release a tarball. o Modifies setup.py and setup.cfg for versioneer o Modifies utils.py and _frontend/cli.py such as to avoid importing the derived version when running bash completion mode, we dont derive the version at completion time because this can result in running a subprocess (when running in developer install mode) and is an undesirable overhead. o Updates tests/frontend/version.py to expect changed version output
* Load and save junctioned source refs from/to junction.refsTristan Van Berkom2018-04-253-10/+37
| | | | | | | | | | | | o _projectrefs.py: Additional constructor option to choose the base name o _project.py: Load two ProjectRefs objects, one for the junctions o source.py: Load and save junctioned source refs with the appropriate ProjectRefs object o tests: Updated some tests to expect junctions to be stored in junction.refs This fixes issue #361
* _loader: Give the loaded MetaSource objects the kind of the owning elementTristan Van Berkom2018-04-252-5/+7
| | | | | | This is needed so that Sources can derive whether they belong to a junction or not, which is needed for separating where junction refs are stored.
* _projectrefs.py: Adhere to policy on private symbolsTristan Van Berkom2018-04-251-18/+16
| | | | A late fix for issue #285
* plugins/elements/compose.py: Avoid losing files inside directory symlinksSam Thursfield2018-04-231-13/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The logic for determining which files were removed by integration commands was broken when dealing with files staged within symlink directories. This rather weird scenario is only possible because of the way BuildStream layers artifacts. If artifact 1 contains a symlink from `/sbin` to `/usr/sbin`, and artifact 2 is staged on top and contains a file `/sbin/init`, then the resulting filesystem contains a file at `/usr/sbin/init`. The manifest used by the compose element is generated from the contents of the individual artifacts, so it lists the original paths such as `/sbin/init`, but would would not contain `/usr/sbin/init` as nothing has processed the symlinks. The path `/sbin/init` is valid inside the composed tree, but filesystem traversals that don't follow symlinks will not report that path in their results. The compose plugin would look for `/sbin/init` in the results of `utils.list_relative_paths()`, find it missing, and would act as if some integration command had removed the file. This meant it would not end up in the results. To fix this, I have inverted the logic that processes the results of the integration commands. We now work through every path in the manifest and check it against the results of the integration commands, rather than the other way around, and if any path from the manifest doesn't appear in the snapshot we assume that it has staged in a different location due to symlinks. See: https://gitlab.com/BuildStream/buildstream/issues/270
* plugins/elements/compose.py: Only calculate snapshot when neededSam Thursfield2018-04-231-5/+8
| | | | | | This is an optimisation for the case where the compose element doesn't do any splitting, and also brings 2 related code fragments closer to each other.
* plugins/elements/compose.py: Use sets instead of lists where appropriateSam Thursfield2018-04-231-7/+8
| | | | | There is no significant order for the lists of added, removed and modified files, so use an unordered set() to store the data.
* Add artifact cache receive profiling domainJim MacArthur2018-04-232-1/+16
| | | | | | _artifactcache/pushreceive.py: Wrap OSTreeReceiver.do_run in a profiling domain. _profile.py: Add 'ARTIFACT_RECEIVE' domain.
* Overwrite sys.excepthook to handle exceptions in the main application.tristan/except-hook-no-testTristan Van Berkom2018-04-231-0/+21
| | | | | | | | | | | | | This uses the existing messaging system to report errors in the main application as a BUG type. It requires the use of a global_app variable which isn't ideal; this may be replaced in future. This partially addresses issue #197. Theoretically, an exception could occur before Scheduler.loop is set up, hence the check for it when terminating all jobs. NOTE: This was originally submitted by Jim MacArthur, and manually reapplied after some refactoring took place.
* deb.py: Make pylint stop complaining about arpyTristan Maat2018-04-201-1/+1
|
* _scheduler/job.py: Disable attribute-defined-outside-init lint errorTristan Van Berkom2018-04-201-0/+1
| | | | | This is in a derived Process from the standard lib, we add this here because we are unsure about the constructor signature.
* _artifactcache/pushreceive.py: Fixed ProcessWithPipes to declare attributes ↵Tristan Van Berkom2018-04-201-0/+3
| | | | in constructor
* _pipeline.py: Declare tracking related members in the constructorTristan Van Berkom2018-04-201-1/+2
|
* _context.py: Properly declare and document log_message_format in the constructorTristan Van Berkom2018-04-201-0/+3
|
* plugins: Disable attribute-defined-outside-init pylint errorTristan Van Berkom2018-04-2014-0/+15
| | | | | Plugins set their attributes in configure(), because the constructor is not public API.
* buildstream/utils.py: Fixing unused variablesTristan Van Berkom2018-04-191-2/+2
|
* buildstream/sandbox/_mount.py: Fixing unused variablesTristan Van Berkom2018-04-191-1/+1
|