Release arm64 binary or universal binary for macOS #369
Replies: 7 comments
-
|
It's been quite some time since I've last worked with go so I don't know much about the toolchain, but I've installed the latest go version and tried to compile klog on M1. These are the errors I get: I've previously build klog successfully for x86_64. |
Beta Was this translation helpful? Give feedback.
-
|
Hey, yeah supporting ARM is a good idea indeed. I don’t have an M1 (yet), so I didn’t get a chance of trying it myself. I suppose eventually the universal binary would be most convenient, and it seems like The error you see is from the systray widget (
|
Beta Was this translation helpful? Give feedback.
-
|
|
Beta Was this translation helpful? Give feedback.
-
|
I’ve fixed the build directives, so running the compile command should work now. |
Beta Was this translation helpful? Give feedback.
-
|
That worked well! I compiled and checked the build: |
Beta Was this translation helpful? Give feedback.
-
Wouldn't it be possible to get that working as well? Compiling Objective C to arm64 should be easy. We would just need to figure out how this thing is build. I've tried to compile the objective c files, but I get multiple warnings about deprecated macOS APIs, so sooner or later it probably won't work anymore anyway. |
Beta Was this translation helpful? Give feedback.
-
|
Awesome, thanks for verifying, and also for fiddling around and sharing your findings. I’ve extended the automated builds now to generate separate versions for both Intel (AMD) and ARM. I’ve also edited the latest v3.1 release, so you find the ARM binary there for download. I didn’t go with universal binaries in the end, because the resulting binary size came out quite big with Regarding the widget, the situation is a bit tricky: I personally don’t use the widget anymore, and I also don’t think a lot of other people do. Unfortunately, the current approach is also very limited, so I feel it’s a dead end overall. I don’t mind keeping the code as it is, because it works (well, on Intel Macs at least) and it doesn’t do too much harm right now. But instead of investing time into extending or porting, I’d rather reimplement it properly and make it more powerful – not sure, admittedly, whether that will ever happen. That being said, if you or anyone else is in the mood to fix the current code to make it work on ARM, I’d be open for pull requests. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
could you please publish release binaries for M1 / arm64 on macOS as well? Cross compiling should be relatively trivial (I hope).
I haven't tested it yet, but it looks like all that's needed are the two variables
GOOS=darwin GOARCH=arm64when running the compilation command.Universal binaries (binaries that contain both x86_64 and arm64 code) don't seem to be supported yet (at least not out of the box by the go compiler), but it should still be possible with very little effort, see here. But I'm not sure whether you need a mac for creating a universal binary this way. But even if there were two separate binaries for macOS, that'd still be great.
Let me know if you need help.
Beta Was this translation helpful? Give feedback.
All reactions