Skip to content

[ci-scan] Test failure: GB18030.Tests.RegexTests are trim and AOT incompatible #132046

Description

@github-actions

Build Information

Build: https://dev.azure.com/dnceng-public/public/_build/results?buildId=1545024
Build error leg or test failing: NativeAOT Compliance.Tests — GB18030.Tests.RegexTests.UnicodeCategory_ExclusionAsync

Pipeline: runtime-nativeaot-outerloop (definition 265), branch main. The GB18030.Tests.RegexTests cases fail across the NativeAOT Compliance.Tests work item in source build 1545024 and persist into follow-up build 1545347.

Under NativeAOT the Regex tests attempt to load Microsoft.CodeAnalysis.CSharp (used by the Regex source-generator compilation path in the test) and fail with System.IO.FileNotFoundException, thrown from the NativeAOT type loader. The failure affects every Regex engine variant (Interpreter, Compiled, NonBacktracking).

Error Details

[FAIL] GB18030.Tests.RegexTests.UnicodeCategory_ExclusionAsync(engine: Interpreter, culture: CultureInfo { })
System.IO.FileNotFoundException : Could not find file 'Microsoft.CodeAnalysis.CSharp'.
   at Internal.Runtime.TypeLoaderExceptionHelper.CreateFileNotFoundException(ExceptionStringID, String) in /_/src/coreclr/nativeaot/System.Private.CoreLib/src/Internal/Runtime/TypeLoaderExceptionHelper.cs:line 49

Error Message

{
  "ErrorMessage": [
    "[FAIL] GB18030.Tests.RegexTests.UnicodeCategory_ExclusionAsync",
    "System.IO.FileNotFoundException : Could not find file 'Microsoft.CodeAnalysis.CSharp'."
  ],
  "ErrorPattern": "",
  "BuildRetry": false,
  "ExcludeConsoleLog": false
}

First build it occurred

Observed in source build 1545024 (2026-08-08) and again in follow-up build 1545347 (2026-08-08) — at least two distinct builds.

Duplicate search

Searched open and closed issues/KBEs for GB18030.Tests.RegexTests and Could not find file 'Microsoft.CodeAnalysis.CSharp': no existing KBE matches. No open or merged PR references this NativeAOT signature.


Filed by ci-failure-scan (detection only). ci-failure-fix walks open [ci-scan] KBEs and either opens a small fix PR or comments here to loop in owners — it never disables the test.

Note

This issue was generated by the ci-failure-scan GitHub Copilot agentic workflow.

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • awmgmcpg

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "awmgmcpg"

See Network Configuration for more information.

Generated by CI Outer-Loop Failure Scanner · 719.9 AIC · ⌖ 16.6 AIC · ⊞ 18.3K · ◷

Report

Build Repository Test Pull Request
1549116 dotnet/runtime GB18030.Tests.RegexTests.NamedBlock_ExclusionAsync
1547968 dotnet/runtime GB18030.Tests.RegexTests.UnicodeCategory_InclusionAsync
1547726 dotnet/runtime Compliance.Tests.WorkItemExecution
1547684 dotnet/runtime GB18030.Tests.RegexTests.NamedBlock_InclusionAsync #132083
1547473 dotnet/runtime Compliance.Tests.WorkItemExecution #131783
1547390 dotnet/runtime GB18030.Tests.RegexTests.NamedBlock_InclusionAsync
1546438 dotnet/runtime GB18030.Tests.RegexTests.NamedBlock_InclusionAsync
1546065 dotnet/runtime Compliance.Tests.WorkItemExecution
1545949 dotnet/runtime GB18030.Tests.RegexTests.NamedBlock_InclusionAsync
1545856 dotnet/runtime GB18030.Tests.RegexTests.UnicodeCategory_ExclusionAsync #131907
1545740 dotnet/runtime GB18030.Tests.RegexTests.NamedBlock_InclusionAsync
1545668 dotnet/runtime Compliance.Tests.WorkItemExecution
1545587 dotnet/runtime GB18030.Tests.RegexTests.NamedBlock_ExclusionAsync #131907
1545564 dotnet/runtime GB18030.Tests.RegexTests.UnicodeCategory_InclusionAsync
1545024 dotnet/runtime GB18030.Tests.RegexTests.UnicodeCategory_InclusionAsync

Summary

24-Hour Hit Count 7-Day Hit Count 1-Month Count
4 15 15

Known issue validation

Build: 🔎 https://dev.azure.com/dnceng-public/public/_build/results?buildId=1545024
Error message validated: [[FAIL] GB18030.Tests.RegexTests.UnicodeCategory_ExclusionAsync System.IO.FileNotFoundException : Could not find file 'Microsoft.CodeAnalysis.CSharp'.]
Result validation: ✅ Known issue matched with the provided build.
Validation performed at: 8/10/2026 2:32:31 PM UTC

