Closed vdurante closed 6 months ago
It tries several file names, including libyrs.dylib
as you can see in the logs.
So the problem seems to be the following: (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64'))
. So we need dedicated arm images.
I don't have a mac and github does not provide arm runners yet, therefore I cannot help with that. If you are willing to contribute, you could build the yrs library on your machine and then provide a PR.
@SebastianStehle I will definitely try to do that. Not sure how to since I am not experienced with rust, but I can definitely try to build for macos arm and contribute!
Thanks for the help
You don't have to understand rust.
Just...
RUSTFLAGS="-C target-feature=-crt-static" cargo build --release
Then create a copy of the OSX project and reference your built project: https://github.com/y-crdt/ydotnet/blob/main/native/YDotNet.Native.MacOS/YDotNet.Native.MacOS.csproj
The problem is that you would have 2 libraries with the same name if you want to build a project for x86 and arm. So we need a custom library resolver: (which needs to be documented):
https://learn.microsoft.com/en-us/dotnet/standard/native-interop/native-library-loading
@SebastianStehle thanks for the help. I ended up using a Linux machine for this.
If you have a mac, your contribution would be awesome. As mentioned above, you don't have to understand rust. Just build the binary. Then add a new native package by and reference your binary: https://github.com/y-crdt/ydotnet/blob/main/native/YDotNet.Native.MacOS/YDotNet.Native.MacOS.csproj#L10
if you put your binary to the correct folder, dotnet should pick it up. The folder name contains the runtime identifier (rid) - here osx
- so we have to use the correct rid: https://learn.microsoft.com/en-us/dotnet/core/rid-catalog#macos-rids
@SebastianStehle I will open a PR with the binaries after I build it. I just don't know how we will differentiate from ARM to Intel, since both are apparently using the macos/native
path.
Give me some time to build that.
I guess you mean osx/native
?
This is what the rids are for. We can change the current osx/native
path to osx-x64/native
and then create a new project where we use osx-arm/native
.
Even if we don't change the existing package, it should work, because dotnet has this RID graph (https://learn.microsoft.com/en-us/dotnet/core/rid-catalog#rid-graph), so it tries the very specific folder first and then moves the graph upwards to the root.
@SebastianStehle Is this what you expect?
Hey, I am trying to run the server on a Mac Apple Silicon, but I am getting the following error:
Checking that folder, I can only see a libyrs.dylib file, but no yrs.dylib file.
Thanks!