better support for generation and installation of associated files #13663
Labels
A-build-scripts
Area: build.rs scripts
C-feature-request
Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`
S-triage
Status: This issue is waiting on initial triage.
Problem
i was trying to create an idiomatic template that uses
clap_complete
withinbuild.rs
in order to generate and install shell completions, when i realized it is basically impossible.because
cargo install
only installs binaries, you have to use a Makefile, which is fine, but there's a problem:build.rs
is only supposed to create files under$OUT_DIR
$OUT_DIR
is not easily accessible to outside programsProposed Solution
$CARGO_TARGET_DIR
(or a fixed subdir thereof, such astarget/release/aux
)(low priority) add a(see Support installing manpages (and potentially other files) #2729)cargo::install
instruction that allows directingcargo install
to install files relative to a configured prefix (eg..local
,/usr
, or/usr/local
). usingcargo::install=$OUT_DIR/CMDNAME.bash=share/bash/bash-completions/completions/CMDNAME
would install the completion in the specified completion dir.Notes
No response
The text was updated successfully, but these errors were encountered: