Consider the libuv 1.9.0 nuget package.
It provides platform specific native asset libuv library.
The package structure is :
runtimes
|- debian-x64/native/libuv.so
|- rhel-x64/native/libuv.so
|- win-x64/native/libuv.dll
dotnet publish will generate the above directory structure within the bin/.net5/publish directory.
However, dotnet publish -r debian-x64 --self-contained=false will generate bin/.net5/debian-x64/publish that only contains libuv.so from runtime/debian-x64/native.
However, dotnet publish -r linux-x64 --self-contained=false will generate bin/.net5/linux-x64/publish without libuv.so. While the publish succeeds here, the app will fail at runtime because of the missing library.
The missing RID-asset (for linux-x64) may actually mean that the library (libuv.so) is unnecessary for that platform -- although it is weird that the lib is not necessary at a higher RID but necessary in a lower RID. This is somewhat similar to missing an assembly that is only loaded at runtime for reflection -- where the SDK cannot know the exact requirements.
Should we consider guards in the SDK to check for this case? (ex: missing assets at a parent RID)?
Consider the libuv 1.9.0 nuget package.
It provides platform specific native asset libuv library.
The package structure is :
dotnet publishwill generate the above directory structure within thebin/.net5/publishdirectory.However,
dotnet publish -r debian-x64 --self-contained=falsewill generatebin/.net5/debian-x64/publishthat only containslibuv.sofromruntime/debian-x64/native.However,
dotnet publish -r linux-x64 --self-contained=falsewill generatebin/.net5/linux-x64/publishwithoutlibuv.so. While the publish succeeds here, the app will fail at runtime because of the missing library.The missing RID-asset (for
linux-x64) may actually mean that the library (libuv.so) is unnecessary for that platform -- although it is weird that the lib is not necessary at a higher RID but necessary in a lower RID. This is somewhat similar to missing an assembly that is only loaded at runtime for reflection -- where the SDK cannot know the exact requirements.Should we consider guards in the SDK to check for this case? (ex: missing assets at a parent RID)?