Skip to content

fix(update): cosign PATH lookup + twin 'malt'/'mt' swap#152

Merged
indaco merged 2 commits intomainfrom
fix/version-update-cosign-and-twin-binary
Apr 23, 2026
Merged

fix(update): cosign PATH lookup + twin 'malt'/'mt' swap#152
indaco merged 2 commits intomainfrom
fix/version-update-cosign-and-twin-binary

Conversation

@indaco
Copy link
Copy Markdown
Owner

@indaco indaco commented Apr 23, 2026

Description

Two independent bugs in mt version update, both surfaced in #151.

Bug 1 - cosign not detected even when installed. fs_compat.Child.spawn built its std.Io.Threaded with .{} defaults, which left environ empty. std.Io.Threaded's PATH resolution then fell back to the baked-in /usr/local/bin:/bin/:/usr/bin and missed /opt/homebrew/bin, so Apple Silicon users who ran brew install cosign still hit cosign is required to verify the release signature. A new processEnviron() helper exposes libc's environ and the per-call Threaded is seeded with it, so PATH lookup and the child's inherited env both match the parent.

Bug 2 . --no-verify updated only one of malt/mt. install.sh drops both as independent regular files. The updater only swapped the binary behind executablePath, so after the update malt --version and mt --version would disagree. resolveTwinRegularFile() now finds the sibling next to self_exe; if it's a regular file we swap it in lockstep, if it's a symlink we leave it alone (symlinks track their target automatically). On a successful primary + failed twin swap, we keep the primary updated and surface a sudo cp recipe rather than rolling back the binary the user just invoked.

Related Issue

Fixes #151

Notes for Reviewers

  • None

indaco and others added 2 commits April 23, 2026 02:22
`Child.spawn` built its `std.Io.Threaded` with `.{}` defaults, which
leaves `environ` empty. PATH lookup then fell back to the baked-in
`/usr/local/bin:/bin/:/usr/bin` and missed `/opt/homebrew/bin`, so
Apple Silicon users with cosign installed via Homebrew still hit
`cosign is required…`. New `processEnviron()` exposes libc's
`environ` and the per-call Threaded is seeded with it, so PATH
resolution and the child's inherited env both match the parent.

Co-authored-by: Claude-Code <noreply@anthropic.com>
Co-authored-by: ruvnet <ruvnet@users.noreply.github.com>
`install.sh` drops `malt` and `mt` as two independent regular files.
`version update` only swapped the invoked one, so after the update
`malt --version` and `mt --version` would disagree. Detect the
sibling via `resolveTwinRegularFile` and swap it after the primary;
symlink siblings are left alone because they already track the
target. On a successful primary + failed twin swap, keep the primary
updated and surface a `sudo cp` recipe rather than rolling back the
one the user actually invoked.

Co-authored-by: Claude-Code <noreply@anthropic.com>
Co-authored-by: ruvnet <ruvnet@users.noreply.github.com>
@indaco indaco merged commit 592b2a7 into main Apr 23, 2026
3 checks passed
@indaco indaco deleted the fix/version-update-cosign-and-twin-binary branch April 23, 2026 00:23
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.

malt version update: cosign not detected, and --no-verify updates only 'mt' not 'malt'

1 participant