Skip to content

[ci-fix] Needs review: fix CS0246 InvalidCSharp build break in ByRefLike/Validate under minifullaot (refs #128767)#131081

Merged
akoeplinger merged 2 commits into
mainfrom
ci-fix/128767-byreflike-validate-processisolation-7cb9e559bb920c69
Jul 21, 2026
Merged

[ci-fix] Needs review: fix CS0246 InvalidCSharp build break in ByRefLike/Validate under minifullaot (refs #128767)#131081
akoeplinger merged 2 commits into
mainfrom
ci-fix/128767-byreflike-validate-processisolation-7cb9e559bb920c69

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

Caution

agentic threat detected
Threat detection flagged this output in warn mode. Manual review is REQUIRED before any follow-up automation.

Details

The threat detection results could not be parsed.

Review the workflow run logs for details.

Workflow artifact: ci-fix
Artifact kind: help
Linked KBE: #128767

Note

This is an AI/Copilot-generated best-effort fix attempt that I could not fully validate in the CI-fix environment (no mono minifullaot test toolchain / baseline build available). The reasoning is strong and mirrors an existing sibling project, but please review before merging.

Root cause (best analysis)

Under AllSubsets_Mono_MiniFullAot_RuntimeTests, the build fails with:

src/tests/Loader/classloader/generics/ByRefLike/Validate.cs(73,20): error CS0246: The type or namespace name 'InvalidCSharp' could not be found
src/tests/Loader/classloader/generics/ByRefLike/GenericTypeSubstitution.cs(8,7): error CS0246: ...

src/tests/Loader/classloader/generics/LoaderClassloaderGenerics.csproj is a merged test runner (<MergedWrapperProjectReference Include="*/**/*.??proj" />). Test projects that do not set RequiresProcessIsolation have their source compiled directly into that merged assembly.

ByRefLike/Validate.csproj sets MonoAotIncompatible=true, which via src/tests/Directory.Build.targets (line 15) sets DisableProjectBuild=true for the standalone project under minifullaot/llvmfullaot. Its referenced InvalidCSharp.ilproj is likewise MonoAotIncompatible and skipped. But because Validate.csproj lacks RequiresProcessIsolation, its Validate.cs/GenericTypeSubstitution.cs sources still get pulled into the merged LoaderClassloaderGenerics assembly, where using InvalidCSharp; can no longer resolve the (excluded) IL assembly → CS0246.

The sibling ByRefLike/ValidateNegative.csproj already sets RequiresProcessIsolation=true with the comment "Needed for MonoAotIncompatible, NativeAotIncompatible, CrossGenTest"Validate.csproj was simply missing it.

Attempted fix

Add <RequiresProcessIsolation>true</RequiresProcessIsolation> to Validate.csproj, mirroring ValidateNegative.csproj. This keeps the project out of the merged runner (in every config), so under minifullaot the whole project is cleanly excluded by the existing MonoAotIncompatible handling instead of leaking source into the merged assembly. This is not a test-disable — the test continues to run standalone everywhere it ran before; it was already excluded from mono full-AOT by MonoAotIncompatible.

What is unverified / where I need help

  • I could not run a mono minifullaot merged-test build in this environment to confirm the CS0246 is gone and no new merge/runner issue appears.
  • Please confirm Validate does not also need NativeAotIncompatible/CrossGenTest like ValidateNegative (the reported failure is minifullaot-only, so I kept the change minimal).

Validation

  • Command: not run because a mono minifullaot test build requires a full baseline/toolchain unavailable in this environment
  • Result: not run

Evidence

Help wanted

  • Area owners (area-VM-meta-mono): @steveisok, @dotnet/runtime

Filed by ci-failure-fix. 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.

Generated by CI Outer-Loop Failure Fixer · 357.3 AIC · ⊞ 18.3K ·

…efs #128767)

Validate.csproj is MonoAotIncompatible but was missing RequiresProcessIsolation,
so under AllSubsets_Mono_MiniFullAot its source was pulled into the merged
LoaderClassloaderGenerics runner while its InvalidCSharp.ilproj reference was
excluded, producing CS0246. Mirrors the sibling ValidateNegative.csproj.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Threat detection produced a warning for this pull request output.

These changes need to be scrutinized before merge and only merged after a careful manual review.

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 3 pipeline(s).
13 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

@dotnet-policy-service

Copy link
Copy Markdown
Contributor

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

@akoeplinger

Copy link
Copy Markdown
Member

/ba-g failure is unrelated and was fixed in main

@akoeplinger
akoeplinger marked this pull request as ready for review July 21, 2026 09:36
Copilot AI review requested due to automatic review settings July 21, 2026 09:36
@akoeplinger
akoeplinger merged commit 2f079da into main Jul 21, 2026
80 of 82 checks passed
@akoeplinger
akoeplinger deleted the ci-fix/128767-byreflike-validate-processisolation-7cb9e559bb920c69 branch July 21, 2026 09:36
Copilot stopped reviewing on behalf of akoeplinger due to an error July 21, 2026 09:36

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot could not run the full agentic suite for this review because it was automatically requested on a bot-authored pull request. Request a review from Copilot under Reviewers to retry with the full agentic suite. Improved support for bot-authored pull requests is coming soon.

Updates the ByRefLike generics loader test project configuration to avoid being included in the merged test runner when marked MonoAotIncompatible, preventing missing-build reference failures under certain AOT configurations.

Changes:

  • Added RequiresProcessIsolation to exclude the project from the merged test runner.
  • Documented the rationale and alignment with ValidateNegative.csproj.

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 3 pipeline(s).
13 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants