Skip to content

build: inherit the workspace version in bugwarden-core - #57

Merged
plusky merged 1 commit into
mainfrom
build/core-workspace-version
Aug 4, 2026
Merged

build: inherit the workspace version in bugwarden-core#57
plusky merged 1 commit into
mainfrom
build/core-workspace-version

Conversation

@plusky

@plusky plusky commented Aug 4, 2026

Copy link
Copy Markdown
Owner

What

crates/bugwarden-core/Cargo.toml carried version = "0.3.0" as a literal while every other shared field of that manifest — edition, rust-version, license, authors, repository, homepage — already inherits, and the binary crate inherits its version too. Now it inherits as well.

Why

The workspace version had two sources of truth with nothing keeping them equal. They agree today and chore: bump version to 0.3.0 moved both by hand, so nothing is broken — the cost is the failure mode when that hand-edit is missed.

The two literals fail differently, which is the point:

  • The dependency requirement in crates/bugwarden/Cargo.toml (bugwarden-core = { path = "…", version = "0.3.0" }) cannot drift silently — cargo refuses to resolve a path dependency whose version does not satisfy the requirement, so a missed bump breaks the first local build.
  • bugwarden-core's own version can. Local builds stay green; the release job publishes the crate at its old version, takes its own "already published, skipping" branch, and the binary crate then resolves against the previous core. Nothing says a word, and only on the release path.

This removes the silent one. The loud one is left alone deliberately: cargo has no way to express "the workspace version" in a dependency requirement, and a failure that stops the first build needs no guard.

Verification

cargo fmt --check, cargo clippy --workspace --all-targets -- -D warnings, cargo test --workspace --all-targets --locked, cargo deny check, typos.

cargo metadata reports both crates at 0.3.0, unchanged, and Cargo.lock is untouched. cargo package -p bugwarden-core succeeds and normalises the field back to a literal version = "0.3.0" in the published manifest — so a distro building from the .crate, with no workspace root present, reads exactly what it read before.

Every other shared field of this manifest already inherits — edition,
rust-version, license, authors, repository, homepage — and the binary
crate inherits its version too. `bugwarden-core` alone carried a literal,
so the workspace version had two sources of truth and no rule keeping
them equal.

The two are the same today and a bump has always moved both by hand, so
nothing is broken. What the literal costs is the failure mode when that
hand-edit is missed: the release job publishes the crate at its old
version, takes its own already-published branch, and the binary crate
then resolves against the previous core. Local builds stay green and
nothing says a word — unlike the dependency requirement in
`crates/bugwarden/Cargo.toml`, whose own literal cannot drift silently,
because cargo refuses to resolve a path dependency the requirement does
not admit.

No version changes here. `Cargo.lock` is untouched, and `cargo package`
normalises the field to a literal in the published manifest, so a distro
building from the `.crate` with no workspace root present reads exactly
what it read before.
@plusky
plusky merged commit 84d27c1 into main Aug 4, 2026
11 checks passed
@plusky
plusky deleted the build/core-workspace-version branch August 4, 2026 19:31
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.

1 participant