summaryrefslogtreecommitdiff
path: root/buildstream/_frontend/cli.py
Commit message (Collapse)AuthorAgeFilesLines
...
* Moving 'fetch_subprojects' configuration to stream <--> loaderTristan Van Berkom2018-05-081-6/+6
| | | | | | | | | 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-081-113/+110
| | | | | | 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().
* _stream.py: Absorb workspace functionality from App.Tristan Van Berkom2018-05-081-16/+25
|
* _stream.py: New Stream object, main calling interface for BuildStream coreTristan Van Berkom2018-05-081-8/+8
| | | | | | 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.
* Use versioneer instead of setuptools_scmTristan Van Berkom2018-04-261-2/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* _frontend/cli.py: Set the track_selection argument to the deps parameterTristan Van Berkom2018-04-191-1/+1
| | | | | | | Tell the pipeline to only track either 'none' or 'all' PipelineSelection modes. This fixes issue #367
* _pipeline.py: Added PipelineSelectionTristan Van Berkom2018-04-191-6/+6
| | | | | | | | Part of a slow, ongoing refactor to unmangle the pipeline into something which just creates pipelines of elements for a centerpiece to process. This also renames Pipeline.deps_elements() -> Pipeline.get_selection()
* _frontend/cli.py: Add option to reset multiple workspacesChandan Singh2018-04-171-6/+16
| | | | | | !357 added support for closing multiple workspaces. Similarly, also allow `bst workspace reset` to work on multiple workspaces, with `--all` as a helper to reset all open workspaces.
* refactor: Do not assume there is only one workspace target in app.pyChandan Singh2018-04-171-2/+6
| | | | | | | | | | | While working with workspaces in _frontend/app.py, we currently assume that there is only workspace in the pippeline. This limits our ability to support multiple workspaces in a given command. Remove this assumption from _frontend/app.py which will allow for the possibility of supporting multiple workspaces from _frontend/cli.py in future. This commit does not change the behavior of these commands though as the target is instead passed as an argument.
* _frontend: Earlier assertion for `bst workspace open` when directory is not ↵Tristan Van Berkom2018-04-171-0/+10
| | | | | | | | empty This just raises the error to the user that the checkout directory where they intend to create a workspace in is not empty, a little bit earlier, without bothering to initialize the pipeline first.
* _frontend: Fix error messaging for closing workspacesTristan Van Berkom2018-04-171-5/+0
| | | | This fixes issue #182 again
* Fix disaster while making cross junction tracking optional.Tristan Van Berkom2018-04-131-6/+8
| | | | | | | | | | | | | | | | | This disaster was introduced in fece8cc81e8d8412e32c6667682a33e7d2f9dafe When doing `bst build --track`, we were: o first scheduling every element to be tracked o later filtering out the cross junction elements o finally asserting consistency state, which would trigger an error because we previously scheduled for tracking. Fixed this by moving all code which resolves elements to track into Pipeline.initialize(), and removing special element list handling from the individual build/fetch/track commands.
* _frontend/cli.py, _pipeline.py: Add options for cross junction tracking.Tristan Van Berkom2018-04-121-10/+23
| | | | | | | | | | | | | | | | | | | | | | | | This patch makes cross junction tracking disabled by default, which was the initial intention when landing project.refs but never got around to doing this (intended to get addressing of junctioned elements via command line sorted first, but didnt happen). This adds the following options to enable cross-junction tracking: o bst build -J / --track-cross-junctions o bst fetch -J / --track-cross-junctions o bst track -J / --cross-junctions This also fixes `bst fetch --track` which had a bug, it was avoiding to track and fetch elements which are in a `cached` consistency state, which is wrong when `--track` is specified. This also updates some test cases which were broken by this change. This fixes issue #354
* _frontend/cli.py, _frontend/app.py: Implemented new `bst init` command.Tristan Van Berkom2018-04-081-1/+27
| | | | | | | This comes with an interactive mode unless the project name is specified on the command line. This fixes issue #342
* _frontend/cli.py: Remove --no-checkout option for `bst workspace reset`Tristan Van Berkom2018-04-071-4/+2
| | | | This option in `bst workspace reset` is just pointless.
* _frontend/cli.py: Add option to close multiple workspacesChandan Singh2018-04-071-4/+13
| | | | | | | | | | | | | At present, it is only possible to close workspaces for elements one at a time. This can become slightly tedious process when you have multiple workspaces open and you want to close all of them, maybe because you just finished working on a set of related elements. Instead of accepting a single element, accept a list of elements as argument for `bst workspace close`. Additionally, add `-a`/`--all` option to close all workspaces. Fixes #337 - Add option to close all workspaces.
* _project.py: Adhere to policy on private symbolsTristan Van Berkom2018-04-031-1/+1
| | | | | | | | | | | | | | | And adjust all surrounding sources for changed symbols. Additional details: o Added Project.get_shell_config() to report the shell configuration, instead of making those members all public o Moved assertions about project specified format versions required of plugins out of Plugin.__init__, and into Project.create_element() and Project.create_source(), so we can keep more things private This is a part of issue #285
* Refactoring of highlevel workspace codeTristan Van Berkom2018-04-021-48/+24
| | | | | | | | | | | | | | | | | | Move all workspace related code out of Pipeline() and into the frontend App() object. Some changes in transition here include: o Workspaces() object methods for looking up and deleting workspaces now take an element name instead of an element. o Share code for partial App() initialization between the `workspace close` and `workspace list` commands o No longer require that an element exist in the project in order to close a workspace This fixes issue #249
* _frontend/app.py: Renamed from main.pyTristan Van Berkom2018-04-021-1/+1
| | | | | Since the CLI and the App object was split up, we should name the file after the object which it implements.
* Include initialization time in the total session time of the build logTristan Van Berkom2018-04-011-104/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | This patch refactors the frontend App object and touches a few internals. o The scheduler now takes a start time given to it at instantiation time, instead of considering the start time to commence in Scheduler.run() o The App.initialize() method has been swapped out for an App.initialized() context manager. This context manager now takes care of the main start/fail/success messages. For convenience and ensured consistency, this context manager is now responsible for: o Printing the startup heading o Printing the end of session summary o Exiting with a consistent error status in case of errors o The Pipeline() object no longer prints the start/fail/success messages, as they are now taken care of by the App() o The cli.py frontend code is much simplified by using the new context manager, also enforcing consistency in how we handle and report errors. This fixes issue #186
* Make workspaces use objects instead of pipeline helper methodsTristan Maat2018-03-271-6/+5
|
* Deprecate `--track-save` option from `bst build`Tristan Van Berkom2018-03-201-7/+10
| | | | | | | | | | | | | | | | | | It makes no sense to support this now that we are adding project.refs, instead of removing the option completely, we document it as deprecated and print a warning. o _frontend/cli.py: Mark the option as deprecated, warn if it's used o _scheduler/trackqueue.py: Remove save optionality o _pipeline.py: Remove save optionality o tests/frontend/buildtrack.py: Stop testing for no-save functionality, This test was actually broken, and only save functionality was being tested. This was due to using a list [True] or [False] in the @pytest.mark.parameterize() statement, both of which are truthy values.
* pylint - dealt with redefined-outer-name and redefined-built in warningsJames Ennis2018-03-141-34/+34
|
* Enhanced bst shell configuration and cli optionsTristan Van Berkom2018-03-041-2/+11
| | | | | | | | | | | | | | | | | | | Some changes to the host-files configuration: o Dont require `host-files` to not be directories We need to specify directories to mount from `project.conf` after all. o Added possibility of specifying optional mounts, to avoid meaningless warnings where optional files don't exist on the host Added --mount CLI option to `bst shell` This allows users to explicitly mount whatever they want into the sandbox environment for `bst shell`. This closes issue #274
* _frontend/cli.py: Adjust help output for `bst shell`Tristan Van Berkom2018-03-021-1/+1
| | | | | Dont specify how we fallback to launching a shell with `sh -i`, since this is now configurable in project.conf.
* _frontend/cli.py: Better help output for the `--option` main option.Tristan Van Berkom2018-03-021-1/+1
| | | | | | Added metavar, making it more clear that you specify: bst --option OPTION VALUE
* Pipeline: Give more helpful errors when opening a workspace for an element ↵Jonathan Maw2018-03-011-2/+1
| | | | | | | | | that has no sources When trying to look at the source code for an element, elements that modify artifacts (e.g. script and compose elements) don't have sources, so we suggest some other elements that they might try opening workspaces for.
* _frontend: Added App.shell() to call instead of directly invoking the ↵Tristan Van Berkom2018-02-241-1/+2
| | | | | | | | Element._shell() And use this place to format a custom prompt for PS1, here we have click and we use the ANSI colors in PS1 only if colors are enabled.
* bst shell: Added --isolate option, disabled by default.tristan/isolate-shellTristan Van Berkom2018-02-231-6/+8
| | | | | | | | | | | | | | | | | | This changes a few things: o How the shell environment and sandbox modes are setup is not decided by whether a `--build` sandbox was staged or not o In interactive build debugging mode, an isolated build sandbox is used o The bst shell command now has the option to control it o All invocations of bst shell now use a read-only rootfs, avoiding FUSE layer and file descriptor limits (this can be made optional later if needed) This is a part of issue #223
* _frontend/cli.py: Check for invalid --track-except or --track-savePhillip Smyth2018-02-131-0/+8
| | | | | | | Report error when --track-except or --track-save is specified without --track or --track-all. Fixes #181
* _frontend/cli.py: Improve closing of non-existing workspacePhillip Smyth2018-02-131-0/+5
| | | | Fixes #182
* Refactor CLI importscompletion-optimizationsTristan Maat2018-02-081-0/+702
This reduces the number of unconditional imports, mainly to speed up bash completion.