Skip to content

Update to newer SDK #14206

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

Merged
merged 14 commits into from
Oct 10, 2019
Merged

Update to newer SDK #14206

merged 14 commits into from
Oct 10, 2019

Conversation

wtgodbe
Copy link
Member

@wtgodbe wtgodbe commented Sep 20, 2019

Replaces #14168 because I was having some troubles with git...

Part of aspnet/AspNetCore-Internal#3016

Update to a newer 5.0 SDK which includes the netcoreapp5.0 TFM.

CC @dougbu @JunTaoLuo

@wtgodbe wtgodbe requested a review from a team September 20, 2019 22:19
@wtgodbe wtgodbe mentioned this pull request Sep 20, 2019
Copy link
Contributor

@dougbu dougbu left a comment

Choose a reason for hiding this comment

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

Needs an additional small fix: Add a _._ file or two to ensure the package's files and .nuspec align. @JunTaoLuo did this recently though I'm not sure where to hunt for that fix. @JunTaoLuo

@JunTaoLuo
Copy link
Contributor

@Pilchie Pilchie added the area-infrastructure Includes: MSBuild projects/targets, build scripts, CI, Installers and shared framework label Sep 23, 2019
@wtgodbe
Copy link
Member Author

wtgodbe commented Sep 23, 2019

@dougbu @JunTaoLuo how can I tell where the placeholder file(s) would be needed? All builds were successful here, the only failures were in flaky tests (plus the template tests timed out)

@JunTaoLuo
Copy link
Contributor

Hmm come to think of it, the fixes I made in 3.1 should already be merged to master so there shouldn't be a need to make them here

@wtgodbe
Copy link
Member Author

wtgodbe commented Sep 24, 2019

014696\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(232,5): error MSB4018: The "ResolveFrameworkReferences" task failed unexpectedly. [F:\workspace\_work\1\s\src\ProjectTemplates\test\bin\Release\netcoreapp5.0\TestTemplates\AspNet.webapicsharp.gwvd0zs5p2n\AspNet.webapicsharp.gwvd0zs5p2n.csproj]\r\nF:\workspace\_work\1\s\.dotnet\sdk\5.0.100-alpha1-014696\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(232,5): error MSB4018: System.ArgumentException: An item with the same key has already been added. Key: Microsoft.AspNetCore.App

@JunTaoLuo @dougbu I think we've seen this one before in the template tests - do either of you remember what the workaround was? CC also @rynowak @pranavkm @BrennanConroy

@JunTaoLuo
Copy link
Contributor

JunTaoLuo commented Sep 24, 2019

That means the workaround like

<KnownAppHostPack 
      Include="@(KnownAppHostPack->WithMetadataValue('TargetFramework', 'netcoreapp3.0'))"
      TargetFramework="$(DefaultNetCoreTargetFramework)"
      Condition="@(KnownAppHostPack->Count()) != '0' AND !(@(KnownAppHostPack->AnyHaveMetadataValue('TargetFramework', '$(DefaultNetCoreTargetFramework)')))"
      />

was probably applied twice somehow. Essentially there's a duplicate item in KnownAppHostPack or KnownFrameworkReference itemgroup.

@wtgodbe
Copy link
Member Author

wtgodbe commented Sep 25, 2019

From the binlog, looks like we get a duplicate entry for Microsoft.AspNetCore.App in ResolvedTargetingPacks before calling ResolveFrameworkReferences - https://github.com/dotnet/sdk/blob/master/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets#L156-L232. Looking into why now.

Specifically, the ItemGroup gets created (with the duplicate) here: https://github.com/dotnet/sdk/blob/master/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets#L160-L166. The TargetingPack Item already has the duplicate when we pass it to that task.

Looks like the original duplicate comes from KnownFrameworkReference - that Item has two entries for each Reference, but every other set of duplicates has one w/ netcoreapp5.0 metadata, and the other w/ netcoreapp3.0 metadata; whereas Microsoft.AspNetCore.App has both with exact duplicate metadata, with netcoreapp5.0 and version 5.0.0-ci (while the others have versions from versions.props)

