rust-osdev / cargo-xbuild

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

the package `alloc` depends on `compiler_builtins`, with features: `rustc-std-workspace-core` but `compiler_builtins` does not have these features. #49

Closed SchrodingerZhu closed 4 years ago

SchrodingerZhu commented 4 years ago
error: failed to select a version for `compiler_builtins`.
    ... required by package `alloc v0.0.0 (/tmp/xargo.en5SPpyhVIGT)`
versions that meet the requirements `^0.1.0` are: 0.1.23, 0.1.22, 0.1.21, 0.1.20, 0.1.19, 0.1.18, 0.1.17, 0.1.16, 0.1.15, 0.1.14, 0.1.13, 0.1.12, 0.1.11, 0.1.10, 0.1.9, 0.1.8, 0.1.7, 0.1.6, 0.1.5, 0.1.4, 0.1.3, 0.1.2, 0.1.1, 0.1.0

the package `alloc` depends on `compiler_builtins`, with features: `rustc-std-workspace-core` but `compiler_builtins` does not have these features.

failed to select a version for `compiler_builtins` which could resolve this conflict
error: `"/home/schrodinger/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/cargo" "/home/schrodinger/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/cargo" "rustc" "-p" "alloc" "--release" "--manifest-path" "/tmp/xargo.en5SPpyhVIGT/Cargo.toml" "--target" "/home/schrodinger/CLionProject/toylibc/target.json" "--" "-Z" "force-unstable-if-unmarked"` failed with exit code: Some(101)
note: run with `RUST_BACKTRACE=1` for a backtrace
phil-opp commented 4 years ago

That's strange. The rustc-std-workspace-core feature comes from this optional dependency: https://github.com/rust-lang/compiler-builtins/blob/6de4f8f2e03197540419eb4c95ead0a5d5307e9c/Cargo.toml#L32. It is still there on the master branch so it should be available on crates.io as well.

What are your versions of rustc, cargo and cargo-xbuild?

SchrodingerZhu commented 4 years ago

Cargo.toml

[package]
name = "toylibc"
version = "0.1.0"
authors = ["schrodingerzhu <i@zhuyi.fan>"]
edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[profile.dev]
panic = "abort"

[profile.release]
panic = "abort"

[dependencies]
packed_simd = "0.3.3"
spin = "0.5.2"
syscalls = "0.1.4"

[dependencies.num-complex]
version = "0.2"
default-features = false

[dependencies.rand]
version = "0.4"
default-features = false

[dependencies.lazy_static]
version = "1.4.0"
features = ["spin_no_std"]

[dependencies.simdeez]
version = "1.0.0"

[package.metadata.cargo-xbuild]
memcpy = false

Version

➜  toylibc git:(master) ✗ cargo --version
cargo 1.41.0-nightly (626f0f40e 2019-12-03)
➜  toylibc git:(master) ✗ rustc --version
rustc 1.41.0-nightly (3ed3b8bb7 2019-12-17)
➜  toylibc git:(master) ✗ cargo xbuild --version
cargo-xbuild 0.5.19
phil-opp commented 4 years ago

Seems like the problem is the memcpy = false. With that option, I can reproduce the same error. I'll try to fix it. Thanks for reporting!

phil-opp commented 4 years ago

It was just a wrong feature name. Fixed in #50.

phil-opp commented 4 years ago

Published the fix in version 0.5.20