If you run cargo package to completion, change something in your crate, and then run it again, a new package will not be generated. You can change anything, add/remove source files, modify the build script, change dependencies, include features, go on vacation for 2 weeks, and cargo package will still do nothing. The only thing that triggers a rebuild is manually deleting the appropriate .crate file in target/package or changing the crate version or name in Cargo.toml.
Since cargo publish just runs ops::package before uploading, it suffers from the same behaviour.
I think the same freshness check for cargo build should be used for cargo package.
If you run
cargo packageto completion, change something in your crate, and then run it again, a new package will not be generated. You can change anything, add/remove source files, modify the build script, change dependencies, include features, go on vacation for 2 weeks, andcargo packagewill still do nothing. The only thing that triggers a rebuild is manually deleting the appropriate.cratefile intarget/packageor changing the crate version or name inCargo.toml.Since
cargo publishjust runsops::packagebefore uploading, it suffers from the same behaviour.I think the same freshness check for
cargo buildshould be used forcargo package.