@federicomena These are the clean cases. libpng has libpng-config, which is like pkg-config, but not quite. llvm is even worse.
Some scripts both search (in complex ways) or build static, depending on platform and settings.
Exposing include path to parent crate is another use of build.rs (e.g. libpng-sys can read where zlib-sys has found zlib.h).
Enabling cargo features based on detected env (rust version, presence of a lib) is another use.

@kornel eeeeeeeek. This is extremely messy. I really look forward to making it possible to let Meson handle this, and leaving Cargo as a figure-out-the-rust-deps part.

@federicomena That's the thing — they're all messy :(
The boring reusable parts are handled by build-time deps of build.rs, but the scripts themselves are almost entirely the logic to handle edge cases.
github.com/sfackler/rust-opens

In a way I like that, because the sys crate author worries about all this stuff once, rather than every downstream user reinventing half of it in their build system.

Regístrate para participar en la conversación
MaSToDoN.MX

¡Primer servidor de Mastodon de México!

Siéntete libre de unirte a esta instancia e invita a todos tus amigos a unirse, entre más gente haya más divertido


Lee atentamente las reglas aquí: /about/more

Si tienes problemas ó deseas reportar a algún usuario o instancia (spam, porno, insultos, etc.), contacta a @maop (aquí y en twitter)

NO SE ACEPTAN BOTS DE MARKETING. Se darán de baja todos los bots de marketing sin excepción y sin aviso