Skip to content

Commit 82134dd

Browse files
committed
builds: Enable lld, optimize linking more, faster cargo-test build
1 parent e06911a commit 82134dd

File tree

3 files changed

+13
-34
lines changed

3 files changed

+13
-34
lines changed

.cargo/config

+10-4
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@
1313
# Sync: This target-cpu and list of features should be kept in sync with the ones in ci-builder and
1414
# xcompile.
1515
rustflags = [
16-
"-C",
17-
"link-arg=-Wl,--compress-debug-sections=zlib-gabi",
16+
"-Clink-arg=-Wl,--compress-debug-sections=zlib",
17+
"-Clink-arg=-Wl,-O2",
18+
"-Clink-arg=-fuse-ld=lld",
1819
"-Csymbol-mangling-version=v0",
1920
"-Ctarget-cpu=x86-64-v3",
2021
"-Ctarget-feature=+aes",
@@ -31,8 +32,9 @@ rustflags = [
3132
# xcompile.
3233
[target."aarch64-unknown-linux-gnu"]
3334
rustflags = [
34-
"-C",
35-
"link-arg=-Wl,--compress-debug-sections=zlib-gabi",
35+
"-Clink-arg=-Wl,--compress-debug-sections=zlib",
36+
"-Clink-arg=-Wl,-O2",
37+
"-Clink-arg=-fuse-ld=lld",
3638
"-Csymbol-mangling-version=v0",
3739
"-Ctarget-cpu=neoverse-n1",
3840
"-Ctarget-feature=+aes,+sha2",
@@ -43,3 +45,7 @@ rustflags = [
4345
# Always reserve at least one core so Cargo doesn't pin our CPU
4446
jobs = -1
4547
rustflags = ["--cfg=tokio_unstable"]
48+
49+
[profile.ci]
50+
inherits = "dev"
51+
debug = "line-tables-only"

ci/test/cargo-test/mzcompose.py

+2-30
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
import os
1111

12-
from materialize import MZ_ROOT, buildkite, spawn, ui
12+
from materialize import buildkite, spawn, ui
1313
from materialize.mzcompose.composition import Composition, WorkflowArgumentParser
1414
from materialize.mzcompose.services.cockroach import Cockroach
1515
from materialize.mzcompose.services.kafka import Kafka
@@ -66,25 +66,6 @@ def workflow_default(c: Composition, parser: WorkflowArgumentParser) -> None:
6666
# TODO(def-): For coverage inside of clusterd called from unit tests need
6767
# to set LLVM_PROFILE_FILE in test code invoking clusterd and later
6868
# aggregate the data.
69-
(MZ_ROOT / "coverage").mkdir(exist_ok=True)
70-
env["CARGO_LLVM_COV_SETUP"] = "no"
71-
# There is no pure build command in cargo-llvm-cov, so run with
72-
# --version as a workaround.
73-
spawn.runv(
74-
[
75-
"cargo",
76-
"llvm-cov",
77-
"run",
78-
"--bin",
79-
"clusterd",
80-
"--release",
81-
"--no-report",
82-
"--",
83-
"--version",
84-
],
85-
env=env,
86-
)
87-
8869
cmd = [
8970
"cargo",
9071
"llvm-cov",
@@ -116,16 +97,6 @@ def workflow_default(c: Composition, parser: WorkflowArgumentParser) -> None:
11697
env=env,
11798
)
11899
else:
119-
spawn.runv(
120-
[
121-
"cargo",
122-
"build",
123-
"--bin",
124-
"clusterd",
125-
],
126-
env=env,
127-
)
128-
129100
cpu_count = os.cpu_count()
130101
assert cpu_count
131102

@@ -138,6 +109,7 @@ def workflow_default(c: Composition, parser: WorkflowArgumentParser) -> None:
138109
"nextest",
139110
"run",
140111
"--profile=ci",
112+
"--cargo-profile=ci",
141113
f"--partition=count:{partition}/{total}",
142114
# Most tests don't use 100% of a CPU core, so run two tests per CPU.
143115
# TODO(def-): Reenable when #19931 is fixed

ci/test/pipeline.template.yml

+1
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,7 @@ steps:
195195
artifact_paths: [junit_*.xml, target/nextest/ci/junit_cargo-test.xml]
196196
inputs:
197197
- Cargo.lock
198+
- ".config/nextest.toml"
198199
- "**/Cargo.toml"
199200
- "**/*.rs"
200201
- "**/*.proto"

0 commit comments

Comments
 (0)