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

Native All? #108

Closed
randyridge opened this issue Dec 29, 2020 · 8 comments
Closed

Native All? #108

randyridge opened this issue Dec 29, 2020 · 8 comments
Labels
question Further information is requested

Comments

@randyridge
Copy link
Contributor

Is there a reason that a nuget -all variant isn't published? It's a hassle copying overtop everytime I do a build... :D

@kleisauke kleisauke added the question Further information is requested label Dec 29, 2020
@kleisauke
Copy link
Owner

The prebuilt binaries provided by NetVips for libvips and its dependencies do not include GPL-licensed or patent-encumbered software.

@randyridge
Copy link
Contributor Author

I guess I'm unclear on the delineation since I can get the prebuilt encumbered libraries as well..

@kleisauke
Copy link
Owner

Using GPL-licensed libraries means that your code must comply with the GPL when you use it. After PR libvips/build-win64-mxe#14 (included in v8.10.2) the patent-encumbered dependencies have been moved to a plugin, but they can still be built optionally.

The -all variant released on https://github.com/libvips/libvips/releases includes patent-encumbered HEVC-related logic as it builds libde265 (I just opened libvips/build-win64#44 to fix this).

If you are satisfied with the GPL, and you want to take the patent risk, you are free to use the -all variant.

@randyridge
Copy link
Contributor Author

Say for instance you want to add an avif benchmark in Netvips.Benchmarks, how would you work around?

@kleisauke
Copy link
Owner

AVIF still has patents, but they are royalty-free and the alliance of tech giants behind it will defend it from patent troll's lawsuits.

@randyridge
Copy link
Contributor Author

randyridge commented Dec 29, 2020

Sorry I was being explicit, in my case I have a benchmark .net benchmark that does:

ImagePipeline
  .FromFile("input.jpg")
  .Resize(Width, Height)
  .ToFile("output.avif");

While I can reference Netvips.Native and manually copy dlls to the appropriate native folder, benchmark .net does its own compile and at runtime fails the avif benchmark... To the best of my knowledge I don't think I can hook benchmark .net to copy the native/encumbered libraries as a post build step... If there were available a NetVips.Native.All.Stay.Away nuget I don't think I'd have any issues.. Of course, I could package it on my own, it just seems like an extraneous step.

@randyridge
Copy link
Contributor Author

Honestly I'm getting confused now :( I took the same benchmark and ran on my primary work machine vs my home machine, the work machine supports AVX2 and both used

<PackageReference Include="NetVips" Version="1.2.4.235-develop" />
<PackageReference Include="NetVips.Native" Version="8.10.5.1" /

without avx2 machine 1 fails, with avx2 machine 2 succeeds

@kleisauke
Copy link
Owner

To the best of my knowledge I don't think I can hook benchmark .net to copy the native/encumbered libraries as a post build step

Is this for Windows? If so, you could try to add the bin folder of the libvips Windows build to your PATH environment variable (see the standard DLL search order). On Linux and macOS it is much easier to use a globally-installed libvips.

Alternatively, see #15 (comment) for a detailed instruction to set the libvips binary directory at runtime (i.e. in a separate directory without changing any environment variables).

If there were available a NetVips.Native.All.Stay.Away nuget I don't think I'd have any issues.. Of course, I could package it on my own, it just seems like an extraneous step.

This is not going to happen due to the above reasons. You are free to build, package and distribute it yourself, but if you are using a library that is released under the GPL license, then the entire project needs to be available under a GPL-compatible open-source license.

If your goal is to distribute the -all variant via NuGet, make sure that the package is private/unlisted and does not contain any references to NetVips. You can also host your own NuGet feed, or using a local NuGet package feed, which might be more appropriate. See for details: https://docs.microsoft.com/en-us/nuget/hosting-packages/overview

<PackageReference Include="NetVips" Version="1.2.4.235-develop" />
<PackageReference Include="NetVips.Native" Version="8.10.5.1" /

without avx2 machine 1 fails, with avx2 machine 2 succeeds

Was NetVips.Native installed via the nightly packing (https://ci.appveyor.com/nuget/net-vips)? If so, it was probably using a cached version of the native binaries. I fixed this with commit b7ad9aa.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants