Problem
The crossgen2 binary shipped in microsoft.netcore.app.crossgen2 nuget package is not the binary we are testing in CI.
Details
We publish crossgen2 as a NativeAOT app on AOT supported platforms and as a SingleFile app on $other platforms.
e.g. microsoft.netcore.app.crossgen2.osx-arm64 nuget package v8.0.0-alpha.1.22605.1 has AOT'd crossgen2 executable under tools/ directory.
With build clr+libs followed by src/tests/build, the non-published (non-AOT, non-SingleFile) variant is copied at artifacts/tests/coreclr/<rid>.<configuration>/Tests/Core_Root/crossgen2/crossgen2 which we use in test runs.
With build clr+libs+packs followed by src/tests/build, both non-published and published variants are copied in artifacts/tests/coreclr/<rid>.<configuration>/Tests/Core_Root/crossgen2 (non-published at ./crossgen2 and published at ./publish/<rid>/crossgen2) and we still use non-published variant during the test runs.
Proposed changes
src/tests/build to always copy published variant of CG2 to artifacts (and publish it anyway if packs subset wasn't built):
artifacts/bin/coreclr/<rid>.<configuration>/crossgen2/<rid>/publish/*.* ->
artifacts/tests/coreclr/<rid>.<configuration>/Tests/Core_Root/crossgen2/ (no need to copy non-published variant)
- test runner and places like R2RTest tool which are spawning
dotnet crossgen2.dll or corerun crossgen2.dll to spawn crossgen2 executable instead
Problem
The crossgen2 binary shipped in
microsoft.netcore.app.crossgen2nuget package is not the binary we are testing in CI.Details
We publish crossgen2 as a NativeAOT app on AOT supported platforms and as a SingleFile app on $other platforms.
e.g.
microsoft.netcore.app.crossgen2.osx-arm64nuget package v8.0.0-alpha.1.22605.1 has AOT'dcrossgen2executable undertools/directory.With
build clr+libsfollowed bysrc/tests/build, the non-published (non-AOT, non-SingleFile) variant is copied atartifacts/tests/coreclr/<rid>.<configuration>/Tests/Core_Root/crossgen2/crossgen2which we use in test runs.With
build clr+libs+packsfollowed bysrc/tests/build, both non-published and published variants are copied inartifacts/tests/coreclr/<rid>.<configuration>/Tests/Core_Root/crossgen2(non-published at./crossgen2and published at./publish/<rid>/crossgen2) and we still use non-published variant during the test runs.Proposed changes
src/tests/buildto always copy published variant of CG2 to artifacts (and publish it anyway ifpackssubset wasn't built):artifacts/bin/coreclr/<rid>.<configuration>/crossgen2/<rid>/publish/*.*->artifacts/tests/coreclr/<rid>.<configuration>/Tests/Core_Root/crossgen2/(no need to copy non-published variant)dotnet crossgen2.dllorcorerun crossgen2.dllto spawncrossgen2executable instead