Activity

  1. dotnet-policy-service commented on Aug 10, 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.

  2. github-actions commented on Aug 10, 2026

    @github-actions
    ContributorAuthor

    Workflow artifact: ci-fix
    Artifact kind: handoff
    Linked KBE: #132046

    Note

    AI/Copilot-generated triage note.

    This Known Build Error has no producible automated code change (reason: non-code/infra failure — NativeAOT test-project publish/trimming wiring, where the only in-bounds product change would be a build-wiring change I cannot build-validate in this environment, and disabling the test is not allowed), so I could not open even a best-effort PR I could stand behind. Looping in owners so it can be fixed forward rather than muted.

    Root cause (best analysis)

    On the runtime-nativeaot-outerloop (def 265) NativeAOT Compliance.Tests work item, every GB18030.Tests.RegexTests case fails — including the Interpreter engine variant, which never invokes the Roslyn source-generator path — with:

    System.IO.FileNotFoundException : Could not find file 'Microsoft.CodeAnalysis.CSharp'.
       at Internal.Runtime.TypeLoaderExceptionHelper.CreateFileNotFoundException(...)
    

    The Compliance.Tests project links the shared Regex test helpers:

    • src/libraries/Common/tests/ComplianceTests/Compliance.Tests.csproj compiles System.Text.RegularExpressions/tests/FunctionalTests/RegexGeneratorHelper.netcoreapp.cs and adds <PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" ... />.
    • That helper references Microsoft.CodeAnalysis.CSharp types, so the assembly is a hard reference of the test even though, on NativeAOT, the SourceGenerated engine is never enumerated (RegexHelpers.AvailableEngines gates it behind PlatformDetection.IsReflectionEmitSupported, which is false under NativeAOT).

    Under NativeAOT the Roslyn assembly is not published/resolvable, so the type loader throws while the test type is brought up — failing all engine variants of RegexTests, not just SourceGenerated. The GB18030 Compliance tests were newly added in #118075 (merged 2026-08-07); the failure first appears on the next NativeAOT outerloop build (1545024, 2026-08-08), which is consistent with the new project not yet being wired for the NativeAOT publish path.

    A fix would likely condition the Microsoft.CodeAnalysis.CSharp.Workspaces package reference and the RegexGeneratorHelper.netcoreapp.cs compile item so the Roslyn dependency is only pulled in when the source-generator engine can actually run (i.e. not for the NativeAOT/mobile publish), or otherwise ensure the Roslyn assemblies are published alongside the NativeAOT test app. Either is a build-wiring decision that needs owner review and a real NativeAOT publish run to validate — not something I can confidently land here without muting the test (which this workflow must not do).

    Evidence

    Suggested reviewers / area contacts

    A fix would most likely live in Compliance.Tests.csproj: gate the Roslyn PackageReference/RegexGeneratorHelper.netcoreapp.cs compile behind the same condition that determines whether the source-generated Regex engine can run, or publish the Roslyn assemblies for the NativeAOT test app.


    Filed by ci-failure-fix, which attempts validated fixes for [ci-scan] Known Build Errors and otherwise loops in owners. Comment here or on the workflow file to suggest changes; ci-failure-scan-feedback reads in-scope feedback daily and opens (or updates) a PR with prompt edits.

    Warning

    Firewall blocked 1 domain

    The following domain was blocked by the firewall during workflow execution:

    • awmgmcpg

    To allow these domains, add them to the network.allowed list in your workflow frontmatter:

    network:
      allowed:
        - defaults
        - "awmgmcpg"

    See Network Configuration for more information.

    Generated by CI Outer-Loop Failure Fixer · 664.5 AIC · ⌖ 15.8 AIC · ⊞ 17.1K · ◷

  3. dotnet-policy-service commented on Aug 10, 2026

    @dotnet-policy-service
    Contributor

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

  4. jkotas commented on Aug 10, 2026

    @jkotas
    Member

    New tests introduced in #118075

    @jozkee You have disabled the trim and aot analyzers for this project https://github.com/dotnet/runtime/pull/118075/changes#diff-bfa2579e42b9a3ee7ca76e23b3703fae9ebd032546d227bf4b2ff69af1b9af15R8-R9 . We try to minimize libraries tests that are incompatible with trimming and aot since it reduces our test coverage. The tests that are incompatible with trimming and aot have to be disabled on trimming and aot test configurations.

    Can you please refactor these tests to allow clean separation of trim and aot incompatible tests?

    • The common can just have GB118030 test helper
    • The actual tests can be in the specific feature area tests. The feature area that are aot/trim incompatible are going to have the tests naturally disabled.
  5. changed the title [-][ci-scan] Test failure: GB18030.Tests.RegexTests fails with FileNotFoundException 'Microsoft.CodeAnalysis.CSharp' on NativeAOT[/-] [+][ci-scan] Test failure: GB18030.Tests.RegexTests are trim and AOT incompatible[/+] on Aug 10, 2026
  6. added a commit that references this issue on Aug 12, 2026
    d6f396f
  7. locked and limited conversation to collaborators on Sep 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Known Build ErrorUse this to report build issues in the .NET Helix tabagentic-workflowsarea-Metablocking-clean-ciBlocking PR or rolling runs of 'runtime' or 'runtime-extra-platforms'

Type

No type

Projects

  • Status
    No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions