ci(release): stop and restart the daemon around cask upgrades - #612
Merged
Conversation
The generated cask gains guarded pre_install/post_install hooks: pre stops a running daemon (only when one answers; recorded via a tmp marker) so the binary swap and any store migration happen without a stale daemon holding the old image and the store lock; post restarts onto the new binary only when one was running. Fresh installs and CI never launch a daemon. Fixes the brew-upgrade leg of zzet#609 alongside PR zzet#611's detection layers.
zzet
approved these changes
Aug 20, 2026
zzet
approved these changes
Aug 20, 2026
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.
Summary
brew upgrade gortexreplaces the binary while a running daemon keeps executing the old image — nothing restarts it, and nothing detects the skew (#609). PR #611 adds the detection layers; this PR closes the loop at the install path: the release pipeline's generated cask now stops a running daemon before the upgrade and restarts it onto the new binary afterwards.Fixes the brew-upgrade leg of #609 (detection: #611).
Changes
.github/workflows/release.yml(thePublish homebrew caskheredoc template) gains guarded hooks in every generatedCasks/gortex.rb:pre_install: if agortexbinary exists ANDgortex daemon statusexits 0, write a tmp marker and rungortex daemon stop— releases the store lock and retires the old image before the swap.post_install: if the marker exists, delete it and rungortex daemon restart(routes through the supervisor when launchd owns the daemon).Testing
ruby -con the produced cask: Syntax OK); workflow YAML parses.zzet/homebrew-tap; a manualbrew upgradeon macOS confirms then.Notes
daemon statusas the was-running probe reuses gortex's own socket resolution (no XDG path duplication in Ruby); it is bounded by the daemon's 30s control timeout.