Skip to content
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

Use RID less targets to obtain compile assets #836

Merged
merged 3 commits into from
Feb 15, 2017

Conversation

natidea
Copy link
Contributor

@natidea natidea commented Feb 8, 2017

NuGet/Home#4207 reports that NuGet is incorrectly including runtime assemblies in the "compile" assets for RID-specific targets. This is compounded by the fact that this SDK populates References using compile assets from RID-specific targets, but these compile assets should be independent of RID, and come from the RID-less targets.

This change derives ResolvedCompileFileDefinitions and ResolvedFrameworkAssemblies from file dependencies with parent target equal to NuGetTargetMoniker (i.e. excluding the RID if one exists)

A fix for the NuGet issue is available (NuGet/NuGet.Client#1103) but is not currently targeting RTW because of risk. My fix may also carry some risk for any scenarios where builds were previously working by accident because we were pulling in runtime assets. But making this available for consideration in case we decide to take it.

Fixes #592

/cc @emgarten @dsplaisted @srivatsn @nguerrera @ericstj

Derive ResolvedCompileFileDefinitions and ResolvedFrameworkAssemblies from file dependencies with parent target equal to NuGetTargetMoniker (i.e. excluding the RID if one exists)
Copy link
Member

@emgarten emgarten left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@natidea
Copy link
Contributor Author

natidea commented Feb 14, 2017

/cc @MattGertz we would like to bar check this at shiproom.

Customer scenario

The SDK pulls in "compile" assets from RID-specific targets, but these compile assets should be independent of RID, and come from the RID-less targets. Normally the "compile" assets should be the same across all targets, but a bug in NuGet (NuGet/Home#4207) results in NuGet incorrectly including runtime assemblies in the "compile" assets for RID-specific targets.

The customer impact is that if Runtime assemblies in a package are inappropriate for inclusion in compiler references, they could get a compile break. So far the only customer to encounter this is CoreFx and they have a workaround (dotnet/core-setup#1029 and dotnet/corefx#15933)

Relatedly #696 reports that Runtime-specific build fails when a project with a RID has a P2P reference to a portable project with no RID. Some of those errors would be fixed by this change because we would not be using the RID-specific target. However, strictly speaking, the complete fix provided in #828 does NOT require this change since it removes the RuntimeIdentifier for projects where it shouldn't apply anyway.

Bugs this fixes:

#592
Removes some of the errors in #696

Workarounds, if any

CoreFx worked around this by modifying their package (dotnet/core-setup#1029 and dotnet/corefx#15933)

Risk

If a customer was relying on this incorrect behavior (i.e. by taking a compile-time dependency on runtime assemblies) then they would be broken.

Performance impact

None

Is this a regression from a previous update?

No

Root cause analysis:

We missed this nuance when porting this feature from the legacy Microsoft.NuGet.targets

How was the bug found?

Reported by partner team

Copy link
Contributor

@nguerrera nguerrera left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Waiting for test

…D because compile is no longer relying on RID-specific section
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

RID-specific targets section from assets file is being used for compile assets.
5 participants