Skip to content

[WIP] Fix FileNotFoundException in NativeAOT test - #132173

Draft
AndyAyersMS with Copilot wants to merge 2 commits into
mainfrom
copilot/fix-file-not-found-error
Draft

[WIP] Fix FileNotFoundException in NativeAOT test#132173
AndyAyersMS with Copilot wants to merge 2 commits into
mainfrom
copilot/fix-file-not-found-error

Conversation

Copilot AI commented Aug 11, 2026

Copy link
Copy Markdown
Contributor
  • Diagnose: Runtime_101046.csproj and Runtime_101046.ilproj shared the same project name, so they shared OutputPath/IntermediateOutputPath and the generated .cmd/.sh wrapper and overwrote each other's outputs. After Enable out-of-process tests for CoreCLR browser WASM #131110 added a TestLibrary ProjectReference + [ActiveIssue(typeof(PlatformDetection), ...)] to the C# variant only, NativeAOT builds could ILC-compile the C# assembly without TestLibrary in its reference set, so __GeneratedMainWrapper.Main() became a throwing body (FileNotFoundException: Could not find file 'TestLibrary').
  • Rename the C# variant to Runtime_101046_1 (project, source file, test class) so the two tests no longer share output/intermediate directories
  • Replace the TestLibrary-based ActiveIssue gate with the CLRTestTargetUnsupported project gate used by sibling native-asset tests
  • Apply the same native-test-asset gate to the IL variant, which now actually runs
  • Gate the IL variant off x64 Unix: once it really runs it fails there (JIT passes the un-normalized uint16, the clang-built callee assumes normalization) — needs a JIT-team decision, noted for follow-up
  • Validate: built clr+libs and the test tree, ran both wrappers on linux-x64 (Runtime_101046_1 passes; IL variant excluded on x64 Unix)

Copilot AI lite review requested due to automatic review settings August 11, 2026 21:58

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.

Copilot wasn't able to review any files in this pull request.

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
16 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/area-infrastructure-libraries
See info in area-owners.md if you want to be subscribed.

…pendency

Co-authored-by: AndyAyersMS <10121823+AndyAyersMS@users.noreply.github.com>
Copilot AI review requested due to automatic review settings August 11, 2026 22:49

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

Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.

Suppressed comments (1)

src/tests/JIT/Regression/JitBlue/Runtime_101046/Runtime_101046.ilproj:11

  • The x64 Unix gating comment links to issue #131997, but that issue tracks a NativeAOT FileNotFoundException (TestLibrary) rather than the uint16 pinvoke normalization behavior described here. This makes the gate hard to audit later; please remove the incorrect link or replace it with the correct tracking issue for the normalization mismatch.
    <!-- The JIT only normalizes small primitive pinvoke arguments where the ABI requires it, but the
         clang-compiled callee assumes normalization on x64 Unix: https://github.com/dotnet/runtime/issues/131997 -->
    <CLRTestTargetUnsupported Condition="'$(TargetArchitecture)' == 'x64' and '$(TargetsUnix)' == 'true'">true</CLRTestTargetUnsupported>

Copilot AI requested a review from AndyAyersMS August 11, 2026 22:57
Copilot stopped work on behalf of AndyAyersMS due to an error August 11, 2026 22:57
@AndyAyersMS

AndyAyersMS commented Aug 11, 2026

Copy link
Copy Markdown
Member

@jakobbotsch do you think we need to extend the small type normalization in #106314 to linux x64 too?

Apparently clang depends on this and GCC does not.

@jakobbotsch

Copy link
Copy Markdown
Member

@jakobbotsch do you think we need to extend the small type normalization in #106314 to linux x64 too?

Apparently clang depends on this and GCC does not.

What is the example where clang depends on that? I believe the upper bits are undefined in SysV so that sounds like a clang bug.

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.

[ci-scan] Test failure: JIT/Regression/JitBlue/Runtime_101046 NativeAOT FileNotFoundException 'TestLibrary'

4 participants