-
Notifications
You must be signed in to change notification settings - Fork 358
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
opam does not compile packages to ARM arch on macOS #5450
Comments
Your default terminal seems to be running in x86_64 mode, so any programs run by opam (even if opam if an arm64 executable) will be run in x86_64 mode. |
Well, running |
In that case it is indeed not expected. I'm unable to reproduce this on my machine. |
This is what I got
|
ah so it's something in your build toolchain that's compiled in x86_64 mode. Could you give us the output of:
There are other commands used but that's a start |
Here's the output, they are all universal builds. You should note that
|
mmmh, maybe try to run what opam is running by hand and see what happens:
and see the result of |
|
These bash wrappers are suspicious. What happens if you remove them from your |
This yields the same result. |
What does |
I get
I think I found the culprit, it seems to use a distribution of bash that is not arm64, I'll try to fix it and report later. EDIT: it was that indeed feel free to close the issue and many thanks for the help debugging |
To avoid this very specific issue in the future in opam I've opened #5451. However you would've certainly gotten similar issues elsewhere at a later time so it only tries to make the user's experience more consistent. |
On macOS Monterey with a M1 arm64 machine,
opam
does not detect the host architecture properly.Even if set manually, opam will not compile packages for the correct architecture.
To recreate this behaviour, install opam following the site instructions, configure opam architecture manually to arm64, create a switch and install a package.
The problem is then observed by checking the kind of file produced using macOS
file
.The last two commands will should produce similar outputs like the following :
.opam/arm/bin/ocamlc: Mach-O 64-bit executable x86_64
instead of the expectedMach-O 64-bit executable arm64
.Is this the expected behaviour? This yields incompatibility issues with third party libraries.
The text was updated successfully, but these errors were encountered: