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

Manually update C# compiler version to a more recent preview #67440

Merged
merged 3 commits into from
Apr 7, 2022

Conversation

stephentoub
Copy link
Member

No description provided.

@ghost ghost assigned stephentoub Apr 1, 2022
@dotnet-issue-labeler
Copy link

I couldn't figure out the best area label to add to this PR. If you have write-permissions please help me learn by adding exactly one area label.

@stephentoub
Copy link
Member Author

@jaredpar, not sure who to ask about this:

D:\a\_work\1\s\.packages\microsoft.net.compilers.toolset\4.3.0-1.22201.1\tasks\net6.0\Microsoft.CSharp.Core.targets(75,5): error : Process terminated. System.IndexOutOfRangeException: Index was outside the bounds of the array. [D:\a\_work\1\s\src\tests\BuildWasmApps\Wasm.Build.Tests\Wasm.Build.Tests.csproj]
D:\a\_work\1\s\.packages\microsoft.net.compilers.toolset\4.3.0-1.22201.1\tasks\net6.0\Microsoft.CSharp.Core.targets(75,5): error :    at Microsoft.CodeAnalysis.CSharp.Binder.<GetAttribute>g__makeSourceIndices|189_0(<>c__DisplayClass189_0& ) [D:\a\_work\1\s\src\tests\BuildWasmApps\Wasm.Build.Tests\Wasm.Build.Tests.csproj]
D:\a\_work\1\s\.packages\microsoft.net.compilers.toolset\4.3.0-1.22201.1\tasks\net6.0\Microsoft.CSharp.Core.targets(75,5): error :    at Microsoft.CodeAnalysis.CSharp.Binder.GetAttribute(BoundAttribute boundAttribute, BindingDiagnosticBag diagnostics) [D:\a\_work\1\s\src\tests\BuildWasmApps\Wasm.Build.Tests\Wasm.Build.Tests.csproj]
D:\a\_work\1\s\.packages\microsoft.net.compilers.toolset\4.3.0-1.22201.1\tasks\net6.0\Microsoft.CSharp.Core.targets(75,5): error :    at Microsoft.CodeAnalysis.CSharp.Binder.GetAttribute(AttributeSyntax node, NamedTypeSymbol boundAttributeType, Action`1 beforeAttributePartBound, Action`1 afterAttributePartBound, BindingDiagnosticBag diagnostics) [D:\a\_work\1\s\src\tests\BuildWasmApps\Wasm.Build.Tests\Wasm.Build.Tests.csproj]
D:\a\_work\1\s\.packages\microsoft.net.compilers.toolset\4.3.0-1.22201.1\tasks\net6.0\Microsoft.CSharp.Core.targets(75,5): error :    at Microsoft.CodeAnalysis.CSharp.Binder.GetAttributes(ImmutableArray`1 binders, ImmutableArray`1 attributesToBind, ImmutableArray`1 boundAttributeTypes, CSharpAttributeData[] attributeDataArray, BoundAttribute[] boundAttributeArray, Action`1 beforeAttributePartBound, Action`1 afterAttributePartBound, BindingDiagnosticBag diagnostics) [D:\a\_work\1\s\src\tests\BuildWasmApps\Wasm.Build.Tests\Wasm.Build.Tests.csproj]
D:\a\_work\1\s\.packages\microsoft.net.compilers.toolset\4.3.0-1.22201.1\tasks\net6.0\Microsoft.CSharp.Core.targets(75,5): error :    at Microsoft.CodeAnalysis.CSharp.Symbol.LoadAndValidateAttributes(OneOrMany`1 attributesSyntaxLists, CustomAttributesBag`1& lazyCustomAttributesBag, AttributeLocation symbolPart, Boolean earlyDecodingOnly, Binder binderOpt, Func`2 attributeMatchesOpt, Action`1 beforeAttributePartBound, Action`1 afterAttributePartBound) [D:\a\_work\1\s\src\tests\BuildWasmApps\Wasm.Build.Tests\Wasm.Build.Tests.csproj]
D:\a\_work\1\s\.packages\microsoft.net.compilers.toolset\4.3.0-1.22201.1\tasks\net6.0\Microsoft.CSharp.Core.targets(75,5): error :    at Microsoft.CodeAnalysis.CSharp.Symbols.SourceMethodSymbolWithAttributes.GetAttributesBag(CustomAttributesBag`1& lazyCustomAttributesBag, Boolean forReturnType) [D:\a\_work\1\s\src\tests\BuildWasmApps\Wasm.Build.Tests\Wasm.Build.Tests.csproj]
D:\a\_work\1\s\.packages\microsoft.net.compilers.toolset\4.3.0-1.22201.1\tasks\net6.0\Microsoft.CSharp.Core.targets(75,5): error :    at Microsoft.CodeAnalysis.CSharp.Symbols.SourceMethodSymbolWithAttributes.GetAttributesBag() [D:\a\_work\1\s\src\tests\BuildWasmApps\Wasm.Build.Tests\Wasm.Build.Tests.csproj]
D:\a\_work\1\s\.packages\microsoft.net.compilers.toolset\4.3.0-1.22201.1\tasks\net6.0\Microsoft.CSharp.Core.targets(75,5): error :    at Microsoft.CodeAnalysis.CSharp.Symbols.SourceMethodSymbolWithAttributes.GetAttributes() [D:\a\_work\1\s\src\tests\BuildWasmApps\Wasm.Build.Tests\Wasm.Build.Tests.csproj]
D:\a\_work\1\s\.packages\microsoft.net.compilers.toolset\4.3.0-1.22201.1\tasks\net6.0\Microsoft.CSharp.Core.targets(75,5): error :    at Microsoft.CodeAnalysis.CSharp.Symbols.SourceMemberMethodSymbol.ForceComplete(SourceLocation locationOpt, CancellationToken cancellationToken) [D:\a\_work\1\s\src\tests\BuildWasmApps\Wasm.Build.Tests\Wasm.Build.Tests.csproj]
D:\a\_work\1\s\.packages\microsoft.net.compilers.toolset\4.3.0-1.22201.1\tasks\net6.0\Microsoft.CSharp.Core.targets(75,5): error :    at Microsoft.CodeAnalysis.CSharp.Symbols.SourceOrdinaryMethodSymbol.ForceComplete(SourceLocation locationOpt, CancellationToken cancellationToken) [D:\a\_work\1\s\src\tests\BuildWasmApps\Wasm.Build.Tests\Wasm.Build.Tests.csproj]
D:\a\_work\1\s\.packages\microsoft.net.compilers.toolset\4.3.0-1.22201.1\tasks\net6.0\Microsoft.CSharp.Core.targets(75,5): error :    at Microsoft.CodeAnalysis.CSharp.Symbols.SourceMemberContainerTypeSymbol.ForceComplete(SourceLocation locationOpt, CancellationToken cancellationToken) [D:\a\_work\1\s\src\tests\BuildWasmApps\Wasm.Build.Tests\Wasm.Build.Tests.csproj]
D:\a\_work\1\s\.packages\microsoft.net.compilers.toolset\4.3.0-1.22201.1\tasks\net6.0\Microsoft.CSharp.Core.targets(75,5): error :    at Microsoft.CodeAnalysis.CSharp.Symbol.ForceCompleteMemberByLocation(SourceLocation locationOpt, Symbol member, CancellationToken cancellationToken) [D:\a\_work\1\s\src\tests\BuildWasmApps\Wasm.Build.Tests\Wasm.Build.Tests.csproj]
D:\a\_work\1\s\.packages\microsoft.net.compilers.toolset\4.3.0-1.22201.1\tasks\net6.0\Microsoft.CSharp.Core.targets(75,5): error :    at Microsoft.CodeAnalysis.CSharp.Symbols.SourceNamespaceSymbol.<>c__DisplayClass63_1.<ForceComplete>b__0(Int32 i) [D:\a\_work\1\s\src\tests\BuildWasmApps\Wasm.Build.Tests\Wasm.Build.Tests.csproj]
D:\a\_work\1\s\.packages\microsoft.net.compilers.toolset\4.3.0-1.22201.1\tasks\net6.0\Microsoft.CSharp.Core.targets(75,5): error :    at Roslyn.Utilities.UICultureUtilities.<>c__DisplayClass6_0`1.<WithCurrentUICulture>b__0(T param) [D:\a\_work\1\s\src\tests\BuildWasmApps\Wasm.Build.Tests\Wasm.Build.Tests.csproj]
D:\a\_work\1\s\.packages\microsoft.net.compilers.toolset\4.3.0-1.22201.1\tasks\net6.0\Microsoft.CSharp.Core.targets(75,5): error :    at Roslyn.Utilities.RoslynParallel.<>c__DisplayClass1_0.<For>g__errorHandlingBody|0(Int32 i) [D:\a\_work\1\s\src\tests\BuildWasmApps\Wasm.Build.Tests\Wasm.Build.Tests.csproj]
D:\a\_work\1\s\.packages\microsoft.net.compilers.toolset\4.3.0-1.22201.1\tasks\net6.0\Microsoft.CSharp.Core.targets(75,5): error :    at System.Environment.FailFast(System.String, System.Exception) [D:\a\_work\1\s\src\tests\BuildWasmApps\Wasm.Build.Tests\Wasm.Build.Tests.csproj]
D:\a\_work\1\s\.packages\microsoft.net.compilers.toolset\4.3.0-1.22201.1\tasks\net6.0\Microsoft.CSharp.Core.targets(75,5): error :    at Microsoft.CodeAnalysis.FailFast.OnFatalException(System.Exception) [D:\a\_work\1\s\src\tests\BuildWasmApps\Wasm.Build.Tests\Wasm.Build.Tests.csproj]
D:\a\_work\1\s\.packages\microsoft.net.compilers.toolset\4.3.0-1.22201.1\tasks\net6.0\Microsoft.CSharp.Core.targets(75,5): error :    at Microsoft.CodeAnalysis.FailFast+<>c.<.cctor>b__5_0(System.Exception, Microsoft.CodeAnalysis.ErrorReporting.ErrorSeverity, Boolean) [D:\a\_work\1\s\src\tests\BuildWasmApps\Wasm.Build.Tests\Wasm.Build.Tests.csproj]
D:\a\_work\1\s\.packages\microsoft.net.compilers.toolset\4.3.0-1.22201.1\tasks\net6.0\Microsoft.CSharp.Core.targets(75,5): error :    at Microsoft.CodeAnalysis.ErrorReporting.FatalError.Report(System.Exception, Microsoft.CodeAnalysis.ErrorReporting.ErrorSeverity, Boolean) [D:\a\_work\1\s\src\tests\BuildWasmApps\Wasm.Build.Tests\Wasm.Build.Tests.csproj]
D:\a\_work\1\s\.packages\microsoft.net.compilers.toolset\4.3.0-1.22201.1\tasks\net6.0\Microsoft.CSharp.Core.targets(75,5): error :    at Microsoft.CodeAnalysis.ErrorReporting.FatalError.ReportAndPropagate(System.Exception, Microsoft.CodeAnalysis.ErrorReporting.ErrorSeverity) [D:\a\_work\1\s\src\tests\BuildWasmApps\Wasm.Build.Tests\Wasm.Build.Tests.csproj]
D:\a\_work\1\s\.packages\microsoft.net.compilers.toolset\4.3.0-1.22201.1\tasks\net6.0\Microsoft.CSharp.Core.targets(75,5): error :    at Microsoft.CodeAnalysis.ErrorReporting.FatalError.ReportAndPropagateUnlessCanceled(System.Exception, System.Threading.CancellationToken, Microsoft.CodeAnalysis.ErrorReporting.ErrorSeverity) [D:\a\_work\1\s\src\tests\BuildWasmApps\Wasm.Build.Tests\Wasm.Build.Tests.csproj]
D:\a\_work\1\s\.packages\microsoft.net.compilers.toolset\4.3.0-1.22201.1\tasks\net6.0\Microsoft.CSharp.Core.targets(75,5): error :    at Roslyn.Utilities.RoslynParallel+<>c__DisplayClass1_0.<For>g__errorHandlingBody|0(Int32) [D:\a\_work\1\s\src\tests\BuildWasmApps\Wasm.Build.Tests\Wasm.Build.Tests.csproj]
D:\a\_work\1\s\.packages\microsoft.net.compilers.toolset\4.3.0-1.22201.1\tasks\net6.0\Microsoft.CSharp.Core.targets(75,5): error :    at Microsoft.CodeAnalysis.CSharp.Binder.<GetAttribute>g__makeSourceIndices|189_0(<>c__DisplayClass189_0 ByRef) [D:\a\_work\1\s\src\tests\BuildWasmApps\Wasm.Build.Tests\Wasm.Build.Tests.csproj]
D:\a\_work\1\s\.packages\microsoft.net.compilers.toolset\4.3.0-1.22201.1\tasks\net6.0\Microsoft.CSharp.Core.targets(75,5): error :    at Microsoft.CodeAnalysis.CSharp.Binder.GetAttribute(Microsoft.CodeAnalysis.CSharp.BoundAttribute, Microsoft.CodeAnalysis.CSharp.BindingDiagnosticBag) [D:\a\_work\1\s\src\tests\BuildWasmApps\Wasm.Build.Tests\Wasm.Build.Tests.csproj]
D:\a\_work\1\s\.packages\microsoft.net.compilers.toolset\4.3.0-1.22201.1\tasks\net6.0\Microsoft.CSharp.Core.targets(75,5): error :    at Microsoft.CodeAnalysis.CSharp.Binder.GetAttribute(Microsoft.CodeAnalysis.CSharp.Syntax.AttributeSyntax, Microsoft.CodeAnalysis.CSharp.Symbols.NamedTypeSymbol, System.Action`1<Microsoft.CodeAnalysis.CSharp.Syntax.AttributeSyntax>, System.Action`1<Microsoft.CodeAnalysis.CSharp.Syntax.AttributeSyntax>, Microsoft.CodeAnalysis.CSharp.BindingDiagnosticBag) [D:\a\_work\1\s\src\tests\BuildWasmApps\Wasm.Build.Tests\Wasm.Build.Tests.csproj]

@jaredpar
Copy link
Member

jaredpar commented Apr 1, 2022

@333fred PTAL

eng/Versions.props Outdated Show resolved Hide resolved
@danmoseley
Copy link
Member

danmoseley commented Apr 4, 2022

Is it surprising that System.Environment.FailFast(System.String, System.Exception) is calling into a whole bunch of other code? I thought it would always terminate immediately (hence the name). Amongst other things, for security reasons, but also because the state of the process, the heap etc is considered potentially unknown or corrupt. I didn't know it could trigger arbitrary code somehow.

@RikkiGibson
Copy link
Contributor

RikkiGibson commented Apr 4, 2022

The break was probably introduced by dotnet/roslyn#59750. I'll take a look.

@danmoseley
Copy link
Member

Is it surprising that System.Environment.FailFast(System.String, System.Exception) is calling into a whole bunch of other code? I thought it would always terminate immediately (hence the name). Amongst other things, for security reasons, but also because the state of the process, the heap etc is considered potentially unknown or corrupt. I didn't know it could trigger arbitrary code somehow.

@stephentoub any idea? it's just a call straight into the runtime. maybe the stack is being mis printed.

@tannergooding
Copy link
Member

Was talking with @AlekseyTs around generic math and the other issue that I hit (#67440 (comment)).

He suggested we should be able to work around both of these issues, if desired. For the params issue it should only occur when the named arguments are supplied out of order. For the ambiguity, we should be able to explicitly pick the right overload with a cast or "string".AsSpan()

No preference on what's done here, just relaying what was suggested to me. If we think the fixes will take longer than the P4 snap, then I might have a preference towards doing the workaround so we can get some additional bits in for generic math with that preview.

@stephentoub
Copy link
Member Author

stephentoub commented Apr 7, 2022

Is it surprising that System.Environment.FailFast(System.String, System.Exception) is calling into a whole bunch of other code?

It's not calling into other code. Roslyn is calling Environment.FailFast(exception.ToString(), exception), i.e. it's using exception.ToString() as the message, so you're seeing the stack of the exception as the message FailFast prints followed by the stack of where FailFast is being called.

@stephentoub
Copy link
Member Author

He suggested we should be able to work around both of these issues, if desired

Yes. I was waiting for Rikki's fix, but I don't want to wait for a design change around string literal overload resolution, as that won't be a quick turnaround.

@tannergooding
Copy link
Member

tannergooding commented Apr 7, 2022

I'll workaround the overload issue (particularly since its test impacting only for our current code, afaict) locally then and will wait for Rikki's fix to flow through this PR 👍

@stephentoub
Copy link
Member Author

Thanks for the offer, but I already started in this branch; I'll push that up soon.

@stephentoub stephentoub force-pushed the compilerupdate branch 2 times, most recently from 6217592 to 1c68cd7 Compare April 7, 2022 13:32
@stephentoub
Copy link
Member Author

particularly since its test impacting only for our current code, afaict

@bartonjs, FYI, there were some src changes here in System.Security.Cryptography. At first it seemed like it might actually be more efficient to use the ReadOnlySpan<byte> overloads, but I see some code paths buried in here that throw for byte-based passwords rather than char-based passwords, and so stuck with ReadOnlySpan<char> for now; we can change it later as is appropriate.

Copy link
Member

@tannergooding tannergooding left a comment

Choose a reason for hiding this comment

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

Changes LGTM and work on my local branch for user-defined checked operators.

@tannergooding
Copy link
Member

Both failures look to be already known looking at them compared to the issues the bot linked

@stephentoub stephentoub merged commit dc030a0 into dotnet:main Apr 7, 2022
@stephentoub stephentoub deleted the compilerupdate branch April 7, 2022 18:53
@bartonjs
Copy link
Member

bartonjs commented Apr 7, 2022

Yeah, ReadOnlySpan<char> is the right target for those.

I am, unsurprisingly, not pleased by the implicit conversion from a string literal to ReadOnlySpan<byte>.

@ghost ghost locked as resolved and limited conversation to collaborators May 8, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants