Description
Hi!
This is a pre-RFC style issue just to write down some long-term thoughts.
The IDE support for rust progressed enough that build scripts need some special support. Specifically, for IDEs it would be useful if Cargo can just run the build scripts and compile proc-macros, without building any code. That is, do all the stuff for $host
, and skip everything $target
related. With this, IDE can provide full support for generated code and procedural macros, without requiring that the code itself builds (if it can also discover results of build-scripts, like the OUT_DIR
).
In the ideal world, I think this should work like this:
cargo build --compile-time-deps # only stuff for $host is run
cargo run # guaranteed to *not* build anything for $host
cargo test # guaranteed to *not* build anything for $host as well
I think we unfortunately can't do that now, as there's little separation between "stages" of dependencies, and, for example cargo run
and cargo test
might run build scripts slightly differently. This also seems to touch "build profile" and "build-deps features influcence the final artifact" problems.