You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, whenever build.rs is re-run, both lib.rsandmain.rs get rebuilt. It would be useful if there were some option to only rebuild main.rs after build.rs is rerun, not both. This wouldn't want to be the default behaviour, as most build scripts will affect content in lib.rs, but some will only affect main.rs, and an option for that would be nice.
This isn't that urgent, and it may not actually want to be built, but it would probably be useful.
I believe this is a duplicate of #1162 because Cargo does not currently ever assume that a binary is the location where a native library should be linked if a library is also present. Cargo will instruct the compiler to link the native library to the Rust library and then purposefully not link the native library to the binary generated.
Unfortunately this means that this is not possible for Cargo to know that a build script (or native dependency) is in fact for just a binary, not a library.
Would it be possible for this to be a configuration though? I realize it isn't going to be what most people want, but it seems like there would be some projects where build.rs only affects main.rs, not lib.rs (where it is used for something other than native library linking).
Currently, whenever
build.rs
is re-run, bothlib.rs
andmain.rs
get rebuilt. It would be useful if there were some option to only rebuildmain.rs
afterbuild.rs
is rerun, not both. This wouldn't want to be the default behaviour, as most build scripts will affect content inlib.rs
, but some will only affectmain.rs
, and an option for that would be nice.This isn't that urgent, and it may not actually want to be built, but it would probably be useful.
This would probably depend on #1162.
The text was updated successfully, but these errors were encountered: