rez icon indicating copy to clipboard operation
rez copied to clipboard

Windows 11 - Missing wmic blocks rez from working

Open Pixel-Minions opened this issue 3 months ago • 4 comments

WMIC is missing in the latest release of Windows 11 24h2. Now it is optional and REZ can't start.

Environment

  • OS Windows 11 24H2
  • Rez version 2.3.1
  • Rez python version 3.11

To Reproduce

  1. Launch rez
  2. It fails

Pixel-Minions avatar Oct 08 '25 16:10 Pixel-Minions

Although it can be enabled from the Windows Settings panel under Optional Features, I've found that to be flakey at best (and there are several reports from others as well).

Downloading the Windows 11 Features on Demand ISO at:

https://learn.microsoft.com/en-us/windows-hardware/manufacture/desktop/features-on-demand-v2--capabilities?view=windows-11

mounting it (say as the E: drive) and then in Powershell:

Add-WindowsCapability -Online -Name WMIC~~~~ -Source "E:\LanguagesAndOptionalFeatures" -LimitAccess

tends to be more reliable and works without an Internet connection.

By it would like be preferable to migrate the code which depends on WMIC to a newer method (assuming that's possible) since WMIC is now deprecated and may not be available for very long.

jfpanisset avatar Oct 08 '25 18:10 jfpanisset

From a quick search in the codebase it seems this is the only call that relies on wmi: https://github.com/AcademySoftwareFoundation/rez/blob/96cd33cfefc254eeb050408011245cd573aece87/src/rez/utils/platform_.py#L517

That said, replacing this on windows might not be as trivial as it seems at first. Getting physical core count can be somewhat tricky on windows unless we'd be using psutil, but that is definitely not a dependency i would like to add to vendoring.

I am not sure where this is used though, from a quick look it seems only for build system configuration? Might have missed something so. Anyone knows?

instinct-vfx avatar Oct 08 '25 20:10 instinct-vfx

Is Powershell an acceptable dependency? If so:

Get-CimInstance -ClassName Win32_Processor | Select-Object NumberOfCores, NumberOfLogicalProcessors

(or some variation thereof) returns the following on a 2 core VM:

NumberOfCores NumberOfLogicalProcessors
------------- -------------------------
            2                         2
            2                         2

jfpanisset avatar Oct 08 '25 22:10 jfpanisset

Good call @jfpanisset . With PowerShell (as opposed to pwsh/PowerShell core) being shipped and still available by default that seems like a good fit, at least as a quick fix.

instinct-vfx avatar Oct 09 '25 08:10 instinct-vfx