-
Notifications
You must be signed in to change notification settings - Fork 7
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
Make choosenim produce x86_64/arm64 proxies on Apple Silicon machines #10
Conversation
hi, thanks for this! I checked out the PR and choosenim. It indeed compiles to a arm64 binary:
after using to install a nim version (tried both 1.6.20 and devel), nim is not arm:
from the examples above I was expecting it to be an arm executable but maybe there is something I am doing wrong? my OS version is 14.3 |
@pietroppeter Thanks for the info! I could reproduce that too! I think the x86_64 proxies is calling arm64 nim and that's why I got |
@pietroppeter I pushed an update! Should be fine by now! It was caused by a bug in Apple Silicon check, forcing choosenim to use x86_64 proxies. |
works for me too, thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From what I can tell the gist of this PR was already reviewed and approved by dom (with help and additional review from @elcritch). with respect to the original PR, it does provide additional features (puppy's workaround and an additional fix), so it looks very good to me.
thanks @heinthanth for working on this and keeping push it even after quite some time after the initial reviews!
I do not feel really competent to review the details of the implementation though, so take my approval with a grain of salt (not a maintainer here) :)
@heinthanth Hello, it seems to break choosenim building on windows
|
@ringabout looks like there's a circular dependency on Windows. Switcher import utils and Utils import switcher on Windows. I'll import update |
This PR makes
choosenim
to producearm64
proxies so that it works on Apple Silicon machines.Previously,
Nim
was compiled as arm64 butchoosenim
produce onlyx86_64
.This PR adjusted the
compileProxyexe
so that it will produce bothx86_64
andarm64
nim proxies and install them according to host machine CPU.Note:
choosenim
itself can bex86_64
binary depending on Nim compiler configuration that used to compile choosenim. It can be easily adjusted. But it's not the scope of this PR.choosenim
will install proxies according to the host CPU (which means even if you compilechoosenim
asx86_64
and run underrosetta
,arm64
proxies will be installed)Rules:
Build machine:
arm64
).User machine:
isAppleSilicon
.Like this: (arm64 is installed even if choosenim is running under Rosetta - zsh)
I did run a few tests on my M3 Macbook Pro.
Here is my original PR on the original repo: dom96/choosenim#301.
Edit:
I've also addressed #9 with temporary solution as suggested here: treeform/puppy#118.