neon-bindings / examples

A collection of examples of Neon
324 stars 43 forks source link

Apple M1 issue #76

Closed javaxiu closed 2 years ago

javaxiu commented 3 years ago

i've clone this example on both intel chip Mac and M1 chip Mac, and build on both, it works well on intel but got this error on M1, please help me find it out and thanks a lot

image

kjvalencik commented 3 years ago

@javaxiu This seems like the addon is being built for a different architecture than Node is running under.

Can you confirm a few things?

  1. The issue still happens after running cargo clean and then rebuilding. This will rule out an old build for a different architecture.
  2. Both the shell and node being run are compiled for M1 and not running under Rosetta. This can be checked in activity monitor or the CLI.
  3. The Rust build chain being used is for aarch.

FYI, native add-ons are not portable across CPU architectures. However, you can use lipo to make a large binary that supports both.

kjvalencik commented 2 years ago

Closing this issue since it has not had updates in awhile and we have sufficient evidence that Neon works great on M1.

Let me know if you continue to have problems and I will re-open.