Angelos Evripiotis pushed to branch aevri/rm-autoinit at BuildStream / buildstream
Commits:
-
87636d5d
by Angelos Evripiotis at 2018-12-19T13:53:23Z
4 changed files:
Changes:
| ... | ... | @@ -30,6 +30,12 @@ buildstream 1.3.1 |
| 30 | 30 |
make changes to their .bst files if they are expecting these environment
|
| 31 | 31 |
variables to be set.
|
| 32 | 32 |
|
| 33 |
+ o BREAKING CHANGE: The 'auto-init' functionality has been removed. This would
|
|
| 34 |
+ offer to create a project in the event that bst was run against a directory
|
|
| 35 |
+ without a project, to be friendly to new users. It has been replaced with
|
|
| 36 |
+ an error message and a hint instead, to avoid bothering folks that just
|
|
| 37 |
+ made a mistake.
|
|
| 38 |
+ |
|
| 33 | 39 |
o Failed builds are included in the cache as well.
|
| 34 | 40 |
`bst checkout` will provide anything in `%{install-root}`.
|
| 35 | 41 |
A build including cached fails will cause any dependant elements
|
| ... | ... | @@ -67,8 +73,8 @@ buildstream 1.3.1 |
| 67 | 73 |
instead of just a specially-formatted build-root with a `root` and `scratch`
|
| 68 | 74 |
subdirectory.
|
| 69 | 75 |
|
| 70 |
- o The buildstream.conf file learned new 'prompt.auto-init',
|
|
| 71 |
- 'prompt.really-workspace-close-remove-dir', and
|
|
| 76 |
+ o The buildstream.conf file learned new
|
|
| 77 |
+ 'prompt.really-workspace-close-remove-dir' and
|
|
| 72 | 78 |
'prompt.really-workspace-reset-hard' options. These allow users to suppress
|
| 73 | 79 |
certain confirmation prompts, e.g. double-checking that the user meant to
|
| 74 | 80 |
run the command as typed.
|
| ... | ... | @@ -117,10 +117,6 @@ class Context(): |
| 117 | 117 |
# Whether or not to attempt to pull build trees globally
|
| 118 | 118 |
self.pull_buildtrees = None
|
| 119 | 119 |
|
| 120 |
- # Boolean, whether to offer to create a project for the user, if we are
|
|
| 121 |
- # invoked outside of a directory where we can resolve the project.
|
|
| 122 |
- self.prompt_auto_init = None
|
|
| 123 |
- |
|
| 124 | 120 |
# Boolean, whether we double-check with the user that they meant to
|
| 125 | 121 |
# remove a workspace directory.
|
| 126 | 122 |
self.prompt_workspace_close_remove_dir = None
|
| ... | ... | @@ -258,12 +254,10 @@ class Context(): |
| 258 | 254 |
prompt = _yaml.node_get(
|
| 259 | 255 |
defaults, Mapping, 'prompt')
|
| 260 | 256 |
_yaml.node_validate(prompt, [
|
| 261 |
- 'auto-init', 'really-workspace-close-remove-dir',
|
|
| 257 |
+ 'really-workspace-close-remove-dir',
|
|
| 262 | 258 |
'really-workspace-close-project-inaccessible',
|
| 263 | 259 |
'really-workspace-reset-hard',
|
| 264 | 260 |
])
|
| 265 |
- self.prompt_auto_init = _node_get_option_str(
|
|
| 266 |
- prompt, 'auto-init', ['ask', 'no']) == 'ask'
|
|
| 267 | 261 |
self.prompt_workspace_close_remove_dir = _node_get_option_str(
|
| 268 | 262 |
prompt, 'really-workspace-close-remove-dir', ['ask', 'yes']) == 'ask'
|
| 269 | 263 |
self.prompt_workspace_close_project_inaccessible = _node_get_option_str(
|
| ... | ... | @@ -219,13 +219,14 @@ class App(): |
| 219 | 219 |
default_mirror=self._main_options.get('default_mirror'))
|
| 220 | 220 |
except LoadError as e:
|
| 221 | 221 |
|
| 222 |
- # Let's automatically start a `bst init` session in this case
|
|
| 223 |
- if e.reason == LoadErrorReason.MISSING_PROJECT_CONF and self.interactive:
|
|
| 224 |
- click.echo("A project was not detected in the directory: {}".format(directory), err=True)
|
|
| 225 |
- if self.context.prompt_auto_init:
|
|
| 226 |
- click.echo("", err=True)
|
|
| 227 |
- if click.confirm("Would you like to create a new project here?"):
|
|
| 228 |
- self.init_project(None)
|
|
| 222 |
+ # Help users that are new to BuildStream by suggesting 'init'.
|
|
| 223 |
+ # We don't want to slow down users that just made a mistake, so
|
|
| 224 |
+ # don't stop them with an offer to create a project for them.
|
|
| 225 |
+ if e.reason == LoadErrorReason.MISSING_PROJECT_CONF:
|
|
| 226 |
+ click.echo("A project was not detected in the directory: '{}'".format(directory), err=True)
|
|
| 227 |
+ click.echo("You can create a new project like so:", err=True)
|
|
| 228 |
+ click.echo("", err=True)
|
|
| 229 |
+ click.echo(" bst init", err=True)
|
|
| 229 | 230 |
|
| 230 | 231 |
self._error_exit(e, "Error loading project")
|
| 231 | 232 |
|
| ... | ... | @@ -112,14 +112,6 @@ logging: |
| 112 | 112 |
#
|
| 113 | 113 |
prompt:
|
| 114 | 114 |
|
| 115 |
- # Whether to create a project with 'bst init' if we are invoked outside of a
|
|
| 116 |
- # directory where we can resolve the project.
|
|
| 117 |
- #
|
|
| 118 |
- # ask - Prompt the user to choose.
|
|
| 119 |
- # no - Never create the project.
|
|
| 120 |
- #
|
|
| 121 |
- auto-init: ask
|
|
| 122 |
- |
|
| 123 | 115 |
# Whether to really proceed with 'bst workspace close --remove-dir' removing
|
| 124 | 116 |
# a workspace directory, potentially losing changes.
|
| 125 | 117 |
#
|
