Skip to content

Conversation

@avsaase
Copy link

@avsaase avsaase commented Dec 23, 2025

We transitively depend on on clang-sys with the runtime feature and I noticed that our dependencies frequently rebuild in CI, always starting at clang-sys. We use the -Zchecksum-freshness cargo 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}.rs files are different after copying them to OUT_DIR because the copy implementation 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 include them directly where they are needed instead of copying them during the build and including them from OUT_DIR. This is what the second commit does. Alternatively, the fist commit uses std::fs::copy to 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.

@avsaase avsaase changed the title Use std::fs::copy to copy files in build script Directly include file from build directory instead of copying in build script Dec 23, 2025
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

Successfully merging this pull request may close these issues.

1 participant