blog_os: Project doesn't build after upgrade to rust 1.47.0-nightly
Hi,
I am reading Allocator design : LinkedList Allocator until now I have been building the project with rustc 1.44.0-nightly (b543afca9 2020-04-05). I was used to launch test withcargo xtest and run the OS with cargo xrun.
After a rustup upgrade the rust compiler version was upgraded up to 1.47. And when I try to launch test I have this error:
$ cargo xtest
error: `rust-src` component not found. Run `rustup component add rust-src`.
note: run with `RUST_BACKTRACE=1` for a backtrace
$
I tried to build test with cargo test as it seems the command given in the blog post but I get error when compiling x86_64
.cargo/registry/src/github.com-1ecc6299db9ec823/x86_64-0.9.6/src/instructions/interrupts.rs:18:9
|
18 | asm!("sti" :::: "volatile");
| ----^^^^^^^^^^^^^^^^^^^^^^^^
| |
| help: replace with: `llvm_asm!`
|
= note: consider migrating to the new asm! syntax specified in RFC 2873
= note: alternatively, switch to llvm_asm! to keep your code working as it is
I have checked x86_64 in my Cargo.toml its version is “0.11.2” which seems the last version of the crate.
Should I downgrade rustc for this project ? How can I do that ? I give up for now. I will come back to this issue later. If you have some hints please let me know.
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 1
- Comments: 21 (8 by maintainers)
@w93163red It seems like you’re using cargo’s
build-stdfeature. In that case, you should not usecargo-xbuildbecause then thecorelibrary is built twice. Instead, try a normalcargo +nightly build(orcargo buildif you have set a rustup override). Using this command, your project builds and runs fine for me.If you’re using the latest version of
cargo-xbuildyou need at least rustc nightly 2020-07-30. On older nighlies, you need an older version ofcargo-xbuild. See the Readme ofcargo-xbuildfor more information:If you’re trying to use build-std, make sure to include
extern crate rlibc;in yourlib.rsfile too.I had this issue, made the changes to support build-std instead of cargo-xbuild, and it worked. I had to reinstall cargo-xbuild along the way to support the
bootimagecrate, but regularcargo runworks for me now.