mirror of
https://github.com/horizon-rust/horizon-mixins.git
synced 2026-12-03 19:34:02 +07:00
[PR #7] [MERGED] fix(native): let cargo add the lock edges a crate's features need #10
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
horizon-rust/horizon-mixins#10
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/horizon-rust/horizon-mixins/pull/7
Author: @reservedbytes
Created: 10/30/2026
Status: ✅ Merged
Merged: 10/30/2026
Merged by: @levzzz5154
Base:
main← Head:fix/complete-lock-for-crate-features📝 Commits (2)
60174cafix(native): let cargo add the lock edges a crate's features needf419c9cMerge remote-tracking branch 'origin/main' into fix7📊 Changes
9 files changed (+201 additions, -8 deletions)
View changed files
📝
.github/workflows/ci.yml(+1 -0)➕
crates/horizon-mixins-cli/src/lockfile.rs(+60 -0)📝
crates/horizon-mixins-cli/src/main.rs(+2 -0)📝
crates/horizon-mixins-cli/tests/cases/native.rs(+49 -1)📝
crates/horizon-mixins-core/src/native.rs(+38 -0)📝
docs/crates-data-and-named-hooks.md(+13 -7)📝
fixtures/native/Cargo.lock(+30 -0)📝
fixtures/native/README.md(+2 -0)📝
fixtures/native/driver/Cargo.toml(+6 -0)📄 Description
What and why
A bundle crate with a normal dependency like
hashbrown = "0.15"can't build on #3964, even though everything it needs is in Horizon's lock.Horizon locks
hashbrownwithout its default features, and the defaults also needallocator-api2andequivalent(both already locked for other crates).native::stagecan't know which optional deps a feature turns on, so two dependency lines are missing and--lockedrefuses the stage.The launcher then says the crate "isn't in Horizon's Cargo.lock", which isn't true.
applyandchecknow runcargo update --workspaceon a scratch copy of the stage (offline first, no crate downloads), then compare with Horizon's lock.Only dependency edges between already locked packages can be added.
Any new or changed package is still
E_CRATE_DEPENDENCY, so the lock stays the allow list.Costs about 0.7 s per apply, only for bundles with crates.
Checks
cargo fmt --all --checkcargo clippy --workspace --all-targets --locked -- -D warningscargo test --workspace --locked(90 passed, new testdefault_features_may_link_locked_packages_but_never_add_one).Also checked against #3964's source: a crate with
hashbrown = "0.15"stages andcargo check --lockedpasses.Same test file as #8 , so the second to merge needs a one-line rebase.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.