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

[release/6.0.4xx] Update dependencies from dotnet/msbuild #25897

Conversation

dotnet-maestro[bot]
Copy link
Contributor

@dotnet-maestro dotnet-maestro bot commented Jun 7, 2022

This pull request updates the following dependencies

From https://github.com/dotnet/msbuild

  • Subscription: 0d1c02d6-f28b-4061-e94d-08da181a39e5
  • Build: 20220622.4
  • Date Produced: June 22, 2022 5:49:14 PM UTC
  • Commit: e504ba9f4f1ac7a8d86a4962ef4f6923f8d7815f
  • Branch: refs/heads/main

…0607.1

Microsoft.Build , Microsoft.Build.Localization
 From Version 17.3.0-preview-22306-01 -> To Version 17.3.0-preview-22307-01
@benvillalobos
Copy link
Member

     C:\h\w\A2DB0920\t\dotnetSdkTests\xfahbgia.5hi\It_generates_---0215FF28\CreateTestProject\obj\Debug\net6.0\staticwebassets.build.json : error : MissingMethodException: Method not found: '!!0 System.Text.Json.JsonSerializer.Deserialize(System.ReadOnlySpan`1<Byte>, System.Text.Json.JsonSerializerOptions)'. [C:\h\w\A2DB0920\t\dotnetSdkTests\xfahbgia.5hi\It_generates_---0215FF28\CreateTestProject\CreateTestProject.csproj]

doesn't look related to msbuild. Kicking CI

@v-wuzhai
Copy link
Member

v-wuzhai commented Jun 9, 2022

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

…0609.1

Microsoft.Build , Microsoft.Build.Localization
 From Version 17.3.0-preview-22306-01 -> To Version 17.3.0-preview-22309-01
@benvillalobos
Copy link
Member

      "C:\h\w\A4F308F2\t\dotnetSdkTests\ozqtoaub.5nu\It_generates_---4CAA7EE3\CreateTestProject\CreateTestProject.csproj" (Build target) (1:7) ->
      (LoadStaticWebAssetsBuildManifest target) -> 
        C:\h\w\A4F308F2\t\dotnetSdkTests\ozqtoaub.5nu\It_generates_---4CAA7EE3\CreateTestProject\obj\Debug\net6.0\staticwebassets.build.json : error : MissingMethodException: Method not found: '!!0 System.Text.Json.JsonSerializer.Deserialize(System.ReadOnlySpan`1<Byte>, System.Text.Json.JsonSerializerOptions)'. [C:\h\w\A4F308F2\t\dotnetSdkTests\ozqtoaub.5nu\It_generates_---4CAA7EE3\CreateTestProject\CreateTestProject.csproj]
      C:\h\w\A4F308F2\t\dotnetSdkTests\ozqtoaub.5nu\It_generates_---4CAA7EE3\CreateTestProject\obj\Debug\net6.0\staticwebassets.build.json : error :    at Microsoft.AspNetCore.Razor.Tasks.StaticWebAssetsManifest.FromJsonBytes(Byte[] jsonBytes) [C:\h\w\A4F308F2\t\dotnetSdkTests\ozqtoaub.5nu\It_generates_---4CAA7EE3\CreateTestProject\CreateTestProject.csproj]
      C:\h\w\A4F308F2\t\dotnetSdkTests\ozqtoaub.5nu\It_generates_---4CAA7EE3\CreateTestProject\obj\Debug\net6.0\staticwebassets.build.json : error :    at Microsoft.AspNetCore.Razor.Tasks.ReadStaticWebAssetsManifestFile.Execute() in /_/src/RazorSdk/Tasks/StaticWebAssets/ReadStaticWebAssetsManifestFile.cs:line 36 [C:\h\w\A4F308F2\t\dotnetSdkTests\ozqtoaub.5nu\It_generates_---4CAA7EE3\CreateTestProject\CreateTestProject.csproj]
      C:\h\w\A4F308F2\t\dotnetSdkTests\ozqtoaub.5nu\It_generates_---4CAA7EE3\CreateTestProject\obj\Debug\net6.0\staticwebassets.build.json : error :  [C:\h\w\A4F308F2\t\dotnetSdkTests\ozqtoaub.5nu\It_generates_---4CAA7EE3\CreateTestProject\CreateTestProject.csproj]

It's failed 3 times in a row with these issues. Is this a known flaky test, or does this need more investigation? Missing method System.Text.Json.JsonSerializer.Deserialize doesn't look like something MSBuild would cause

@benvillalobos
Copy link
Member

benvillalobos commented Jun 10, 2022

cc @mkArtakMSFT Marc suggested pinging you, any idea what's going on here?

@joeloff
Copy link
Member

joeloff commented Jun 15, 2022

@mkArtakMSFT anyone from ASP.NET that can help look at the Razor failures?

…0615.1

Microsoft.Build , Microsoft.Build.Localization
 From Version 17.3.0-preview-22306-01 -> To Version 17.3.0-preview-22315-01
