bazelbuild / bazel

a fast, scalable, multi-language and extensible build system
https://bazel.build
Apache License 2.0
22.69k stars 3.98k forks source link

Publish shell completion scripts separately in releases so they can be downloaded by e.g. the Bazelisk brew formula #22659

Open gibfahn opened 4 weeks ago

gibfahn commented 4 weeks ago

Description of the feature request:

The Bazelisk homebrew formula downloads the zsh completions for the latest bazel release and installs them.

However it can't do the same with fish or bash completions, because they can't be easily downloaded. The bazel formula builds them directly, but that isn't feasible for bazelisk.

Currently the completion scripts are included in the self-extracting archive shell scripts, but aren't otherwise accessible as far as I can tell.

As well as public homebrew, we would also use these files internally if they were available.

Which category does this issue belong to?

CLI

What underlying problem are you trying to solve with this feature?

Making it easy to download the shell completion scripts for bash, zsh, and fish.

Doesn't have to be this layout, but as an example it would be great if this worked:

# One file per completion:
curl -sSL https://github.com/bazelbuild/bazel/releases/latest/download/bazel-completion.bash
curl -sSL https://github.com/bazelbuild/bazel/releases/latest/download/bazel-completion.zsh
curl -sSL https://github.com/bazelbuild/bazel/releases/latest/download/bazel-completion.fish

# Or one file, containing _bazel , bazel-complete.bash , bazel.fish
curl -sSL https://github.com/bazelbuild/bazel/releases/latest/download/bazel-completions.tar.gz

Which operating system are you running Bazel on?

macOS latest

What is the output of bazel info release?

release 7.1.2

If bazel info release returns development version or (@non-git), tell us how you built Bazel.

No response

What's the output of git remote get-url origin; git rev-parse HEAD ?

No response

Have you found anything relevant by searching the web?

Can't find any existing issues.

Any other information, logs, or outputs that you want to share?

No response

Wyverald commented 3 weeks ago

this shouldn't be too hard -- we just need to tweak the build/release scripts a bit.