@wtgodbe
Copy link
Member Author

wtgodbe commented Sep 25, 2019

Looks like I need to apply the workaround from Workarounds.targets to templateTests.props.in, as well as the updates to KnownFrameworkReference from Dir.Build.targets

@wtgodbe
Copy link
Member Author

wtgodbe commented Sep 25, 2019

F:\workspace_work\1\s.packages\microsoft.dotnet.arcade.sdk\1.0.0-beta.19462.4\tools\Tools.proj : error : Version 5.0.100-alpha1-014696 of the .NET Core SDK requires at least version 16.3.0 of MSBuild. The current available version of MSBuild is 16.2.37902.0. Change the .NET Core SDK specified in global.json to an older version that requires the MSBuild version currently available.

Looks like the same thing is happening here - dotnet/razor#1173 (comment). CC @NTaylorMullen

@wtgodbe
Copy link
Member Author

wtgodbe commented Sep 26, 2019

All build failures are the MSBuild thing. We're down to 25 test template failures:

ReactTemplate_Works_NetCore

Project new react failed to publish.\r\nProcess exited with code 1\nStdErr: \nStdOut: Microsoft (R) Build Engine version 16.3.0-preview-19456-02+ee8294b55 for .NET Core\r\nCopyright (C) Microsoft Corporation. All rights reserved.\r\n\r\nF:\workspace\_work\1\s\.dotnet\sdk\5.0.100-alpha1-014696\MSBuild.dll -maxcpucount -property:Configuration=Release -restore -target:Publish -verbosity:m /bl .\AspNet.reactnoauth.cfpruki0w22.csproj\r\nF:\workspace\_work\1\s\src\ProjectTemplates\test\bin\Release\netcoreapp5.0\TestTemplates\AspNet.reactnoauth.cfpruki0w22\AspNet.reactnoauth.cfpruki0w22.csproj : error NU1102: Unable to find package Microsoft.AspNetCore.SpaServices.Extensions with version (>= 5.0.0-ci)\r\nF:\workspace\_work\1\s\src\ProjectTemplates\test\bin\Release\netcoreapp5.0\TestTemplates\AspNet.reactnoauth.cfpruki0w22\AspNet.reactnoauth.cfpruki0w22.csproj : error NU1102: - Found 2339 version(s) in aspnetcore-dev [ Nearest version: 3.0.0-preview6-19253-01 ]\r\nF:\workspace\_work\1\s\src\ProjectTemplates\test\bin\Release\netcoreapp5.0\TestTemplates\AspNet.reactnoauth.cfpruki0w22\AspNet.reactnoauth.cfpruki0w22.csproj : error NU1102: - Found 138 version(s) in dotnet-core [ Nearest version: 5.0.0-alpha1.19475.17 ]\r\nF:\workspace\_work\1\s\src\ProjectTemplates\test\bin\Release\netcoreapp5.0\TestTemplates\AspNet.reactnoauth.cfpruki0w22\AspNet.reactnoauth.cfpruki0w22.csproj : error NU1102: - Found 24 version(s) in nuget.org [ Nearest version: 3.0.0 ]\r\nF:\workspace\_work\1\s\src\ProjectTemplates\test\bin\Release\netcoreapp5.0\TestTemplates\AspNet.reactnoauth.cfpruki0w22\AspNet.reactnoauth.cfpruki0w22.csproj : error NU1102: - Found 0 version(s) in aspnetcore-tools\r\nF:\workspace\_work\1\s\src\ProjectTemplates\test\bin\Release\netcoreapp5.0\TestTemplates\AspNet.reactnoauth.cfpruki0w22\AspNet.reactnoauth.cfpruki0w22.csproj : error NU1102: - Found 0 version(s) in roslyn-tools\r\nF:\workspace\_work\1\s\src\ProjectTemplates\test\bin\Release\netcoreapp5.0\TestTemplates\AspNet.reactnoauth.cfpruki0w22\AspNet.reactnoauth.cfpruki0w22.csproj : error NU1102: - Found 0 version(s) in roslyn\r\nF:\workspace\_work\1\s\src\ProjectTemplates\test\bin\Release\netcoreapp5.0\TestTemplates\AspNet.reactnoauth.cfpruki0w22\AspNet.reactnoauth.cfpruki0w22.csproj : error NU1102: - Found 0 version(s) in aspnet-aspnetcore-tooling\r\nF:\workspace\_work\1\s\src\ProjectTemplates\test\bin\Release\netcoreapp5.0\TestTemplates\AspNet.reactnoauth.cfpruki0w22\AspNet.reactnoauth.cfpruki0w22.csproj : error NU1102: - Found 0 version(s) in aspnet-blazor\r\nF:\workspace\_work\1\s\src\ProjectTemplates\test\bin\Release\netcoreapp5.0\TestTemplates\AspNet.reactnoauth.cfpruki0w22\AspNet.reactnoauth.cfpruki0w22.csproj : error NU1102: - Found 0 version(s) in aspnet-entityframeworkcore\r\nF:\workspace\_work\1\s\src\ProjectTemplates\test\bin\Release\netcoreapp5.0\TestTemplates\AspNet.reactnoauth.cfpruki0w22\AspNet.reactnoauth.cfpruki0w22.csproj : error NU1102: - Found 0 version(s) in aspnet-extensions\r\nF:\workspace\_work\1\s\src\ProjectTemplates\test\bin\Release\netcoreapp5.0\TestTemplates\AspNet.reactnoauth.cfpruki0w22\AspNet.reactnoauth.cfpruki0w22.csproj : error NU1102: - Found 0 version(s) in grpc-nuget-dev\r\n Restore failed in 508.13 ms for F:\workspace\_work\1\s\src\ProjectTemplates\test\bin\Release\netcoreapp5.0\TestTemplates\AspNet.reactnoauth.cfpruki0w22\AspNet.reactnoauth.cfpruki0w22.csproj.\r\n\r\nExpected: True\r\nActual: False

