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

Update to .NET SDK 7.0 Preview 2 #27447

Merged
merged 3 commits into from
Mar 23, 2022
Merged

Update to .NET SDK 7.0 Preview 2 #27447

merged 3 commits into from
Mar 23, 2022

Conversation

bricelam
Copy link
Contributor

@bricelam bricelam commented Feb 15, 2022

Still waiting for the official release, so the version number may change again before I merge, but this one is close.

@bricelam bricelam requested a review from a team February 15, 2022 18:31
@bricelam
Copy link
Contributor Author

bricelam commented Feb 15, 2022

@dotnet/efteam Should we update our tests (and benchmarks) to run on net7.0 or wait?

@bricelam
Copy link
Contributor Author

Looks like there are a few failures in the analyzers tests.

The collection was expected to contain a single element

@bricelam
Copy link
Contributor Author

Hmm, looks like there's some failure around Trimming now...

@roji
Copy link
Member

roji commented Feb 24, 2022

Huh? Tried to fix the trimming by running the resulting executable from the right directory (net7.0 instead of net6.0), now there's a new test failure on AddressAndPayment_RedirectToCompleteWhenSuccessful ⁉️

@bricelam
Copy link
Contributor Author

@maumar, do you want to dig into the MusicStoreInMemoryTest.AddressAndPayment_RedirectToCompleteWhenSuccessful failure?

Assert.Equal() Failure
Expected: 0
Actual:   (null)

@bricelam
Copy link
Contributor Author

bricelam commented Feb 28, 2022

And now there's a new exception being thrown from System.Text.Json.

TypeLoadException : Could not load type 'System.Runtime.CompilerServices.Unsafe' from assembly 'System.Runtime, Version=7.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.
   at System.Text.Json.JsonReaderHelper.IndexOfOrLessThan(Byte& searchSpace, Byte value0, Byte value1, Byte lessThan, Int32 length)
   at System.Text.Json.Utf8JsonReader.ConsumeString()
   at System.Text.Json.Utf8JsonReader.ConsumePropertyName()
   at System.Text.Json.Utf8JsonReader.ReadSingleSegment()

@bricelam
Copy link
Contributor Author

@Pilchie Is the Json exception a known issue?

@Pilchie
Copy link
Member

Pilchie commented Feb 28, 2022

Not known to me. @danmoseley - any ideas?

@Pilchie
Copy link
Member

Pilchie commented Feb 28, 2022

@dotnet/aspnet-build - any of you seen this in .NET 7 builds?

@wtgodbe
Copy link
Member

wtgodbe commented Feb 28, 2022

Looks like you might be building one version of the runtime while running against another - there may be other net6.0 TFMs to update. I see it's referenced in 51 files but this PR only touches 41: https://github.com/dotnet/efcore/search?q=net6.0

@ajcvickers
Copy link
Contributor

@wtgodbe We still want to target .NET 6 with our product assemblies, but we want our tests to use .NET 7. (Ideally, we won't target .NET 7 even when we ship RTM since that forces people off an LTS framework, which many people don't want to do.)

@Pilchie
Copy link
Member

Pilchie commented Mar 1, 2022

Just saw dotnet/aspnetcore#40471 from @jkotas which looks like it might be related?

@jkotas
Copy link
Member

jkotas commented Mar 1, 2022

Just saw dotnet/aspnetcore#40471 from @jkotas which looks like it might be related?

Yes, it is related, but I do not think it is the root cause of the build break. The change that removed S.R.CS.Unsafe package in dotnet/runtime is not included in .NET 7 preview1. If you see build breaks due to do this package removal, you are mixing .NET 7 preview1 bits with some newer bits. It is not unusual to see intra-release breaking changes in previews like this one. Mixing bits from different previews will expose you to the intra-release breaking changes like that.

@bricelam
Copy link
Contributor Author

bricelam commented Mar 1, 2022

Thanks! We typically only hit a few of these breaks each release. We find that saying on released previews of the SDK and runtime helps contributors immensely since they don't have to worry about setting environment variables before launching their IDE.

I'll pin a few packages to their Preview 1 versions for now. If this continues to be a problem, we can consider flowing the runtime again (at the expense of productivity and contributors).

@bricelam
Copy link
Contributor Author

bricelam commented Mar 1, 2022

@maumar Looks like SQL Server and SQLite are now failing with the same error.

@maumar
Copy link
Contributor

maumar commented Mar 8, 2022

@bricelam AddressAndPayment_RedirectToCompleteWhenSuccessful also happens due to

