Closed porglezomp closed 5 years ago
Try updating your rust nighty.
Cargo-xbuild assumes that the alloc crate uses the 2018 edition, which was a relatively recent change to rust. If you're using an older nightly cargo-xbuild tries to build the old 2015 version of liballoc with edition=2018
, which causes the errors.
Oh sorry, I meant to include the version information but forgot. I already have the latest nightly that rustup
will give me at the moment (due to clippy
and rls
):
$ cargo --version
cargo 1.33.0-nightly (2b4a5f1f0 2019-01-12)
Ah, I think by default rustup tries to install the latest nightly, which currently fails for you since it doesn't have the rls/clippy components. See https://mexus.github.io/rustup-components-history/x86_64-unknown-linux-gnu.html for an overview over which components are included in which nightly. The 2019-02-08
nightly seems to include rls and clippy. Try:
rustup toolchain install nightly-2019-02-08
and try using it via rustup override
or rustup default
Alternatively you can downgrade to cargo-xbuild
0.5.4, which should support your nightly:
cargo install cargo-xbuild --version 0.5.4 --force
Ok, that resolves the issue, thank you very much! Could you add a note about the nightly 1.34 requirement to the README?
I tried to use
cargo-xbuild
today, and am finding that it can't do the minimum case. If I create a new binary (justcargo new
one) and thencargo xbuild
for my native target, it fails while trying to compilealloc
.Version:
Massive error log…
``` $ cargo xbuild Updating crates.io index Compiling compiler_builtins v0.1.5 Compiling core v0.0.0 (/Users/c/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libcore) Compiling rustc-std-workspace-core v1.0.0 (/Users/c/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/tools/rustc-std-workspace-core) Compiling alloc v0.0.0 (/var/folders/6f/l9rcfr1d2s55xy9vd6rtnvv00000gn/T/xargo.5t16SLxIxhfA) error[E0432]: unresolved import `sync` --> /Users/c/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/liballoc/task.rs:14:9 | 14 | use sync::Arc; | ^^^^ did you mean `crate::sync`? | = note: `use` statements changed in Rust 2018; read more at