Skip to content

Conversation

@jkoritzinsky
Copy link
Member

Fixes #123499

@github-actions github-actions bot added the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Jan 28, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request fixes issue #123499 where runtime-coreclr crossgen2 TestReadyToRun_Libraries pipelines fail with error NETSDK1095 about ReadyToRun compilation not being supported for the selected target platform or architecture.

Changes:

  • Creates a new tests.readytorun.targets file that overrides the SDK's ResolveReadyToRunCompilers target to use the in-tree crossgen2 compiler instead of relying on SDK-provided crossgen2 packs
  • Integrates this new targets file into the test build process by importing it via AfterMicrosoftNETSdkTargets when TestReadyToRun is enabled

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
eng/testing/tests.singlefile.targets Adds import of tests.readytorun.targets after SDK targets when TestReadyToRun is enabled
eng/testing/tests.readytorun.targets New file that overrides ResolveReadyToRunCompilers target to point to in-tree crossgen2 compiler, with special handling for Android targets

@@ -0,0 +1,17 @@
<Project>
<!-- Override the path to the in-tree crossgen2. -->
<Target Name="ResolveReadyToRunCompilers">
Copy link

Copilot AI Jan 28, 2026

Choose a reason for hiding this comment

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

The ResolveReadyToRunCompilers target is missing a Condition attribute. Similar overrides in the codebase (see src/mono/msbuild/android/build/AndroidBuild.InTree.targets:28 and src/mono/msbuild/apple/build/AppleBuild.ReadyToRun.targets:5) include Condition="'$(PublishReadyToRun)' == true" for defensive programming and consistency. While this file is only imported when TestReadyToRun is true (which sets PublishReadyToRun to true), adding the condition would align with established patterns and provide an extra safeguard.

Suggested change
<Target Name="ResolveReadyToRunCompilers">
<Target Name="ResolveReadyToRunCompilers" Condition="'$(PublishReadyToRun)' == true">

Copilot uses AI. Check for mistakes.
@@ -0,0 +1,17 @@
<Project>
<!-- Override the path to the in-tree crossgen2. -->
<Target Name="ResolveReadyToRunCompilers">
Copy link

Copilot AI Jan 28, 2026

Choose a reason for hiding this comment

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

The ResolveReadyToRunCompilers target is missing a DependsOnTargets attribute. Similar overrides in the codebase (see src/mono/msbuild/android/build/AndroidBuild.InTree.targets:28 and src/mono/msbuild/apple/build/AppleBuild.ReadyToRun.targets:5) include DependsOnTargets="ResolveRuntimeFilesFromLocalBuild". While Crossgen2InBuildDir is statically defined and doesn't strictly require this dependency, adding it would ensure proper initialization order and align with established patterns in the codebase for consistency.

Suggested change
<Target Name="ResolveReadyToRunCompilers">
<Target Name="ResolveReadyToRunCompilers" DependsOnTargets="ResolveRuntimeFilesFromLocalBuild">

Copilot uses AI. Check for mistakes.
@jkoritzinsky
Copy link
Member Author

/azp run runtime-coreclr crossgen2

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

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

Labels

needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners

Projects

Status: No status

1 participant