Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This lists all packages that may possibly exists.
linux-arm
is not the only package that is not officially shipping.freebsd
later in this list is not officially shipping either.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the key here is that nobody will have
freebsd
in theirRuntimeIdentifiers
because nothing will restore with that in the RuntimeIdentifiers list (even if we take native AOT out of the picture completely, like I did in the below):Running
dotnet publish
on this:Now if we put native AOT back in the picture and try with a RID that is properly annotated as non-existent:
Try that:
Note this succeeded even though win-x86 doesn't work in .NET 8.
And now try with the bad one that is getting addressed here;
This results in:
I think this fix is good and complete given NuGet's odd behaviors (I don't get why it needs to restore RIDs we're not building, but this behavior is not native AOT specific).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you both.
I will investigate this further.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't the whole purpose of
RuntimeIdentifiers
to tell NuGet the list of RIDs that you plan to build for, so that you can run a single restore and then build for multiple RIDs without redoing the restore?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FWIW the presence of
runtime.json
makes NuGet Restore try to merge runtimes defined forMicrosoft.DotNet.ILCompiler
which I think causes the restore to fail (notice the:Merging in runtimes defined in package/Microsoft.DotNet.ILCompiler 8.0.2.
).For project:
Built with:
dotnet publish
while when I remove the entry for
linux-arm
(or completely removeruntime.json
) the restore succeeds.This happens somewhere around: https://github.com/NuGet/NuGet.Client/blob/78c8c0fddd17dbf23e110c44ea1455f49e50363f/src/NuGet.Core/NuGet.Commands/RestoreCommand/ProjectRestoreCommand.cs#L458 and I am not super familiar with the code, but I suppose the build should probably bail out earlier than this.