Skip to content

Avoid shared-file races in parallel CoreCLR builds - #132920

Open
EgorBo wants to merge 1 commit into
dotnet:mainfrom
EgorBo:fix-parallel-coreclr-builds
Open

Avoid shared-file races in parallel CoreCLR builds#132920
EgorBo wants to merge 1 commit into
dotnet:mainfrom
EgorBo:fix-parallel-coreclr-builds

Conversation

@EgorBo

@EgorBo EgorBo commented Aug 29, 2026

Copy link
Copy Markdown
Member

When I build multiple dotnet/runtime repos on the same windows machine at the same time I quite often run into build failures.

Avoid cross-checkout file contention in Windows CoreCLR builds:

  • capture Python discovery output without %TEMP%\pythonlocation.txt
  • copy MSVC PGO databases into each build tree before linking

Validated with a Release clr.runtime build and two concurrent isolated Release JIT builds.

Addresses #45423 and #46018.

Note

This PR description was generated by GitHub Copilot.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 2174abe4-e659-4c3b-b004-ca86e91f14da
Copilot AI lite review requested due to automatic review settings August 29, 2026 16:02
@github-actions github-actions Bot added the area-Infrastructure-coreclr Only use for closed issues label Aug 29, 2026
@azure-pipelines

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

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.

🟡 Changes recommended

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

This PR reduces cross-checkout build contention on Windows by removing shared-temp-file usage during Python discovery and by making PGO database inputs build-local to avoid sharing violations during concurrent CoreCLR builds.

Changes:

  • Replace %TEMP%\pythonlocation.txt-based Python discovery in run.cmd and build-runtime.cmd with in-process capture via for /f.
  • Update CoreCLR PGO support to copy MSVC PGO database files into the build tree before linking, avoiding shared-file access across parallel builds.
File summaries
File Description
src/tests/run.cmd Avoids writing a shared temp file when discovering Python for test runs.
src/coreclr/build-runtime.cmd Avoids writing a shared temp file when discovering Python for CoreCLR builds.
src/coreclr/pgosupport.cmake Copies PGO database inputs into the build output tree to avoid Windows sharing violations during linking.
Review details
  • Files reviewed: 3/3 changed files
  • Comments generated: 2
  • Review effort level: Lite

Comment thread src/tests/run.cmd
Comment thread src/coreclr/build-runtime.cmd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-Infrastructure-coreclr Only use for closed issues

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants