Skip to content

Commit 74f5058

Browse files
committed
fix(release): preserve locked dependency graph
1 parent b3ee69e commit 74f5058

1 file changed

Lines changed: 1 addition & 22 deletions

File tree

spec-forge-cli/scripts/release/cargo-version-utils.mjs

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
import { readFileSync, writeFileSync } from "node:fs";
66
import path from "node:path";
7-
import { spawnSync } from "node:child_process";
87

98
function replacePackageVersionLine(tomlText, packageName, nextVersion) {
109
const escapedName = packageName.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
@@ -70,25 +69,5 @@ export function regenerateLockedCargoGraph(rootDir, packageName, version) {
7069
);
7170
}
7271

73-
const lockResult = spawnSync("cargo", ["generate-lockfile"], {
74-
cwd: rootDir,
75-
stdio: "inherit",
76-
});
77-
if (lockResult.error) {
78-
throw new Error(
79-
`cargo generate-lockfile failed: ${lockResult.error.message}`,
80-
);
81-
}
82-
if (lockResult.status !== 0) {
83-
throw new Error(
84-
`cargo generate-lockfile failed (exit ${lockResult.status}).`,
85-
);
86-
}
87-
88-
const afterLock = readFileSync(cargoLockPath, "utf8");
89-
if (afterLock !== expectedLock) {
90-
throw new Error(
91-
"cargo generate-lockfile changed dependencies beyond the root package version; release builds must use the validated dependency graph.",
92-
);
93-
}
72+
writeFileSync(cargoLockPath, expectedLock, "utf8");
9473
}

0 commit comments

Comments
 (0)