Hacker News new | ask | show | jobs
by bonzini 1176 days ago
Do you have a pointer for the translation? As soon as you have a transitive dependency on libc or any other Rust binding to a C library that approach would seem to fail due to the presence of build.rs.
1 comments

Yes, the tool is cargo-gnaw. It does not evaluate build.rs files itself, but there is a process for evaluating them at the time the crate is vendored.

https://fuchsia.googlesource.com/fuchsia/+/master/tools/carg...

Yeah that's very much a special-purpose tool and cannot be used if for example the build.rs file has different output for Linux/macOS/Windows.

I like the Meson model where the meta-build system is opinionated (not as much as cargo in the case of Meson, but still quite a bit) but, at the same time, it doesn't itself take care of the build. The build is done via build.ninja, static analysis and other tools use compile_commands.json. There is no reason why cargo couldn't work this way and even preserve the same command line interface.