docs icon indicating copy to clipboard operation
docs copied to clipboard

Clarification on runtime identifiers for OSX Universal binaries

Open lostromb opened this issue 2 years ago • 4 comments

Issue description

This is regarding the documentation page for Runtime Identifiers.

I am building a Nuget package that distributes native libraries for multiple platforms, one of them being MacOS. The libraries are compiled as a universal binary, meaning they support x64 and arm64 simultaneously. How do I best represent this platform using runtime identifiers in Nuget and with dotnet pack? My best guess is to package as /runtimes/osx/native/mylib.dylib, using "osx" without an architecture specifier, since by definition the universal binary should run on all architectures.

If this is true, I would appreciate a specific comment to clarify this in the documentation. Perhaps under "macOS RIDs" could be:

  • osx-x64 (Minimum OS version is macOS 10.12 Sierra)
  • osx-arm64
  • osx (For universal binaries supporting both x64 and arm64)

I have seen one package in the wild (Vosk) which includes a native binary under an "osx-universal" folder, but this seems to be proprietary and not linked to an actual runtime identifier, since osx-universal is not in the RID catalog.

Target framework

  • [x] .NET Core 8.0

lostromb avatar Sep 22 '23 16:09 lostromb

@terrajobst Can you help with this question?

gewarren avatar Apr 02 '24 22:04 gewarren

I suppose this documentation page is kind of the wrong area as well, since I'm looking for guidance specifically on Nuget packaging. However, the most relevant Nuget doc on which paths to use for packaging all refer to runtime identifiers, which in turn leads to the page in question.

lostromb avatar May 04 '24 04:05 lostromb

@richlander is your guy

terrajobst avatar Jun 26 '24 19:06 terrajobst

I think your reasoning is sound.

richlander avatar Jun 26 '24 19:06 richlander