Repository navigation
[ci-scan] Test failure: GB18030.Tests.RegexTests are trim and AOT incompatible #132046
Description
Activity
- addedblocking-clean-ciBlocking PR or rolling runs of 'runtime' or 'runtime-extra-platforms'Blocking PR or rolling runs of 'runtime' or 'runtime-extra-platforms'Known Build ErrorUse this to report build issues in the .NET Helix tabUse this to report build issues in the .NET Helix tab
on Aug 9, 2026 - addeduntriagedNew issue has not been triaged by the area ownerNew issue has not been triaged by the area owner
on Aug 9, 2026 dotnet-policy-service commented
on Aug 10, 2026 ContributorMore actionsTagging subscribers to this area: @agocke, @dotnet/ilc-contrib
See info in area-owners.md if you want to be subscribed.github-actions commented
on Aug 10, 2026 on Aug 10, 2026 – with GitHub ActionsContributorAuthorMore actionsWorkflow artifact: ci-fix
Artifact kind: handoff
Linked KBE: #132046Note
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, everyGB18030.Tests.RegexTestscase fails — including theInterpreterengine 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.Testsproject links the shared Regex test helpers:src/libraries/Common/tests/ComplianceTests/Compliance.Tests.csprojcompilesSystem.Text.RegularExpressions/tests/FunctionalTests/RegexGeneratorHelper.netcoreapp.csand adds<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" ... />.- That helper references
Microsoft.CodeAnalysis.CSharptypes, so the assembly is a hard reference of the test even though, on NativeAOT, theSourceGeneratedengine is never enumerated (RegexHelpers.AvailableEnginesgates it behindPlatformDetection.IsReflectionEmitSupported, which isfalseunder 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 justSourceGenerated. TheGB18030Compliance 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.Workspacespackage reference and theRegexGeneratorHelper.netcoreapp.cscompile 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
- Failing build: https://dev.azure.com/dnceng-public/public/_build/results?buildId=1545024 (reproduced on follow-up build 1545347)
- First build it occurred: build 1545024 (2026-08-08) — computed within the scanned window; may not be the true origin
- Possible related PR: Add Compliance tests for GB18030-2022 #118075 (added the
GB18030Compliance tests, merged 2026-08-07)
Suggested reviewers / area contacts
- Likely author:
@dacantu(added the Compliance.Tests project in Add Compliance tests for GB18030-2022 #118075) - Area owners (
area-NativeAOT-coreclr):@agocke,@dotnet/ilc-contrib
A fix would most likely live in
Compliance.Tests.csproj: gate the RoslynPackageReference/RegexGeneratorHelper.netcoreapp.cscompile 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-feedbackreads 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.allowedlist 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 · ◷
dotnet-policy-service commented
on Aug 10, 2026 ContributorMore actionsTagging subscribers to this area: @dotnet/area-meta
See info in area-owners.md if you want to be subscribed.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.
- 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 - added a commit that references this issue
on Aug 12, 2026 - removeduntriagedNew issue has not been triaged by the area ownerNew issue has not been triaged by the area owner
on Aug 12, 2026 - locked and limited conversation to collaborators
on Sep 11, 2026
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsNo status
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), branchmain. TheGB18030.Tests.RegexTestscases 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 withSystem.IO.FileNotFoundException, thrown from the NativeAOT type loader. The failure affects every Regex engine variant (Interpreter,Compiled,NonBacktracking).Error Details
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.RegexTestsandCould 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-fixwalks 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-scanGitHub Copilot agentic workflow.Warning
Firewall blocked 1 domain
The following domain was blocked by the firewall during workflow execution:
awmgmcpgSee Network Configuration for more information.
Report
Summary
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