diff --git a/NEWS b/NEWS index 7e6ec8477ca9309640849c8a81fdfb7e9403f120..7ee63f952c47517af63b0ccea76b1369bf74e923 100644 --- a/NEWS +++ b/NEWS @@ -30,6 +30,12 @@ buildstream 1.3.1 make changes to their .bst files if they are expecting these environment variables to be set. + o BREAKING CHANGE: The 'auto-init' functionality has been removed. This would + offer to create a project in the event that bst was run against a directory + without a project, to be friendly to new users. It has been replaced with + an error message and a hint instead, to avoid bothering folks that just + made a mistake. + o Failed builds are included in the cache as well. `bst checkout` will provide anything in `%{install-root}`. A build including cached fails will cause any dependant elements @@ -67,8 +73,8 @@ buildstream 1.3.1 instead of just a specially-formatted build-root with a `root` and `scratch` subdirectory. - o The buildstream.conf file learned new 'prompt.auto-init', - 'prompt.really-workspace-close-remove-dir', and + o The buildstream.conf file learned new + 'prompt.really-workspace-close-remove-dir' and 'prompt.really-workspace-reset-hard' options. These allow users to suppress certain confirmation prompts, e.g. double-checking that the user meant to run the command as typed. diff --git a/buildstream/_context.py b/buildstream/_context.py index a3487a7948378b665cf8b937df869dfc467aa03f..e0eea99ff0968d39ea21a6677cf27e64d3d24bac 100644 --- a/buildstream/_context.py +++ b/buildstream/_context.py @@ -117,10 +117,6 @@ class Context(): # Whether or not to attempt to pull build trees globally self.pull_buildtrees = None - # Boolean, whether to offer to create a project for the user, if we are - # invoked outside of a directory where we can resolve the project. - self.prompt_auto_init = None - # Boolean, whether we double-check with the user that they meant to # remove a workspace directory. self.prompt_workspace_close_remove_dir = None @@ -258,12 +254,10 @@ class Context(): prompt = _yaml.node_get( defaults, Mapping, 'prompt') _yaml.node_validate(prompt, [ - 'auto-init', 'really-workspace-close-remove-dir', + 'really-workspace-close-remove-dir', 'really-workspace-close-project-inaccessible', 'really-workspace-reset-hard', ]) - self.prompt_auto_init = _node_get_option_str( - prompt, 'auto-init', ['ask', 'no']) == 'ask' self.prompt_workspace_close_remove_dir = _node_get_option_str( prompt, 'really-workspace-close-remove-dir', ['ask', 'yes']) == 'ask' self.prompt_workspace_close_project_inaccessible = _node_get_option_str( diff --git a/buildstream/_frontend/app.py b/buildstream/_frontend/app.py index 87b85cd37d89fb654fc482ebca44e95164bc5735..96e3c60aee7baecf52a603c8aafb1692f6e84028 100644 --- a/buildstream/_frontend/app.py +++ b/buildstream/_frontend/app.py @@ -219,13 +219,13 @@ class App(): default_mirror=self._main_options.get('default_mirror')) except LoadError as e: - # Let's automatically start a `bst init` session in this case - if e.reason == LoadErrorReason.MISSING_PROJECT_CONF and self.interactive: - click.echo("A project was not detected in the directory: {}".format(directory), err=True) - if self.context.prompt_auto_init: - click.echo("", err=True) - if click.confirm("Would you like to create a new project here?"): - self.init_project(None) + # Help users that are new to BuildStream by suggesting 'init'. + # We don't want to slow down users that just made a mistake, so + # don't stop them with an offer to create a project for them. + if e.reason == LoadErrorReason.MISSING_PROJECT_CONF: + click.echo("No project found. You can create a new project like so:", err=True) + click.echo("", err=True) + click.echo(" bst init", err=True) self._error_exit(e, "Error loading project") diff --git a/buildstream/data/userconfig.yaml b/buildstream/data/userconfig.yaml index 4429d1f6d6ef5a40580640268c217c4061b37225..6351619aa2db3b8c1de35557fc9aa5a135799cf7 100644 --- a/buildstream/data/userconfig.yaml +++ b/buildstream/data/userconfig.yaml @@ -112,14 +112,6 @@ logging: # prompt: - # Whether to create a project with 'bst init' if we are invoked outside of a - # directory where we can resolve the project. - # - # ask - Prompt the user to choose. - # no - Never create the project. - # - auto-init: ask - # Whether to really proceed with 'bst workspace close --remove-dir' removing # a workspace directory, potentially losing changes. #