On 10/21/24 16:15, Peter Maydell wrote:
Very simple - "cargo install bindgen-cli", as already seen in the
fedora-rust-nightly container's Dockerfile (note: building QEMU does
_not_ need cargo).  In fact we could in fact do it via libvirt-ci, and
it's quite possible that MacOS or some BSDs will need it.

Why doesn't 'rustup update' do this automatically? My Ubuntu 22.04
system I'm using 'rustup' to provide the rust toolchain,
and 'rustup update' updates rustc, cargo, clippy, etc, so
why isn't it also providing and updating bindgen?
('bindgen' for me is ~/.cargo/bin/bindgen, so not the system one.)
My expectation here was that "rustup update" would keep
the whole toolchain up-to-date...

I'd agree with you, but bindgen is not part of the toolchain. :/ In the Cargo way of doing things, bindgen is specified in build-dependencies and it's rebuilt together with the rest of the library that uses it.

This is as wasteful as it sounds; I guess it makes it easier for bindgen authors to "move fast and break things"? Even in the 3-years span of bindgen versions supported by QEMU we have the case where --size_t-is-usize is needed on older versions and was removed only a handful of versions after it became the default.

Hopefully, this becomes less problematic as Linux forces the tools to mature (my hope is that, in general, Linux will force the Rust team to give more consideration to non-Cargo mixed-language projects).

Paolo


Reply via email to