On 7/6/24 5:04 AM, Florian Schmaus wrote: > FYI, it turns out that at least clap-rs has support to generate the > completion files as part of the build process: > > https://docs.rs/clap_complete/latest/clap_complete/generator/fn.generate_to.html > > Maybe we could encourage projects to simply adjust their build.rs to > generate the completion files. This would avoid inconsistent (Gentoo) > package contents when cross compiling. Cargo is NOT a real build system, as partially evidenced by the fact that it does not possess an install system either. build.rs is an extremely crude hack around this and doesn't work well for that use case. The main consequence is that you have to manually find a checksummed build artifact, since that's all build.rs can create. It reduces the temptation of projects to support this at all, in favor of just providing an argument to generate it which they figure is the only thing people can practically use. So, you can try to convince upstreams to care, but I am cynical. ripgrep, which I suspect due to recent conversations is the reason you're mentioning this, *used* to do exactly what you suggest. Recent versions have moved on to rolling their own argument parser and manpage generator, which they then use to produce prebuilt binary packages via, well, running the compiled binary with --generate. I get the feeling they aren't worried about cross compiling. -- Eli Schwartz