You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Replace deprecated wmic with MSBuild parallelism properties (#122386)
`wmic` is deprecated and missing on newer Windows builds. The build
scripts used it to detect processor cores for CL parallelism tuning via
`CL_MPCount`.
**Changes:**
- Remove `wmic cpu get NumberOfCores` detection from
`src/coreclr/build-runtime.cmd` and `src/tests/build.cmd`
- Remove `CL_MPCount` property from `src/coreclr/Directory.Build.props`
- Add MSBuild properties in root `Directory.Build.props` to control
build parallelism:
- `UseMultiToolTask=true`
- `EnforceProcessCountAcrossBuilds=true`
- `EnableClServerMode=true`
The MSBuild properties are set globally in the root
Directory.Build.props file (in a separate PropertyGroup right after the
Arcade SDK import) so they apply to all projects in the repository.
This follows Microsoft's [recommended
approach](https://devblogs.microsoft.com/cppblog/cpp-build-throughput-investigation-and-tune-up/#3.-tune-build-options-for-better-parallelism)
for C++ build parallelism on modern systems.
<!-- START COPILOT ORIGINAL PROMPT -->
<details>
<summary>Original prompt</summary>
>
> ----
>
> *This section details on the original issue you should resolve*
>
> <issue_title>wmic deprecated/missing on newer builds of
windows</issue_title>
> <issue_description>We should find an alternative
>
>
https://github.com/dotnet/runtime/blob/ac764af3e2d77aa582dff3511295ee701b831a7d/src/coreclr/build-runtime.cmd#L276
>
>
https://learn.microsoft.com/en-us/windows/win32/wmisdk/wmic</issue_description>
>
> ## Comments on the Issue (you are @copilot in this section)
>
> <comments>
> <comment_new><author>@jkotas</author><body>
> This was introduced by
ac172ef
.
>
> Is this workaround for a buggy parallelism still
needed?</body></comment_new>
> <comment_new><author>@akoeplinger</author><body>
>
https://github.com/dotnet/runtime/blob/8dbca2cd19e608d45f13b8f193299dd2fe52d3b3/src/tests/build.cmd#L277
is another instance</body></comment_new>
> <comment_new><author>@akoeplinger</author><body>
> Judging from
https://devblogs.microsoft.com/cppblog/cpp-build-throughput-investigation-and-tune-up/#3.-tune-build-options-for-better-parallelism.
I think we can just use:
>
> ```
> set UseMultiToolTask=true
> set EnforceProcessCountAcrossBuilds=true
> set EnableClServerMode=true
> ```
>
> instead of setting NumberOfCores
>
> this means we can also stop setting CL_MPCount in
src/coreclr/Directory.Build.props which was being set to
NumberOfCores</body></comment_new>
> </comments>
>
</details>
<!-- START COPILOT CODING AGENT SUFFIX -->
- Fixes#118223
<!-- START COPILOT CODING AGENT TIPS -->
---
💬 We'd love your input! Share your thoughts on Copilot coding agent in
our [2 minute survey](https://gh.io/copilot-coding-agent-survey).
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: akoeplinger <1376924+akoeplinger@users.noreply.github.com>
Co-authored-by: Jan Kotas <jkotas@microsoft.com>
0 commit comments