Page MenuHomeFreeBSD

lang/dotnet: Bundle FreeBSD runtime NuGet packages
Needs ReviewPublic

Authored by zirias on Mar 30 2024, 9:24 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Apr 29, 7:46 PM
Unknown Object (File)
Mon, Apr 29, 9:11 AM
Unknown Object (File)
Fri, Apr 26, 4:34 AM
Unknown Object (File)
Sun, Apr 21, 1:40 PM
Unknown Object (File)
Apr 2 2024, 8:26 PM
Unknown Object (File)
Apr 2 2024, 5:58 PM
Unknown Object (File)
Apr 2 2024, 5:19 PM
Subscribers
None

Details

Reviewers
arrowd
Summary

Building dotnet also creates a collection of NuGet packages that aren't
installed as a part of the dotnet distribution. They are instead
available from Microsoft's NuGet repositories.

Some of these packages are platform-specific and some features (like
e.g. publishing a .NET application with the "ReadyToRun" option) require
some of these, but the FreeBSD-specific packages aren't available on
Microsoft's servers (yet).

As a workaround, add a port option NUPKG that will add a "packages"
directory to the dotnet distribution and populate it with all
platform-specific packages. A post-install script will configure this as
an additional default nuget package source.

Unfortunately, many projects clear the list of package sources in their
own nuget configurations, so you might still need to patch them in order
to build them for FreeBSD as e.g. ReadyToRun.

Diff Detail

Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 56836
Build 53724: arc lint + arc unit

Event Timeline

zirias created this revision.

I'm again not sure about post-install part. I think something should be patches in the runtime code to look in the location suitable for FreeBSD.

The Makefile part is fine, although I wonder if the OPTION is really needed. I guess, we always want to install these?

I'm again not sure about post-install part. I think something should be patches in the runtime code to look in the location suitable for FreeBSD.

It's a similar issue here, although a bit less problematic than with the first review. Anyone looking in Microsoft docs will only find these locations in /etc, it seems Microsoft just isn't aware this can be located in some prefix as well.

But in this case, a simple and probably sane solution would be to just NOT install any nuget config. Most projects come with their own nuget.config anyways and they almost always clear package sources there, so to build these on FreeBSD, you have to patch them anyways. Therefore, maybe just bundle an example nuget.config with a comment telling the user where to install it for using it system-wide?

Might also be an approach for the install_location file, although this is unfortunately baked into any executable built with dotnet ...

A final alternative could be to make these files part of the package (using the @sample mechanism) although they're outside ${PREFIX}. Yes, that's a bit fishy as well...

The Makefile part is fine, although I wonder if the OPTION is really needed. I guess, we always want to install these?

Would work without an option as well. My line of thinking was, you *can* use dotnet without these, although pretty limited (I think any attempt to publish fails, not entirely sure about that, but what certainly fails is a PublishReadyToRun because this requires the crossgen2 package). And on the other hand, putting a directory somewhere inside the dotnet distribution tree is against Microsoft's docs[1] and only needed as a "hack" because they still don't officially support FreeBSD, so the packages are missing from their nuget repos.

[1] https://learn.microsoft.com/en-us/dotnet/core/distribution-packaging