Skip to content

Exclude mixed-mode TLS tests from crossgen/ReadyToRun testing - #136266

Merged
jkoritzinsky merged 3 commits into
mainfrom
copilot/fix-test-failure-tls-loaded-dlls
Oct 24, 2026
Merged

jkoritzinsky merged 3 commits into
mainfrom
copilot/fix-test-failure-tls-loaded-dlls

Conversation

Copilot AI commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Crossgen2 rejects the managed C++ dependencies used by these TLS tests.

  • Scope: TestTLSWithLoadedDlls, MutualRecurThd-TLS, and Test-TLS, covering the issue and its comments.
  • Change: Set CrossGenTest=false and R2RIncompatible=true on all three projects. Normal JIT coverage remains enabled.

@azure-pipelines

azure-pipelines Bot commented Oct 22, 2026 •

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.

Co-authored-by: jkoritzinsky <1571408+jkoritzinsky@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix test failure in TestTLSWithLoadedDlls command Exclude mixed-mode TLS tests from crossgen/ReadyToRun testing Oct 22, 2026
Copilot AI requested a review from jkoritzinsky October 22, 2026 02:46
@jkoritzinsky
jkoritzinsky marked this pull request as ready for review October 22, 2026 02:46
@github-actions github-actions Bot added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Oct 22, 2026
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch
See info in area-owners.md if you want to be subscribed.

@pcshrosbree

Copy link
Copy Markdown
Contributor

@jkoritzinsky, I plan to send a small follow-up after this merges. TestTLSWithLoadedDlls is not a C++/CLI test: it only loads copies of usetls. It fails the ilasm round trip because JIT/Directed/tls/CMakeLists.txt also builds the two C++/CLI libraries, and the recursive native-binary copy puts them in its output directory.

With this PR applied on Windows x64, it still fails the ilasm round trip, on MutualRecurThdTLSNative.il. Its Crossgen2 run now reports that it skips execution because the test is incompatible with ReadyToRun.

The follow-up will give usetls its own CMake directory so this test copies only usetls. It will also remove the two properties this PR adds to the test. I've tested that layout on Windows x64 and Linux x64.

@jkoritzinsky

Copy link
Copy Markdown
Member

@copilot looks like TestTLSWithLoadedDlls doesn't actually use C++/CLI, can you move the tests that are testing C++/CLI TLS (both the managed and native components) into a subfolder under the tls folder named MixedMode and re-enable TestTLSWithLoadedDlls in crossgen runs?

…rage

Co-authored-by: jkoritzinsky <1571408+jkoritzinsky@users.noreply.github.com>

Copilot AI commented Oct 22, 2026

Copy link
Copy Markdown
Contributor Author

@copilot looks like TestTLSWithLoadedDlls doesn't actually use C++/CLI, can you move the tests that are testing C++/CLI TLS (both the managed and native components) into a subfolder under the tls fo...

Addressed in 2c8c996. Moved both C++/CLI tests and their native components into tls/MixedMode, updated references, and restored crossgen/ReadyToRun coverage for TestTLSWithLoadedDlls. Its usetls dependency now lives in a separate Native subtree so recursive native copying cannot pull in mixed-mode DLLs.

The targeted Linux x64 Checked build and TestTLSWithLoadedDlls JIT and Crossgen2 runs passed. Windows project references and compatibility metadata were validated; Windows C++/CLI binaries were not built or run.

@pcshrosbree

Copy link
Copy Markdown
Contributor

I applied PR head 2c8c996c to main at 42e0970dffe and tested it on Windows x64 (Checked, priority 1, with the C++/CLI libraries built):

  • TestTLSWithLoadedDlls passes under the JIT, both ilasm round trips (native and managed ilasm) and Crossgen2. Its output directory now holds only usetls.dll beside the test.
  • Test-TLS and MutualRecurThd-TLS pass under the JIT. Their round-trip and Crossgen2 runs are skipped, as their properties ask.

On main without the PR, on the same machine, TestTLSWithLoadedDlls failed both round trips and Crossgen2, and both C++/CLI tests failed Crossgen2.

@jkoritzinsky
jkoritzinsky merged commit a4d6516 into main Oct 24, 2026
80 checks passed
@jkoritzinsky
jkoritzinsky deleted the copilot/fix-test-failure-tls-loaded-dlls branch October 24, 2026 01:39
@github-project-automation github-project-automation Bot moved this to Done in AppModel Oct 24, 2026
steveisok added a commit that referenced this pull request Oct 25, 2026
<!-- -->

Fixes #136264.

The `B03689Native.dll` and `B07847Native.dll` C++/CLI helpers are
mixed-mode assemblies that Crossgen2 explicitly rejects. Add
`<CrossGenTest>false</CrossGenTest>` and
`<R2RIncompatible>true</R2RIncompatible>` to `b03689.csproj` and
`b07847.csproj`, matching the related mixed-mode TLS tests updated in
#136266.

This prevents unsupported ReadyToRun compilation and skips execution in
both ordinary and composite R2R runs. Ordinary JIT coverage remains
enabled, and existing compatibility metadata and test assertions are
unchanged. This does not change Crossgen2 support.

### Validation

- **Passed:** MSBuild evaluation of both actual projects for Windows x64
and arm64 Checked, plus complete batch and Bash wrapper generation using
`FetchExternalProperties,GenerateBatchExecutionScript,GenerateBashExecutionScript`.
All four configurations remain `BuildAndRun`, with
`_WillCLRTestProjectBuild=true` and `GenerateRunScript=true`.
- **Passed:** 16 generated Bash wrapper/control-flow checks using a
probe launcher. Ordinary and composite R2R skip successfully before
launch; ordinary JIT, including `CompositeBuildMode` alone without
`RunCrossGen2`, reaches the probe launcher. These checks did **not**
execute the Windows C++/CLI test assertions.
- **Passed:** Inspection of the generated Windows batch wrappers
confirms the R2R skip precedes the unchanged `corerun.exe` launch.
Structural XML comparison confirms all pre-existing project settings and
references are preserved. `git diff --check` passed.
- **Not run:** Windows binaries were not built or executed on the macOS
ARM64 host.

Resolves #136264

> [!NOTE]
> This PR description was generated with GitHub Copilot.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 12.0-preview1 milestone Oct 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Test failure: JIT/Directed/tls/TestTLSWithLoadedDlls/TestTLSWithLoadedDlls.cmd

4 participants