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

Homebrew installation issues on mac m1 #151

Open
LucasLombardo opened this issue Apr 6, 2021 · 16 comments
Open

Homebrew installation issues on mac m1 #151

LucasLombardo opened this issue Apr 6, 2021 · 16 comments

Comments

@LucasLombardo
Copy link

I wasn't able to install plenti initially through homebrew following instructions from the readme on a mac with m1 processor.

After running brew tap plentico/homebrew-plenti I got the error below.

Error: Invalid formula: /opt/homebrew/Library/Taps/plentico/homebrew-plenti/plenti.rb
formulae require at least a URL
Error: Cannot tap plentico/plenti: invalid syntax in tap!

Looking at the homebrew-plenti repo I saw there was a check for if you are on intel before installing. Forking that file and removing the check worked for me and it installed / created a new site OK. Fork I used.

@jimafisk
Copy link
Member

jimafisk commented Apr 6, 2021

Hey @LucasLombardo!

This is a good catch, it's nice to know that removing && Hardware::CPU.intel? from our formula still works on m1. We're automatically building the homebrew settings using Goreleaser, so we specify the supported architectures here:

- amd64

Go added native m1 support in v1.16, so we should be able to add arm64 to Goreleaser: https://goreleaser.com/customization/build/. The only hangup might be that we're using cgo, so we need an OSXcross target to cross compile from Linux to Darwin (Mac).

This could be the same issue @Valexr was experiencing in #141

@jimafisk
Copy link
Member

jimafisk commented Apr 6, 2021

So it looks like trying to build with arm64 broke our build in the past: #110. I think this probably because our github-action was locked at Go v1.14 until recently:

go-version: 1.14.x

jimafisk added a commit that referenced this issue Apr 6, 2021
@jimafisk
Copy link
Member

jimafisk commented Apr 6, 2021

I just tried building with arm64 and it failed: https://github.com/plentico/plenti/runs/2280442554

Error message
   ⨯ release failed after 75.98s error=failed to build for darwin_arm64: # runtime/cgo
osxcross: error: unsupported architecture: 'arm64'
osxcross: error: while detecting target

Error: The process '/opt/hostedtoolcache/goreleaser-action/0.162.0/x64/goreleaser' failed with exit code 1

Right from the OSXCross README:

arm64 requires macOS 11.0 SDK (or later).

Right from our OSXCross-Target README we used MacOSX10.15.sdk.tar.xz

I can rebuild with a newer SDK but it's a pain on Ubuntu 20 because of the newer version of libssl: plentico/osxcross-target#1.

@LucasLombardo
Copy link
Author

@jimafisk Thanks for looking into it, I wouldn't be surprised if the other installation methods offered would have also worked so not necessarily a big deal. Just wanted to give you a heads up.

@jimafisk
Copy link
Member

jimafisk commented Apr 6, 2021

I appreciate you flagging it to me and debugging to figure out what the issue was @LucasLombardo! I use linux so I don't always catch these things, but I imagine a lot of other folks would run into the same issue.

I updated the SDK in osxcross-target from MacOSX10.15 to MacOSX11.3: plentico/osxcross-target@3b747bf

Reran build https://github.com/plentico/plenti/runs/2281823775 which failed with a new error:

Error message
   ⨯ release failed after 61.41s error=failed to build for darwin_amd64: # runtime/cgo
/home/runner/work/osxcross/target/bin/x86_64-apple-darwin20.4-ld: error while loading shared libraries: libtinfo.so.6: cannot open shared object file: No such file or directory
clang: error: unable to execute command: No such file or directory
clang: error: linker command failed due to signal (use -v to see invocation)

Error: The process '/opt/hostedtoolcache/goreleaser-action/0.162.0/x64/goreleaser' failed with exit code 1

This might have to do with the fact that I'm building the target on Ubuntu 20.04 now. I could bump our CI from 18.04 to 20.04, but I'll have to add a step to install an outdated version of libssl: plentico/osxcross-target#1 (comment)

@jimafisk
Copy link
Member

jimafisk commented Apr 6, 2021

New failure: https://github.com/plentico/plenti/runs/2282087718

Snapcraft login error
Error: Invalid value for '--experimental-login': 
is not a valid boolean
Error: Process completed with exit code 2.

Sounds like --experimental-login was added in Snapcraft 4.6: https://forum.snapcraft.io/t/call-for-testing-snapcraft-4-6/23549

Not sure if bumping the OS to Ubuntu 20.04 from 18.04 is causing the issue...

@jimafisk
Copy link
Member

jimafisk commented Apr 6, 2021

I can't find much support for this snapcraft login issue, at least we're not the only ones https://twitter.com/dosco/status/1378055663792705536

@sergiusens
Copy link

This is interesting, we use click and added a new option (boolean) which seems to be causing issues with the way you are feeding the auth data.

While I figure out what is going on with click, can you see if echo "$SNAPCRAFT_LOGIN" | snapcraft login --with -?

@jimafisk
Copy link
Member

jimafisk commented Apr 7, 2021

Thanks for taking a look @sergiusens! I just ran another build with the updated login command, but it seems to have the same Error: Invalid value for '--experimental-login' error: https://github.com/plentico/plenti/runs/2283432297

@sergiusens
Copy link

This was more of a simpler issue to fix than I thought, but still a 🤦 moment canonical/snapcraft#3493

Renaming the env var should do it for now, will try to get this fix released by tomorrow in a patch release. Sorry for the troubles.

@jimafisk
Copy link
Member

jimafisk commented Apr 7, 2021

No worries @sergiusens, thanks for the quick fix! Renaming the env var on my end now as a test, will follow up if I have any issues! Thanks!

@jimafisk
Copy link
Member

jimafisk commented Apr 7, 2021

@sergiusens that worked! Thanks again!

The remain breakage is unrelated: https://github.com/plentico/plenti/runs/2283581048

@jimafisk
Copy link
Member

jimafisk commented Apr 7, 2021

This might not be possible in v8go at the moment: rogchap/v8go#54

jimafisk added a commit that referenced this issue Apr 7, 2021
@jamestagal
Copy link

FYI I just installed plenti via Homebrew on my Mac mini M1 and it worked for the first time because previous tries failed. But when looking at the version it has installed it is not the latest. I wonder does Homebrew take a few days to update its packages?

plenti --version
v0.5.5

Cheers,
Ben

@jimafisk
Copy link
Member

Oh interesting, thanks for testing this out @jamestagal. I honestly wasn't sure if this would work on M1 or not, so it's great to have more data points. Some day I'd like to remove our cgo dependency so we could open up the releases to a vast number of different devices.

For getting the newest Plenti version, does something like brew upgrade plenti work? Since we're running our own tap, it should get updated when we make a release.

@jamestagal
Copy link

Hi @jimafisk
Thanks. Yes interestingly running that command and then I checked the version and it outputted the following:

❯ brew upgrade plenti
Running `brew update --auto-update`...
==> Auto-updated Homebrew!
Updated 2 taps (homebrew/core and homebrew/cask).
==> New Formulae
leapp-cli                         levant                            livekit

Warning: plentico/plenti/plenti 0.5.8 already installed
❯ plenti --version
v0.5.5

So the version is showing V.0.5.5 while V0.5.8 is installed? How can I know which version I have because I don't believe I have the latest version installed?

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

4 participants