libgit2dart icon indicating copy to clipboard operation
libgit2dart copied to clipboard

Add support for arm64 for macos

Open nickmeinhold opened this issue 3 years ago • 1 comments

Thanks for making this plugin!

I'm on an ARM mac and had build errors about needing an arm64 binary when I tried to use the plugin.

I checked and running file macos/libgit2-1.5.0.dylib gives:

macos/libgit2-1.5.0.dylib: Mach-O 64-bit dynamically linked shared library x86_64

I built a universal binary with libgit2 and replaced the libgit2dart/macos/libgit2-1.5.0.dylib but then the build wasn’t finding the dylib until I put a (slightly differently named) dylib in a folder the app was checking in but then was still getting a different error that said:

“Failed to open the library. Make sure that libgit2 library is bundled with the application.”

I did get a dylib that I built to work by putting it straight in an empty project (ie. no plugin) so I guess I must have messed up the libgit2dart project config somehow. I've given up for now but happy to have another go if it's helpful.

Thanks!

nickmeinhold avatar Nov 29 '22 14:11 nickmeinhold

Hey! Support for arm64 macos would definitely be great to have.

I have a private repo setup for building libgit2 libraries, however github runners currently don't have support for apple m1/m2. I was thinking about making fat binary of libgit2 for macos, but it turned out to be quite challenging (at least as far as i remember it :). Github macos runner is x86_64, which leads to brew installation of libgit2 required packages (openssl and libssh2) to be x86_64, and frankly speaking i wasn't too happy about compiling those packages as fat binaries myself before compiling libgit2, so i just decided to wait until github will add m1/m2 runners.

As for the problem with the build you had, i'm not sure why that happened. Simply replacing library in libgit2dart/macos/ should be enough.

SkinnyMind avatar Dec 01 '22 11:12 SkinnyMind