On 3/18/26 09:51, Manos Pitsidianakis wrote:
+ error('bindgen version ' + bindgen.version() + ' is unsupported. You can install a
new version with "cargo install --locked bindgen-cli"')
Am I missing something or is bindgen not in Cargo.lock? Also doesn't
this depend on `cargo-install` being invoked in the same path as
Cargo.lock, i.e. `rust/` subdir? (Not sure about this)
Because the bindgen step is done in Meson it uses a bindgen binary that
is preinstalled in $PATH; it doesn't build bindgen-cli the way you'd see
it happen when done with build.rs(*). Usually it can use the distro
package, but as you can see from the tests/lcitool/ part of the patch
it's too old for Ubuntu 22.04.
The "cargo install bindgen-cli" command does not use QEMU's Cargo.lock,
it downloads bindgen-cli as a standalone package from crates.io and
builds it. It works even if invoked from `rust/`, that is QEMU's
Cargo.lock does not interact with "cargo install".
(*) which I hate. It's 67 crates and takes 5 minutes of CPU
time (1 minute wallclock). Why did no one write a
simplified implementation of the same bindgen::Builder
struct, that calls out to a preinstalled bindgen binary?
But I digress.
I'd do `cargo install --version 0.60.0 bindgen-cli` instead
Picking a specific version of bindgen-cli can be a good idea for the
Ubuntu 22.04 container, but it does not fix the problem with the lack of
--locked. The breakage happened due to a new release of clap_lex, not
bindgen.
Paolo