homebrew-core icon indicating copy to clipboard operation
homebrew-core copied to clipboard

rustup: add cargo completions; expand rustup completion shell support

Open pantheraleo-7 opened this issue 2 months ago • 5 comments

  • [x] Have you followed the guidelines for contributing?
  • [x] Have you ensured that your commits follow the commit style guide?
  • [x] Have you checked that there aren't other open pull requests for the same formula update/change?
  • [x] Have you built your formula locally with HOMEBREW_NO_INSTALL_FROM_API=1 brew install --build-from-source <formula>, where <formula> is the name of the formula you're submitting?
  • [x] Is your test running fine brew test <formula>, where <formula> is the name of the formula you're submitting?
  • [ ] Does your build pass brew audit --strict <formula> (after doing HOMEBREW_NO_INSTALL_FROM_API=1 brew install --build-from-source <formula>)? If this is a new formula, does it pass brew audit --new <formula>?

  • add rustup completion support for powershell and elvish
  • add cargo completions to (upstream supported shells, namely,) bash and zsh

pantheraleo-7 avatar Nov 12 '25 16:11 pantheraleo-7

I tried using generate_completions_from_executable DSL but there's just no way (at least to my knowledge) to insert the shell argument in the middle of the command (which rustup requires, there's no workaround). Hence the brew audit --strict rustup failure.

rustup
  * line 41, col 5: Use `generate_completions_from_executable` DSL instead of `(bash_completion/"cargo").write Utils.safe_popen_read(bin/"rustup", "completions", "bash", "cargo")`.
  * line 42, col 5: Use `generate_completions_from_executable` DSL instead of `(zsh_completion/"_cargo").write Utils.safe_popen_read(bin/"rustup", "completions", "zsh", "cargo")`.
Error: 2 problems in 1 formula detected.

pantheraleo-7 avatar Nov 12 '25 16:11 pantheraleo-7

Thanks for contributing to Homebrew! :tada: It looks like you're having trouble with a CI failure. See our contribution guide for help. You may be most interested in the section on dealing with CI failures. You can find the CI logs in the Checks tab of your pull request.

github-actions[bot] avatar Nov 12 '25 16:11 github-actions[bot]

hm... it seems that there cannot be two generate_completions_from_executable in a formula for now.

daeho-ro avatar Nov 16 '25 03:11 daeho-ro

Yeah... I tried [almost] everything I can think of. I hoped the DSL set $SHELL but it doesn't and the $ gets escaped anyway in the final command. #13536(comment) should've been implemented IMO. And Elvish support is missing too. All in all, the DSL needs updating.


If I'm not mistaken, not using the DSL is a style error, right? If yes then, should it really be a blocker...?

pantheraleo-7 avatar Nov 17 '25 02:11 pantheraleo-7

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

github-actions[bot] avatar Dec 11 '25 00:12 github-actions[bot]