derry icon indicating copy to clipboard operation
derry copied to clipboard

Failed to load dynamic library executor_mac64.dylib - incompatible architecture (have 'x86_64', need 'arm64e') (mac m1)

Open HugoHeneault opened this issue 3 years ago • 6 comments

Hello there 👋

Thanks your derry! Such a cool tool.

I'm having issues running it on my m1 macbook:

Invalid argument(s): Failed to load dynamic library '/Users/hugo/.pub-cache/hosted/pub.dartlang.org/derry-1.4.3/lib/src/blobs/executor_mac64.dylib': dlopen(/Users/hugo/.pub-cache/hosted/pub.dartlang.org/derry-1.4.3/lib/src/blobs/executor_mac64.dylib, 0x0001): tried: '/Users/hugo/.pub-cache/hosted/pub.dartlang.org/derry-1.4.3/lib/src/blobs/executor_mac64.dylib' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e')), '/usr/lib/executor_mac64.dylib' (no such file)

Even when running in a Rosetta terminal, I still encounter this issue.

How could I help you make derry run on m1 arch?

Thanks!

HugoHeneault avatar Nov 16 '21 04:11 HugoHeneault

Hey 👋

That's a late response, but if anyone is still interested, here is what I did. Long story short, you need to recompile the project yourself (on your m1 machine), then activate it from local.

I just followed the build script in derry.yaml:

# Once cloned and inside the repo directory

$> (cd native && cargo build --release)

# I haven't tried to change the name of the lib during copy
$> cp native/target/release/libexecutor.dylib lib/src/blobs/executor_mac64.dylib

$> dart pub global activate -s path .
Screenshot 2022-04-17 at 00 51 31 Screenshot 2022-04-17 at 00 55 42

⚠️ You need rust installed for the first command line

Obviously it comes with some drawbacks:

  • You have to update derry manually. But since there are not much updates, I'd say it's bearable 😊
  • You have to keep the source code locally (at the path of activation)

Arinono avatar Apr 16 '22 22:04 Arinono

I am also facing same issue on my Macbook air M1.

aarajput avatar May 15 '22 10:05 aarajput

@Arinono , Now i am getting below error after following your steps.F

Screenshot 2022-05-16 at 11 28 43 AM

aarajput avatar May 16 '22 06:05 aarajput

@aarajput I don't know the reason, and I don't have enough information to guess, but it seems that you either:

  • did not rebuild the lib with rust
  • did not copy the built lib before activating
  • have an environment that made you build the lib with the wrong target architecture

I'm not sure how I can provide more help but to advise you to make sure that you followed the steps and that your environment is properly configured (Terminal, rust/dart config, ...)

Everything I tried lead to it working with me:

Using a terminal through Rosetta

Screenshot 2022-05-16 at 10 52 10

Building the lib targeting the wrong arch

Screenshot 2022-05-16 at 10 53 14

Arinono avatar May 16 '22 08:05 Arinono

@Arinono , i found the issue. My terminal's rosetta was enabled when i installed cargo. So, i uninstalled rustup, then switched off rosetta and reinstalled cargo using rustup and followed your steps and it worked. Thanks.

aarajput avatar May 19 '22 08:05 aarajput

Seconded 👍 👀

om-ha avatar Jun 28 '22 07:06 om-ha

Hey everyone, I'm back. I'm so sorry for disappearing for such a long time.

If you're still using derry, I just finished working on v1.5 that'll add support for M1 Macs. I'll close this issue automatically once it's released. Feel free to reopen it if the it's still not working on M1 machines because I haven't got the chance to test it on a real M1 machine.

frencojobs avatar Feb 04 '23 19:02 frencojobs