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

Failing to find bootloader dependency when it's conditionally included #75

Open
bollian opened this issue Jul 21, 2021 · 0 comments
Open

Comments

@bollian
Copy link

bollian commented Jul 21, 2021

I'm writing a kernel that runs on both the Raspberry Pi 3 and x86_64. I'm trying to use bootloader+bootimage exclusively for the x86_64 version, but not any other architecture. As a result, my Cargo.toml looks like this:

[dependencies]
# common, architecture-independent dependencies

[target.'cfg(target_arch = "x86_64")'.dependencies]
bootloader = "^0.9.8"

When I compile this project with cargo bootimage --target targets/x86_64-unknown-none-softfloat.json --release I get this error message:

Error: An error occured while trying to build the bootloader: Could not find required key `packages[name = `bootloader`` in cargo metadata output

However, if I change the bootloader dependency to not be conditional, i.e. if I just put it in the [dependencies] section, the above error goes away and the project boots perfectly.

Is there some extra configuration I need to do to make this work? It would be nice for me to be able to completely exclude the bootloader dependency off of x86.

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