clap
clap copied to clipboard
Generate shell completions as part of the build process to assist cross compilation
Please complete the following tasks
- [X] I have searched the discussions
- [X] I have searched the open and rejected issues
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/[email protected]/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