Skip to content

bigdecimal 0.4.0 always forces a rebuild (on mac) #105

@alamb

Description

@alamb

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:

cargo test
cargo test

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions