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

Add a library crate to the repo for downloading/caching prebuilts #38

Open
nicholasbishop opened this issue Mar 2, 2024 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@nicholasbishop
Copy link
Contributor

As mentioned in #37 (comment), I'd like to add a library crate here, essentially an upgrade to https://crates.io/crates/ovmf-prebuilt to make it easy to get the new prebuilts.

Filing an issue here to lay out a quick plan:

  1. Make the repo a workspace so we can have multiple packages. Initially this will just be one package, build-edk2, containing the code that's currently in src/. build-edk2 will not be published.
  2. Add an ovmf-prebuilt package to the workspace. This can start at version 0.2.0 to supersede the currently-published versions.
  3. Implement functionality in ovmf-prebuilt similar to what we have in uefi-rs: https://github.com/rust-osdev/uefi-rs/blob/ccdfb66cd073442e3dc08412a7c18369d906aff7/xtask/src/qemu.rs#L95. This differs from the previous approach of putting the binaries directly in the crates.io release. I couldn't find any specific policy about uploading prebuilts on crates.io, but this discussion makes it sound at least discouraged.
@nicholasbishop nicholasbishop added the enhancement New feature or request label Mar 2, 2024
@nicholasbishop nicholasbishop self-assigned this Mar 2, 2024
nicholasbishop added a commit that referenced this issue Mar 2, 2024
Move the build code to a new build-edk2 package.

This is a precursor to adding a second package to the workspace:
#38
@phil-opp
Copy link
Member

phil-opp commented Mar 4, 2024

Sounds good to me overall!

This differs from the previous approach of putting the binaries directly in the crates.io release. I couldn't find any specific policy about uploading prebuilts on crates.io, but this discussion makes it sound at least discouraged.

Yeah, I wasn't sure about that either. I'm fine with trying a GitHub download instead, but that approach has drawbacks too (network connection required, no longer self-contained, forking more difficult, etc).

Implement functionality in ovmf-prebuilt similar to what we have in uefi-rs: https://github.com/rust-osdev/uefi-rs/blob/ccdfb66cd073442e3dc08412a7c18369d906aff7/xtask/src/qemu.rs#L95.

For the crate, we could do the downloading in a build script and place the artifacts in OUT_DIR. Then we don't need to do any hash checks as the build script is only run on the first compile.

nicholasbishop added a commit that referenced this issue Mar 6, 2024
Move the build code to a new build-edk2 package.

This is a precursor to adding a second package to the workspace:
#38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants