mirror of
https://github.com/oven-sh/bun
synced 2026-02-02 15:08:46 +00:00
cmake: Fix cross-compiling zig on alpine (#15400)
Co-authored-by: Electroid <Electroid@users.noreply.github.com>
This commit is contained in:
@@ -307,14 +307,16 @@ function getPipeline(options) {
|
||||
const getZigAgent = platform => {
|
||||
const { arch } = platform;
|
||||
const instanceType = arch === "aarch64" ? "c8g.large" : "c7i.large";
|
||||
const zigPlatform = {
|
||||
return {
|
||||
robobun: true,
|
||||
robobun2: true,
|
||||
os: "linux",
|
||||
arch,
|
||||
abi: "musl",
|
||||
distro: "alpine",
|
||||
release: "3.20"
|
||||
distro: "debian",
|
||||
release: "11",
|
||||
"image-name": `linux-${arch}-debian-11-v5`, // v5 is not on main yet
|
||||
"instance-type": instanceType,
|
||||
};
|
||||
return getEmphemeralAgent("v2", zigPlatform, instanceType);
|
||||
// TODO: Temporarily disable due to configuration
|
||||
// return {
|
||||
// queue: "build-zig",
|
||||
|
||||
@@ -136,16 +136,6 @@ else()
|
||||
set(WARNING WARNING)
|
||||
endif()
|
||||
|
||||
if(LINUX)
|
||||
if(EXISTS "/etc/alpine-release")
|
||||
set(DEFAULT_ABI "musl")
|
||||
else()
|
||||
set(DEFAULT_ABI "gnu")
|
||||
endif()
|
||||
|
||||
optionx(ABI "musl|gnu" "The ABI to use (e.g. musl, gnu)" DEFAULT ${DEFAULT_ABI})
|
||||
endif()
|
||||
|
||||
# TODO: This causes flaky zig builds in CI, so temporarily disable it.
|
||||
# if(CI)
|
||||
# set(DEFAULT_VENDOR_PATH ${CACHE_PATH}/vendor)
|
||||
|
||||
@@ -48,6 +48,16 @@ else()
|
||||
message(FATAL_ERROR "Unsupported architecture: ${CMAKE_SYSTEM_PROCESSOR}")
|
||||
endif()
|
||||
|
||||
if(LINUX)
|
||||
if(EXISTS "/etc/alpine-release")
|
||||
set(DEFAULT_ABI "musl")
|
||||
else()
|
||||
set(DEFAULT_ABI "gnu")
|
||||
endif()
|
||||
|
||||
optionx(ABI "musl|gnu" "The ABI to use (e.g. musl, gnu)" DEFAULT ${DEFAULT_ABI})
|
||||
endif()
|
||||
|
||||
if(ARCH STREQUAL "x64")
|
||||
optionx(ENABLE_BASELINE BOOL "If baseline features should be used for older CPUs (e.g. disables AVX, AVX2)" DEFAULT OFF)
|
||||
endif()
|
||||
|
||||
@@ -1163,7 +1163,7 @@ if(NOT BUN_CPP_ONLY)
|
||||
|
||||
if(CI)
|
||||
set(bunTriplet bun-${OS}-${ARCH})
|
||||
if(ABI STREQUAL "musl")
|
||||
if(LINUX AND ABI STREQUAL "musl")
|
||||
set(bunTriplet ${bunTriplet}-musl)
|
||||
endif()
|
||||
if(ENABLE_BASELINE)
|
||||
|
||||
@@ -4,7 +4,7 @@ if(NOT ENABLE_LLVM)
|
||||
return()
|
||||
endif()
|
||||
|
||||
if(CMAKE_HOST_WIN32 OR CMAKE_HOST_APPLE OR ABI STREQUAL "musl")
|
||||
if(CMAKE_HOST_WIN32 OR CMAKE_HOST_APPLE OR EXISTS "/etc/alpine-release")
|
||||
set(DEFAULT_LLVM_VERSION "18.1.8")
|
||||
else()
|
||||
set(DEFAULT_LLVM_VERSION "16.0.6")
|
||||
|
||||
@@ -63,7 +63,7 @@ else()
|
||||
message(FATAL_ERROR "Unsupported architecture: ${CMAKE_SYSTEM_PROCESSOR}")
|
||||
endif()
|
||||
|
||||
if(ABI STREQUAL "musl")
|
||||
if(LINUX AND ABI STREQUAL "musl")
|
||||
set(WEBKIT_SUFFIX "-musl")
|
||||
endif()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user