Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for Apple M1 chips #2131

Closed
nirajhx opened this issue Jan 25, 2021 · 37 comments
Closed

Support for Apple M1 chips #2131

nirajhx opened this issue Jan 25, 2021 · 37 comments

Comments

@nirajhx
Copy link

nirajhx commented Jan 25, 2021

Please provide details on the following items. Failure to do so may result in deletion of your feature request.
Not able to install on Apple MacBook with M1 chipset

What's the user value of this feature request?
Devs using the latest MacBook will be able to use cli

Who is the functionality for?
Devs using the latest M1 chip macbook

How often will this functionality be used by the user?
Always

Who else is affected by the change?
This should not affect the other versions

Is your feature request related to a problem? Please describe.
Trying to install CLI on my M1 chip MacBook, but the installation fails with following error:

==> Installing cf-cli from cloudfoundry/tap
cf-cli: The x86_64 architecture is required for this software.
Error: An unsatisfied requirement failed this build.

Describe alternatives you've considered
I tried compiling the source code, but that also didn't workout. Got following error:

go build -ldflags "-w -s -X code.cloudfoundry.org/cli/version.binarySHA=$(git rev-parse --short HEAD) -X code.cloudfoundry.org/cli/version.binaryBuildDate=$(date -u +"%Y-%m-%d") -X code.cloudfoundry.org/cli/version.binaryVersion=$(cat BUILD_VERSION) " -o out/cf .
# code.cloudfoundry.org/cli/api/cloudcontroller/ccv3/constant
assertion failed [abi_info.kind == AbiKind::TranslatedCode]: emulated forward to an arm pc that isn't in translated code. arm_pc=0x1020cf4d8 abi_kind=6 emulation_interval=[0x1020f8df8,0x1020f8e0c) instruction_interval=[0x1020f8de4, 0x1020f8e0c) x86_rip=0x101c91a
(ThreadContextRegisterState.cpp:677 move_to_instruction_boundary)
@cf-gitbot
Copy link

We have created an issue in Pivotal Tracker to manage this:

https://www.pivotaltracker.com/story/show/176633479

The labels on this github issue will be updated when the story is started.

@a-b
Copy link
Member

a-b commented Feb 5, 2021

Hello @nirajhx, thanks for reporting this issue. Did you try running our macOS binary using Rosetta Shell?

@nirajhx
Copy link
Author

nirajhx commented Feb 11, 2021

Yeah, binary did work for me. Thanks 😊

@biolauri
Copy link

Could someone re-open this issue? Albeit the workaround with Rosetta Shell does work, it'd be very great to have the cf cli native for ARM-based architecture.

@a-b
Copy link
Member

a-b commented May 26, 2021

@biolauri do you know if it is possible to cross-compile Golang binary for ARM on Linux?

@a-b
Copy link
Member

a-b commented May 26, 2021

It looks like Apple Silicone is just a normal ARM we will look into this proposal as we start working on the improvement of our release process next couple of months.

@a-b a-b reopened this May 26, 2021
@cf-gitbot
Copy link

We have created an issue in Pivotal Tracker to manage this:

https://www.pivotaltracker.com/story/show/178307311

The labels on this github issue will be updated when the story is started.

@biolauri
Copy link

Great to hear @a-b! Yes, AFAIK, Apple Silicon is just normal ARM64 architecture.

@sumitpal-singh
Copy link

Hello @nirajhx, thanks for reporting this issue. Did you try running our macOS binary using Rosetta Shell?

Binary did not work for me using the ZSH shell

@Parovsky
Copy link

This guide is useful for installing Rosetta Shell and Homebrew and after the restart, you can run the command brew install cloudfoundry/tap/cf-cli

@a-b
Copy link
Member

a-b commented Aug 24, 2021

Technically now you can compile M1, check this

@mattreddy3
Copy link

Hi all, wondering if this is still on the radar? I unfortunately am not advanced enough to take the information above and compile the binary myself :) so am wondering if it's A. available somewhere or B. still in process or C. off the table?

@a-b
Copy link
Member

a-b commented Sep 22, 2021

While M1 support is not entirely off the radar, I can't give you any specific timeline.

@mattreddy3
Copy link

Got it, thank you for the update. Is there an approach you would recommend for utilizing the CF CLI on ARM containers in the meantime?

