This commit is contained in:
Jozef Steinhübl 2025-07-10 18:46:30 +00:00 committed by GitHub
commit 01e0111da4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 81 additions and 47 deletions

View file

@ -50,6 +50,7 @@ jobs:
- ubuntu-latest - ubuntu-latest
- macos-latest - macos-latest
- windows-latest - windows-latest
- windows-11-arm
bun-version: bun-version:
- latest - latest
- canary - canary
@ -88,6 +89,7 @@ jobs:
- ubuntu-latest - ubuntu-latest
- macos-latest - macos-latest
- windows-latest - windows-latest
- windows-11-arm
file: file:
- name: package.json (bun@1.1.0) - name: package.json (bun@1.1.0)

91
dist/setup/index.js generated vendored

File diff suppressed because one or more lines are too long

View file

@ -155,6 +155,33 @@ function isCacheEnabled(options: Input): boolean {
return isFeatureAvailable(); return isFeatureAvailable();
} }
function getEffectiveArch(os: string, arch: string): string {
// Temporary workaround for absence of arm64 builds on Windows (#130)
if (os === "win32" && arch === "arm64") {
warning(
[
"⚠️ Bun does not provide native arm64 builds for Windows.",
"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"),
);
return "x64";
}
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 { function getDownloadUrl(options: Input): string {
const { customUrl } = options; const { customUrl } = options;
if (customUrl) { if (customUrl) {
@ -163,8 +190,12 @@ function getDownloadUrl(options: Input): string {
const { version, os, arch, avx2, profile } = options; const { version, os, arch, avx2, profile } = options;
const eversion = encodeURIComponent(version ?? "latest"); const eversion = encodeURIComponent(version ?? "latest");
const eos = encodeURIComponent(os ?? process.platform); const eos = encodeURIComponent(os ?? process.platform);
const earch = encodeURIComponent(arch ?? process.arch); const earch = encodeURIComponent(
const eavx2 = encodeURIComponent(avx2 ?? true); getEffectiveArch(os ?? process.platform, arch ?? process.arch),
);
const eavx2 = encodeURIComponent(
getEffectiveAvx2(os ?? process.platform, arch ?? process.arch, avx2),
);
const eprofile = encodeURIComponent(profile ?? false); const eprofile = encodeURIComponent(profile ?? false);
const { href } = new URL( const { href } = new URL(
`${eversion}/${eos}/${earch}?avx2=${eavx2}&profile=${eprofile}`, `${eversion}/${eos}/${earch}?avx2=${eavx2}&profile=${eprofile}`,