Closed alamb closed 1 year ago
I can reproduce this on my macbook, but running multiple builds on my Linux machine does not trigger a recompile. I'm not sure why there will be a difference.
It's been merged and will be in v0.4.1, soon.
It's been merged and will be in v0.4.1, soon.
Thank you @akubera -- I was also seeing this on Mac
Do you have any idea when yo plan to release 0.4.1
? There is no rust from my perspective, but if it will be more than a day or so I plan to downgrade back to 0.3.0 until it is ready
I think some cases have been fixed, but I still see bigdecimal get rebuilt sometimes and im not sure what the pattern is yet.
Oh I've figured it out. It always triggers a rebuild on the second compile, after that it settles down and stops recompiling.
I ran with cargo build --verbose
and saw the reason for rebuild listed as:
I think you could use this macro https://docs.rs/const-str/latest/const_str/macro.parse.html and println!("cargo:rustc-env=DEFAULT_PRECISION={default_precision}");
to avoid having to generate a .rs file
I've used rustc-env without rebuilding issues like this https://github.com/shotover/shotover-proxy/blob/468cea8afab29a2c5eb9798b73971337b04d89ce/shotover-proxy/build.rs#L5
Unfortunately its minimum Rust version is 1.64.0, and this project supports older versions.
But that is a good crate to know, thanks!
After we updated to bigdecimal
0.4.0
in https://github.com/apache/arrow-datafusion/pull/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 -v
the following is output in the following line
It appears to me that the issue is that build.rs always rewrites
default_precision.rs
even when there are no changes:https://github.com/akubera/bigdecimal-rs/blob/b80509a8be4d77149388311a486c754cb4bb1a76/build.rs#L16
I think this could be fixed by checking if the contents of
default_precision.rs
would be changed prior to rewriting them