Skip to content

fix: skip deb download when the pinned install is already present - #40

Merged
rldyourmnd merged 1 commit into
mainfrom
fix/skip-download-when-installed
Jul 28, 2026
Merged

fix: skip deb download when the pinned install is already present#40
rldyourmnd merged 1 commit into
mainfrom
fix/skip-download-when-installed

Conversation

@rldyourmnd

Copy link
Copy Markdown
Contributor

Problem

bootstrap.sh unconditionally downloaded and re-installed the ZCode DEB even when the host already had the exact pinned version + architecture installed with a CLI reporting the pinned CLI version. A transient DNS or CDN failure then broke re-running bootstrap on an already-correct host:

curl: (6) Could not resolve host: cdn-zcode.z.ai
[error] zcode module bootstrap (--apply) failed

The download is the first network operation and there was no pre-download skip gate.

Fix

Add nddev::installed_deb_matches: checks dpkg-query Version + Architecture against the pinned PACKAGE_VERSION/PACKAGE_ARCH and probes the installed embedded CLI version against the pinned CLI_VERSION. When all three match, the deb) branch skips the download, extraction, and dpkg -i and reuses the verified installed CLI entry as app_entry; the post-install verification block still runs.

macOS dmg always re-verifies its artifact (codesign/spctl/ditto swap), so it is intentionally not affected.

Verification

bash -n cli-tools/scripts/bootstrap.sh passes; shellcheck -S warning is clean. Discovered during the first concrete Linux device bootstrap (GDS rldyourmnd-ubuntu-1) where a DNS blip broke a host that already had zcode 3.3.6 installed.

Notes

The skip is conservative: it requires the installed CLI to report the pinned CLI version (not just the deb Version field), so a manually downgraded or tampered install that happens to carry the right deb metadata still fails closed and triggers a fresh download + install.

bootstrap.sh unconditionally downloaded and re-installed the ZCode DEB
even when the host already had the exact pinned version + architecture
installed with a CLI reporting the pinned CLI version. A transient DNS
or CDN failure (e.g. cdn-zcode.z.ai temporarily unresolvable) then broke
re-running bootstrap on an already-correct host, because the download is
the first network operation and there was no pre-download skip gate.

Add nddev::installed_deb_matches: it checks dpkg-query Version +
Architecture against the pinned PACKAGE_VERSION/PACKAGE_ARCH and probes
the installed embedded CLI version against the pinned CLI_VERSION. When
all three match, the deb) branch skips the download, extraction, and
dpkg -i and reuses the verified installed CLI entry as app_entry; the
post-install verification block still runs. macOS dmg always re-verifies
its artifact, so it is intentionally not affected.

Discovered during the first concrete Linux device bootstrap (GDS
rldyourmnd-ubuntu-1) where a DNS blip broke a host that already had
zcode 3.3.6 installed.
@rldyourmnd
rldyourmnd merged commit b504a8e into main Jul 28, 2026
8 checks passed
@rldyourmnd
rldyourmnd deleted the fix/skip-download-when-installed branch July 28, 2026 12:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant