Hi all,

`bst shell` currently defaults to `--use-buildtree=ask`, which asks the
user whether they want to use a cached buildtree instead of a clean
source tree for build shells. In non-interactive mode it's equivalent
to `--use-buildtree=never`.

I see a few issues with this:

 * If the buildtree is not already available in the local cache, the
   user is asked whether to pull and use the buildtree without knowing
   whether the buildtree is actually available on a configured artifact
   server. I.e., in that scenario it's simply an interactive prompt for
   the `--use-buildtree` CLI option and the user has to respond with
   'try', 'always' or 'never', which seems very odd to me. As far as I
   can tell, no other BuildStream command has a similar prompt.

 * The above 'pull and use' prompt is shown only if both `--pull` and
   `--pull-buildtrees` are specified (the latter is also configurable
   in buildstream.conf but is disabled by default). If we already
   provide an interactive prompt, I'd expect it to be presented even if
   `--pull-buildtrees` is not enabled.

 * The prompt is presented even if `--build` is not specified, however,
   only build shells can actually use buildtrees. This would be easy to
   fix, of course.

 * I'm working towards supporting remote execution without downloading
   blobs. This requires remote cache queries, which will often be
   slower than local cache queries. An interactive prompt after waiting
   for the remote cache queries to complete would make the user
   experience even worse.

I'm proposing to completely drop support for `--use-buildtree=ask`,
defaulting to `--use-buildtree=never` (the current default for non-
interactive usage). Requiring the user to explicitly specify `--use-
buildtree` if they want to stage a cached buildtree seems reasonable to
me.

Any thoughts on this? Does anyone think it's worthwhile to keep support
for `bst shell --use-buildtree=ask`?

It may make sense to make the CLI a bit more convenient while we're at
it. E.g., have `--use-buildtree` imply `--build` as buildtree only
makes sense with build shells. Maybe even rename it to just `
--buildtree` such that the user can type `bst shell --build` to get a
clean build shell and `bst shell --buildtree` to get a shell with a
cached buildtree.

This would require making the click option a boolean flag instead of a
choice, which means that we would also lose `--use-buildtree=try`.
However, I don't see an issue adding a separate `--try-buildtree` flag
for this, assuming we want to keep that functionality.

Cheers,
Jürg

Reply via email to