Add an install.rs that lets a file perform installation setup, as well as a permanent installation outdir #2386
Labels
Command-install
E-hard
Experience: Hard
S-needs-design
Status: Needs someone to work further on the design for the feature or fix. NOT YET accepted.
Currently,
cargo install
builds a binary using the regular build script and copies it to.cargo/bin
.In this process we lose the outdir. Which makes sense, since usually that's only needed for compilation.
However, some binaries may need to do extra work on installation, as well as store some data in an output dir. It would be nice if
cargo install
would run a specifiedinstall.rs
which has access to an$INSTALL_OUT_DIR
variable which is a directory under.cargo/bin
which is deleted if empty after installation.This, for example, makes it possible to run
cargo install rust-clippy
(clippy needs a place to stash the compiled plugin).The text was updated successfully, but these errors were encountered: