-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Add back NuGetSourceType=Package metadata in package resolution #2133
Conversation
This was used in a few places to distinguish between refs coming from NuGet from others. In particular, it caused all nuget refs to be copied to refs/ folder on Build with PreserverCompilationContext=true.
@@ -251,6 +251,7 @@ private void SetImplicitMetadataForCompileTimeAssemblies() | |||
|
|||
foreach (var item in CompileTimeAssemblies) | |||
{ | |||
item.SetMetadata(MetadataKeys.NuGetSourceType, "Package"); |
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.
If we control all the consumers of this metadata, I'd prefer we just update them to check if there is a package ID set.
However, this change is also fine if you think it's better based on risk, churn, etc.
I've discovered that there are other refs with NuGetPackageId but no NuGetSourceType: I don't know yet if it would be a fix or a bug to start treating them as we do the ones that come from assets file. I suspect a fix. cc @ericstj @eerhardt |
There appears to be other usages of this metadata outside of https://github.com/CommonBuildToolset/CBT.Core/blob/3514c6f2f047a455439dd277437c9596634531b2/src/CBT.Core/ILMerge.targets#L13 |
The thing that NETStandard.Library was mimicking is the NuGet restore task that predates the SDK/NuGet's reimplementation. It also sets only NuGetPackageId and NuGetPackageVersion, but not NuGetSourceType: https://github.com/NuGet/NuGet.BuildTasks/blob/8316e6a9ffcec0c0f8ae6a99f1f39bac5417b4e3/src/Microsoft.NuGet.Build.Tasks/ResolveNuGetPackageAssets.cs#L821-L822 |
@ericstj - |
I see, I stand corrected. Thank you sir.
|
@dotnet-bot Test OSX10.12 Release (machine was out of disk space) |
In the links above there is hint of NuGetSourceType being something other than Package. Project seems to be another value. What does this mean? I cannot find anywhere we ever set anything other than Package. |
@dotnet-bot Test OSX10.12 Release |
This was used in a few places to distinguish between refs coming from NuGet from others.
In particular, it caused all nuget refs to be copied to refs/folder on Build with PreserveCompilationContext=true.
Fix #2121