-
Notifications
You must be signed in to change notification settings - Fork 18
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
Support for M1 #50
Comments
Oh good catch. There's no good reason why it wouldn't work on M1 macs but I have no idea what configuration changes are needed because I don't have an M1 mac to test and experiment with. I would happy fix this bug in exchange for an M1 mac. Otherwise someone else will need to pick it up! |
Made a request for help on the fdb forums |
Thanks. Will do. I feel like we just need to set some npm package settings so that it uses the x64 version on Darwin-arm64 |
The specific error you're running into comes from this in package.json:
If you remove that, does it build? There may be other changes required in binding.gyp. |
There is probably also a way to cross-compile the package for ARM from an intel mac, but I'm not sure how to do this. Edit: Looks pretty easy - but we'll need to figure out how to express that in gyp. I wonder if |
Ok - I managed to build a universal binary for macos and it seems to work. But foundationdb itself doesn't yet support the apple M1. With 6.2.28 (latest at time of writing):
There's an open PR for apple silicon support on foundationdb but it hasn't yet been merged. I've updated package.json to remove the x86_64 restriction and updated the github actions to generate prebuilds for arm64. But I have no idea what Rosetta's behaviour would be in this case - it should be able to use the x86 binaries for everything, but I couldn't speculate on what it actually does. I'm worried with prebuilds for arm nodejs will try to load the native arm version of the module, and that'll fail to run because it can't find a working ARM copy of libfdb_c.dylib. |
Mmmf.. looks like github actions is still by default using an old version of macos which doesn't support building for ARM, and we can't move to the newer images until github adds capacity. The current GH environment does not support arm64. |
Anyway, summary:
To cross-compile the node-foundationdb bindings for ARM and experiment either run:
or compile prebuilds with:
(This depends on the updated prebuildify - git pull then run Manually specifying --arch should be unnecessary on an arm mac. Its also possible to build a universal napi module like this:
But afaik it won't help until we have a universal libfdb_c.dylib. |
Hi Just that I get an error when trying to install the package. I will check your update and see if it works. Thanks for the help! |
For the time being I've installed node + npm under Rosetta so it all works fine for now. Thanks! |
Hey, we've managed to get a working setup with FoundationDB 6.3.23 for M1 in Docker. To do that, we had to enable knob fdbserver --knob_disable_posix_kernel_aio=1 <...other args> fdbcli --exec 'configure new single ssd' --knob_disable_posix_kernel_aio=1 // do this before fdb.open():
fdb.configNetwork({
knob: 'disable_posix_kernel_aio=1',
}); |
Hi, do you have any outlook on this issue? Checking foundationdb downloads, there is now an ARM version for Mac available. This should resolve the first blocker from the list above. |
Oh lovely - well, if there are ARM builds of Maybe someone with an M1/M2 chip can play around with the build? A quick glance also suggests we should be able to use github actions to build for apple silicon now that they've updated their images for macos 12. (Macos 11+ is needed for the ARM compiler toolchain). |
I've just published foundationdb 2.0 with support via cross-compilation for ARM. Unfortunately, while I can compile the foundationdb library for arm directly on an arm computer (and the resulting artifact works fine), the module compiled on github actions doesn't seem to work. It gets this error:
I'd love some help figuring this out if anyone has time to debug it! |
From I have an M1 machine, and if I try to |
Sure. Can x86 and ARM copies of foundationdb sit side-by-side? I guess we could just install x86 foundationdb, build for x86, uninstall, then install arm foundationdb and build for arm. I wonder if there's some |
Yep, installing the arm version of foundationdb before building for arm did the trick. Thanks @atn34! foundationdb@2.0.1 works with native apple silicon support now. Sorry this took so long to get sorted! Let me know if there's any problems. |
On a M1 Mac - when I try to install I get the following:
Is there a way to make it work on this new architecture?
The text was updated successfully, but these errors were encountered: