mirror of
https://github.com/oven-sh/setup-bun.git
synced 2025-07-17 20:18:24 +02:00
feat: force baseline for win32 arm fallback to x64
This commit is contained in:
parent
e006d01d6a
commit
6edb297001
1 changed files with 13 additions and 5 deletions
|
@ -161,7 +161,7 @@ function getEffectiveArch(os: string, arch: string): string {
|
|||
warning(
|
||||
[
|
||||
"⚠️ Bun does not provide native arm64 builds for Windows.",
|
||||
"Using x64 build which will run through Microsoft's x64 emulation layer.",
|
||||
"Using x64-baseline build which will run through Microsoft's x64 emulation layer.",
|
||||
"This may result in reduced performance and potential compatibility issues.",
|
||||
"💡 For best performance, consider using x64 Windows runners or other platforms with native support.",
|
||||
].join("\n"),
|
||||
|
@ -173,6 +173,15 @@ function getEffectiveArch(os: string, arch: string): string {
|
|||
return arch;
|
||||
}
|
||||
|
||||
function getEffectiveAvx2(os: string, arch: string, avx2?: boolean): boolean {
|
||||
// Temporary workaround for absence of arm64 builds on Windows (#130)
|
||||
if (os === "win32" && arch === "arm64") {
|
||||
return false;
|
||||
}
|
||||
|
||||
return avx2 ?? true;
|
||||
}
|
||||
|
||||
function getDownloadUrl(options: Input): string {
|
||||
const { customUrl } = options;
|
||||
if (customUrl) {
|
||||
|
@ -184,7 +193,9 @@ function getDownloadUrl(options: Input): string {
|
|||
const earch = encodeURIComponent(
|
||||
getEffectiveArch(os ?? process.platform, arch ?? process.arch),
|
||||
);
|
||||
const eavx2 = encodeURIComponent(avx2 ?? true);
|
||||
const eavx2 = encodeURIComponent(
|
||||
getEffectiveAvx2(os ?? process.platform, arch ?? process.arch, avx2),
|
||||
);
|
||||
const eprofile = encodeURIComponent(profile ?? false);
|
||||
const { href } = new URL(
|
||||
`${eversion}/${eos}/${earch}?avx2=${eavx2}&profile=${eprofile}`,
|
||||
|
@ -217,9 +228,6 @@ async function getRevision(exe: string): Promise<string | undefined> {
|
|||
const revision = await getExecOutput(exe, ["--revision"], {
|
||||
ignoreReturnCode: true,
|
||||
});
|
||||
console.log(revision.stdout);
|
||||
console.log(revision.stderr);
|
||||
console.log(revision.exitCode);
|
||||
if (revision.exitCode === 0 && /^\d+\.\d+\.\d+/.test(revision.stdout)) {
|
||||
return revision.stdout.trim();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue