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

Fix regression in selecting default RuntimeIdentifier #3543

Merged
merged 3 commits into from
Aug 19, 2019

Conversation

dsplaisted
Copy link
Member

@dsplaisted dsplaisted commented Aug 16, 2019

Description

Fixed change in behavior (regression) that was introduced when we started including the RuntimeIdentifier graph in the SDK and passing it to NuGet.

Customer Impact

The change in behavior had to do with the automatic selection of the PlatformTarget. In specific cases, the PlatformTarget would be set to x86, where it would have previously been set to AnyCPU. This is because previously you had to have a (transitive) dependency on the Microsoft.NETCore.Platforms package to get the RuntimeIdentifier graph, and without it, you wouldn't get assets that didn't exactly match the default RuntimeIdentifier (win7-x86). Since no native assets were found, the PlatformTarget defaulted to AnyCPU, even though if the RuntimeGraph had been available there would have been native assets.

Roslyn ran into this, their apps switched to x86 unintentionally. We are not sure how many other customers would be impacted, as the combination of factors necessary to see the behavior change is somewhat of an edge case.

Regression?

Yes, regressed with #3406

Risk

Low

Fixes #3495

I thought of a "clever" way to fix this regression. We revert to the AnyCPU PlatformTarget if:

  • There are no native assets
  • There are native assets, but the Microsoft.NETCore.Platforms package (which was previously necessary to get the RID graph) is not transitively referenced, and there are no native assets for the exact RID win7-x86.

This should match the PlatformTarget which SDKs prior to the 3.0 SDK would have used.

@dsplaisted dsplaisted requested review from nguerrera and a team August 16, 2019 22:26
@@ -305,6 +308,7 @@ private void ReadItemGroups()
FrameworkAssemblies = reader.ReadItemGroup();
FrameworkReferences = reader.ReadItemGroup();
NativeLibraries = reader.ReadItemGroup();
PackageDependencies = reader.ReadItemGroup();
Copy link
Contributor

Choose a reason for hiding this comment

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

Bump format version

Copy link
Member Author

Choose a reason for hiding this comment

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

@nguerrera I've bumped it, can you re-approve?

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.

Cache format version needs to be bumped

@dsplaisted dsplaisted merged commit 9fab69d into dotnet:release/3.0.1xx Aug 19, 2019
dsplaisted pushed a commit to dsplaisted/sdk that referenced this pull request Feb 19, 2020
….1 (dotnet#3543)

- Microsoft.DotNet.Cli.Runtime - 3.1.100-preview3.19562.1
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.

2 participants