Scott__D on X: "Magpie 里的这个 RTK 安装一直都不成功". The RTK card sat on
"Installing RTK… this can take a minute." over `brew install rtk`.
Cause: Homebrew bottles rtk only for Apple silicon on the newest macOS
(arm64_sequoia, arm64_tahoe, arm64_golden_gate, and Linux). On an Intel Mac
or macOS 14 and older, `brew install rtk` builds rtk from source, and first
the 19 formulae it builds with, rust, llvm and python among them: hours.
InstallRTK gives the installer five minutes, so each try was ended, said so
in a status line gone after ten seconds, and the next try started over.
Reproduced on mote with a sandbox Homebrew (HOME and prefix of its own)
and HOMEBREW_FAKE_MACOS=14.7: brew info rtk says "stable 1.1.0, HEAD" with
no "(bottled)", brew install rtk lists 19 dependencies to build, and
magpie's InstallRTK spent 3m43s in it before failing.
Fix:
- rtkInstaller asks `brew info rtk` and uses brew only when it says
"(bottled)", brew's own word for pouring the bottle here. Otherwise, and
when brew fails or doesn't answer in 30s, it is rtk's own script
(install.sh from rtk-ai/rtk's README, which downloads rtk's release for
darwin x86_64/aarch64 and Linux). The answer is kept an hour per brew,
since ReadRTK asks on every read while rtk isn't installed.
- A failed brew says Homebrew's first Error: line and what it says to do,
not the support-tier notice its output ends with.
- The card keeps "The install failed: {why}" beside Get RTK until the
next try (as the upgrade's error already did), in every language.
- The five-minute bound on the installer was already there and stays.
Run on mote (macOS 27.2, arm64):
- real InstallRTK, sandbox HOME, sandbox Homebrew, HOMEBREW_FAKE_MACOS=14.7:
chose rtk's script, installed rtk 1.1.0 into the sandbox ~/.local/bin in
12.2s (`rtk --version`: rtk 1.1.0); the card then offers Put RTK on PATH.
- real InstallRTK, same sandbox, macOS 27 as it is: chose brew (bottled),
installed rtk 1.1.0 in 10.7s.
- go test ./internal/library (TestRTK*): ok. New tests:
TestRTKInstallsWithBrewOnlyFromItsBottle (brew info output read from the
real brew, bottled and not), TestRTKBrewInfoThatHangs,
TestRTKBrewInstallSaysBrewsError (brew's real output on mote).
- GUI: library-rtk-install.test.cjs, 5 languages x 1100/420, Chromium and
WebKit: 22/22. All library-*, gui-de/ja/zh-tw and i18n-keys files: 770 of
771; the one red is i18n-keys "a plugin's words are its own" on
plugins/routing "masking…", red on origin/main too (#4053).
- gofmt -l: nothing. go vet ./internal/library ./internal/gui;
GOOS=linux and GOOS=windows go vet ./internal/library: ok.
- Full suite on mote, go test -tags nogui -count=1 -timeout 45m ./...
at base df9376592: 77 packages ok, exit 0. Rebased on 874b86653 (no
change under internal/library or the library plugin); at the pushed
tree: go test ./internal/library ok, GOOS=linux go vet -tags nogui ./...
ok, library-rtk-install + i18n-keys 25 of 26 (the one red is #4053).
Broken by hand: rtkInstaller back to "brew when there is one": all four
bottle cases, the hang test and (with brewError off) the error test red.
The kept answer dropped: "brew asked 2 times". The card's error line
dropped: library-rtk-install red in every language.
Not tried: a real Intel Mac or a real macOS 14 (simulated with
HOMEBREW_FAKE_MACOS); Scott__D's own Mac, macOS version and network; a
network where GitHub downloads fail (the script's error then shows on the
card).