From 9f1b039a9624bc9bcead8d6838a5062af92c5ae5 Mon Sep 17 00:00:00 2001 From: Alan Everett Date: Sun, 10 May 2026 19:19:34 -0400 Subject: [PATCH 1/2] Only use architecture of first CPU Some VMs expose multiple cores as multiple CPUs, which breaks the current check for architecture type. This isolates the first CPU, fixing the incompatibility. --- src/main/kotlin/com/github/gradle/node/util/PlatformHelper.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/kotlin/com/github/gradle/node/util/PlatformHelper.kt b/src/main/kotlin/com/github/gradle/node/util/PlatformHelper.kt index ad641def..7802d894 100644 --- a/src/main/kotlin/com/github/gradle/node/util/PlatformHelper.kt +++ b/src/main/kotlin/com/github/gradle/node/util/PlatformHelper.kt @@ -96,7 +96,7 @@ fun main(args: Array) { val osType = parseOsType(osName) val uname = { val args = if (osType == OsType.WINDOWS) { - listOf("powershell", "-NoProfile", "-Command", "(Get-WmiObject Win32_Processor).Architecture") + listOf("powershell", "-NoProfile", "-Command", "(Get-WmiObject Win32_Processor)[0].Architecture") } else { listOf("uname", "-m") } From 2ec2ab50c57560ba2f94eb05317c0aaefb1db505 Mon Sep 17 00:00:00 2001 From: Alan Everett Date: Thu, 13 Aug 2026 18:15:45 -0400 Subject: [PATCH 2/2] Use Select-Object instead of array access to be compatible with single-CPU devices --- src/main/kotlin/com/github/gradle/node/util/PlatformHelper.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/kotlin/com/github/gradle/node/util/PlatformHelper.kt b/src/main/kotlin/com/github/gradle/node/util/PlatformHelper.kt index 7802d894..6380cc2a 100644 --- a/src/main/kotlin/com/github/gradle/node/util/PlatformHelper.kt +++ b/src/main/kotlin/com/github/gradle/node/util/PlatformHelper.kt @@ -96,7 +96,7 @@ fun main(args: Array) { val osType = parseOsType(osName) val uname = { val args = if (osType == OsType.WINDOWS) { - listOf("powershell", "-NoProfile", "-Command", "(Get-WmiObject Win32_Processor)[0].Architecture") + listOf("powershell", "-NoProfile", "-Command", "(Get-WmiObject Win32_Processor | Select-Object -First 1).Architecture") } else { listOf("uname", "-m") }