[Pre-RFC] `cargo package` should include fewer files by default
kpreid:
I also think that it would be valuable if
cargo publishverification ran tests to reduce the chances of publishing a broken-as-published package — all the more so if the default file exclusion rules were stricter.
No, thank you. Crates may have more than "the machine I use to publish with the Rust toolchain I happened to publish from" as interesting targets where the tests need to pass. And without build isolation, you still have the "oops, works on my machine" problem. I have our publishes done in a CI job that depends on all relevant configurations testing successfully; I don't think cargo publish is ever going to understand that for anything beyond "needs to work on a Linux"-scoped crates.
If the "the build is sensitive to this file" worked better (I don't have the issues handy, but basically if you use them, Rust's default file collection is completely ignored, so you have to implement it just to add one file to the list), then I think cargo publish could at least rely on build.rs and cargo check reporting. But again, if a file is only used on Windows, a pass on Linux is going to miss it.
Discussion in the ATmosphere