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

Could not open bootloader #25

Closed
GrayJack opened this issue Dec 30, 2018 · 11 comments
Closed

Could not open bootloader #25

GrayJack opened this issue Dec 30, 2018 · 11 comments

Comments

@GrayJack
Copy link

When I try to build blog_os or intermezzOS or my "OS" I get this error:
Error: Failed to build bootloader: Could not open bootloader: No such file or directory (os error 2)

And I can't see to find the reason why since all of them already have the bootloader package as dependency

@phil-opp
Copy link
Member

phil-opp commented Jan 3, 2019

The error occurs here in the code, which means that the bootloader build succeeded, but there is no bootloader output file. I don't know how this could happen.

Which version of bootimage and bootloader are you using and what's your Rust version? And which OS are you on (Windows, Linux, macOS)?

@GrayJack
Copy link
Author

GrayJack commented Jan 3, 2019

I am using the latests release to this date, Rust 1.33.0-nightly, on Linux

@phil-opp
Copy link
Member

phil-opp commented Jan 3, 2019

Thanks. That's strange, I'm using Linux too and it is also regularly tested on travis CI, but I've never seen this error. Do you use any .cargo/config files or special Rust/Cargo environment variables such as RUSTFLAGS?

@GrayJack
Copy link
Author

GrayJack commented Jan 3, 2019

I have a special path environment for Rust target folder, that's all.
But i also did a reset of that and it gave me the same mistake

@phil-opp
Copy link
Member

phil-opp commented Jan 3, 2019

This could be the problem. Bootimage performs an uncommon second building step to build the bootloader and it does not handle any target overrides yet. I think the problem is that the bootloader is put to your custom target folder, but bootimage looks for it in the default location.

What option are you using exactly to override the target folder?

@GrayJack
Copy link
Author

GrayJack commented Jan 3, 2019

Something like

export $CARGO_TARGET_DIR=/path/to/my/custom/target/dir

@phil-opp
Copy link
Member

phil-opp commented Jan 4, 2019

Ok. Could you try wether it works when you don't set the environment variable?

@GrayJack
Copy link
Author

GrayJack commented Jan 4, 2019

Yeah, looks like that works...

I wonder why it doesn't work when I simply have that set and simply unset it at runtime

like if I have set
export CARGO_TARGET_DIR=/path/to/my/custom/target/dir
and then
export CARGO_TARGET_DIR=

after that using bootimage don't work.

But it works when I don't set that env at all

@phil-opp
Copy link
Member

phil-opp commented Jan 9, 2019

I just opened #26, which should fix the compilation with a set CARGO_TARGET_DIR. Could you try whether this works for you? To install the version from this pull request, run:

cargo install bootimage --git https://github.com/rust-osdev/bootimage.git --branch bootloader_target_dir --debug --force

@GrayJack
Copy link
Author

GrayJack commented Jan 9, 2019

Yeap, it worked!!! Nice :3

@phil-opp
Copy link
Member

phil-opp commented Jan 9, 2019

Perfect, thanks for testing!

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

2 participants