Skip to content

Building library tests for NativeAot with checked runtime fails due to analyzer assert #133796

Closed

Description

@VSadov

I am building main as:

build.cmd clr+libs+libs.tests -rc Checked -lc Release /p:TestNativeAot=true -test

The build fails with

C:\Users\vs\.nuget\packages\microsoft.net.compilers.toolset\5.12.0-1.26458.117\tasks\netcore\Microsoft.CSharp.Core.targets(97,5): error : Process terminated. [E:\dotnet003\runtime\src\libraries\System.Runtime\tests\System.Runtime.Tests\System.Runtime.Tests.csproj::TargetFramework=net11.0-windows]
C:\Users\vs\.nuget\packages\microsoft.net.compilers.toolset\5.12.0-1.26458.117\tasks\netcore\Microsoft.CSharp.Core.targets(97,5): error : Assertion failed. [E:\dotnet003\runtime\src\libraries\System.Runtime\tests\System.Runtime.Tests\System.Runtime.Tests.csproj::TargetFramework=net11.0-windows]
C:\Users\vs\.nuget\packages\microsoft.net.compilers.toolset\5.12.0-1.26458.117\tasks\netcore\Microsoft.CSharp.Core.targets(97,5): error :    at ILLink.RoslynAnalyzer.DataFlow.MethodBodyValue..ctor(ISymbol owningSymbol, ControlFlowGraph cfg) in E:\dotnet003\runtime\src\tools\illink\src\ILLink.RoslynAnalyzer\DataFlow\MethodBodyValue.cs:line 23 [E:\dotnet003\runtime\src\libraries\System.Runtime\tests\System.Runtime.Tests\System.Runtime.Tests.csproj::TargetFramework=net11.0-windows]
C:\Users\vs\.nuget\packages\microsoft.net.compilers.toolset\5.12.0-1.26458.117\tasks\netcore\Microsoft.CSharp.Core.targets(97,5): error :    at ILLink.RoslynAnalyzer.DataFlow.LocalDataFlowAnalysis`6.InterproceduralAnalyze() in E:\dotnet003\runtime\src\tools\illink\src\ILLink.RoslynAnalyzer\DataFlow\LocalDataFlowAnalysis.cs:line 91 [E:\dotnet003\runtime\src\libraries\System.Runtime\tests\System.Runtime.Tests\System.Runtime.Tests.csproj::TargetFramework=net11.0-windows]
C:\Users\vs\.nuget\packages\microsoft.net.compilers.toolset\5.12.0-1.26458.117\tasks\netcore\Microsoft.CSharp.Core.targets(97,5): error :    at ILLink.RoslynAnalyzer.DynamicallyAccessedMembersAnalyzer.<>c__DisplayClass13_0.<Initialize>b__1(OperationBlockAnalysisContext context) in E:\dotnet003\runtime\src\tools\illink\src\ILLink.RoslynAnalyzer\DynamicallyAccessedMembersAnalyzer.cs:line 119 [E:\dotnet003\runtime\src\libraries\System.Runtime\tests\System.Runtime.Tests\System.Runtime.Tests.csproj::TargetFramework=net11.0-windows]
C:\Users\vs\.nuget\packages\microsoft.net.compilers.toolset\5.12.0-1.26458.117\tasks\netcore\Microsoft.CSharp.Core.targets(97,5): error :    at Microsoft.CodeAnalysis.Diagnostics.AnalyzerExecutor.<>c.<ExecuteOperationBlockActions>b__59_4(ValueTuple`2 data) [E:\dotnet003\runtime\src\libraries\System.Runtime\tests\System.Runtime.Tests\System.Runtime.Tests.csproj::TargetFramework=net11.0-windows]
C:\Users\vs\.nuget\packages\microsoft.net.compilers.toolset\5.12.0-1.26458.117\tasks\netcore\Microsoft.CSharp.Core.targets(97,5): error :    at Microsoft.CodeAnalysis.Diagnostics.AnalyzerExecutor.ExecuteAndCatchIfThrows_NoLock[TArg](DiagnosticAnalyzer analyzer, Action`1 analyze, TArg argument, Nullable`1 info, CancellationToken cancellationToken) [E:\dotnet003\runtime\src\libraries\System.Runtime\tests\System.Runtime.Tests\System.Runtime.Tests.csproj::TargetFramework=net11.0-windows]
C:\Users\vs\.nuget\packages\microsoft.net.compilers.toolset\5.12.0-1.26458.117\tasks\netcore\Microsoft.CSharp.Core.targets(97,5): error :    at Microsoft.CodeAnalysis.Diagnostics.AnalyzerExecutor.ExecuteAndCatchIfThrows[TArg](DiagnosticAnalyzer analyzer, Action`1 analyze, TArg argument, Nullable`1 contextInfo, CancellationToken cancellationToken) [E:\dotnet003\runtime\src\libraries\System.Runtime\tests\System.Runtime.Tests\System.Runtime.Tests.csproj::TargetFramework=net11.0-windows]
C:\Users\vs\.nuget\packages\microsoft.net.compilers.toolset\5.12.0-1.26458.117\tasks\netcore\Microsoft.CSharp.Core.targets(97,5): error :    at Microsoft.CodeAnalysis.Diagnostics.AnalyzerExecutor.<>c.<ExecuteOperationBlockActions>b__59_2(HashSet`1 blockActions, AnalyzerDiagnosticReporter diagReporter, Func`3 isSupportedDiagnostic, ExecutionData executionData, ValueTuple`6 args, CancellationToken cancellationToken) [E:\dotnet003\runtime\src\libraries\System.Runtime\tests\System.Runtime.Tests\System.Runtime.Tests.csproj::TargetFramework=net11.0-windows]

could potentially be a Roslyn bug - I am not sure.

Activity

  1. added
    untriaged
    on Sep 12, 2026
  2. dotnet-policy-service commented on Sep 12, 2026

    @dotnet-policy-service
    Contributor

    Tagging subscribers to this area: @dotnet/area-infrastructure-libraries
    See info in area-owners.md if you want to be subscribed.

  3. dotnet-policy-service commented on Sep 12, 2026

    @dotnet-policy-service
    Contributor

    Tagging subscribers to this area: @agocke, @dotnet/ilc-contrib
    See info in area-owners.md if you want to be subscribed.

  4. MihuBot commented on Sep 12, 2026

    @MihuBot

    I'm a bot. Here is a possible related and/or duplicate issue (I may be wrong):

  5. added
    area-Tools-ILLink
    and removed on Sep 13, 2026
  6. dotnet-policy-service commented on Sep 13, 2026

    @dotnet-policy-service
    Contributor

    Tagging subscribers to this area: @agocke, @dotnet/illink
    See info in area-owners.md if you want to be subscribed.

  7. self-assigned this
    on Sep 14, 2026
  8. removed
    untriaged
    on Sep 14, 2026
  9. added 2 commits that reference this issue on Sep 14, 2026
    a527ca6
    995c13d
  10. locked and limited conversation to collaborators on Oct 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area-Tools-ILLink

Type

No type

Projects

  • Status
    No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions