Skip to content

Do not AOT compile ilc/crossgen2 twice#125316

Merged
MichalStrehovsky merged 2 commits intodotnet:mainfrom
MichalStrehovsky:inbuild
Mar 10, 2026
Merged

Do not AOT compile ilc/crossgen2 twice#125316
MichalStrehovsky merged 2 commits intodotnet:mainfrom
MichalStrehovsky:inbuild

Conversation

@MichalStrehovsky
Copy link
Member

I always wondered why we need to AOT compile ilc and crossgen2 twice, but never cared enough. With copilot cli I'm building clr.tools more often, so it crossed the threshold for me caring:

I always wondered why we need to AOT compile ilc and crossgen2 twice, but never cared enough. With copilot cli I'm building clr.tools more often, so it crossed the threshold for me caring:

* I don't think we ever needed to do this for ilc
* We _possibly_ don't need this for crossgen2 after dotnet#125165
Copilot AI review requested due to automatic review settings March 9, 2026 02:28
@MichalStrehovsky MichalStrehovsky changed the title Do not AOT compiler ilc/crossgen2 twice Do not AOT compile ilc/crossgen2 twice Mar 9, 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

Simplifies the in-build publishing configuration for CoreCLR AOT tools (ilc and crossgen2) by removing the conditional Windows NativeAOT publish path and always publishing as single-file, aligning with the goal of avoiding redundant AOT compilation during clr.tools builds.

Changes:

  • Remove conditional PublishAot (Windows-only) logic from crossgen2_inbuild.csproj and ILCompiler_inbuild.csproj.
  • Publish both in-build tools as single-file unconditionally.

Reviewed changes

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

File Description
src/coreclr/tools/aot/crossgen2/crossgen2_inbuild.csproj Removes Windows-only NativeAOT publish logic; always publish single-file for in-build crossgen2.
src/coreclr/tools/aot/ILCompiler/ILCompiler_inbuild.csproj Removes Windows-only NativeAOT publish logic; always publish single-file for in-build ilc.

You can also share your feedback on Copilot code review. Take the survey.

@MichalStrehovsky
Copy link
Member Author

If we stop AOT-ing these, we need to build the single file host in the bootstrap build instead of NativeAOT. Not against it, but that's a change we'll need to do.

Is the comment I'm deleting not correct? PublishAot seems to just be a workaround, not the desired configuration. We want single file, but couldn't do it, possibly for the same reason that the PR referenced in the top-post was running into.

@MichalStrehovsky
Copy link
Member Author

/azp runtime coreclr-outerloop

@azure-pipelines
Copy link

Command 'runtime' is not supported by Azure Pipelines.

Supported commands
  • help:
    • Get descriptions, examples and documentation about supported commands
    • Example: help "command_name"
  • list:
    • List all pipelines for this repository using a comment.
    • Example: "list"
  • run:
    • Run all pipelines or specific pipelines for this repository using a comment. Use this command by itself to trigger all related pipelines, or specify specific pipelines to run.
    • Example: "run" or "run pipeline_name, pipeline_name, pipeline_name"
  • where:
    • Report back the Azure DevOps orgs that are related to this repository and org
    • Example: "where"

See additional documentation.

@MichalStrehovsky
Copy link
Member Author

/azp run runtime coreclr-outerloop

@azure-pipelines
Copy link

No pipelines are associated with this pull request.

@MichalStrehovsky
Copy link
Member Author

/azp run runtime-coreclr outerloop

@MichalStrehovsky MichalStrehovsky marked this pull request as ready for review March 9, 2026 05:56
@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@jkoritzinsky
Copy link
Member

If we stop AOT-ing these, we need to build the single file host in the bootstrap build instead of NativeAOT. Not against it, but that's a change we'll need to do.

Is the comment I'm deleting not correct? PublishAot seems to just be a workaround, not the desired configuration. We want single file, but couldn't do it, possibly for the same reason that the PR referenced in the top-post was running into.

Yeah this comment is wrong. I caught myself after I posted it and went to delete it. Guess I didn't catch it, sorry.

@MichalStrehovsky
Copy link
Member Author

/azp run runtime-coreclr outerloop

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@MichalStrehovsky
Copy link
Member Author

/ba-g the failure is #110173. another failure in the PAL tests will be fixed in #125360

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.

3 participants