Richard W.M. Jones
2023-Jan-13 09:41 UTC
[Libguestfs] Cargo edition problem with Debian 11
https://gitlab.com/nbdkit/nbdkit/-/jobs/3598390121
----------------------------------------------------------------------
cargo build --release --example ramdisk
Downloading crates ...
Downloaded float-cmp v0.9.0
Downloaded downcast v0.11.0
Downloaded mockall_derive v0.11.3
Downloaded itertools v0.10.5
Downloaded aho-corasick v0.7.20
Downloaded predicates-tree v1.0.7
error: failed to parse manifest at
`/root/.cargo/registry/src/github.com-1ecc6299db9ec823/predicates-tree-1.0.7/Cargo.toml`
Caused by:
failed to parse the `edition` key
Caused by:
this version of Cargo is older than the `2021` edition, and only supports
`2015` and `2018` editions.
----------------------------------------------------------------------
nbdkit itself uses edition = 2018, but this seems to affects one of
the dependencies.
I'm not sure how to solve this, but one ideas I had is in ./configure
to check if the cargo/rust we're trying to use doesn't support some
base edition (eg. latest edition supported < 2021) then we would
disable rust bindings.
Unfortunately actually getting the latest supported edition seems
hard. The best I could find is parsing this which doesn't seem ideal:
$ rustc --help |& grep -- --edition
--edition 2015|2018|2021|2024
What do you think?
Rich.
--
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
libguestfs lets you edit virtual machines. Supports shell scripting,
bindings from many languages. http://libguestfs.org
I think we should downgrade predicates-tree to 1.0.5 or older. I can submit a PR for that. What does "rustc --version" show you? On Fri, Jan 13, 2023 at 2:41 AM Richard W.M. Jones <rjones at redhat.com> wrote:> > > https://gitlab.com/nbdkit/nbdkit/-/jobs/3598390121 > > ---------------------------------------------------------------------- > cargo build --release --example ramdisk > Downloading crates ... > Downloaded float-cmp v0.9.0 > Downloaded downcast v0.11.0 > Downloaded mockall_derive v0.11.3 > Downloaded itertools v0.10.5 > Downloaded aho-corasick v0.7.20 > Downloaded predicates-tree v1.0.7 > error: failed to parse manifest at `/root/.cargo/registry/src/github.com-1ecc6299db9ec823/predicates-tree-1.0.7/Cargo.toml` > Caused by: > failed to parse the `edition` key > Caused by: > this version of Cargo is older than the `2021` edition, and only supports `2015` and `2018` editions. > ---------------------------------------------------------------------- > > nbdkit itself uses edition = 2018, but this seems to affects one of > the dependencies. > > I'm not sure how to solve this, but one ideas I had is in ./configure > to check if the cargo/rust we're trying to use doesn't support some > base edition (eg. latest edition supported < 2021) then we would > disable rust bindings. > > Unfortunately actually getting the latest supported edition seems > hard. The best I could find is parsing this which doesn't seem ideal: > > $ rustc --help |& grep -- --edition > --edition 2015|2018|2021|2024 > > What do you think? > > Rich. > > -- > Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones > Read my programming and virtualization blog: http://rwmj.wordpress.com > libguestfs lets you edit virtual machines. Supports shell scripting, > bindings from many languages. http://libguestfs.org >