Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

netvips.native.osx-arm64 for use in Unity #151

Closed
jsm174 opened this issue Nov 5, 2021 · 8 comments
Closed

netvips.native.osx-arm64 for use in Unity #151

jsm174 opened this issue Nov 5, 2021 · 8 comments
Labels
bug Something isn't working

Comments

@jsm174
Copy link

jsm174 commented Nov 5, 2021

Hello. I started working on getting VisualPinball.Engine to run on M1 macs using Unity 2021.2.1f1.

As you know from helping us in the past, we put the libraries in a Plugins folder keeping everything organized by architecture.

I noticed that 8.11.4 native does not include the osx-arm64 because of .NET 6. I tried to manually include it with a PackageReference, but it complained as well.

I was able to manually copy the file from the nuget into the Plugins folder, and Unity and NetVips runs fine.

Just to confirm, I checked the architecture:

➜  osx-arm64 git:(master) ✗ file libvips.42.dylib
libvips.42.dylib: Mach-O 64-bit dynamically linked shared library arm64

Is there anyway around this .NET 6 requirement for this type of case?

@jsm174
Copy link
Author

jsm174 commented Nov 7, 2021

@kleisauke kleisauke added the triage This issue is being investigated label Nov 7, 2021
@kleisauke
Copy link
Owner

Thanks for reporting this! I think that I erroneously assumed that Apple Silicon support would only be available in .NET 6.

Note to myself: I could probably move this:

<!-- macOS ARM64 (Apple Silicon) will be supported with .NET 6.0 -->
<dependency id="NetVips.Native.osx-arm64" version="$version$" include="native" />

To the targetFramework="netstandard2.1" group below and remove the entire targetFramework="net6.0" group. Although, I'm not sure if I should also add a custom target file (NetVips.Native.osx-arm64.targets), similar to the x64 build:

<!-- Mono still needs to copy the native dependencies to the output directory -->

(perhaps that isn't needed on the newer versions of Mono(?))

@jsm174
Copy link
Author

jsm174 commented Nov 8, 2021

Thanks for looking into this. We appreciate it!

I'm not sure how custom targets work. In Visual Studio 2019 .Mac, I'm not sure how you would actually set up osx-arm64 for running / debugging. I know dotnet is using Rosetta.

Screen Shot 2021-11-08 at 7 10 59 AM

In Unity, it's definitely not using Rosetta, and is using the arm64 binaries.

I have a branch started here:

https://github.com/freezy/VisualPinball.Engine/tree/update-deps-osx-arm64

@kleisauke
Copy link
Owner

Those .targets files are only included within the netstandard2.0 or net452 target framework groups, so I guess I can leave that out within the netstandard2.1 group.

Commit b2ddba1 on the issue-151 branch moves the macOS ARM64 NuGet package to the netstandard2.1 group, I think that should work for Mono/Unity. If you want to test this, you can use the nightly version of NetVips.Native. Add the https://ci.appveyor.com/nuget/net-vips feed in the <packageSources> section of your NuGet.config:

<packageSources>
  <add key="netvips-nightly" value="https://ci.appveyor.com/nuget/net-vips" />
</packageSources>

And use NetVips.Native v8.11.4.1 from there. This will be in NetVips.Native v8.12.0, due in a couple of days.

@jsm174
Copy link
Author

jsm174 commented Nov 15, 2021

@kleisauke - Thank you again! Just tried this all out. Upgraded our projects to .netstandard2.1 as well, and it's working great. Since 8.12.0 is close, I'm assuming there won't be a 8.11.4.1 official?

@kleisauke kleisauke added bug Something isn't working and removed triage This issue is being investigated labels Nov 17, 2021
@kleisauke
Copy link
Owner

A release candidate of NetVips.Native v8.12.0 is now available for testing.
https://www.nuget.org/packages/NetVips.Native/8.12.0-rc1

I don't think there would be an official 8.11.4.1 release.

@jsm174
Copy link
Author

jsm174 commented Nov 17, 2021

Great. Thanks. Just updated!

@kleisauke
Copy link
Owner

NetVips.Native v8.12.1 is now available.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants