mirror of
https://codeberg.org/ziglang/zig.git
synced 2025-12-06 05:44:20 +00:00
build: adjust max_rss on a per-CI-host basis
This avoids pessimizing concurrency on all machines due to e.g. the macOS machine having high memory usage across the board due to 16K page size.
This commit is contained in:
parent
e2e64fd9c4
commit
fa0b57202c
2 changed files with 116 additions and 5 deletions
|
|
@ -5,6 +5,7 @@ on:
|
|||
push:
|
||||
branches:
|
||||
- master
|
||||
- max-rss-tuning
|
||||
workflow_dispatch:
|
||||
|
||||
concurrency:
|
||||
|
|
|
|||
120
build.zig
120
build.zig
|
|
@ -459,8 +459,29 @@ pub fn build(b: *std.Build) !void {
|
|||
.skip_linux = skip_linux,
|
||||
.skip_llvm = skip_llvm,
|
||||
.skip_libc = skip_libc,
|
||||
// 3888779264 was observed on an x86_64-linux-gnu host.
|
||||
.max_rss = 4000000000,
|
||||
.max_rss = switch (b.graph.host.result.os.tag) {
|
||||
.freebsd => switch (b.graph.host.result.cpu.arch) {
|
||||
.x86_64 => 1, // TODO
|
||||
else => 0,
|
||||
},
|
||||
.linux => switch (b.graph.host.result.cpu.arch) {
|
||||
.aarch64 => 659809075,
|
||||
.loongarch64 => 598902374,
|
||||
.riscv64 => 1, // TODO
|
||||
.s390x => 580596121,
|
||||
.x86_64 => 3290894745,
|
||||
else => 0,
|
||||
},
|
||||
.macos => switch (b.graph.host.result.cpu.arch) {
|
||||
.aarch64 => 767736217,
|
||||
else => 0,
|
||||
},
|
||||
.windows => switch (b.graph.host.result.cpu.arch) {
|
||||
.x86_64 => 603070054,
|
||||
else => 0,
|
||||
},
|
||||
else => 0,
|
||||
},
|
||||
}));
|
||||
|
||||
test_modules_step.dependOn(tests.addModuleTests(b, .{
|
||||
|
|
@ -483,6 +504,29 @@ pub fn build(b: *std.Build) !void {
|
|||
.skip_llvm = skip_llvm,
|
||||
.skip_libc = true,
|
||||
.no_builtin = true,
|
||||
.max_rss = switch (b.graph.host.result.os.tag) {
|
||||
.freebsd => switch (b.graph.host.result.cpu.arch) {
|
||||
.x86_64 => 1, // TODO
|
||||
else => 0,
|
||||
},
|
||||
.linux => switch (b.graph.host.result.cpu.arch) {
|
||||
.aarch64 => 639565414,
|
||||
.loongarch64 => 598884352,
|
||||
.riscv64 => 1, // TODO
|
||||
.s390x => 574166630,
|
||||
.x86_64 => 764861644,
|
||||
else => 0,
|
||||
},
|
||||
.macos => switch (b.graph.host.result.cpu.arch) {
|
||||
.aarch64 => 701413785,
|
||||
else => 0,
|
||||
},
|
||||
.windows => switch (b.graph.host.result.cpu.arch) {
|
||||
.x86_64 => 536414208,
|
||||
else => 0,
|
||||
},
|
||||
else => 0,
|
||||
},
|
||||
}));
|
||||
|
||||
test_modules_step.dependOn(tests.addModuleTests(b, .{
|
||||
|
|
@ -505,6 +549,29 @@ pub fn build(b: *std.Build) !void {
|
|||
.skip_llvm = skip_llvm,
|
||||
.skip_libc = true,
|
||||
.no_builtin = true,
|
||||
.max_rss = switch (b.graph.host.result.os.tag) {
|
||||
.freebsd => switch (b.graph.host.result.cpu.arch) {
|
||||
.x86_64 => 1, // TODO
|
||||
else => 0,
|
||||
},
|
||||
.linux => switch (b.graph.host.result.cpu.arch) {
|
||||
.aarch64 => 615302758,
|
||||
.loongarch64 => 598974464,
|
||||
.riscv64 => 1, // TODO
|
||||
.s390x => 395555635,
|
||||
.x86_64 => 528128409,
|
||||
else => 0,
|
||||
},
|
||||
.macos => switch (b.graph.host.result.cpu.arch) {
|
||||
.aarch64 => 451389030,
|
||||
else => 0,
|
||||
},
|
||||
.windows => switch (b.graph.host.result.cpu.arch) {
|
||||
.x86_64 => 317852057,
|
||||
else => 0,
|
||||
},
|
||||
else => 0,
|
||||
},
|
||||
}));
|
||||
|
||||
test_modules_step.dependOn(tests.addModuleTests(b, .{
|
||||
|
|
@ -526,8 +593,29 @@ pub fn build(b: *std.Build) !void {
|
|||
.skip_linux = skip_linux,
|
||||
.skip_llvm = skip_llvm,
|
||||
.skip_libc = skip_libc,
|
||||
// I observed a value of 5605064704 on the M2 CI.
|
||||
.max_rss = 6165571174,
|
||||
.max_rss = switch (b.graph.host.result.os.tag) {
|
||||
.freebsd => switch (b.graph.host.result.cpu.arch) {
|
||||
.x86_64 => 1, // TODO
|
||||
else => 0,
|
||||
},
|
||||
.linux => switch (b.graph.host.result.cpu.arch) {
|
||||
.aarch64 => 6732817203,
|
||||
.loongarch64 => 3216349593,
|
||||
.riscv64 => 1, // TODO
|
||||
.s390x => 3652514201,
|
||||
.x86_64 => 5554053120,
|
||||
else => 0,
|
||||
},
|
||||
.macos => switch (b.graph.host.result.cpu.arch) {
|
||||
.aarch64 => 8273795481,
|
||||
else => 0,
|
||||
},
|
||||
.windows => switch (b.graph.host.result.cpu.arch) {
|
||||
.x86_64 => 3750236160,
|
||||
else => 0,
|
||||
},
|
||||
else => 0,
|
||||
},
|
||||
}));
|
||||
|
||||
const unit_tests_step = b.step("test-unit", "Run the compiler source unit tests");
|
||||
|
|
@ -721,7 +809,29 @@ fn addCompilerMod(b: *std.Build, options: AddCompilerModOptions) *std.Build.Modu
|
|||
fn addCompilerStep(b: *std.Build, options: AddCompilerModOptions) *std.Build.Step.Compile {
|
||||
const exe = b.addExecutable(.{
|
||||
.name = "zig",
|
||||
.max_rss = 7_800_000_000,
|
||||
.max_rss = switch (b.graph.host.result.os.tag) {
|
||||
.freebsd => switch (b.graph.host.result.cpu.arch) {
|
||||
.x86_64 => 1, // TODO
|
||||
else => 0,
|
||||
},
|
||||
.linux => switch (b.graph.host.result.cpu.arch) {
|
||||
.aarch64 => 6240805683,
|
||||
.loongarch64 => 5024158515,
|
||||
.riscv64 => 1, // TODO
|
||||
.s390x => 4997174476,
|
||||
.x86_64 => 5486090649,
|
||||
else => 0,
|
||||
},
|
||||
.macos => switch (b.graph.host.result.cpu.arch) {
|
||||
.aarch64 => 6639145779,
|
||||
else => 0,
|
||||
},
|
||||
.windows => switch (b.graph.host.result.cpu.arch) {
|
||||
.x86_64 => 5770394009,
|
||||
else => 0,
|
||||
},
|
||||
else => 0,
|
||||
},
|
||||
.root_module = addCompilerMod(b, options),
|
||||
});
|
||||
exe.stack_size = stack_size;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue