fix(update): cosign PATH lookup + twin 'malt'/'mt' swap#152
Merged
Conversation
`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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Two independent bugs in
mt version update, both surfaced in #151.Bug 1 - cosign not detected even when installed.
fs_compat.Child.spawnbuilt itsstd.Io.Threadedwith.{}defaults, which leftenvironempty.std.Io.Threaded's PATH resolution then fell back to the baked-in/usr/local/bin:/bin/:/usr/binand missed/opt/homebrew/bin, so Apple Silicon users who ranbrew install cosignstill hitcosign is required to verify the release signature. A newprocessEnviron()helper exposes libc'senvironand the per-call Threaded is seeded with it, so PATH lookup and the child's inherited env both match the parent.Bug 2 .
--no-verifyupdated only one ofmalt/mt.install.shdrops both as independent regular files. The updater only swapped the binary behindexecutablePath, so after the updatemalt --versionandmt --versionwould disagree.resolveTwinRegularFile()now finds the sibling next toself_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 asudo cprecipe rather than rolling back the binary the user just invoked.Related Issue
Fixes #151
Notes for Reviewers