summaryrefslogtreecommitdiff
path: root/buildstream/_frontend
Commit message (Collapse)AuthorAgeFilesLines
* Download buildtrees on demand for bst shell --use-buildtreetpollard/829Tom Pollard2019-01-281-14/+26
| | | | | | | | | | | | | | | | | Provide bst shell --use-buildtree the ability to attempt to acquire missing buildtrees, given respective option, user pull-buildtree context and remote availability. _frontend/cli.py: Refactor logic for determining --use-buildtree option with given opportunity to attempt pulling a non-local buildtree. Element loaded with artifact_config to allow remote querying. _stream.py: With given user option and element state, construct PullQueue to fetch remote buildtree. Continue or Error without buildtree if cannot be attained. tests/integration/build-tree.py: Update to support new usecases
* _frontend/status.py: Added Cache size usage indicator to status barTristan Van Berkom2019-01-241-7/+35
| | | | | This also adds some comments around the main status bar heading rendering function.
* _frontend/widget.py: Added cache usage entry in the startup headingTristan Van Berkom2019-01-241-0/+1
|
* _frontend/app.py: Initialize logging before preflighting the artifact cacheTristan Van Berkom2019-01-241-5/+7
| | | | The artifact cache emits messages, and we want to allow that in preflight.
* _frontend/widget.py: Render core messages more like other messagesTristan Van Berkom2019-01-241-17/+13
| | | | | | | | | | | | | | In order to test when core activities occur by parsing the stderr in tests, we should make the messages conform more. At the same time, this restores alignment of columns in core messages with the element processing related messages. Also, _scheduler/scheduler.py is updated to make it's activity names conform to the (current) 5 character limit for the sake of alignment. The tests/frontend/logging.py test gets it's regexes updated for the log lines it checks for in stderr.
* _frontend/cli.py: Ignore junctions in default targets where appropriateJürg Billeter2019-01-241-2/+17
| | | | | | | Junctions cannot be built, pulled, or pushed. Specifying a junction on the command line for these commands will result in an error. However, junctions may be in the list of default targets, so they need to be ignored for build, pull, and push commands.
* _project.py: Add get_default_target() and get_default_targets() methodsJürg Billeter2019-01-241-25/+68
| | | | | | _frontend/cli.py: Use new methods. Based on patches by Phillip Smyth.
* _frontend/cli.py: Guess element also for bst build --allJürg Billeter2019-01-241-1/+1
| | | | There is no reason to disallow guess_element() for bst build --all.
* cli.py: Add an obsoletion note to our deprecated commands.James Ennis2019-01-221-5/+5
| | | | | | | | | Click 7.0 allows us to declare commands as 'hidden'. However, sphinx-click and click-man still generate these hidden commands in the documentation and man pages, respectively. This is a stop gap solution until the upstream issues (tracked in issues #879 and #881) have been addressed.
* Mark 'old' checkout command as obsoleteJames Ennis2019-01-221-61/+27
| | | | | | | | | | | This commit marks 'bst checkout' as a 'hidden' command. If used, the user will be prompted to use the new 'bst artifact checkout' command. All tests which used 'bst checkout' have been modified to use the new artifact sub-command. This partially solves #822.
* cli: Add artifact checkout subcommandJames Ennis2019-01-221-0/+69
| | | | | | 'artifact checkout' has slightly different behaviour from 'checkout', that is, either '--directory' or '--tar' are now required options. This is a step towards allowing checkout to take multiple args.
* Move push and pull to the new artifact subcommand groupJames Ennis2019-01-221-72/+106
| | | | | This commit also ensures that if we try to use the 'old' commands, BuildStream will fail and instruct the user to use the new command.
* widget.py: Avoid "showing 0 lines" messages when there are no linesTristan Maat2019-01-181-2/+3
| | | | | | | | This happened when bst is invoked with --message-lines 0 or --error-lines 0, and was arguably a little too verbose (the user explicitly asked us not to show them any lines, after all). Fixes #779
* cli.py: add a hint about '--' to 'bst shell' helpAngelos Evripiotis2019-01-181-0/+6
|
* _frontend/cli.py: Also check original args for --config in bash completionJürg Billeter2019-01-141-7/+20
| | | | | | | The path of the config file generated by testutils for completion tests is passed as regular argument, not via COMP_WORDS. Use that config file in complete_artifact() to ensure the test uses the right artifact directory.
* Scheduler: Introduced JobStatus instead of simple success booleanTristan Van Berkom2019-01-071-3/+3
| | | | | | | | | | This changes the deepest callback from when a Job completes to propagate a JobStatus value instead of a simple boolean, and updates all of the effected code paths which used to receive a boolean to now handle the JobStatus values. This further improves the situation for issue #753, as now we avoid queueing cache size jobs for pull jobs which are skipped.
* _frontend/app.py: Use buildtree for interactive shell on build failureJürg Billeter2019-01-061-1/+1
| | | | Fixes: e29aea36 ("Basic options for shell --build to use buildtrees")
* _frontend/cli.py: Reinstate support for guessing targetsjuerg/source-guess-targetJürg Billeter2019-01-041-0/+10
| | | | | | Moving fetch and track to the source command group accidentally dropped the support for guessing targets for these commands when invoked from a workspace directory. This brings it back.
* Use collections.abc for Mapping, IterableThomas Coldrick2019-01-031-2/+2
| | | | | | | In _yaml.py and _frontend/complete.py we were getting pylint warnings for using collections.Mapping and collections.Iterable, which are abstract classes now provided from collections.abc. This patch just uses the classes from the right place.
* _frontend/widget.py: Fixing new (wrong-import-order) linter errorTristan Van Berkom2018-12-261-1/+1
|
* _frontend/complete.py: Fixing new (simplifiable-if-expression) linter errorTristan Van Berkom2018-12-261-1/+1
|
* _frontend/cli.py: Fixing new (unnecessary-pass) linter errorsTristan Van Berkom2018-12-261-3/+0
|
* BREAK: remove auto-init behaviourAngelos Evripiotis2018-12-201-7/+7
| | | | | | | | | | | | | | | | | | | | | In the event that the project could not be found, stop BuildStream from asking if the user would like to create a new project. Exit with error instead, and give a hint to the user in case they're new. As proposed on the mailing list here: https://mail.gnome.org/archives/buildstream-list/2018-December/msg00082.html The new interaction looks like this: $ bst show nonsuch.bst No project found. You can create a new project like so: bst init Error loading project: None of ['project.conf', '.bstproject.yaml'] found in '/src/temp/blah' or any of its parent directories Fixes #826
* Basic options for shell --build to use buildtreesWilliam Salmon2018-12-191-2/+25
| | | | Fixes issue #740
* Introduce new "source" command groupChandan Singh2018-12-142-104/+158
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Following the message thread https://mail.gnome.org/archives/buildstream-list/2018-November/msg00106.html, implement a new command group called `source`. Move existing `track`, `fetch`, and the recently added `source-checkout` commands under this group. For `track` and `fetch`, this is a BREAKING change, as the old commands have been marked as obsolete. Using them will result in an error message that refers people to use the new versions, like `bst source fetch` instead of old `bst fetch`. `source-checkout` will now become `source checkout` (the dash has turned into a space), and is not a breaking change as it was added in the current development cycle. Note that the functionality to hide commands from help output was added only recently in Click, so the minimum version of Click that we now require is 7.0. Summary of changes: * _frontend/cli.py: Add `source` command group, mark previous versions as obsolete and hide them from the help output. * _frontend/complete.py: Fix completion for hidden commands. * setup.py: Bump Click minimum version to 7.0. * tests: Update to cope with the new command names. Fixes #814.
* cli: Add artifact log commandRichard Maw2018-12-121-0/+59
|
* cli: Add artifact command groupRichard Maw2018-12-121-0/+42
|
* cli: Add support for auto-completing artifact ref namesRichard Maw2018-12-121-7/+26
|
* Remove source bundle commandPhil Dawson2018-12-121-31/+0
| | | | This is part of the work towards #672
* Add option to source-checkout command to generate build scriptsPhil Dawson2018-12-121-4/+6
|
* Add --force / -f option to source-checkout commandPhil Dawson2018-12-121-1/+4
|
* Add --tar option to source-checkout commandPhil Dawson2018-12-121-2/+6
| | | | This commit is part of the work towards #672
* Make specifying elements optional in bst commandsJonathan Maw2018-12-111-13/+85
| | | | | | | | | | | | | | | | | | | | | | Known issues: * `bst shell` works, but `bst shell COMMANDS...` doesn't, because click has no way of separating optional args from variable-length args. * `bst checkout` and `bst source-checkout`'s usage strings mark LOCATION as an optional argument. Because click gets confused if there's an optional argument before a mandatory argument, I had to mark LOCATION as optional internally. * `bst workspace open` makes no sense with element being optional, so I skipped it. * `bst workspace close` will probably need to be revisited when multiple projects can own one workspace. * `bst workspace reset` will happily delete the directory you're currently in, requiring you to `cd $PWD` to see the contents of your directory. I could exclude the top-level directory of the workspace being deleted, but it is entirely valid to run workspace commands from deeper in the workspace. This is a part of #222
* _context.py: Store the directory buildstream was invoked onJonathan Maw2018-12-111-1/+1
|
* cli: Interactively warn if the user is trying to close the workspace they're ↵Jonathan Maw2018-12-111-1/+9
| | | | | | | | | | | | | | | | | | | using to load the project This involves changes in: * _stream.py: * Add the helper Stream.workspace_is_required() * userconfig.yaml: * Add a default value for prompt.really-workspace-close-project-inaccessible * _context.py: * Load the prompt 'really-workspace-close-project-inaccessible' from user config. * cli.py: * If buildstream is invoked interactively, prompt the user to confirm that they want to close the workspace they're using to load this project. This is a part of #222
* cli.py: Use utils' search upwards helper when searching for project.confJonathan Maw2018-12-111-11/+2
| | | | This is a part of #222
* Refactor and simplify _prepare_sandbox for elementsBenjamin Schubert2018-12-031-1/+9
| | | | | | | | Before we would have a intricate logics with multiple arguments that might get ignored. This simplifies the design and introduces a bool `shell` instead of having two different variables concerned about scope
* Add `--deps build` option to `bst checkout`Chandan Singh2018-12-031-1/+1
| | | | | | | | | | | | | | | As discussed in https://mail.gnome.org/archives/buildstream-list/2018-September/msg00064.html, add `--deps build` option to `bst checkout`. This will allow users to checkout the all build dependencies of a given element using a single command. - _frontend/cli.py: Add `--deps build` option for `bst checkout`. - element.py: Support `deps='build'` in Element._prepare_sandbox(). - tests/frontend/buildcheckout.py: Ensure `--deps build` works as expected.
* cli.py: no autocomplete on files without .bstPhillip Smyth2018-11-301-1/+5
|
* _stream.py: Ability to pull missing buildtrees outside of pull/buildTom Pollard2018-11-301-0/+4
| | | | | | | | | | | | | | | | | | Adds helper function _buildtree_pull_required() to determine if a pullqueue should be constructed, for commands outside of bst pull and build where it is determined that an element's buildtree artifact is to be required given the respective semantics and config. Utilised in push() to attempt to mitigate skipping the push of partial elements without the user having to have preceded it with an explicit pull. cli.py: Add new behaviour to push command description element.py: Move _cached_buildtree() to be non local private method, use _KeyStrength types to reduce duplication. tests/integration/pullbuildtrees.py also updated to cover this use-case.
* Workspace CLI updateWilliam Salmon2018-11-211-17/+9
| | | | | | | This is to update the workspace CLI to as agreed on the mailing list https://mail.gnome.org/archives/buildstream-list/2018-September/msg00046.html This patch also introduces the default workspace directory.
* Add prompt.workspace-... optionsAngelos Evripiotis2018-11-201-2/+2
| | | | | | | | | | Provide options in project.conf to disable the 'Are you sure ...' prompts when making destructive changes: - Add prompt.really-workspace-close-remove-dir - Add prompt.really-workspace-reset-hard Add a NEWS item for these.
* Add prompt.auto-init buildstream.conf optionAngelos Evripiotis2018-11-201-3/+4
| | | | | | | | | | | | | | | Provide an option in buildstream.conf to disable the 'Would you like to ...' prompt when we cannot resolve a project. Some users prefer not to be interrupted by such prompts, so pave the way to creating options to disable all those that might get in the way. Follow the example of the advice.* options 'git-config', and create a namespace for these UI options grouped by behaviour, rather than an over-reaching 'ui.*' namespace. In later work perhaps we'll also add 'advice.*' options. Add a NEWS item for this.
* Add `bst source-checkout` commandChandan Singh2018-11-191-0/+27
| | | | | | | | | | | | As discussed in https://mail.gnome.org/archives/buildstream-list/2018-September/msg00064.html, add `bst source-checkout` command. This will allow users to checkout sources for a given target. * _frontend/cli.py: Add source-checkout command * _pipeline.py: Add assert_sources_cached() method * _stream.py: Add source_checkout method, abstract out __check_location_writable() method that used to part of checkout()
* Add cli main and user config option for 'pull-buildtrees' context.Tom Pollard2018-11-172-1/+4
| | | | | | | | | | | | _context.py: Add pull_buildtrees global user context, the default of which is set to False via the addition of pull-buildtrees to userconfig.yaml cache group. _frontend/app.py & cli.py: Add --pull-buildtrees as a bst main option, which when passed will override the default or user defined context for pull_buildtrees. tests/completions/completions.py: Update for the added flag.
* _frontend/app.py: Set correct element-path in interactive bst-initchiaratolentino/bst-init-interactive-elementpathctolentino82018-10-311-1/+1
|
* Element: Use cached buildtree in build shells and failure shellsJonathan Maw2018-10-302-12/+1
| | | | | | | | | | | | | | | | | | | | | | | | This includes changes in app.py: * Interactive failure shell no longer uses the failed build sysroot, defaulting to the cached build tree. Changes in element.py are: * Errors caused by building don't store the failed build sysroot, instead storing that a sandbox can be created to debug the error. * When staging sources, will stage the element's cached build tree if it exists. Changes in _exceptions.py: * BstError.sandbox is now a flag of whether a sandbox can be opened up to debug the error. Changes in widget.py: * Don't try to print any information about the sandbox. Changes in _message.py: * Fix documentation so Message.sandbox is not a directory any more. This is part of #539
* _frontend/status.py: Reorder importsDaniel Silverstone2018-10-251-1/+1
| | | | | | | The `curses` import is "standard" whereas `click` is not. As such, despite alphabetical order normally being the rule, `curses` must come before `click`. Signed-off-by: Daniel Silverstone <daniel.silverstone@codethink.co.uk>
* _frontend/app.py: Remove unused import of `resource`Daniel Silverstone2018-10-251-1/+0
| | | | | | The `resource` import was unused. Removed. Signed-off-by: Daniel Silverstone <daniel.silverstone@codethink.co.uk>
* Fix spelling of it's and itsRichard Dale2018-10-161-1/+1
|