Directly include file from build directory instead of copying in build script #200
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We transitively depend on on
clang-syswith theruntimefeature and I noticed that our dependencies frequently rebuild in CI, always starting atclang-sys. We use the-Zchecksum-freshnesscargo feature and this seems to interact with the build script in this crate.Specifically, cargo considers the build dirty because the sizes of the
build/{common,dynamic,macros}.rsfiles are different after copying them toOUT_DIRbecause thecopyimplementation doesn't produce a byte for byte copy.I took a look at how these files are used and I think it's more straightforward to
includethem directly where they are needed instead of copying them during the build and including them fromOUT_DIR. This is what the second commit does. Alternatively, the fist commit usesstd::fs::copyto copy the files. Both approaches fix our problem. Let me know if I overlooked something that requires doing this from build.rs, then I'll revert the other commit.