summaryrefslogtreecommitdiff
path: root/src/buildstream/_frontend
Commit message (Collapse)AuthorAgeFilesLines
* fix tab-completion: hardcode default min versiondwinship/fix-tab-completionDouglas Winship2020-07-141-13/+1
| | | | | | | Hardcodes the default min version as "2.0", instead of using a function. (The function was causing an ImportError during tab completion, because it attempts to import "__version__", which isn't available at tab completion time.)
* Don't strip '.bst' from user-supplied checkout dirDouglas Winship2020-07-101-2/+2
| | | | | | | | Allows user to supply a directory name ending in '.bst' for "bst artifact checkout", without buildstream removing '.bst' from the end. (It's only supposed to remove '.bst' if the user didn't supply a directory name, and buildstream is auto-generating a name based on the target name.)
* _state.py: Only use a single place of truth for the start timeBenjamin Schubert2020-07-062-3/+3
| | | | | This moves all implementations of 'start_time' into a single place for easier handling and removing roundtrips of notifications
* app.py: Remove unnecessary operation in _message()Benjamin Schubert2020-07-061-2/+1
| | | | | This copies a dictionary before it gets expanded, which is not necessary since the expansion will not keep the dictionary as is
* Add `bst source push` commandJürg Billeter2020-07-061-0/+52
|
* _loader: Adding LoadContexttristan/load-contextTristan van Berkom2020-06-161-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of passing around many details though calling signatures throughout the loader code, create a single LoadContext object which holds any overall loading state along with any values which are constant to a full load process. Overall this patch does: * _frontend/app.py: No need to pass Stream.fetch_subprojects() along anymore * _loader/loadelement.pyx: collect_element_no_deps() no longer takes a task argument * _loader/loader.py: Now the Loader has a `load_context` member, and no more `_fetch_subprojects` member or `_context` members Further, `rewritable` and `ticker` is no longer passed along through all of the recursing calling signatures, and `ticker` itself is finally removed because this has been replaced a long time ago with `Task` API from `State`. * _pipeline.py: The load() function no longer has a `rewritable` parameter * _project.py: The Project() is responsible for creating the toplevel LoadContext() if one doesn't exist yet, and this is passed through to the Loader() (and also passed to the Project() constructor by the Loader() when instantiating subprojects). * _stream.py: The `Stream._fetch_subprojects()` is now private and set on the project when giving the Project to the Stream in `Stream.set_project()`, also the Stream() sets the `rewritable` state on the `LoadContext` at the earliest opportunity, as the `Stream()` is the one who decides this detail. Further, some double underscore private functions are now regular single underscores, there was no reason for this inconsistency. * tests/internals/loader.py: Updated for API change
* Completely abolish job pickling.tristan/nuke-pickle-jobberTristan van Berkom2020-06-151-42/+0
|
* _frontent/cli.py: Removed message to user informing the workspace is closed.Tristan van Berkom2020-06-111-13/+0
| | | | | | | | | When closing a workspace while the `workspace close` command was issued from the closed workspace, we go to great lengths to inform the user that they can no longer run bst commands from the closed workspace directory. This is not worthwhile, the user will know this the next time they run `bst` anyway.
* Optimize variable flatteningValentin David2020-06-031-1/+1
| | | | | | | | | | | | | | | | | 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.
* _pluginfactory: Delegating the work of locating plugins to the PluginOriginTristan van Berkom2020-05-281-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This way we split up the logic of how to load plugins from different origins into their respective classes. This commit also: o Introduces PluginType (which is currently either SOURCE or ELEMENT) o Reduces the complexity of the PluginFactory constructor o Kills the loaded_dependencies list and the all_loaded_plugins API, and replaces both of these with a new list_plugins() API. Consequently the jobpickler.py from the scheduler, and the widget.py from the frontend, are updated to use list_plugins(). o Split up the PluginOrigin implementations into separate files Instead of having all PluginOrigin classes in pluginorigin.py, split it up into one base class and separate files for each implementation, which is more inline with BuildStream coding style. This has the unfortunate side effect of adding load_plugin_origin() into the __init__.py file, because keeping new_from_node() as a PluginOrigin class method cannot be done without introducing a cyclic dependency with PluginOrigin and it's implementations.
* _frontend/profile: Use non-greedy search to substitute variablesChandan Singh2020-05-181-1/+1
| | | | | | | | 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.
* _frontend/cli: Support "build" and "run" values for `artifact push --deps`Chandan Singh2020-05-131-1/+6
|
* _frontend/cli: Support "build" and "run" values for `artifact pull --deps`Chandan Singh2020-05-131-1/+6
|
* _frontend/cli: Support "build" and "run" values for `source fetch --deps`Chandan Singh2020-05-131-1/+12
|
* _frontend/cli: Support "build" value for `bst build --deps`Chandan Singh2020-05-131-1/+4
| | | | | | This can be quite handy when one is preparing to open a build shell. This originally came up in https://gitlab.com/BuildStream/buildstream/-/issues/685#note_105460896.
* Remove bst shell --sysrootJürg Billeter2020-04-251-13/+1
| | | | This is no longer needed now that we support caching buildtrees in CAS.
* Replace format-version with min-versionTristan Van Berkom2020-04-252-51/+67
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * "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.
* Fix typo namspaceing -> namespacingSean Borg2020-04-211-1/+1
|
* _frontend/cli.py: Fix formatting for `bst show` help textChandan Singh2020-03-041-6/+5
| | | | | | | | | | | | | | * Sphinx does not allow sections within docstrings so convert the "FORMAT" heading into bold text. See https://sphinx-dev.narkive.com/7rqrxjgL/headings-in-docstrings for some related discussion on this issue. * Sphinx uses double backticks for code samples so fix that for CLI options. * Fix a typo. Fixes #323.
* exceptions: Expose ErrorDomain, ErrorLoadReasonThomas Coldrick2020-01-231-1/+2
| | | | | | | 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.
* _frontend/cli.py: Make show() --use-buildtree respect pull semanticsTom Pollard2020-01-211-23/+62
| | | | | | | Ensure that if a buildtree isn't cached locally, it's only fetched if --pull and pull-buildtrees config are set. Also, only attempt to fetch if it's plausible that it could be pulled, with appropriate messaging based on local cached state.
* element.py: Remove _get_consistency and introduce explicit methodsBenjamin Schubert2020-01-161-4/+3
| | | | | | | This replaces the _get_consistency method by two methods: `_has_all_sources_resolved` and `_has_all_sources_cached` which allows a more fine grained control on what information is needed.
* element.py: Rename '_source_cached' to '_has_all_sources_in_source_cache'Benjamin Schubert2020-01-161-1/+1
| | | | | | '_source_cached' is not explicit enough as it doesn't distinguishes between sources in their respective caches and sources in the global sourcecache.
* userconfig.yaml: Add bool for disabling console output throttlingtpollard/messagerateTom Pollard2020-01-151-2/+6
| | | | Also highlight the change & configuration in NEWS
* _frontend/app.py: Make message printing tick drivenTom Pollard2020-01-151-12/+31
|
* scheduler.py: Handle exceptions that are caught under the event looptpollard/loop_exceptionTom Pollard2020-01-101-2/+5
| | | | | | The default exception handler of the async event loop bypasses our custom global exception handler. Ensure that isn't the case, as these exceptions are BUGS & should cause bst to exit.
* _frontend/widget.py: show_pipeline() Don't show buildable for junctionTom Pollard2020-01-092-2/+4
| | | | | Instead output "junction" in magenta for info. Also include test in format/junctions.py
* Make PipelineSelection a proper enum typeTristan Maat2020-01-081-36/+73
| | | | | | | | | | | | | | | | | | PipelineSelection is one of the few stringy types that weren't converted to FastEnum, presumably because we lacked a mechanism for only allowing a sub-set of options as CLI arguments. We've re-designed this since, and as part of the UI/UX refactor we'd like to generally clean this, but that is probably still a while out. Since that hasn't happened, for now, this adds a feature to the FastEnumType that allows specifying only a subset of values is allowed for a specific command, so that we can use the type as a proper enum. We also get rid of a number of accidental uses of strings, and move PipelineSelection to buildstream.types so that we don't have a significant import overhead for it.
* _stream.py: Remove dead code and comments about trackingBenjamin Schubert2019-11-251-13/+4
| | | | | We don't have many of the `--track` options anymore, so we can remove handling for them in parts of the code that don't need it.
* Remove all `--track` optionsTristan Maat2019-11-221-32/+4
|
* Improve help message for workspace soft-resetDarius Makovsky2019-11-191-1/+5
|
* Reformat code using BlackChandan Singh2019-11-147-883/+1099
| | | | | | | 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.
* Pass color setting to StatusDarius Makovsky2019-11-131-5/+3
|
* _frontend: Simplify color handlingChandan Singh2019-11-123-13/+12
| | | | | | | | | | | | Currently we store color configuration in our App object, and have to remember to pass it around to `click.echo()` when printing things on the screen. This is error-prone as we can forget to do so. This leads to bugs like #1200, where `bst init` was not respecting `--no-colors` flag. Instead of doing that, this patch controls colors in output by configuring the `click.Context` object. Fixes #1200.
* app.py: Also catch SystemError with click.AbortBenjamin Schubert2019-11-081-2/+8
| | | | | | | | | This is to catch an error when sometimes the readline buffer of stdin gets corrupted during the second CTRL-C we send, and leads to having BuildStream hand and throw a SystemError. Catching the SystemError and treating as a click.Abort doesn't seem to have adverse effects.
* frontend: Remove tracking options from `bst build`Chandan Singh2019-11-041-29/+1
| | | | | | | | | | | | | BREAKING CHANGE: Remove all tracking related options and flags from `bst build` command, as discussed on mailing list previously. See https://mail.gnome.org/archives/buildstream-list/2019-October/msg00009.html for the original proposal, and https://mail.gnome.org/archives/buildstream-list/2019-October/msg00024.html for a summary. At the same time, remove use of the removed options from our test suite.
* _frontend/status.py: Complete names when rendering dynamic queue statusTom Pollard2019-10-251-3/+3
| | | | | | | At somepoint action_name instead of complete_name started to be rendered to the user for the dynamic list of queue status reports. As we now have more of a UI seperation between 'Artifact' & 'Source' tasks, it also makes sense to reflect these actions in this output.
* cli: BST_FORCE_START_METHOD only sets if necessaryAngelos Evripiotis2019-10-181-10/+39
| | | | | | | | | | | | | Allow situations where the start method is already set, this enables us to use this in testing situations. Also, print a diagnostic if it's already set to something we didn't want. Now this block got more complex, split out into a new function. Now we're using this string a lot, extract it to a variable, to make sure we're spelling it correctly everywhere.
* cli.py: no fcntl on WindowsAngelos Evripiotis2019-10-081-9/+18
| | | | | | | | | | | | | Work around the fact that we can't import 'fcntl' on Windows, and confine the workaround to as small a scope as we can. This enables us to run at least these commands on Windows: bst help bst init We can't run any commands that require a Platform object though, which is most commands.
* Do not check for casd in bash completionTristan Maat2019-10-021-1/+1
| | | | | | | | | This caused stacktraces when a user didn't have buildbox-casd installed, even though it wasn't required for completion, even for artifacts. It does add a slightly ugly parameter to Context, long-term it might make sense to create a special slimmed-down context for completion.
* _stream.py: Load the appropriate PipelineSelection in checkoutJames Ennis2019-09-131-4/+1
| | | | | | | This patch ensures checkout behaves like the rest of our commands which support --deps options. That is, we carry the "deps" string through to the Stream and load the corresponding PipelineSelection.
* cli.py: Allow checkout to handle --deps allJames Ennis2019-09-131-2/+2
| | | | | | | | source checkout supports --deps all, so we should be consistent. Additionally, a user may want to have build deps in a potential chroot so you could rebuild any component.
* cli.py: Add --compression option to source checkoutJames Ennis2019-09-121-1/+9
| | | | | | | | | !1451 introduced the --compression option to bst artifact checkout. This MR is a step towards making the commands more symmetric, and introduces the --compression option to bst source checkout Now we're compressing, we must explicitly close the tarball once we're done writing to it.
* cli.py: Make source checkout more consistent with artifact checkoutJames Ennis2019-09-121-12/+15
| | | | | | | | | | | | This MR changes the behaviour of source checkout so that it is more like artifact checkout. That is, a --directory option can be provided, rather than a mandatory LOCATION. In addition to this, the --tar option is no longer a boolean flag, rather it expects a tarfile name (just like artifact checkout) The appropriate tests have also been altered so that they support the new API
* cli.py: Fix typo in source checkout's doc stringJames Ennis2019-09-121-1/+1
|
* _context.py: Add 'dependencies' option to 'build' user configRaoul Hidalgo Charman2019-09-121-1/+4
| | | | | This option sets the default value for the `--deps` option of `bst build`.
* scheduler.py: Notification for interactive failure retryTom Pollard2019-09-101-5/+1
| | | | | | | | | Add a notifcation for RETRY. This moves the retry handling into scheduler, which will be running in the process which has been suspended for interactivity and as such will be able to load the relevant Element. Note a failed job via the scheduler should never not have a related queue, so the try except when matching the queue via the action name should not be needed.
* _frontend/status.py: Fix non-formatted terminatorcoldtom/fix-status-job-renderThomas Coldrick2019-09-091-1/+1
| | | | | | | | Currently we don't format the terminator to the displayed widget for a StatusJob, which means that we have blue brackets apart from the terminating one, which is white. This is a trivial patch to fix this.
* cli.py: remove superfluous kwargs for flagsDarius Makovsky2019-09-091-38/+38
| | | | cleanup help msgs
* Address no-else-raise pylint warningJames Ennis2019-09-062-4/+4
| | | | | | | | | | | In the latest released version of pylint (2.3.x), the "no-else-raise" (R1720) warning has been introduced. See: http://pylint.pycqa.org/en/latest/whatsnew/changelog.html#what-s-new-in-pylint-2-3-0 There are many instances of this in our codebase, which this patch addresses.