mirror of
https://github.com/oven-sh/setup-bun.git
synced 2026-05-20 07:10:13 +02:00
feat: add AVX2 support detection for x64 Linux systems (#167)
This commit is contained in:
+2
-2
File diff suppressed because one or more lines are too long
+35
-35
File diff suppressed because one or more lines are too long
@@ -98,6 +98,18 @@ export function getAvx2(
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Check AVX2 support on x64 Linux
|
||||||
|
if (os === "linux" && arch === "x64" && avx2 === undefined) {
|
||||||
|
try {
|
||||||
|
const cpuInfo = readFileSync("/proc/cpuinfo", "utf8");
|
||||||
|
const hasAvx2 = cpuInfo.includes("avx2");
|
||||||
|
return hasAvx2;
|
||||||
|
} catch (error) {
|
||||||
|
warning(`Failed to detect AVX2 support.`);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return avx2 ?? true;
|
return avx2 ?? true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user