Skip to content

fix: select native Arm64 binary under Rosetta 2#9

Merged
BartoszBlizniak merged 1 commit into
mainfrom
feat/detect-rosetta-arm64
Jul 21, 2026
Merged

fix: select native Arm64 binary under Rosetta 2#9
BartoszBlizniak merged 1 commit into
mainfrom
feat/detect-rosetta-arm64

Conversation

@BartoszBlizniak

Copy link
Copy Markdown
Member

Summary

  • detect when the macOS shell is running as x86-64 under Rosetta 2
  • select the native macos-arm64 Cloudsmith CLI binary on Apple silicon
  • preserve macos-x86_64 selection on genuine Intel Macs and when the Rosetta
    probe is unavailable
  • document the Rosetta behavior and cover native, translated, and unavailable
    probe results

Type of change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update
  • Refactoring
  • Other (please describe)

Validation

  • sh -n install.sh
  • shellcheck --shell=sh --severity=style install.sh
  • bats tests/detect_target.bats — 9 tests passed
  • bats tests/ — 45 tests passed
  • git diff --check

Compatibility

Apple silicon Macs running the shell under Rosetta 2 now resolve to
macos-arm64 instead of macos-x86_64. Native Apple silicon and genuine Intel
Mac behavior is unchanged. An explicit --target override still takes
precedence. The Windows-only PowerShell installer is unaffected.

Checklist

  • I have added or updated tests where appropriate.
  • I have updated documentation and CHANGELOG.md where appropriate.
  • I have not included credentials, tokens, or other sensitive data.
  • I have called out any breaking change explicitly.

@BartoszBlizniak
BartoszBlizniak marked this pull request as ready for review July 20, 2026 17:23
@BartoszBlizniak
BartoszBlizniak requested a review from a team as a code owner July 20, 2026 17:23
Copilot AI review requested due to automatic review settings July 20, 2026 17:23

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes macOS target detection so that Apple silicon machines running an x86_64 shell under Rosetta 2 download/use the native macos-arm64 Cloudsmith CLI binary, while preserving existing behavior on genuine Intel Macs and when the Rosetta probe is unavailable.

Changes:

  • Updated install.sh target detection to probe sysctl.proc_translated when uname -m reports x86_64/amd64 on macOS.
  • Added Bats coverage for native, translated (Rosetta), and unavailable Rosetta probe outcomes.
  • Documented the Rosetta behavior in README.md and noted it in CHANGELOG.md.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
install.sh Prefer macos-arm64 when Rosetta translation is detected under an x86_64 macOS shell.
tests/detect_target.bats Adds a sysctl stub and tests covering Rosetta/native/unavailable probe outcomes.
README.md Clarifies that macos-arm64 applies to Apple silicon shells running under Rosetta 2.
CHANGELOG.md Notes native Arm64 selection under Rosetta 2 in the unreleased feature list.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@BartoszBlizniak
BartoszBlizniak merged commit 7658091 into main Jul 21, 2026
12 checks passed
@BartoszBlizniak
BartoszBlizniak deleted the feat/detect-rosetta-arm64 branch July 22, 2026 14:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants