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

ovmf-prebuilt v0.1.0-alpha.1 doesn't compile #361

Open
Zingoooooo opened this issue Mar 29, 2023 · 3 comments
Open

ovmf-prebuilt v0.1.0-alpha.1 doesn't compile #361

Zingoooooo opened this issue Mar 29, 2023 · 3 comments

Comments

@Zingoooooo
Copy link

Zingoooooo commented Mar 29, 2023

The result i get when I compile with cargo 1.70.0-nightly (15d090969 2023-03-21) is listed below. What am I missing?
I'm following the migration guide from 0.9.

Compiling ovmf-prebuilt v0.1.0-alpha.1
error[E0463]: can't find crate for std
|
= note: the x86_64-unknown-none target may not support the standard library
= note: std is required by ovmf_prebuilt because it does not declare #![no_std]
= help: consider building the standard library from source with cargo build -Zbuild-std

error[E0463]: can't find crate for std
--> /home/zingo/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ovmf-prebuilt-0.1.0-alpha.1/src/lib.rs:1:5
|
1 | use std::path::{PathBuf, Path};
| ^^^ can't find crate
|
= note: the x86_64-unknown-none target may not support the standard library
= help: consider building the standard library from source with cargo build -Zbuild-std

error: cannot find macro assert in this scope
--> /home/zingo/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ovmf-prebuilt-0.1.0-alpha.1/src/lib.rs:5:5
|
5 | assert!(path.exists(), "OVMF-pure-efi.fd does not exist");
| ^^^^^^
|
= help: consider importing this macro:
core::assert

error: cannot find macro env in this scope
--> /home/zingo/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ovmf-prebuilt-0.1.0-alpha.1/src/lib.rs:4:26
|
4 | let path = Path::new(env!("CARGO_MANIFEST_DIR")).join("OVMF-pure-efi.fd");
| ^^^
|
= help: consider importing this macro:
core::env

@IntegralPilot
Copy link

I'm having this issue too, any chance you figured out how to resolve it?

@phil-opp
Copy link
Member

Could you give more details about the commands that you're running and your project setup? Or do you have your project online somewhere so that I can take a look?

In general, the ovmf-prebuilt should be built for your host system, not for the x86_64-unknown-none target.

@br0kenpixel
Copy link

I ran into the same issue. Turns out, my .cargo/config.toml was also forcing ovmf-prebuilt to be built for the x86_64-unknown-none target. I fixed it by moving the [build] section to a separate .cargo/config.toml inside my kernel crate.

.
├── .cargo
│   └── config.toml <-- only contains `[unstable] bindeps = true`
├── Cargo.lock
├── Cargo.toml
├── build.rs
├── kernel
│   ├── .cargo
│   │   └── config.toml <-- only contains `[build] target = "x86_64-unknown-none"`
│   ├── Cargo.toml
│   └── src
├── rust-toolchain.toml
├── src
│   └── main.rs
└── target

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

4 participants