'Could not load type 'System.Runtime.CompilerServices.Unsafe' from assembly 'System.Runtime, Version=7.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.'

@maumar
Copy link
Contributor

maumar commented Mar 11, 2022

@bricelam

Could not load type 'System.Runtime.CompilerServices.Unsafe' from assembly 'System.Runtime, Version=7.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.":"System.Runtime.CompilerServices.Unsafe"

   at Microsoft.Extensions.Primitives.StringValues.get_Count()
   at System.Linq.Enumerable.TryGetFirst[TSource](IEnumerable`1 source, Boolean& found)
   at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable`1 source)
   at Microsoft.EntityFrameworkCore.MusicStoreTestBase`1.CheckoutController.<AddressAndPayment>d__3.MoveNext() in 

@bricelam bricelam changed the title Update to .NET SDK 7.0 Preview 1 Update to .NET SDK 7.0 Preview 2 Mar 15, 2022
@ghost
Copy link

ghost commented Mar 15, 2022

Hello @bricelam!

Because this pull request has the auto-merge label, I will be glad to assist with helping to merge this pull request once all check-in policies pass.

p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (@msftbot) and give me an instruction to get started! Learn more here.

@ghost
Copy link

ghost commented Mar 15, 2022

Apologies, while this PR appears ready to be merged, I've been configured to only merge when all checks have explicitly passed. The following integrations have not reported any progress on their checks and are blocking auto-merge:

  1. Azure Pipelines

These integrations are possibly never going to report a check, and unblocking auto-merge likely requires a human being to update my configuration to exempt these integrations from requiring a passing check.

Give feedback on this
From the bot dev team

We've tried to tune the bot such that it posts a comment like this only when auto-merge is blocked for exceptional, non-intuitive reasons. When the bot's auto-merge capability is properly configured, auto-merge should operate as you would intuitively expect and you should not see any spurious comments.

Please reach out to us at fabricbotservices@microsoft.com to provide feedback if you believe you're seeing this comment appear spuriously. Please note that we usually are unable to update your bot configuration on your team's behalf, but we're happy to help you identify your bot admin.

@bricelam
Copy link
Contributor Author

New failures in EFCore.OData.FunctionalTests after updating to Preview 2.

@smitpatel
Copy link
Contributor

System.Net.Http.HttpRequestException : An error occurred while sending the request.
---- System.IO.IOException : The response ended prematurely.

@bricelam
Copy link
Contributor Author

Yep. That's the one.

@maumar Would it be possible (without a ton of infrastructure) to show the server-side errors on failure?

@maumar
Copy link
Contributor

maumar commented Mar 22, 2022

@bricelam OData tests fail due to:

Could not load type 'System.Runtime.CompilerServices.Unsafe' from assembly 'System.Runtime, Version=7.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.
   at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.Http1Connection.EnsureHostHeaderExists()
   at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.Http1Connection.TryParseRequest(ReadResult result, Boolean& endConnection)
   at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.ProcessRequests[TContext](IHttpApplication`1 application)
   at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.ProcessRequestsAsync[TContext](IHttpApplication`1 application)
Exception thrown: 'System.Net.Http.HttpRequestException' in System.Private.CoreLib.dll

@bricelam bricelam force-pushed the 70p1 branch 2 times, most recently from 789d401 to 2696b36 Compare March 22, 2022 22:42
@bricelam bricelam merged commit e112653 into dotnet:main Mar 23, 2022
@bricelam bricelam deleted the 70p1 branch March 23, 2022 17:43
<MicrosoftExtensionsConfigurationAbstractionsVersion>7.0.0-preview.3.22171.1</MicrosoftExtensionsConfigurationAbstractionsVersion>
<MicrosoftExtensionsConfigurationEnvironmentVariablesVersion>7.0.0-preview.3.22171.1</MicrosoftExtensionsConfigurationEnvironmentVariablesVersion>
<MicrosoftExtensionsConfigurationJsonVersion>7.0.0-preview.3.22171.1</MicrosoftExtensionsConfigurationJsonVersion>
<SystemCollectionsImmutableVersion>7.0.0-preview.2.22152.2</SystemCollectionsImmutableVersion>
Copy link
Contributor

Choose a reason for hiding this comment

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

With this change we have downgraded our dependencies in main branch. Is that required? Do we need to get main to upgrade dependencies again?
cc: @dotnet/aspnet-build

Copy link
Contributor Author

@bricelam bricelam Mar 23, 2022

Choose a reason for hiding this comment

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

Will unpin once we upgrade to Preview 3 of the SDK (see conversation above)

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.

8 participants