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

updated dependency for M1 support #37

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

cnpog
Copy link

@cnpog cnpog commented Oct 27, 2022

  • set the go version to 1.16 which is the first version to support M1
  • updated all the dependencies to get rid of compile errors
    On an additional note you can combine an arm and an x86 binary with "lipo" to get a universal binary.

@prashantgupta24
Copy link
Owner

Thanks for the PR! Will take a look asap

@cnpog
Copy link
Author

cnpog commented Oct 28, 2022

thanks for looking at it, I guess the version needs to be 1.18 at least if I understand that pipeline error correctly

@prashantgupta24
Copy link
Owner

prashantgupta24 commented Oct 28, 2022

Will probably need to edit the workflow file which mentions 1.17

@prashantgupta24
Copy link
Owner

Hmm, seems to be some issues with the new robotgo lib?

@cnpog
Copy link
Author

cnpog commented Nov 3, 2022

I cannot replicate this on my machine, do you know how?

@prashantgupta24
Copy link
Owner

no :(

@Resousse
Copy link
Contributor

Better go directly with robotGo v1.0.0 which is in RC1(https://github.com/go-vgo/robotgo/releases/tag/v1.0.0-rc1), which seems to bring not retro-compatible change

@Resousse
Copy link
Contributor

this PR can be closed I presume

@longgiangp
Copy link

Newest release still uses Rosetta 2 on my M1

@Resousse
Copy link
Contributor

Newest release still uses Rosetta 2 on my M1

I think it's more a matter of compilation because on my side (compiled from source), I have it running as Apple (not Intel)
image

@prashantgupta24
Copy link
Owner

Should I add something to the build to build one for Apple macs?

@Resousse
Copy link
Contributor

may be it depends on the system you used to compile, because I didn't add anything, to make "Apple" appear :/

@prashantgupta24
Copy link
Owner

@Resousse how did you get to the view where it says Apple ?

@Resousse
Copy link
Contributor

Activity monitor > processes

@prashantgupta24
Copy link
Owner

Let me compile it with my m1 and add it to the release. Right now the one I have added was compiled on my x86

@longgiangp
Copy link

Should I add something to the build to build one for Apple macs?

Setting Architecture variables should work. I haven't tried yet.

   GOOS=darwin
   BINARY_NAME=amm_universal

   build:
       mkdir -p -v ./bin/amm.app/Contents/Resources
       mkdir -p -v ./bin/amm.app/Contents/MacOS
       cp ./appInfo/*.plist ./bin/amm.app/Contents/Info.plist
       cp ./appInfo/*.icns ./bin/amm.app/Contents/Resources/icon.icns
       GOARCH=amd64 go build -o ./bin/amm.app/Contents/MacOS/amm_amd64 cmd/main.go
       GOARCH=arm64 go build -o ./bin/amm.app/Contents/MacOS/amm_arm64 cmd/main.go
       lipo -create -output $(BINARY_NAME) amm_amd64 amm_arm64

@Resousse
Copy link
Contributor

When you compiled it it goes with rosetta/intel?

@prashantgupta24
Copy link
Owner

When you compiled it it goes with rosetta/intel?

Yep. I see intel instead of Apple in Activity monitor > processes

@Resousse
Copy link
Contributor

Resousse commented Oct 18, 2023

on my side, I do not find how to compile an "Intel" version :)
My go version is : go1.21.3 darwin/arm64
Same on your side?

Finally I'm able to generate an intel version :
CGO_ENABLED=1 GOARCH=amd64 make

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

Successfully merging this pull request may close these issues.

None yet

4 participants