[MONGOCRYPT-375] Building for macOS-x86_64 but attempting to link with file built for macOS-arm64 on mac m1 Created: 29/Jan/22  Updated: 16/Jun/22  Resolved: 30/Jan/22

Status: Closed
Project: Libmongocrypt
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Unknown
Reporter: Anon Decen Assignee: Unassigned
Resolution: Duplicate Votes: 0
Labels: bug
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: PNG File Screenshot 2022-01-29 at 9.45.14 AM.png    

 Description   

Hey there, I don't see issues page, but i saw this PR about mac m1.
I use Mac m1 12.0.1 monterey, and node@14.17.0 | darwin | x64.

I successfully installed mongodb-client-encryption npm package. Now when i try to run my index.js where i require('mongodb-client-encryption"), it gives me following error in the terminal.

Error: dlopen(/Users/ray/Desktop/crypt/cryptpad/database/node_modules/mongodb-client-encryption/build/Release/mongocrypt.node, 0x0001): tried: '/Users/ray/Desktop/crypt/cryptpad/database/node_modules/mongodb-client-encryption/build/Release/mongocrypt.node' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e')), '/usr/lib/mongocrypt.node' (no such file)

When i tried to rebuild inside node_modules, env BUILD_TYPE="dynamic" npx node-gyp rebuild, it throws:

Anyone knows how to resolve ? I followed the README of _https://github.com/mongodb/libmongocrypt/_ repo, but still same issue on mac M1



 Comments   
Comment by Kevin Albertson [ 30/Jan/22 ]

Hi rajugautam45@gmail.com, NODE-3631 tracks M1 support of the mongodb-client-encryption package. Please watch NODE-3631 for updates. NODE-3631 includes steps for a workaround.

Generated at Thu Feb 08 09:08:33 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.