I am working on some FFI-related libraries, specific to windows, which leads to the requirement to use a build.rs file.
However, this is… clunky.
Getting system parameters is not easy. For example, accessing registry values can differ based on if the host is a 32 bit windows vs 64 bit windows. Finding required compilers is nicely abstracted away by the
cc crate, but there’s no way to state this dependency in the Cargo.toml.
This is a hidden dependency, and it makes me unhappy.
So what I’m curious about is making things a little bit clearer to users of our crates in declarative ways, and to make build.rs files less clunky. If we iterate on this step by step, we may be able to eliminate them almost entirely.
So, how do you use build.rs files? Why? If you use it for codegen, why do you do that codegen? Is it possible for you to skip that codegen with better code design?
Thank you in advance for your contributions!