So far my best solution is running an AMD container on my M1-native docker desktop install, but the qemu runs everything so slowly (per Docker's known issues) that i'm better off using my local machine w/rosetta and praying i keep all my global programs/versions in sync.

@lokhmakov
Copy link

Any updates?

@raulfdm
Copy link

raulfdm commented Nov 25, 2021

@a-b about the infrastructure... do you need an Mac with M1 to run automate tests or just someone who can install and report if everything went well?

@gmuth
Copy link

gmuth commented Dec 7, 2021

By default installing via homebrew fails (workarounds exists, e.g. install x86-binary from tar.gz):
Maybe a hint in the docs would help: "install via homebrew (only for Intel Macs)"

Cloning into '/Volumes/Toolchain/homebrew/Library/Taps/cloudfoundry/homebrew-tap'...
remote: Enumerating objects: 1929, done.
remote: Counting objects: 100% (92/92), done.
remote: Compressing objects: 100% (67/67), done.
remote: Total 1929 (delta 54), reused 57 (delta 25), pack-reused 1837
Receiving objects: 100% (1929/1929), 248.61 KiB | 1.54 MiB/s, done.
Resolving deltas: 100% (1222/1222), done.
Tapped 9 formulae (25 files, 330.2KB).
cf-cli: The x86_64 architecture is required for this software.
Error: cf-cli: An unsatisfied requirement failed this build.

@lokhmakov
Copy link

Temporary solution:

docker run -it --mount src=`pwd`,target=/home/piper/app,type=bind ppiper/cf-cli:latest /bin/bash

@oarthursilva
Copy link

Temporary solution:

docker run -it --mount src=`pwd`,target=/home/piper/app,type=bind ppiper/cf-cli:latest /bin/bash

Thanks, it worked for me.

@oarthursilva
Copy link

oarthursilva commented Dec 18, 2021

same than @lokhmakov , but using docker-compose

https://gist.github.com/oarthursilva/e03d7766575a6b8d96a0c697aa1f6d4b#file-docke-compose-cf-yml

run

$ docker-compose run cf

@oarthursilva
Copy link

oarthursilva commented Dec 18, 2021

Facing an issue while connecting on postgres by using ppiper/cf-cli:latest .

I'm following the wiki https://help.sap.com/viewer/b3fe3621fa4a4ed28d7bbe3d6d88f036/Cloud/en-US/69036a6c0b3b4377a1ae6a1edd084988.html in order to establish connection with Postgres.

I'm able to access the container and establish a ssh connection with Postgres (manually), the container exposes the port 63306 for the DBeaver to connect, but with no success, having connectivity issues.

the flow:
DBeaver (localhost) <--> ppiper/cf-cli:latest <-ssh-> Postges(hanatrial)

@onesail
Copy link

onesail commented Dec 19, 2021

@oarthursilva, from your description it looks like the cause is not related to native support for Apple Silicon.

philandstuff added a commit to philandstuff/homebrew-cloudfoundry that referenced this issue Feb 14, 2022
cf-cli is a go binary and can be easily built on ARM.

The only thing preventing it was this declaration in the homebrew
formula.

Fixes cloudfoundry#74, cloudfoundry/cli#2131.
@marcosrmendezthd
Copy link

any progress on this?

@AkihiroKitada
Copy link

Any progresses on this?

I understand cf cli intel binary for Mac can work on M1 Mac once it's installed based on Rosetta technology. The problem is that users could not install easily cf cli on M1 Mac via Homebrew system unless applying the following kind of trick:
https://community.pivotal.io/s/article/The-x86-64-architecture-is-required-unsatisfied-requirement-failed-this-build-error-when-installing-cf-CLI-on-an-M1-MacBook

The ideal resolution is to provide ARM64 binary for cf CLI. But, at least, should we work for something to enable M1 Mac users to install cf cli via homebrew easily without any tricks?

@wanddynosios
Copy link
Contributor

I created a homebrew tap for this, which I will keep manually updated until the official release comes around:
brew install wanddynosios/tap/cf-cli

@the-docta
Copy link

WOW. Thanks! The repository https://github.com/wanddynosios/homebrew-tap got a ⭐

dunno why this isnt yet added to official builld..

@a-b
Copy link
Member

a-b commented Apr 18, 2022

Our team just finished migrating our release process into GitHub Actions #2265
As part of this effort, we start building ARM Mac binaries. Our next step will include them into our official homebrew tap.

We discourage using 3rd party taps, to avoid confusion and support issues.

@jeffreyaggrey
Copy link

When will this be resolved.

@wanddynosios
Copy link
Contributor

@jeffreyaggrey It has been resolved for v8.4.0 and can now be installed via homebrew (see this commit)

@rafikt1992
Copy link

is it possible to support linux_arm as well

when running docker on M1 Mac. Docker will use linux arm64 instead of amd64. Thus cf for linux_arm64 is needed.

@a-b
Copy link
Member

a-b commented Jul 13, 2022

@rafikt1992 please create a separate GitHub Issue to track your proposal. Would you be open to helping with testing this?

@a-b
Copy link
Member

a-b commented Jul 13, 2022

Closing this issue since Apple ARM are now supported in V8 and V7

Next steps

@rafikt1992
Copy link

rafikt1992 commented Jul 13, 2022

@a-b

sure i can help i created a PR and an issue

however i noticed there is already a similar PR

#2279

@niklas1375
Copy link

For anyone coming here thinking it still does not work with Homebrew: You'll need to explicitly tell brew to use v8:

brew install cloudfoundry/tap/cf-cli@8

stephengrier added a commit to stephengrier/dotfiles that referenced this issue Nov 12, 2022
Update Brewfile with some changes for MacOS Monterey on ARM.

* Cleanup some unused packages like blackbox, ansible, stellarium, keepassx
* Replace cf-cli with cloudfoundry/tap/cf-cli@8, which includes ARM
  support - see cloudfoundry/cli#2131
* Install docker from the formula instead of the cask
* zoomus is now renamed to zoom
* The python formula now installs python3 so don't install both
@sangareddynalla
Copy link

Hi,

I am trying to execute the command % brew install credhub-cli
But is giving the error : credhub-cli: The x86_64 architecture is required for this software.
Error: credhub-cli: An unsatisfied requirement failed this build.

I am using Apple M2 system with Mac OS : 13.4.1 (ventura)

Please help me how to fix this issue on the Apple M2

@the-docta
Copy link

@sangareddynalla its been a while, but as far as I remember, the brew package has some architecture dependency. but not cli. So just install with x86 version of brew, and use it from your native terminals

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests