-
Notifications
You must be signed in to change notification settings - Fork 296
Description
Earlier discussion: #716 (comment)
The recommended way of using bindgen is to add it as a dependency and to use it from build.rs when building the crate. This has the advantaged of producing the correct bindings for the system that is building rust-secp, which may differ from system to system because C is a poorly specified language.
This has the disadvantage of adding bindgen
and its dep tree to our dep tree, and it's not clear how valuable the advantage is given that nobody has complained about our bindings being wrong yet. (And in fact, we have hardcoded some C->Rust mappings in our secp256k1-sys/src/types.rs, because Rust stdlib didn't provide them until very recently, which you'd expect to exacerbate this sort of thing. But AFACT it hasn't.) And people are using Rust on weird systems -- we get issues about broken tools and missing headers etc.
So I would like to have a script to use bindgen, commit the output, and check it in CI. Kix alternately suggests the "xtask pattern" which I believe refers to this and which he also referenced in August. I read its README then and read it again now and still have no idea what it is supposed to be. However, Kix suggests that when using this pattern it would require contributors to run bindgen/xtask "even for unrelated changes". Presumably we could fix that by committing more stuff.