After we updated to bigdecimal 0.4.0 in apache/datafusion#6848 our project now always rebuilds even when we make no code change
Reproducer
run this in this repository:
I expect the second invocation of cargo test not to recompile, it should just rerun the test
In DataFusion, when I run cargo test -v
the following is output in the following line
Dirty bigdecimal v0.4.0: the file `/Users/alamb/Software/target-df2/debug/build/bigdecimal-b4aed73795116eae/out/default_precision.rs` has changed (1688920018.458734757s, 202831743ns after last build at 1688920018.255903014s)
Compiling bigdecimal v0.4.0
It appears to me that the issue is that build.rs always rewrites default_precision.rs even when there are no changes:
|
write_default_precision(&outdir_path, "default_precision.rs")?; |
I think this could be fixed by checking if the contents of default_precision.rs would be changed prior to rewriting them
After we updated to bigdecimal
0.4.0in apache/datafusion#6848 our project now always rebuilds even when we make no code changeReproducer
run this in this repository:
I expect the second invocation of cargo test not to recompile, it should just rerun the test
In DataFusion, when I run
cargo test -vthe following is output in the following line
It appears to me that the issue is that build.rs always rewrites
default_precision.rseven when there are no changes:bigdecimal-rs/build.rs
Line 16 in b80509a
I think this could be fixed by checking if the contents of
default_precision.rswould be changed prior to rewriting them