RFR: 8355249: Remove the use of WMIC from the entire source code [v2]
Magnus Ihse Bursie
ihse at openjdk.org
Mon Apr 28 20:10:49 UTC 2025
On Tue, 22 Apr 2025 07:41:43 GMT, Daishi Tabata <duke at openjdk.org> wrote:
>> After searching the entire JDK source code, I found that WMIC is only used in four files. These WMIC calls can be replaced with PowerShell for WMI.
>>
>> The primary challenge in this replacement is to make it work the same as before, even if the output format of the PowerShell command is different from the original WMIC output. Where necessary, I've adjusted the output formatting to maintain consistency.
>>
>> Regarding the PowerShell options `-NoLogo`, `-NoProfile`, and `-NonInteractive`, I've included them only when they are already used in the surrounding code within the affected file.
>> Note: In my environment, it worked correctly even without these options.
>>
>> The `failure_handler` outputs powershell command execution results directly into HTML. While the number and order of output items may differ slightly after the modification, all previously output items are still included. Therefore, I believe this is not a problem. Specific output changes are located in:
>>
>> - `environment.html`: `windows/system/os` section
>> - `process.html`: `[Process ID]/windows/native/info` section
>>
>> **Testing:**
>> I have confirmed that all tests in `jdk/tools/jpackage` pass after these changes.
>
> Daishi Tabata has updated the pull request incrementally with one additional commit since the last revision:
>
> run jcheck
make/autoconf/build-performance.m4 line 78:
> 76: elif test "x$OPENJDK_BUILD_OS" = xwindows; then
> 77: # Windows, but without cygwin
> 78: MEMORY_SIZE=`powershell -Command \
We should actually lookup the path of powershell and refer to it as `$POWERSHELL` instead of hard-coding it like this. But I see that the entire BPERF_CHECK_MEMORY_SIZE calls unverified tools on all platforms, and this is not a regression, so I'll let this slip for now.
Are we sure powershell is always installed on Windows?
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/24791#discussion_r2064464221
More information about the build-dev
mailing list