@wtgodbe
Copy link
Member Author

wtgodbe commented Sep 26, 2019

Looks like the failing template tests aren't restoring from the local build like they should be. Will dig further after tactics

@wtgodbe
Copy link
Member Author

wtgodbe commented Sep 26, 2019

All failures are the MSBuild 16.3 thing. Seems to be happening much more consistently now - I'm optimistic that this means machines are offline getting an update rolled out 🤞

@wtgodbe
Copy link
Member Author

wtgodbe commented Oct 8, 2019

This should be good to go now, @JunTaoLuo @dougbu any concerns before I merge?

@@ -16,22 +16,12 @@

<KnownFrameworkReference
Update="Microsoft.AspNetCore.App"
TargetFramework="${DefaultNetCoreTargetFramework}"
DefaultRuntimeFrameworkVersion="${MicrosoftAspNetCoreAppRuntimePackageVersion}"
LatestRuntimeFrameworkVersion="${MicrosoftAspNetCoreAppRuntimePackageVersion}"
TargetingPackVersion="${MicrosoftAspNetCoreAppRefPackageVersion}"
RuntimePackRuntimeIdentifiers="${SupportedRuntimeIdentifiers}" />
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this look more like the @(KnownFrameworkReference) changes done in eng/Workarounds.targets and related files? Main issue is this updates the Microsoft.AspNetCore.App reference for all TFMs to use the latest ref and runtime packages. While this might be fine now, it could cause problems when "new" TFM isn't recognized in the SDK yet or if we have any tests using downlevel TFMs.

Copy link
Member Author

Choose a reason for hiding this comment

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

Ideally yes, but that hits the issue from #14670 (comment), where msbuild complains about conditions on item metadata here. Will open an issue on this after I merge, since it will take some investigation to figure out why that's happening only here.

@dougbu
Copy link
Contributor

dougbu commented Oct 8, 2019

No concerns other than my question. At least file an issue to revisit the *.in file used in template tests.

@wtgodbe wtgodbe merged commit 10b0e6f into master Oct 10, 2019
@wtgodbe wtgodbe deleted the UpdateSdk branch October 10, 2019 17:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-infrastructure Includes: MSBuild projects/targets, build scripts, CI, Installers and shared framework
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants