Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rebuild crate when artefact contents change #540

Open
taminomara opened this issue Jun 18, 2021 · 7 comments
Open

Rebuild crate when artefact contents change #540

taminomara opened this issue Jun 18, 2021 · 7 comments

Comments

@taminomara
Copy link
Contributor

Changes in artefact .json files should trigger a rebuild.

@nlordell
Copy link
Contributor

I thought this was already the case (because they are include!-ed) but it may have gotten broken in the past.

@taminomara
Copy link
Contributor Author

I'm not sure if it works with build.rs, but with macros it certainly isn't the case.

@taminomara
Copy link
Contributor Author

So it looks like we can't add dependency on actual JSON files unless we include! them 😕

@nlordell
Copy link
Contributor

nlordell commented Jul 1, 2021

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");

@taminomara
Copy link
Contributor Author

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.

@nlordell
Copy link
Contributor

nlordell commented Jul 1, 2021

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?

@taminomara
Copy link
Contributor Author

Is there a macro to include the cargo fingerprints without reading it?

I'm not sure, probably no.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants