When installing an extension, the CLI must to select the correct binary to download for the machine (see the installBin function).
By default, the CLI will download a binary matching the current machine's architecture.
However, to provide better support for Macs running on Apple Silicon, it will fall back from darwin-arm64 to darwin-amd64 if Rosetta (Apple's compatibility layer) is installed.
If Rosetta isn't installed, this fallback doesn't happen, which can lead to surprising and confusing results when one Mac has Rosetta and another doesn't, because the extension will install on one machine but not another.
I would propose that we return a specific error message suggesting that the user installs Rosetta where:
- a
darwin-arm64 binary is not available
- a
darwin-amd64 binary is available
- Rosetta is not installed
Steps to reproduce the behavior
- Try to install an extension without a
darwin-arm64 binary on a Mac with Apple Silicon which doesn't have Rosetta installed:
gh extension install github/gh-gei
- Installation fails with an error
gh-gei unsupported for darwin-arm64. Open an issue: `gh issue create -R github/gh-gei -t'Support darwin-arm64'`
- Try the same thing on an Apple Silicon Mac with Rosetta installed, and installation succeeds