Skip to content

Consider guards for projects missing RID-specific assets #11206

@swaroop-sridhar

Description

@swaroop-sridhar

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)?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions