Skip to content

Commit 46d157f

Browse files
committed
[build] Increase link parallelism again
Budget fewer CPU resources for link actions since lld generally can't sustain the full level of parallelism requested for long in practice. This is also helpful since the tag is also applied when compiling the main C++ file of the given test, which shouldn't need more than one CPU – unfortunately we can't set that directly.
1 parent c61cc1a commit 46d157f

6 files changed

Lines changed: 12 additions & 12 deletions

File tree

‎build/kj_test.bzl‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ def kj_test(
2626
] + deps,
2727
linkstatic = CC_TEST_LINKSTATIC,
2828
data = data,
29-
# Tag with cpu:4 since this target depends on linkopts_default.
30-
tags = tags + ["cpu:4"],
29+
# Tag with cpu:2 since this target depends on linkopts_default.
30+
tags = tags + ["cpu:2"],
3131
target_compatible_with = select({
3232
"@//build/config:no_build": ["@platforms//:incompatible"],
3333
"//conditions:default": [],

‎build/wd_cc_benchmark.bzl‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ def wd_cc_benchmark(
2727
],
2828
# use the same malloc we use for server
2929
malloc = "//src/workerd/server:malloc",
30-
# Tag with cpu:4 since this target depends on linkopts_default.
31-
tags = ["workerd-benchmark", "google_benchmark", "cpu:4"] + tags,
30+
# Tag with cpu:2 since this target depends on linkopts_default.
31+
tags = ["workerd-benchmark", "google_benchmark", "cpu:2"] + tags,
3232
size = "large",
3333
**kwargs
3434
)

‎build/wd_cc_binary.bzl‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ def wd_cc_binary(
1818
"//conditions:default": [],
1919
}) + target_compatible_with,
2020
visibility = visibility,
21-
# Tag with cpu:8 since this target depends on linkopts_tool.
22-
tags = tags + ["cpu:8"],
21+
# Tag with cpu:4 since this target depends on linkopts_tool.
22+
tags = tags + ["cpu:4"],
2323
deps = deps + ["//build/deps:linkopts_tool"],
2424
**kwargs
2525
)

‎build/wd_rust_binary.bzl‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ def wd_rust_binary(
127127
experimental_use_cc_common_link = 1,
128128
proc_macro_deps = proc_macro_deps,
129129
# linkopts_tool links with full optimization, so it is given more CPUs.
130-
tags = tags + ["cpu:8" if tool else "cpu:4"],
130+
tags = tags + ["cpu:4" if tool else "cpu:2"],
131131
target_compatible_with = select({
132132
"@//build/config:no_build": ["@platforms//:incompatible"],
133133
"//conditions:default": [],
@@ -169,6 +169,6 @@ def wd_rust_binary(
169169
experimental_use_cc_common_link = 1,
170170
link_deps = ["//build/deps:linkopts_default", "@@//deps:rust_runtime"],
171171
size = test_size,
172-
# Tag with cpu:4 since this target depends on linkopts_default.
173-
tags = ["no-coverage", "cpu:4"],
172+
# Tag with cpu:2 since this target depends on linkopts_default.
173+
tags = ["no-coverage", "cpu:2"],
174174
)

‎build/wd_rust_proc_macro.bzl‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ def wd_rust_proc_macro(
4646
"RUST_TEST_THREADS": "1",
4747
} | test_env,
4848
experimental_use_cc_common_link = 1,
49-
# Tag with cpu:4 since this target depends on linkopts_default.
50-
tags = test_tags + ["no-coverage", "cpu:4"],
49+
# Tag with cpu:2 since this target depends on linkopts_default.
50+
tags = test_tags + ["no-coverage", "cpu:2"],
5151
deps = test_deps,
5252
link_deps = ["@@//deps:rust_runtime", "//build/deps:linkopts_default"],
5353
target_compatible_with = select({

‎build/wd_rust_test.bzl‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def wd_rust_test(
2323
],
2424
malloc = "//src/workerd/server:malloc",
2525
# linkopts_default limits linker parallelism to avoid resource exhaustion.
26-
tags = tags + ["no-coverage", "cpu:4"],
26+
tags = tags + ["no-coverage", "cpu:2"],
2727
target_compatible_with = select({
2828
"@//build/config:no_build": ["@platforms//:incompatible"],
2929
"//conditions:default": [],

0 commit comments

Comments
 (0)