You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Re-exec the new binary after an in-place self-upgrade
When the auto-updater ran 'brew upgrade' (or npm/go/docker) mid-command, it
replaced the binary on disk but kept executing the old image already loaded in
memory. So the very run that triggered the upgrade still used pre-upgrade
logic (e.g. a service-detection fix that had just shipped), confusing users
who saw a fixed bug reappear until the next invocation.
After a successful upgrade, re-exec the freshly installed binary in place
(syscall.Exec on Unix), preserving the user's original args, so their command
continues on the new code. Resolve the new binary via a fresh PATH lookup
since os.Executable() can point at the old install dir the upgrade deleted
(e.g. Homebrew Cellar/<old-version>). A PREFLIGHT_NO_UPDATE_CHECK guard set on
the re-exec'd process prevents a re-prompt loop and lets users opt out.
Windows has no exec(2) equivalent, so it falls back to asking the user to
re-run.
0 commit comments