Skip to content

Commit ce4ca58

Browse files
fix(release): bump internal dep pins with the workspace version
scripts/release.sh bumped only [workspace.package].version, leaving the explicit `version = "..."` pins on the internal es-runtime* path deps in [workspace.dependencies] untouched. Once the crates moved to the new version, those path deps no longer satisfied their own `^old` requirement, so `cargo update --workspace` failed to resolve ("could not update Cargo.lock") and the script err-exited leaving a dirty tree. Step 1 now bumps every internal pin in lockstep (one perl pass over the `es-runtime* = { path = "crates/…", version = "…" }` lines), and the cargo-update failure path restores Cargo.toml so a failure no longer strands a half-done bump. Verified: a 0.1.0 -> 0.2.0 bump resolves and updates all six workspace members in Cargo.lock.
1 parent efcd445 commit ce4ca58

1 file changed

Lines changed: 15 additions & 3 deletions

File tree

scripts/release.sh

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
# scripts/release.sh
66
#
77
# Asks for a major / minor / patch bump, then:
8-
# 1. bumps the version (workspace Cargo.toml + Cargo.lock). The site
8+
# 1. bumps the version (workspace Cargo.toml — package version + the internal
9+
# es-runtime* dep pins — and Cargo.lock). The site
910
# (site/package.json) is versioned independently — docs change far more
1011
# often than the runtime — so it is intentionally left alone.
1112
# 2. promotes CHANGELOG.md's [Unreleased] section to the new version + date,
@@ -93,10 +94,21 @@ bold "Preparing $tag ($date)"
9394
# --- 1. bump versions -------------------------------------------------------
9495
# workspace.package.version — the first `version = "..."` line in the root manifest.
9596
NEW="$new" perl -0777 -i -pe 'BEGIN{$v=$ENV{NEW}} s/^(version = ")[^"]+(")/${1}$v${2}/m' "$CARGO_TOML"
97+
# Internal-crate dep pins in [workspace.dependencies]: each `es-runtime*` path
98+
# dep also carries an explicit `version = "..."` that must track the workspace
99+
# version (a path dep still has to satisfy its own version requirement, or
100+
# `cargo update` can't resolve). Bump every internal pin in lockstep — these are
101+
# single-line entries (`es-runtime-x = { path = "crates/x", version = "..." }`).
102+
NEW="$new" perl -i -pe \
103+
'BEGIN{$v=$ENV{NEW}} s/(version = ")[^"]+(")/${1}$v${2}/ if /^es-runtime[\w-]* = .*\bpath = "crates\//;' \
104+
"$CARGO_TOML"
96105
# Cargo.lock — refresh only the workspace members' recorded versions (no build).
106+
# On failure, restore the manifest so a half-done bump never strands a dirty tree.
97107
cargo update --workspace --offline >/dev/null 2>&1 ||
98-
cargo update --workspace >/dev/null 2>&1 ||
99-
err "could not update Cargo.lock (run 'cargo update --workspace' and retry)"
108+
cargo update --workspace >/dev/null 2>&1 || {
109+
git checkout -- "$CARGO_TOML" 2>/dev/null || true
110+
err "could not update Cargo.lock (run 'cargo update --workspace' and retry)"
111+
}
100112

101113
# --- 2. changelog: promote [Unreleased] -> [new] - date, keep a fresh one ---
102114
grep -q '^## \[Unreleased\]' "$CHANGELOG" || err "no '## [Unreleased]' section in $CHANGELOG"

0 commit comments

Comments
 (0)