You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Gentoo currently improves on Rust cross-compilation. However many Rust packages in Gentoo generate the shell completions files by invoking the resulting binary, which will then output the shell completion (files). Unfortunately, this approach does not work when cross-compiling, since the resulting binary will be a binary of a different architecture than the build host.
Not to sure what is expected of clap. We document both workflows and a reason to generate completions as part of the program (rather than cargo build) is so that the completions can be generated on-demand, rather than statically, so that they "auto-update" with the program (for non-distro use cases). In fact, I'm going to be encouraging that workflow with the new completion system (#3166) as there is a tighter coupling between the completions and the users program.
I wasn't aware that clap is already able to generate the completions as part of the build. Thanks for pointing this out!
In fact, I'm going to be encouraging that workflow
Feel free to encourage it. But with my package-maintainer hat on, there is no need for that if the application is installed via means of the Linux distribution. Because then, the completions are installed system wide via the package manager of the used Linux distribution and updated as soon as the package is updated. So, please keep the generate_to functionality, as it is relevant when packaging the application.
Please complete the following tasks
Clap Version
4.5.8
Describe your use case
Gentoo currently improves on Rust cross-compilation. However many Rust packages in Gentoo generate the shell completions files by invoking the resulting binary, which will then output the shell completion (files). Unfortunately, this approach does not work when cross-compiling, since the resulting binary will be a binary of a different architecture than the build host.
See also https://www.mail-archive.com/gentoo-dev@lists.gentoo.org/msg99709.html
Describe the solution you'd like
The shell completion files should be an output of
cargo build
and not of the final binary.Alternatives, if applicable
No response
Additional Context
No response
The text was updated successfully, but these errors were encountered: