Skip to content

chore: add hakari workspace-hack to stabilize feature unification#6291

Closed
baszalmstra wants to merge 2 commits into
prefix-dev:mainfrom
baszalmstra:claude/vibrant-dirac-ZmrYw
Closed

chore: add hakari workspace-hack to stabilize feature unification#6291
baszalmstra wants to merge 2 commits into
prefix-dev:mainfrom
baszalmstra:claude/vibrant-dirac-ZmrYw

Conversation

@baszalmstra
Copy link
Copy Markdown
Contributor

Description

Running cargo test -p <crate> often rebuilds large amounts of shared dependencies because the resolved feature set differs from cargo build and cargo nextest run. This adds a workspace-hack crate so all of these commands resolve the same feature set, which removes the repeated rebuilds and makes local Rust iteration noticeably faster.

A CI check keeps the workspace-hack crate in sync, and pixi tasks are provided to regenerate and verify it locally.

How Has This Been Tested?

  • Verified the workspace-hack crate is consistent and that every member is wired up.
  • Confirmed the workspace still builds and resolves with the committed lockfile.
  • Confirmed formatting and linting stay green.

AI Disclosure

  • This PR contains AI-generated content.
    • I have tested any AI-generated content in my PR.
    • I take responsibility for any AI-generated content in my PR.

Tools: Claude

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas

Introduces a cargo-hakari managed 'workspace-hack' crate that unifies the
features of all third-party dependencies across the workspace. This keeps
the resolved feature set identical between 'cargo build', 'cargo test -p
<crate>' and 'cargo nextest run', so switching between them no longer
rebuilds shared dependencies.

- Add crates/workspace-hack and .config/hakari.toml (platforms mirror the
  ones pixi develops and ships on).
- Wire the workspace-hack dependency into every workspace member.
- Add 'hakari-check' and 'hakari-generate' pixi tasks.
- Add a 'cargo hakari' CI job that fails if the crate is out of date.
- Exclude the generated Cargo.toml from taplo so its formatter does not
  fight 'cargo hakari generate --diff'.

cargo-shear auto-detects the hakari crate, and cargo-deny ignores it as a
private (publish = false) package, so no extra config is needed there.
@baszalmstra baszalmstra requested a review from Hofer-Julian June 5, 2026 13:00
@baszalmstra baszalmstra changed the title Add hakari workspace-hack to stabilize feature unification chore: add hakari workspace-hack to stabilize feature unification Jun 5, 2026
Copy link
Copy Markdown
Contributor

@Hofer-Julian Hofer-Julian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's hope that this gives us fewer rebuilds 🚀

The workspace-hack was unifying both the default rustls backend and the
opt-in native-tls backend, so every build pulled in native-tls (OpenSSL)
even though rustls is the default. Exclude the members that toggle the TLS
backend from hakari traversal so the hack no longer forces native-tls into
ordinary builds. Shared dependencies are still unified through the
lower-level library crates, so the rebuild savings are preserved.
@baszalmstra baszalmstra closed this Jun 5, 2026
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.

3 participants