-
Notifications
You must be signed in to change notification settings - Fork 94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
regression: Xargo v0.3.9 can't compile compiler-builtins #167
Comments
I think the version numbers should be the same really, so I feel like (a) should be done nevertheless. But having (b) may be useful anyway? Not sure. The layout of rust-src not being stable is not exactly an argument for "it will always be
Maybe xargo CI could build a bunch of Xargo.toml files that should work? Plain libstd (maybe several feature combinations?), the one from this issue, ... |
Hey, I am getting the same error. As a complete Rust newbie, I have no idea how to fix this manually. Any pointers?
|
@pkronstrom downgrade your rust version:
I first tried 2017-09-01 and it was still broken. 2017-08-01 seems to be working; likely there are more recent versions than that which will also work, if you need them. |
Or install an older Xargo version. v0.3.8 works fine with a recent nightly. ( |
I tried fixing the version number of the shim in rust-lang/rust#44742. Unfortunately, this doesn't work; there's code in bootstrap assuming the version numbers of all sorts of things to be 0.0.0. |
@RalfJung What about doing it the other way around? That is changing the version of the compiler-builtins crate in the rust-lang-nursery/compiler-builtins repo to 0.0.0. Do you think that will work? People keep asking about this issue and we are going to have a big influx of cortex-m users tomorrow and I'd rather not have them run into this. So, I have decide to yank the v0.3.9 release until this issue is fixed in master. Xargo v0.3.8 can build std with jemalloc enabled with a recent nightly, in any case, so the .lock is not currently needed (I'm not entirely sure why it was needed in the first place -- you don't usually ship a .lock file with libraries and the std facade is comprised of libraries only -- did some dependency break semver?) |
I don't have a strong opinion. The reason I implemented the lock file stuff is that semver doesn't help in the presence of |
Nowadays compile-builtins is pulled in via crates.io, so this should not be a problem any more. |
STR
Meta
Diagnosis
As the error message says the libcompiler_builtins crate has version 0.1.0 in its Cargo.toml but this doesn't match the version in Cargo.lock: 0.0.0.
Why does this happen? When bootstrapping the compiler the Cargo.toml in
src/libcompiler_builtins
is not used; instead the Cargo.toml insrc/rustc/compiler_builtins_shim
is used. Because of this the version that appears in Cargo.lock is 0.0.0 -- this matches the version insrc/rustc/compiler_builtins_shim/Cargo.toml
. However, when Xargo compiles the Rust source it assumes that the source of dependencies for which nopath
orgit
information is specified in Xargo.toml will be located at$XARGO_RUST_SRC/lib$name/Cargo.toml
where$name
is the name of the dependency. Thus Xargo will use the version insrc/libcompiler_builtins/Cargo.toml
: 0.1.0. Hence the unmet version requirement.What should we do?
Clearly the Xargo assumption of where the source for the compiler_builtins crate is located is not always right. We can ...
(a) continue using this assumption and patch rust-lang-nursery/compiler-builtins so that the version in its Cargo.toml matches the version in rust-lang/rust. Then we update the submodule in rust-lang/rust. Problem fixed (until someone changes either version ... as there's nothing forcing them to match)
(b) add special syntax to Xargo.toml to let the user specify the exact path of dependencies that reside in the rust-src component. Maybe:
$XARGO_RUST_SRC/libcore
,$XARGO_RUST_SRC/rustc/libcompiler_builtins
, etc. To avoid breaking current users we use$XARGO_RUST_SRC/lib$name
as the default if bothpath
andgit
information is missing in Xargo.toml.(c) do something else?
Both (a) and (b) seem rather prone to breakage. Maybe (b) more than (a) since the layout of the rust-src crates is by no means stable.
Thoughts?
cc @RalfJung
The text was updated successfully, but these errors were encountered: