Repository navigation
fix!: installer follow-ups from the 0.2.0 review - #13
Merged
Merged
Conversation
Contributor
Author
|
This change is part of the following stack: Change managed by git-spice. |
An unanchored /Cellar/ refused any path with a directory of that name, and dpkg and rpm also own /usr/sbin, /usr/lib64 and /usr/libexec. The Cellar pattern requires the formula and version segments and nothing below them, so sbin and libexec installs stay refused.
Moving the target to .old first opened a two-syscall window in which a crash left no binary at all. The next update then could not even start, since the missing file is the one that runs it. rename(2) replaces a running executable atomically on Linux and macOS, so the .old step is gone and RollbackError is removed with it. BREAKING CHANGE: RollbackError is removed. No caller used it.
client() used to assign the lazily built default to the exported field, which raced when one installer served several goroutines. The download also had no size bound, so a hostile payload could fill the temp dir before the checksum rejected it.
bfirestone
force-pushed
the
fix/installer-followups
branch
from
September 9, 2026 03:22
212f242 to
3a6a2f5
Compare
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.
Three follow-ups from the 0.2.0 code review, one commit each.
replaceFileused to move the target to.oldbefore renaming.newover it. A crash between those two renames left no binary at all, and the missing file is the one that would run the next update. It now does a singlerename(2)of.newover the target, which is atomic on Linux and macOS and works on a running executable.RollbackErroris unreachable and removed. No caller used it, hence thefix!.DefaultManagedInstallsanchors the Homebrew pattern on the formula and version segments, so a project directory namedCellaris no longer refused. The dpkg/rpm pattern adds/usr/sbin,/usr/lib64and/usr/libexec.ArchiveInstallerbuilds its default HTTP client once at package level instead of writing to the struct, and caps the download at the declared asset size.Verify with
go test -race -count=1 ./...andgolangci-lint run ./....Closes goselfupda-1cc5.04rmyj, goselfupda-1cc5.03wl6k, goselfupda-1cc5.0043vw.