…0615.2

Microsoft.Build , Microsoft.Build.Localization
 From Version 17.3.0-preview-22306-01 -> To Version 17.3.0-preview-22315-02
…0615.3

Microsoft.Build , Microsoft.Build.Localization
 From Version 17.3.0-preview-22306-01 -> To Version 17.3.0-preview-22315-03
…0615.4

Microsoft.Build , Microsoft.Build.Localization
 From Version 17.3.0-preview-22306-01 -> To Version 17.3.0-preview-22315-04
@joeloff
Copy link
Member

joeloff commented Jun 16, 2022

@Pilchie anyone from ASP.NET that can look at the Razor failures?

@Pilchie
Copy link
Member

Pilchie commented Jun 16, 2022

@Pilchie
Copy link
Member

Pilchie commented Jun 16, 2022

Also @DamianEdwards since he's changed some template stuff.

@DamianEdwards
Copy link
Member

The failure I see doesn't appear to be a template issue?

C:\h\w\9F73085D\t\dotnetSdkTests\aahti5dy.r1x\UpToDateReloa---143E05B3\obj\Debug\net6.0\staticwebassets.build.json : error : MissingMethodException: Method not found: '!!0 System.Text.Json.JsonSerializer.Deserialize(System.ReadOnlySpan`1<Byte>, System.Text.Json.JsonSerializerOptions)'. 

@joeloff
Copy link
Member

joeloff commented Jun 16, 2022

The failure I see doesn't appear to be a template issue?

C:\h\w\9F73085D\t\dotnetSdkTests\aahti5dy.r1x\UpToDateReloa---143E05B3\obj\Debug\net6.0\staticwebassets.build.json : error : MissingMethodException: Method not found: '!!0 System.Text.Json.JsonSerializer.Deserialize(System.ReadOnlySpan`1<Byte>, System.Text.Json.JsonSerializerOptions)'. 

That method definitely exists.

@DamianEdwards
Copy link
Member

Just realized this is 6.0.4xx. I haven't made any template changes there.

@TanayParikh
Copy link
Contributor

TanayParikh commented Jun 17, 2022

Call is here:

var manifest = JsonSerializer.Deserialize<StaticWebAssetsManifest>(jsonBytes);

and as @joeloff mentioned above, the method should be present:

https://docs.microsoft.com/en-us/dotnet/api/system.text.json.jsonserializer.deserialize?view=net-6.0#system-text-json-jsonserializer-deserialize-1(system-readonlyspan((system-byte))-system-text-json-jsonserializeroptions)

The error is being thrown on the specific test projects (ex. MvcWithComponents.csproj).

MissingMethodException

Normally a compilation error is generated if code attempts to access a nonexistent method of a class. MissingMethodException is designed to handle cases where an attempt is made to dynamically access a renamed or deleted method of an assembly that is not referenced by its strong name. MissingMethodException is thrown when code in a dependent assembly attempts to access a missing method in an assembly that was modified.

Is this just a matter of explicitly referencing STJ from the test projects? Why is this issue coming up just now though?


Thing I'm not sure about is why are we enforcing a net472 framework for the STJ reference:

<PackageReference Include="System.Text.Json" Version="$(SystemTextJsonVersion)" Condition="'$(TargetFramework)'=='net472'" />

Granted this isn't something that has changed recently, so likely not the root cause here.

