Skip to content

feat: don't download and unpack kernel sources#876

Merged
mkroening merged 1 commit intomainfrom
kernel-src
Feb 25, 2026
Merged

feat: don't download and unpack kernel sources#876
mkroening merged 1 commit intomainfrom
kernel-src

Conversation

@mkroening
Copy link
Member

@mkroening mkroening commented Dec 12, 2025

This PR removes downloading and unpacking external kernel sources from the hermit wrapper crate. This means that the Hermit wrapper crate will no longer be published on crates.io but will need to be used via git.

Users will need to upgrade like this:

-hermit = "0.12"
+hermit = { git = "https://github.com/hermit-os/hermit-rs.git", tag = "hermit-0.13.0" }

Comparison

This was tested in hermit-os/hermit-rs-template#88:

  • Downloaded dependencies for the wrapper crate
    • Before: 33
    • After: 4
  • Time to download dependencies for the wrapper crate
    • Before: 1s (does not include kernel sources)
    • After: 4s (does include kernel sources)
  • lockfile of the application
    • Before: 55 packages, 463 lines
    • After: 8 packages, 66 lines
  • Building an application with the dev profile cleanly
    • Before: 1m 50s
    • After: 1m 26s
  • Building an application with the release profile after the step above
    • Before: 1m 20s
    • After: 1m 8s

Evaluation

Downsides

  • The Hermit dependency becomes longer to type.
  • Applications cannot be published to crates.io with git dependencies.

Upsides

  • We put 47 fewer dependencies into application lockfiles.
  • Clean building 20% faster on CI.
  • Clean building works without network connection.
  • We don't need to implement HTTP retry handling ourselves to be reliable.
  • We don't break the crates.io rule about depending on code outside of crates.io anymore.

@mkroening mkroening self-assigned this Dec 12, 2025
@fogti
Copy link
Contributor

fogti commented Dec 29, 2025

I don't think removing the download+unpack functionality entirely is a good idea, but it might be worth it to put it behind a feature flag (and pass an appropriate environment variable into the hermit build to enable the feature flag, and state that in documentation for this crate, optimally alongside HERMIT_MANIFEST_DIR).

@mkroening
Copy link
Member Author

I added justification for this change to the PR description.

Why do you think this is not a good idea exactly?

pass an appropriate environment variable into the hermit build to enable the feature flag

I don't think that's possible.

@mkroening mkroening added this pull request to the merge queue Feb 25, 2026
Merged via the queue into main with commit 9cc4f22 Feb 25, 2026
9 checks passed
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

Successfully merging this pull request may close these issues.

2 participants