Skip to content

Commit c130d1b

Browse files
authored
ci: Switch build-zig to use EC2 (#19487)
1 parent cc33a85 commit c130d1b

File tree

2 files changed

+28
-4
lines changed

2 files changed

+28
-4
lines changed

.buildkite/ci.mjs

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -323,9 +323,26 @@ function getCppAgent(platform, options) {
323323
function getZigAgent(platform, options) {
324324
const { arch } = platform;
325325

326-
return {
327-
queue: "build-zig",
328-
};
326+
// Uncomment to restore to using macOS on-prem for Zig.
327+
// return {
328+
// queue: "build-zig",
329+
// };
330+
331+
return getEc2Agent(
332+
{
333+
os: "linux",
334+
arch: "x64",
335+
abi: "musl",
336+
distro: "alpine",
337+
release: "3.21",
338+
},
339+
options,
340+
{
341+
instanceType: "c7i.2xlarge",
342+
cpuCount: 4,
343+
threadsPerCore: 1,
344+
},
345+
);
329346
}
330347

331348
/**

cmake/tools/SetupZig.cmake

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,14 @@ optionx(ZIG_OBJECT_FORMAT "obj|bc" "Output file format for Zig object files" DEF
5454

5555
optionx(ZIG_LOCAL_CACHE_DIR FILEPATH "The path to local the zig cache directory" DEFAULT ${CACHE_PATH}/zig/local)
5656
optionx(ZIG_GLOBAL_CACHE_DIR FILEPATH "The path to the global zig cache directory" DEFAULT ${CACHE_PATH}/zig/global)
57-
optionx(ZIG_COMPILER_SAFE BOOL "Download a ReleaseSafe build of the Zig compiler. Only availble on macos aarch64." DEFAULT ${BUILDKITE})
57+
58+
if(CI AND CMAKE_HOST_APPLE)
59+
set(ZIG_COMPILER_SAFE_DEFAULT ON)
60+
else()
61+
set(ZIG_COMPILER_SAFE_DEFAULT OFF)
62+
endif()
63+
64+
optionx(ZIG_COMPILER_SAFE BOOL "Download a ReleaseSafe build of the Zig compiler. Only availble on macos aarch64." DEFAULT ${ZIG_COMPILER_SAFE_DEFAULT})
5865

5966
setenv(ZIG_LOCAL_CACHE_DIR ${ZIG_LOCAL_CACHE_DIR})
6067
setenv(ZIG_GLOBAL_CACHE_DIR ${ZIG_GLOBAL_CACHE_DIR})

0 commit comments

Comments
 (0)