Skip to content

Only use architecture of first CPU#346

Open
thatcomputerguy0101 wants to merge 1 commit into
node-gradle:mainfrom
thatcomputerguy0101:patch-1
Open

Only use architecture of first CPU#346
thatcomputerguy0101 wants to merge 1 commit into
node-gradle:mainfrom
thatcomputerguy0101:patch-1

Conversation

@thatcomputerguy0101
Copy link
Copy Markdown

Some VMs expose multiple cores as multiple CPUs, which breaks the current check for architecture type. This isolates the first CPU, fixing the incompatibility.

@thatcomputerguy0101
Copy link
Copy Markdown
Author

We just saw those same CI errors. Apparently, PNPM auto-updated to 11, which requires manual approval for post-install scripts.

@deepy
Copy link
Copy Markdown
Member

deepy commented May 12, 2026

I've disabled the fail-fast so the test result should show up again, most of the pnpm ones will fail but this way we can at least tell if the windows ones are ok
Could you rebase on main and push the new change?

Some VMs expose multiple cores as multiple CPUs, which breaks the current check for architecture type. This isolates the first CPU, fixing the incompatibility.
@deepy
Copy link
Copy Markdown
Member

deepy commented May 26, 2026

Sorry it's taken me a while to get ahold of a windows computer to test it out on
But unfortunately this setup looks like it breaks for a single CPU setup, where Get-WmiObject Win32_Processor returns a value directly but not an array/list

But I think replacing [0] with Select-Object -First 1 might work

@thatcomputerguy0101
Copy link
Copy Markdown
Author

Using .Architecture[0] also worked for me, so that is another thing to try.

@thatcomputerguy0101
Copy link
Copy Markdown
Author

Select-Object worked for me. Also, if I enter (12)[0] into PowerShell, I get back 12, so I'm a little confused why array syntax is causing problems.

@thatcomputerguy0101
Copy link
Copy Markdown
Author

thatcomputerguy0101 commented May 26, 2026

Actually, if the incoming data is a structure, [0] seems to behave differently than if it is a number. So either of these will probably work:

(Get-WmiObject Win32_Processor | Select-Object -First 1).Architecture

or

(Get-WmiObject Win32_Processor).Architecture[0]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants