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

Upgrade to .NET 7 P6 SDK #63062

Merged
merged 4 commits into from
Aug 8, 2022
Merged

Upgrade to .NET 7 P6 SDK #63062

merged 4 commits into from
Aug 8, 2022

Conversation

allisonchou
Copy link
Contributor

Running this through scouting queue to see if it fixes failures we're seeing

@dibarbet
Copy link
Member

dibarbet commented Aug 1, 2022

@dotnet/roslyn-compiler could I get some assistance with the compiler server errors in the correctness build?

Build FAILED.

D:\a\_work\1\s\eng\targets\Bootstrap.targets(4,5): error : Compiler request rejected [D:\a\_work\1\s\src\Compilers\Extension\Roslyn.Compilers.Extension.csproj]
D:\a\_work\1\s\artifacts\Bootstrap\tasks\net472\Microsoft.CSharp.Core.targets(79,5): error MSB6006: "csc.exe" exited with code 57005. [D:\a\_work\1\s\src\EditorFeatures\Core.Wpf\Microsoft.CodeAnalysis.EditorFeatures.Wpf_icujsfd5_wpftmp.csproj]
D:\a\_work\1\s\eng\targets\Bootstrap.targets(4,5): error : Compiler request rejected [D:\a\_work\1\s\src\Tools\ExternalAccess\Xamarin.Remote\Microsoft.CodeAnalysis.ExternalAccess.Xamarin.Remote.csproj]
    0 Warning(s)
    3 Error(s)

There's also consistent tests in CompoundAssignment.vb failing (all for Bug1021941) on all CI legs, which I plan to disable
https://sourceroslyn.io/#Microsoft.CodeAnalysis.VisualBasic.Semantic.UnitTests/Semantics/CompoundAssignment.vb,1098

@dibarbet
Copy link
Member

dibarbet commented Aug 1, 2022

@chsienki looks like the compiler server failures might be source generator related?

ID=VBCSCompiler TID=60: Begin Analyzer Consistency Check
ID=VBCSCompiler TID=60: End Analyzer Consistency Check
ID=VBCSCompiler TID=60: Begin 4e8c2ffc-cb5c-488d-94bd-113203bd60b3 Visual Basic compiler run
ID=VBCSCompiler TID=33: Debug.Assert failed with message: Fail: 
Stack Trace
   at Microsoft.CodeAnalysis.CommandLine.ExitingTraceListener.Exit(String originalMessage)
   at Microsoft.CodeAnalysis.CommandLine.ExitingTraceListener.WriteLine(String message)
   at System.Diagnostics.TraceInternal.Fail(String message)
   at System.Diagnostics.Debug.Assert(Boolean condition)
   at Microsoft.CodeAnalysis.GeneratorDriver..ctor(GeneratorDriverState state)
   at Microsoft.CodeAnalysis.CSharp.CSharpGeneratorDriver..ctor(GeneratorDriverState state)
   at Microsoft.CodeAnalysis.CSharp.CSharpGeneratorDriver.FromState(GeneratorDriverState state)
   at Microsoft.CodeAnalysis.GeneratorDriver.RunGeneratorsAndUpdateCompilation(Compilation compilation, Compilation& outputCompilation, ImmutableArray`1& diagnostics, CancellationToken cancellationToken)
   at Microsoft.CodeAnalysis.CommonCompiler.RunGenerators(Compilation input, ParseOptions parseOptions, ImmutableArray`1 generators, AnalyzerConfigOptionsProvider analyzerConfigOptionsProvider, ImmutableArray`1 additionalTexts, DiagnosticBag generatorDiagnostics)
   at Microsoft.CodeAnalysis.CommonCompiler.CompileAndEmit(TouchedFileLogger touchedFilesLogger, Compilation& compilation, ImmutableArray`1 analyzers, ImmutableArray`1 generators, ImmutableArray`1 additionalTextFiles, AnalyzerConfigSet analyzerConfigSet, ImmutableArray`1 sourceFileAnalyzerConfigOptions, ImmutableArray`1 embeddedTexts, DiagnosticBag diagnostics, CancellationToken cancellationToken, CancellationTokenSource& analyzerCts, AnalyzerDriver& analyzerDriver, Nullable`1& generatorTimingInfo)
   at Microsoft.CodeAnalysis.CommonCompiler.RunCore(TextWriter consoleOutput, ErrorLogger errorLogger, CancellationToken cancellationToken)
   at Microsoft.CodeAnalysis.CommonCompiler.Run(TextWriter consoleOutput, CancellationToken cancellationToken)
   at Microsoft.CodeAnalysis.CompilerServer.CompilerServerHost.RunCompilation(RunRequest& request, CancellationToken cancellationToken)
   at Microsoft.CodeAnalysis.CompilerServer.CompilerServerHost.Microsoft.CodeAnalysis.CompilerServer.ICompilerServerHost.RunCompilation(RunRequest& request, CancellationToken cancellationToken)
   at Microsoft.CodeAnalysis.CompilerServer.ClientConnectionHandler.<>c__DisplayClass8_0.<ProcessCompilationRequestAsync>b__1()
   at System.Threading.Tasks.Task`1.InnerInvoke()
   at System.Threading.Tasks.Task.Execute()
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot)
   at System.Threading.Tasks.Task.ExecuteEntry(Boolean bPreventDoubleExecution)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ThreadHelper.ThreadStart(Object obj)

@chsienki
Copy link
Contributor

chsienki commented Aug 2, 2022

@dibarbet Interesting, that assert is called when we're passing the same type of generator to the driver multiple times, which usually indicates a test authoring issue. I guess some generator tests got introduced? Though I don't see how main isn't failing in that case?

@JoeRobich
Copy link
Member

This PR updates the SDK meaning the compiler toolset is updated to whatever shipped in Preview 6. How old is this assert?

@dibarbet
Copy link
Member

dibarbet commented Aug 2, 2022

Not familiar at all with the area - could the new preview sdk be adding a duplicate generator?

Note that this is failing in the correctness build, so I don't think tests apply here?

@chsienki
Copy link
Contributor

chsienki commented Aug 2, 2022

Yeah, this is very weird. Looking at the correctness builds its not failing on the same projects either, which suggests something else strange is going on.

In theory, outside of tests, you shouldn't be able to hit this assert, because the analyzer loader will only return a single type of each generator / analyzer. We have the assert (and have done so for multiple years) to check that invariant isn't being broken in tests (and thus testing something that shouldn't be possible).

Clearly that assertion is not holding for some reason, my guess being something in the analyzer loader has changed meaning we're now somehow creating multiple instances of a single type? Do we know which compiler commit we're updating from and to?

@chsienki
Copy link
Contributor

chsienki commented Aug 2, 2022

Ugh, hang on, this is even more confusing. Its not at the initial construction that it's failing, but after the generators have run and we've modified the state. That suggests we're somehow incorrectly modifying the generator state. And given that its happening on different projects, that possibly its a race condition we've exposed via the new SDK.

Bleurgh. I'll keep digging.

@RikkiGibson
Copy link
Contributor

It sounds like it may not be relevant, but FWIW we have seen cases where the same generator gets passed multiple times during the build and weird things happen. #62610

@jaredpar
Copy link
Member

jaredpar commented Aug 2, 2022

It sounds like it may not be relevant, but FWIW we have seen cases where the same generator gets passed multiple times during the build and weird things happen.

That was my first thought too but last night I took a look at the binlog and didn't see any generator obviously being passed twice. Possible it's more subtle than I realize but at a glance this wasn't the issue.

@dibarbet
Copy link
Member

dibarbet commented Aug 4, 2022

Per conversation with @chsienki and @vatsalyaagrawal we will be disabling the tests for CompoundAssignment.Bug1021941 which consistently fail on .net7p6 so that we can fix the scouting queue and merge the -vs-deps branches back into main.

@allisonchou allisonchou marked this pull request as ready for review August 5, 2022 18:19
@allisonchou allisonchou requested review from a team as code owners August 5, 2022 18:19
@dibarbet
Copy link
Member

dibarbet commented Aug 6, 2022

@chsienki for review on the compiler test changes

@dibarbet
Copy link
Member

dibarbet commented Aug 6, 2022

planning on merging Monday (just sent a reminder email)

@dibarbet dibarbet merged commit a9740c7 into main Aug 8, 2022
@dibarbet dibarbet deleted the dev/allichou/TryUpdateSDK2 branch August 8, 2022 23:20
@ghost ghost added this to the Next milestone Aug 8, 2022
@dibarbet dibarbet restored the dev/allichou/TryUpdateSDK2 branch August 8, 2022 23:20
@JoeRobich
Copy link
Member

❤️

@allisonchou allisonchou deleted the dev/allichou/TryUpdateSDK2 branch August 11, 2022 21:03
@allisonchou allisonchou restored the dev/allichou/TryUpdateSDK2 branch August 11, 2022 21:04
@allisonchou allisonchou deleted the dev/allichou/TryUpdateSDK2 branch August 11, 2022 21:04
dibarbet added a commit to dibarbet/roslyn that referenced this pull request Aug 12, 2022
dibarbet added a commit that referenced this pull request Aug 12, 2022
@dibarbet dibarbet modified the milestones: Next, 17.4 P2 Sep 1, 2022
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.

6 participants