Skip to content

fix(dstackup): build installed binaries with --locked - #1393

Merged
kvinwang merged 1 commit into
nextfrom
fix/dstackup-cargo-locked
Sep 25, 2026
Merged

kvinwang merged 1 commit into
nextfrom
fix/dstackup-cargo-locked

Conversation

@kvinwang

Copy link
Copy Markdown
Collaborator

Problem

scripts/install.sh builds dstackup with cargo build --release -p dstackup, and dstackup install builds the managed dstack, dstack-vmm, dstack-auth and supervisor binaries with cargo build --release -p .... Neither passes --locked. The results are installed into root-owned bin/libexec and run as root (sudo dstackup install, the generated systemd units).

Without --locked, Cargo is free to re-resolve the dependency graph whenever the manifests and the checked-in Cargo.lock disagree (a stale lockfile on the selected ref, a local edit in a --source checkout). The binaries then no longer correspond to the reviewed lockfile, and nothing reports it. The release pipeline (mkosi-build.yml) and the local key-provider build already use --locked. These two host install paths were the exceptions.

Fix

Pass --locked in both places. If the lockfile would need changing, the install stops with Cargo's the lock file ... needs to be updated but --locked was passed error, where before it silently resolved new versions.

This does not attempt to pin the source revision itself. DSTACK_REF/--ref and DSTACK_REPO/--repo stay operator-chosen, as before.

Verification

  • cargo metadata --locked --format-version 1 on origin/next: lockfile is in sync, so default installs are unaffected.
  • cargo build --release --locked -p dstackup: builds.
  • cargo clippy --locked -p dstackup -- -D warnings -D clippy::unwrap_used -D clippy::expect_used: clean.
  • cargo test --locked -p dstackup: 31 passed.
  • cargo fmt --all --check, sh -n scripts/install.sh, shellcheck scripts/install.sh: clean.

@kvinwang
kvinwang merged commit 0548c06 into next Sep 25, 2026
11 checks passed
@kvinwang
kvinwang deleted the fix/dstackup-cargo-locked branch September 25, 2026 00:38
kvinwang added a commit that referenced this pull request Sep 25, 2026
#1393 added --locked to the install.sh build. The stub cargo in
tc-vmm-install-007 now records its arguments, and every row that builds must
pass --locked.

Signed-off-by: Kevin Wang <wy721@qq.com>
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