Skip to content

Use eng\common\dotnet.cmd instead of .\dotnet.cmd in crossgen2 comparison legs#131007

Draft
jtschuster wants to merge 1 commit into
dotnet:mainfrom
jtschuster:fix-crossgen2-dotnet-race
Draft

Use eng\common\dotnet.cmd instead of .\dotnet.cmd in crossgen2 comparison legs#131007
jtschuster wants to merge 1 commit into
dotnet:mainfrom
jtschuster:fix-crossgen2-dotnet-race

Conversation

@jtschuster

Copy link
Copy Markdown
Member

dotnet.cmd unconditionally calls InitializeDotnetCLI $true $true which locks sdk.txt for a short period during startup. Later in the batch file, sdk.txt is read. In crossgen2 comparison jobs, over 200 parallel invocations happen at once, so occasionally sdk.txt is locked when trying to read, and the eventual call to the dotnet cli fails.

Instead, use .\eng\common\dotnet.ps1 to invoke the cli, which doesn't touch sdk.txt.

Fixes #131004
Fixes #131005

@jtschuster jtschuster self-assigned this Jul 18, 2026
Copilot AI review requested due to automatic review settings July 18, 2026 01:04
@github-actions github-actions Bot added the area-crossgen2-coreclr only use for closed issues label Jul 18, 2026
@jtschuster jtschuster added area-ReadyToRun and removed area-crossgen2-coreclr only use for closed issues labels Jul 18, 2026
@jtschuster

Copy link
Copy Markdown
Member Author

/azp run runtime-coreclr crossgen2 outerloop

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 4 pipeline(s).
12 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 crossgen2 comparison build job to avoid using the repo-root dotnet.cmd wrapper in Windows comparison runs, reducing contention around artifacts/toolset/sdk.txt when many parallel dotnet invocations occur.

Changes:

  • Removed the “pre-initialize dotnet CLI” step that existed to mitigate parallel dotnet.cmd races.
  • Switched the Windows --dotnet argument passed to crossgen2_comparison.py from $(Build.SourcesDirectory)\dotnet.cmd to $(Build.SourcesDirectory)\eng\common\dotnet.cmd.

Comment on lines 141 to 144
crossgen_framework
--crossgen $(crossgen2location)
--dotnet $(Build.SourcesDirectory)\dotnet.cmd
--dotnet $(Build.SourcesDirectory)\eng\common\dotnet.cmd
--core_root $(workItemDirectory)\dlls
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

Crossgen2 comparison mismatch: System.IO.FileSystem.DriveInfo Crossgen2 comparison mismatch: Microsoft.Bcl.AsyncInterfaces

2 participants