Stack Trace
      "C:\h\w\9F73085D\t\dotnetSdkTests\vtkm0xmp.ysu\StaticWebAsse---80EE375B\blazorwasm-minimal.csproj" (Publish target) (1:7) ->
      (LoadStaticWebAssetsBuildManifest target) -> 
        C:\h\w\9F73085D\t\dotnetSdkTests\vtkm0xmp.ysu\StaticWebAsse---80EE375B\obj\Debug\net6.0\staticwebassets.build.json : error : MissingMethodException: Method not found: '!!0 System.Text.Json.JsonSerializer.Deserialize(System.ReadOnlySpan`1<Byte>, System.Text.Json.JsonSerializerOptions)'. [C:\h\w\9F73085D\t\dotnetSdkTests\vtkm0xmp.ysu\StaticWebAsse---80EE375B\blazorwasm-minimal.csproj]
      C:\h\w\9F73085D\t\dotnetSdkTests\vtkm0xmp.ysu\StaticWebAsse---80EE375B\obj\Debug\net6.0\staticwebassets.build.json : error :    at Microsoft.AspNetCore.Razor.Tasks.StaticWebAssetsManifest.FromJsonBytes(Byte[] jsonBytes) [C:\h\w\9F73085D\t\dotnetSdkTests\vtkm0xmp.ysu\StaticWebAsse---80EE375B\blazorwasm-minimal.csproj]
      C:\h\w\9F73085D\t\dotnetSdkTests\vtkm0xmp.ysu\StaticWebAsse---80EE375B\obj\Debug\net6.0\staticwebassets.build.json : error :    at Microsoft.AspNetCore.Razor.Tasks.ReadStaticWebAssetsManifestFile.Execute() in /_/src/RazorSdk/Tasks/StaticWebAssets/ReadStaticWebAssetsManifestFile.cs:line 49 [C:\h\w\9F73085D\t\dotnetSdkTests\vtkm0xmp.ysu\StaticWebAsse---80EE375B\blazorwasm-minimal.csproj]
      C:\h\w\9F73085D\t\dotnetSdkTests\vtkm0xmp.ysu\StaticWebAsse---80EE375B\obj\Debug\net6.0\staticwebassets.build.json : error :  [C:\h\w\9F73085D\t\dotnetSdkTests\vtkm0xmp.ysu\StaticWebAsse---80EE375B\blazorwasm-minimal.csproj]
      
          0 Warning(s)
          1 Error(s)
      
      Time Elapsed 00:00:09.38
      StdErr:
      
      
      Stack Trace:
           at FluentAssertions.Execution.XUnit2TestFramework.Throw(String message)
           at FluentAssertions.Execution.TestFrameworkProvider.Throw(String message)
           at FluentAssertions.Execution.DefaultAssertionStrategy.HandleFailure(String message)
           at FluentAssertions.Execution.AssertionScope.FailWith(String message, Object[] args)
        /_/src/Tests/Microsoft.NET.TestFramework/Assertions/CommandResultAssertions.cs(33,0): at Microsoft.NET.TestFramework.Assertions.CommandResultAssertions.Pass()
        /_/src/Tests/Microsoft.NET.Sdk.BlazorWebAssembly.Tests/BlazorWasmStaticWebAssetsIntegrationTest.cs(76,0): at Microsoft.NET.Sdk.BlazorWebAssembly.Tests.BlazorWasmStaticWebAssetsIntegrationTest.StaticWebAssets_PublishMinimal_Works()

@javiercn
Copy link
Member

@rainersigwald can this be the same issue that we saw a while ago with STJ on full MSBuild?

@rainersigwald
Copy link
Member

@rainersigwald can this be the same issue that we saw a while ago with STJ on full MSBuild?

I don't think I remember that issue, can you point me to it?

@javiercn
Copy link
Member

@rainersigwald let me search for it, but I believe it was caused by a STJ version mismatch or something similar.

I think this is the context
dotnet/msbuild#7078
dotnet/msbuild#7077

I've also re-sent you the email thread at the time so its on top of your list.

I think it might be similar because there is a method missing exception happening.

@rainersigwald
Copy link
Member

Ah, I begin to see what's going on. This line

var manifest = JsonSerializer.Deserialize<StaticWebAssetsManifest>(jsonBytes);

Calls a System.Text.Json method that takes a ReadOnlySpan<byte>. ReadOnlySpan<T> is defined in System.Memory, which was updated in MSBuild by @benvillalobos in dotnet/msbuild#7680.

The test machines are running VS 17.2, which has an older System.Memory (4.0.1.1). So I think the missing method is the one with a ROS(4.0.1.2), which isn't available because STJ references 4.0.1.1 and so doesn't get binding redirected upward, so it thinks that is a distinct type.

A fix similar to 66826cc is probably in order here (and is just as awful as ever).

@TanayParikh
Copy link
Contributor

TanayParikh commented Jun 17, 2022

Thanks @rainersigwald, that's a great find with System.Memory.

A fix similar to 66826cc is probably in order here (and is just as awful as ever).

So do we need to manually specify something like:

    <PackageDownload Include="System.Memory" Version="[4.0.1.2)" GeneratePathProperty="true" />

Is this an issue specifically for .NET Framework (asking because of the Condition="'$(TargetFrameworkIdentifier)' == '.NETFramework'" in the commit you linked.

@rainersigwald
Copy link
Member

@TanayParikh I'll put up a PR in an hour or so. And yes, this is specific to .NET Framework and on older VS versions (prior to the 17.3 version that has binding redirects to the latest System.Memory).

@rainersigwald
Copy link
Member

#26080 should fix the problem; I am confirming with #26079.

…0620.3

Microsoft.Build , Microsoft.Build.Localization
 From Version 17.3.0-preview-22306-01 -> To Version 17.3.0-preview-22320-03
@v-wuzhai
Copy link
Member

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@rainersigwald
Copy link
Member

Blocked now waiting on dotnet/msbuild#7727. ETA a couple of hours.

…0622.4

Microsoft.Build , Microsoft.Build.Localization
 From Version 17.3.0-preview-22306-01 -> To Version 17.3.0-preview-22322-04
@dotnet-maestro dotnet-maestro bot merged commit 7d1d689 into release/6.0.4xx Jun 22, 2022
@dotnet-maestro dotnet-maestro bot deleted the darc-release/6.0.4xx-4298834d-3b60-4f2f-8a7d-ba6064f62d5f branch June 22, 2022 19:20
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.

9 participants