Skip to content

fix(macos-host): refresh Tailscale only where it is behind and run the formula from its keg - #199

Merged
Mearman merged 2 commits into
mainfrom
fix/macos-tailscale-refresh
Nov 3, 2026
Merged

Mearman merged 2 commits into
mainfrom
fix/macos-tailscale-refresh

Conversation

@Mearman

@Mearman Mearman commented Nov 3, 2026

Copy link
Copy Markdown
Member

Closes #198

The Tailscale refresh in github_runner_macos_host failed site.yml on a Mac that has the standalone app, on two different paths.

On an Intel Mac the app's wrapper script holds /usr/local/bin/tailscale, so brew upgrade tailscale installs the keg, removes every link it made and exits 1 with "The brew link step did not complete successfully". The role now runs the formula's tailscaled and tailscale from the keg's opt path, which exists whether or not Homebrew linked anything, and judges an install or upgrade by the formula brew info reports afterwards. An installed, current keg is a success whatever the link step said; a formula that did not install still fails the run with Homebrew's output. The running daemon is also read through the formula's tailscale, since the wrapper talks to the app. The first install goes through the same task, so a fresh Mac that has the app no longer fails there either.

On an Apple silicon Mac whose app updated itself, brew outdated --cask --greedy still lists tailscale-app, and the cask's pkg fails over the current app and is reverted. The cask is now upgraded only when the release in the app bundle (CFBundleShortVersionString) is behind the cask's.

tests/unit/test_macos_host.py gains a brew stand-in that fails as in the issue (keg installed and unlinked with the wrapper in the way, and the cask's installer failing), a defaults stand-in for the bundle's release, and tests for each state, including --check and a second run.

@Mearman
Mearman marked this pull request as ready for review November 3, 2026 17:23
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
🔒 Security Review ⚠️ Failed 2026-11-03T19:41:43.612296Z
We couldn’t complete this review. Comment @codex security review to try again.
43f11dd Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

This security review couldn’t start because the paying account has exhausted its Codex allowance and has insufficient available credits. The payer can check their balance and add credits in the Codex usage dashboard, then try again. If you do not manage the paying account, contact this repository's admins.

@Mearman
Mearman force-pushed the fix/macos-tailscale-refresh branch 2 times, most recently from 03a9250 to 594ccb2 Compare November 3, 2026 18:39
…e formula from its keg

A Mac with the standalone app has the app's wrapper script at
/usr/local/bin/tailscale, so Homebrew installs the formula's keg, removes
every link it made and exits non-zero. The module treated that as a failed
upgrade and failed the play before any cluster task ran.

The role now runs the formula's tailscaled and tailscale from the keg's
stable opt path, which exists whether or not Homebrew linked anything, and
judges an install or upgrade by the formula Homebrew reports afterwards:
an installed, current keg is a success whatever the link step said, and
anything else fails with Homebrew's own output. The running daemon is read
through the formula's tailscale, because the wrapper talks to the app.

A cask that Homebrew lists as outdated is upgraded only when the app
bundle's release is behind the cask's. The app updates itself, so
Homebrew's record lags, and the cask's installer fails over an app that is
already current and is reverted.
…r script

The wrapper script the tests model called the real /Applications/Tailscale.app
where one is installed, so a role that asked the app instead of the daemon
could pass by reading the machine's own Tailscale. The wrapper now calls a
stand-in that logs the call and fails, and every wrapper test asserts the app
was never asked and the wrapper was left as it was, including a join beside
the wrapper.
@Mearman
Mearman force-pushed the fix/macos-tailscale-refresh branch from 594ccb2 to 43f11dd Compare November 3, 2026 19:15
@Mearman

Mearman commented Nov 3, 2026

Copy link
Copy Markdown
Member Author

@codex security review

@chatgpt-codex-connector

Copy link
Copy Markdown

This security review couldn’t start because the paying account has exhausted its Codex allowance and has insufficient available credits. The payer can check their balance and add credits in the Codex usage dashboard, then try again. If you do not manage the paying account, contact this repository's admins.

@Mearman
Mearman merged commit d9aed1d into main Nov 3, 2026
16 checks passed
@Mearman
Mearman deleted the fix/macos-tailscale-refresh branch November 3, 2026 19:42
@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown

🎉 This PR is included in version 2.30.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

macOS host: the Tailscale refresh fails on a Mac whose app self-updated or whose /usr/local/bin/tailscale is the app wrapper

1 participant