rust-osdev / cargo-xbuild

Automatically cross-compiles the sysroot crates core, compiler_builtins, and alloc.
Apache License 2.0
256 stars 25 forks source link

cargo-xbuild doesn't build with older nightlies #106

Closed vamanea closed 1 year ago

vamanea commented 1 year ago

My project uses rust nightly 2021-03-23 and since some time I can't build cargo-xbuild anymore, on account of this error:

error[E0658]: use of unstable library feature 'btree_retain'
   --> /home/xxx/.cargo/registry/src/github.com-1ecc6299db9ec823/serde_json-1.0.83/src/map.rs:286:18
    |
286 |         self.map.retain(f);
    |                  ^^^^^^
    |
    = note: see issue #79025 <https://github.com/rust-lang/rust/issues/79025> for more information
    = help: add `#![feature(btree_retain)]` to the crate attributes to enable

With older serde_json(1.0.59) it builds fine.

The linked issue was fixed in 2021 Apr 14 nightlies, so updating the toolchain to that fixed my issue. The other solution is to request a specific version of serde_json in Cargo.toml.

I'm not sure which is the better fix, but I think at least updating the README to indicate the latest supported toolchain is needed.

phil-opp commented 1 year ago

Why do you need to install cargo-xbuild using the pinned nightly? Installing it through cargo +stable install cargo-xbuild should work in your case.

vamanea commented 1 year ago

Right, that didn't occur to me, no idea why. Sorry for the noise.