Repository navigation
fix(update): error cleanly on an unlisted arch or OS - #728
Merged
dubadub merged 1 commit intoOct 15, 2026
Merged
Conversation
`get_target_triple` panicked for targets it does not know, so `cook update` died with exit 101 on e.g. riscv64. Return the target as a `Result` so an unsupported platform reports `Error: Unsupported ...` and exits nonzero like every other command. Closes #720
1 task done
LeMyst
reviewed
Oct 13, 2026
LeMyst
left a comment
Collaborator
There was a problem hiding this comment.
Looks good to me: get_target_triple returns Result and bail!s instead of panicking.
Heads-up: #650 (still open, versioned release asset names) removes get_target_triple and moves the same two panic!s into release_platform(). Whichever lands second needs the fix redone there (release_platform() / asset_name() returning Result), not just a textual merge. It also conflicts trivially with #729 in update.rs.
🤖 Analysis and recommendations made by Claude (Anthropic's AI assistant), posted on behalf of @LeMyst.
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.
Closes #720
get_target_triplehadpanic!("Unsupported architecture")/panic!("Unsupported operating system")for unlisted targets, socook updatedied with exit 101 on e.g. riscv64. It now returnsResult<String>and bails withError: Unsupported architecture: <arch>/Error: Unsupported operating system: <os>, like every other command.Test plan
cargo buildcompiles; supported targets still produce the same triples (panic sites becamebail!1:1)