Skip to content

Resolution of NetVips.Native.linux-musl-arm64 fails #233

@zotanmew

Description

@zotanmew

This is plausibly a bug in the .NET SDK, but I wanted to open an issue here as well:

Referencing NetVips.Native when building a linux-musl-arm64 package results in the linux-arm64 .so file ending up in the output directory. I've tested various ways of fixing this problem (since I initially assumed it had to do with the differing netstandard1.0/2.0/2.1 targetframeworks), and the only solution that I've found that worked both for musl-arm64 as well as other RIDs was to modify NetVips.Native.nuspec in a way that has it contain all the native binaries directly, instead of depending on them.

The one issue with this method is that explicitly depending on a specific architecture package is no longer possible, which is why I didn't open a PR with these changes, but maybe there's a different way of solving this I'm not seeing.

Example:

<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2013/01/nuspec.xsd">
  <metadata>
    <id>NetVips.Native</id>
    <title>NetVips - Native binaries</title>
    <version>$version$</version>
    <description>This package complements the NetVips package and contains native binaries of libvips</description>
    <summary>Native binaries of libvips</summary>
    <projectUrl>https://kleisauke.github.io/net-vips</projectUrl>
    <repository type="git" url="https://github.com/kleisauke/net-vips" />
    <tags>libvips binaries image-processing</tags>
    <license type="expression">MIT</license>
    <authors>Kleis Auke Wolthuizen</authors>
    <owners>Kleis Auke Wolthuizen</owners>
    <requireLicenseAcceptance>false</requireLicenseAcceptance>
    <copyright>Kleis Auke Wolthuizen</copyright>
  </metadata>
  <files>
    <file src="pack\linux-x64\*.so*" target="runtimes/linux-x64/native" />
    <file src="pack\linux-arm\*.so*" target="runtimes/linux-arm/native" />
    <file src="pack\linux-arm64\*.so*" target="runtimes/linux-arm64/native" />
    <file src="pack\linux-musl-x64\*.so*" target="runtimes/linux-musl-x64/native" />
    <file src="pack\linux-musl-arm64\*.so*" target="runtimes/linux-musl-arm64/native" />
    <file src="pack\osx-x64\*.dylib" target="runtimes/osx-x64/native" />
    <file src="pack\osx-arm64\*.dylib" target="runtimes/osx-arm64/native" />
    <file src="pack\win-x86\*.dll" target="runtimes/win-x86/native" />
    <file src="pack\win-x64\*.dll" target="runtimes/win-x64/native" />
    <file src="pack\win-arm64\*.dll" target="runtimes/win-arm64/native" />

    <file src="pack\linux-x64\THIRD-PARTY-NOTICES.md" />
    <file src="pack\linux-x64\versions.json" />

    <!-- A dummy reference which prevents NuGet from adding any compilation references when this package is imported -->
    <file src="_._" target="lib/netstandard2.1" />
  </files>
</package>

Metadata

Metadata

Assignees

No one assigned

    Labels

    blocked-upstream-dependencyUpstream dependency needs to be updatedbugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions