-
Notifications
You must be signed in to change notification settings - Fork 211
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
Add bios and uefi cargo features (closes #287) #304
Conversation
Both features are enabled by default. mbrman and gpt are now optional, and are pulled in by the bios and uefi features respectively.
They all had the same value anway
Thanks a lot! I only took a quick look, but what I saw looked good. I try to do a full review in the next few days. |
I have an API change that will conflict with this (Two actually) The newest refactors the separate BiosBoot/UefiBoot into a single DiskImageBuilder struct/impl. The purpose of this upcoming change will be to support loading arbitrary files, and a text configuration file. @AlexJMohr would you mind if I add these changes to that API change, since I'll be breaking things anyway? |
Here's the API change that I can add this to: 154dbab |
If it were up to me I'd say merge this PR first, then integrate the changes into your branch. But it's more up to @phil-opp on how to handle that. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, thanks a lot!
I pushed two more commits to allow running our test framework only for BIOS or UEFI and for testing the feature gates on the CI. |
Regarding the conflicts with #302 and #313: We will have some conflicts either way and I don't think that one direction is significantly harder than the other. So I don't see any reason to block this PR, which is otherwise ready. @jasoncouture I'm happy to help with resolving conflicts in #302! |
See https://doc.rust-lang.org/cargo/reference/features.html#optional-dependencies Co-authored-by: Tom Dohrmann <Erbse.13@gmx.de>
The test runner was accidentally disabled in #351, in an attempt to fix the publish errors introduced by #304 (caused by a bug in cargo: rust-lang/cargo#12225). As a result, the test runner became a no-op as neither the bios nor the uefi features were enabled. This commit fixes the issue by enabling both features by default. Once the cargo bug is fixed, we might want to switch back to the feature configuration added of #304. Fixes #405
closes #287
bios
anduefi
features inCargo.toml
(both enabled by default)mbrman
andgpt
dependencies optional, enabled by thebios
anduefi
features respectivelyBiosBoot
to newsrc/bios/mod.rs
mbr.rs
tosrc/bios
since it is only used in bios bootUefiBoot
to newsrc/uefi/mod.rs
gpt.rs
andpxe.rs
tosrc/uefi
since they are only used in uefi bootBiosBoot
andUefiBoot
inlib.rs
, gated by thebios
anduefi
features respectivelybuild.rs
to use the new features to conditionally compile bios or uefi related crates