replicated icon indicating copy to clipboard operation
replicated copied to clipboard

Homebrew installation gives `bad CPU` error on M4 mac

Open toddboom opened this issue 1 year ago • 1 comments

Just installed v0.88.1 via Homebrew on an M4 MacBook Pro running macOS 15.2 and got this message: bad CPU type in executable: replicated

I uninstalled and reinstalled - same error.

I am guessing that there is some issue with the architecture targeting going on since there is a universal binary. Is it possible to have architecture-specific builds within Homebrew?

I am building from source now, which I assume will fix the issue. I will report back.

toddboom avatar Jan 17 '25 17:01 toddboom

Building this locally works fine.

Running otool -L on the downloaded cli binary yields the following:

replicated (architecture x86_64):
	/usr/lib/libSystem.B.dylib (compatibility version 0.0.0, current version 0.0.0)
	/usr/lib/libresolv.9.dylib (compatibility version 0.0.0, current version 0.0.0)
	/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 0.0.0, current version 0.0.0)
	/System/Library/Frameworks/Security.framework/Versions/A/Security (compatibility version 0.0.0, current version 0.0.0)

So this was clearly not built for the arm64 architecture that is required to run on a non-Intel mac. This lines up with the Homebrew recipe also: https://github.com/replicatedhq/homebrew-replicated/blob/main/HomebrewFormula/cli.rb#L10-L17

Possibly this just needs to have the architecture added to https://github.com/replicatedhq/replicated/blob/main/.goreleaser.yaml?

toddboom avatar Jan 24 '25 20:01 toddboom

Replicated CLI v0.119.0 and forward includes ARM64 builds

mikhailswift avatar Nov 04 '25 00:11 mikhailswift