Skip to content
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

Failed to run example-kernels #78

Open
p-alik opened this issue Nov 2, 2021 · 3 comments
Open

Failed to run example-kernels #78

p-alik opened this issue Nov 2, 2021 · 3 comments

Comments

@p-alik
Copy link

p-alik commented Nov 2, 2021

I run in an issue by the attempt to run example-kernels and hope to find help this way.
The cli cargo bootimage --target x86_64-bootimage-example-kernels.json finished successfully, but cargo xrun failed

✔ ~/git/github/rust-osdev/bootimage/example-kernels [master|✔] 
14:47 $ git log --oneline -n1
d590098 (HEAD -> master, origin/master, origin/HEAD) CI: Use choco to install QEMU 6.0.0
✔ ~/git/github/rust-osdev/bootimage/example-kernels [master|✔] 
14:47 $ cargo xrun --target x86_64-bootimage-example-kernels.json
WARNING: There is no root package to read the cargo-xbuild config from.
   Compiling core v0.0.0 (/home/XXX/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core)
   Compiling compiler_builtins v0.1.49
   Compiling rustc-std-workspace-core v1.99.0 (/home/XXX/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/rustc-std-workspace-core)
error[E0465]: multiple rmeta candidates for `core` found
 --> /home/XXX/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/rustc-std-workspace-core/lib.rs:4:9
  |
4 | pub use core::*;
  |         ^^^^
  |
note: candidate #1: /tmp/cargo-xbuild0mSUnk/target/x86_64-bootimage-example-kernels/release/deps/libcore-8386ca77507e6ddc.rmeta
 --> /home/XXX/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/rustc-std-workspace-core/lib.rs:4:9
  |
4 | pub use core::*;
  |         ^^^^
note: candidate #2: /tmp/cargo-xbuild0mSUnk/target/x86_64-bootimage-example-kernels/release/deps/libcore-cb62582e916e4b2a.rmeta
 --> /home/XXX/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/rustc-std-workspace-core/lib.rs:4:9
  |
4 | pub use core::*;
  |         ^^^^

error: could not compile `rustc-std-workspace-core` due to previous error
warning: build failed, waiting for other jobs to finish...
error: build failed
error: `"/home/XXX/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/cargo" "rustc" "-p" "alloc" "--release" "--manifest-path" "/tmp/cargo-xbuild0mSUnk/Cargo.toml" "--target" "x86_64-bootimage-example-kernels.json" "--" "-Z" "force-unstable-if-unmarked"` failed with exit code: Some(101)
@p-alik
Copy link
Author

p-alik commented Nov 4, 2021

Going to close the issue. Solved it by purging ~/.cargo directory and repeating the build procedure again.

@p-alik p-alik closed this as completed Nov 4, 2021
@p-alik
Copy link
Author

p-alik commented Nov 5, 2021

Going to reopen the issue because it's unresolved.

@p-alik p-alik reopened this Nov 5, 2021
@p-alik
Copy link
Author

p-alik commented Nov 7, 2021

Update of the crate x86_64 and removing of build-std solved the issue.

21:03 $ git diff .cargo/ basic/
diff --git a/example-kernels/.cargo/config.toml b/example-kernels/.cargo/config.toml
index 92cee48..37efe54 100644
--- a/example-kernels/.cargo/config.toml
+++ b/example-kernels/.cargo/config.toml
@@ -1,2 +1,2 @@
 [unstable]
-build-std = ["core", "compiler_builtins"]
+build-std-features = ["compiler-builtins-mem"]
diff --git a/example-kernels/basic/Cargo.toml b/example-kernels/basic/Cargo.toml
index 5a9a509..0beaadf 100644
--- a/example-kernels/basic/Cargo.toml
+++ b/example-kernels/basic/Cargo.toml
@@ -6,4 +6,4 @@ edition = "2018"
 
 [dependencies]
 bootloader = "0.9.7"
-x86_64 = "0.14.1"
+x86_64 = "0.14.6"
21:02 $ cargo xbuild --target  x86_64-bootimage-example-kernels.json
WARNING: There is no root package to read the cargo-xbuild config from.
   Compiling core v0.0.0 (/home/apastuchov/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core)
   Compiling compiler_builtins v0.1.49
   Compiling rustc-std-workspace-core v1.99.0 (/home/apastuchov/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/rustc-std-workspace-core)
   Compiling alloc v0.0.0 (/tmp/cargo-xbuildfkpbyO)
    Finished release [optimized] target(s) in 13.45s
   Compiling bootloader v0.9.19
   Compiling x86_64 v0.14.6
   Compiling bit_field v0.10.1
   Compiling volatile v0.4.4
   Compiling bitflags v1.3.2
   Compiling rlibc v1.0.0
   Compiling runner-test v0.1.0 (/home/apastuchov/git/github/rust-osdev/bootimage/example-kernels/runner-test)
   Compiling runner-doctest v0.1.0 (/home/apastuchov/git/github/rust-osdev/bootimage/example-kernels/runner-doctest)
   Compiling runner-fail-reboot v0.1.0 (/home/apastuchov/git/github/rust-osdev/bootimage/example-kernels/runner-fail-reboot)
   Compiling basic v0.1.0 (/home/apastuchov/git/github/rust-osdev/bootimage/example-kernels/basic)
   Compiling runner v0.1.0 (/home/apastuchov/git/github/rust-osdev/bootimage/example-kernels/runner)
    Finished dev [unoptimized + debuginfo] target(s) in 2.08s

There is a thread regarding core and compiler_builtins in build-std
rust-lang/wg-cargo-std-aware#53

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant