ethcontract-rs
ethcontract-rs copied to clipboard
Rebuild crate when artefact contents change
Changes in artefact .json
files should trigger a rebuild.
I thought this was already the case (because they are include!
-ed) but it may have gotten broken in the past.
I'm not sure if it works with build.rs
, but with macros it certainly isn't the case.
So it looks like we can't add dependency on actual JSON files unless we include!
them 😕
If we just include!
them, but don't do anything with the file, does the optimizer remove the data from the output binary? If so, we can
let _ = include_bytes!("source/path.json");
Yes, the optimizer will remove the data. However, the compiler will still read that data and include it into AST (at least HIR, not sure about MIR). This will potentially slow down compilation. Not sure if it's a real concern though.
Yes, the optimizer will remove the data. However, the compiler will still read that data and include it into AST (at least HIR, not sure about MIR). This will potentially slow down compilation. Not sure if it's a real concern though.
Yeah, its a downside for sure - but personally I view not recompiling as a bigger issue than the slower compile time. Is there a macro to include the cargo fingerprints without reading it?
Is there a macro to include the cargo fingerprints without reading it?
I'm not sure, probably no.