Skip to content

Commit e1691f1

Browse files
authored
Merge pull request #25116 from def-/pr-ci-cargo-test
builds: Enable lld, optimize linking more, faster cargo-test build
2 parents 1412588 + c37a18c commit e1691f1

File tree

4 files changed

+15
-5
lines changed

4 files changed

+15
-5
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
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ def workflow_default(c: Composition, parser: WorkflowArgumentParser) -> None:
122122
"build",
123123
"--bin",
124124
"clusterd",
125+
"--profile=ci",
125126
],
126127
env=env,
127128
)
@@ -138,6 +139,7 @@ def workflow_default(c: Composition, parser: WorkflowArgumentParser) -> None:
138139
"nextest",
139140
"run",
140141
"--profile=ci",
142+
"--cargo-profile=ci",
141143
f"--partition=count:{partition}/{total}",
142144
# Most tests don't use 100% of a CPU core, so run two tests per CPU.
143145
# 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"

doc/developer/guide.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ you'll need a working C and C++ toolchain. You'll also need to install:
1616
* The [CMake] build system
1717
* libclang
1818
* PostgreSQL
19+
* lld (on Linux, or set a custom `RUSTFLAGS`)
1920

2021
On macOS, if you install [Homebrew], you'll be guided through the process of
2122
installing Apple's developer tools, which includes a C compiler and libclang.
@@ -29,7 +30,7 @@ On Debian-based Linux variants, it's even easier:
2930

3031
```shell
3132
sudo apt update
32-
sudo apt install build-essential cmake postgresql-client libclang-dev
33+
sudo apt install build-essential cmake postgresql-client libclang-dev lld
3334
```
3435

3536
On other platforms, you'll have to figure out how to get these tools yourself.

0 commit comments

Comments
 (0)