Skip to content

Add ProjectReference for crossgen2 in tests project#128414

Open
jtschuster wants to merge 1 commit into
mainfrom
jtschuster/CrossgenTestsReferenceCrossgen
Open

Add ProjectReference for crossgen2 in tests project#128414
jtschuster wants to merge 1 commit into
mainfrom
jtschuster/CrossgenTestsReferenceCrossgen

Conversation

@jtschuster
Copy link
Copy Markdown
Member

@jtschuster jtschuster commented May 20, 2026

To make sure the latest changes for crossgen2 are picked up when building and running the test project locally.

Copilot AI review requested due to automatic review settings May 20, 2026 18:15
@github-actions github-actions Bot added the area-crossgen2-coreclr only use for closed issues label May 20, 2026
@jtschuster jtschuster requested a review from davidwrighton May 20, 2026 18:18
Copy link
Copy Markdown
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 PR updates the ReadyToRun test project to depend on the in-build crossgen2 project so that crossgen2 changes are picked up when building/running the tests.

Changes:

  • Add a ProjectReference from ILCompiler.ReadyToRun.Tests to crossgen2_inbuild.csproj (with ReferenceOutputAssembly="false").

Comment on lines 23 to 25
<ProjectReference Include="../ILCompiler.Reflection.ReadyToRun/ILCompiler.Reflection.ReadyToRun.csproj" />
<ProjectReference Include="../crossgen2/crossgen2_inbuild.csproj" ReferenceOutputAssembly="false" />
</ItemGroup>
@github-actions
Copy link
Copy Markdown
Contributor

Note

This review was generated by Copilot.

🤖 Copilot Code Review — PR #128414

Holistic Assessment

Motivation: The PR ensures the crossgen2 tool is freshly built before the ReadyToRun tests execute, so tests always pick up the latest crossgen2 changes. This is a legitimate build-ordering concern — without this, stale crossgen2 binaries could cause confusing test failures.

Approach: Using <ProjectReference ... ReferenceOutputAssembly="false" /> is the idiomatic MSBuild pattern for declaring a build-order dependency without adding a runtime assembly reference. This is the right technique.

Summary: ✅ LGTM. A single-line, well-scoped change that uses the correct MSBuild pattern to establish a build dependency. The referenced project (crossgen2_inbuild.csproj) exists at the expected relative path. No correctness, performance, or compatibility concerns.


Detailed Findings

✅ Build Dependency Pattern — Correct usage

The ReferenceOutputAssembly="false" attribute ensures this is purely a build-order dependency. The crossgen2 output won't be added to the test project's references or copied to its output directory — it just guarantees crossgen2 is built first. This is consistent with how the test project already consumes crossgen2 via the R2RTest.Crossgen2Dir runtime configuration option pointing to $(RuntimeBinDir)/$(BuildArchitecture)/crossgen2.

✅ File existence verified

src/coreclr/tools/aot/crossgen2/crossgen2_inbuild.csproj exists at the expected relative path from the test project.

Generated by Code Review for issue #128414 · ● 1.5M ·

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

Labels

area-crossgen2-coreclr only use for closed issues

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants