corelocationcli icon indicating copy to clipboard operation
corelocationcli copied to clipboard

bad CPU type in executable: /usr/local/bin/CoreLocationCLI

Open rr0ss0rr opened this issue 2 years ago • 11 comments

Did a brew upgrade CoreLocationCLI and received the error. I removed and did a brew install cask corelocationcli with same results.

MacBook Pro (13-inch, 2018, Four Thunderbolt 3 Ports) 2.3 GHz Quad-Core Intel Core i5

Thanks

rr0ss0rr avatar Apr 28 '22 14:04 rr0ss0rr

I have the same issue. This did work on my M1 MacBook Pro, but it failed on my Intel-based Mac

MacBook Pro (16-inch, 2019) 2.4 GHz 8-Core Intel Core i9

jlconlin avatar May 23 '22 14:05 jlconlin

~ > brew ls corelocationcli
==> Binary
/usr/local/bin/CoreLocationCLI -> /usr/local/Caskroom/corelocationcli/4.0.0/CoreLocationCLI (98.9KB)

~ > file /usr/local/bin/CoreLocationCLI
/usr/local/bin/CoreLocationCLI: Mach-O 64-bit executable arm64

~ > uname -rsm
Darwin 21.5.0 x86_64

evgkrsk avatar May 26 '22 18:05 evgkrsk

Easiest workaround: compile it for your current machine. Download the repo, unzip, and then run swift build -c release from the root folder. The binary will be available in the hidden folder ./.build/<arch>/release. You can optionally move the binary to a location in your PATH. It requires XCode, obviously.

edoardob90 avatar Sep 19 '22 20:09 edoardob90

Wondering why the official package is not build as a universal binary for both architectures. I ran into the same issue and setup as a workaround my own homebrew tap and compiled it with swift build -c release --arch arm64 --arch x86_64. Hope the upstream homebrew cask will be universal at one point. Intel Macs are not going away anytime soon.

mschirrmeister avatar Oct 31 '22 11:10 mschirrmeister

CoreLocationCLI.zip

I just ran this and got this executable. Any good?


Also I can't find any documentation for these --arch flags. But it seems straightforward enough. Happy to support universal builds if this works.

fulldecent avatar Nov 05 '22 02:11 fulldecent

Looks like still a arm64 binary only.

marco@loop ~/Downloads> ./CoreLocationCLI
exec: Failed to execute process '/Users/marco/Downloads/CoreLocationCLI': Bad CPU type in executable.

marco@loop ~/Downloads> lipo -info CoreLocationCLI
Non-fat file: CoreLocationCLI is architecture: arm64

When I run it on the one I compiled.

◆ corelocationcli git:(main) ❯❯❯ lipo -info .build/apple/Products/Release/CoreLocationCLI
Architectures in the fat file: .build/apple/Products/Release/CoreLocationCLI are: x86_64 arm64

I don't know where the options are in the official documentation. I found it here. https://developer.apple.com/forums/thread/667440 https://liamnichols.eu/2020/08/01/building-swift-packages-as-a-universal-binary.html

Also read somewhere that you can change something in Xcode, but could not figure out what to do in Xcode that it spits out a universal binary.

mschirrmeister avatar Nov 05 '22 08:11 mschirrmeister

Also really looking forward to this working on Intel Macs! Very sad that its not been working since April :(. p.s. @mschirrmeister Could you explain the hosting your own homebrew tap briefly? I would love this temporary fix!

mayurankv avatar Nov 21 '22 22:11 mayurankv

Trying a new approach. Please see

https://github.com/fulldecent/corelocationcli/releases/tag/4.0.2

https://github.com/Homebrew/homebrew-cask/pull/136269

fulldecent avatar Nov 22 '22 02:11 fulldecent

@fulldecent, version 4.0.2 works perfect. :-)

@mayurankv, not sure what you exactly mean. My repo is here and it has some description. Does that answer your question? https://github.com/mschirrmeister/homebrew-corelocationcli

mschirrmeister avatar Nov 22 '22 14:11 mschirrmeister

I was just wondering how to replicate the same self-maintained tap but 4.0.2 works great for me (up to the location privacy issues mentioned in another issue) so no need anymore. Thanks so much for the speedy responses!

mayurankv avatar Nov 22 '22 15:11 mayurankv

On that note, this thread can be closed no?

mayurankv avatar Nov 22 '22 15:11 mayurankv