Skip to content

Commit

Permalink
Update platform.ts to fix isWindowsAVX2 implementation. (#10313)
Browse files Browse the repository at this point in the history
The isWindowsAVX2 function is not working as expected due to the stdout endwith `\r\n`. So the simple `stdout == "True"` will never true.
  • Loading branch information
liudonghua123 authored Apr 17, 2024
1 parent fdaa012 commit 51bb5f3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/bun-release/src/platform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ function isWindowsAVX2(): boolean {
spawn("powershell", [
"-c",
`(Add-Type -MemberDefinition '[DllImport("kernel32.dll")] public static extern bool IsProcessorFeaturePresent(int ProcessorFeature);' -Name 'Kernel32' -Namespace 'Win32' -PassThru)::IsProcessorFeaturePresent(40);`,
]).stdout == "True"
]).stdout.trim() === "True"
);
} catch (error) {
debug("isWindowsAVX2 failed", error);
Expand Down

0 comments on commit 51bb5f3

Please sign in to comment.