Skip to content

Commit 1abcac2

Browse files
nrainer-materializebenesch
authored andcommitted
cargo: ignore unused alloc dependencies
1 parent 1ab7ec6 commit 1abcac2

11 files changed

+49
-28
lines changed

ci/test/lint-deps/README.md

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,26 @@ However, note the specifics for `jemalloc` below.
2828

2929
### Specifics for `jemalloc`
3030

31-
We enable `jemalloc` by default on all non-mac platforms, unless `--no-default-features` is enabled.
32-
In this case, `jemalloc` should be disabled on all platforms.
33-
To quickly determine the validity of changes, check that only the file `x86_64-unknown-linux-gnu-default` mentions the `tikv-jemallocator` dependency, and all others don't.
31+
* `--no-default-features` unequivocally disables jemalloc, regardless of platform.
32+
* `--features=jemalloc` unequivocally enables jemalloc, regardless of platform.
33+
* `--default-features` chooses the best allocator for the platform: the system allocator on macOS and jemalloc on Linux.
34+
35+
To determine the validity of changes, ensure that the following files mention
36+
the tikv-jemallocator family of dependencies:
37+
38+
* aarch64-apple-darwin-jemalloc
39+
* aarch64-unknown-linux-gnu-default
40+
* aarch64-unknown-linux-gnu-jemalloc
41+
* x86_64-apple-darwin-jemalloc
42+
* x86_64-unknown-linux-gnu-default
43+
* x86_64-unknown-linux-gnu-jemalloc
44+
45+
And that the following files do *not* mention the tikv-jemallocator family
46+
of dependencies:
47+
48+
* aarch64-apple-darwin-default
49+
* aarch64-apple-darwin-no-default-features
50+
* aarch64-unknown-linux-gnu-no-default-features
51+
* x86_64-apple-darwin-default
52+
* x86_64-apple-darwin-no-default-features
53+
* x86_64-unknown-linux-gnu-no-default-features

ci/test/lint-deps/aarch64-apple-darwin-jemalloc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
# generated by ci/test/lint-deps.sh -- see ci/test/lint-deps/README.md for details
22
tikv_jemalloc_ctl
33
0::default,jemalloc,mz-alloc-default,tokio-console
4-
1:mz_alloc:default,jemalloc,tikv-jemallocator,workspace-hack
4+
1:mz_alloc:default,jemalloc,mz-prof,tikv-jemallocator,workspace-hack
55
2:mz_prof:jemalloc,tikv-jemalloc-ctl
66
3:tikv_jemalloc_ctl:default,use_std
77
tikv_jemallocator
88
0::default,jemalloc,mz-alloc-default,tokio-console
9-
1:mz_alloc:default,jemalloc,tikv-jemallocator,workspace-hack
9+
1:mz_alloc:default,jemalloc,mz-prof,tikv-jemallocator,workspace-hack
1010
2:tikv_jemallocator:background_threads,background_threads_runtime_support,default,profiling,stats,unprefixed_malloc_on_supported_platforms
1111
tikv_jemalloc_sys
1212
0::default,jemalloc,mz-alloc-default,tokio-console
13-
1:mz_alloc:default,jemalloc,tikv-jemallocator,workspace-hack
13+
1:mz_alloc:default,jemalloc,mz-prof,tikv-jemallocator,workspace-hack
1414
2:mz_prof:jemalloc,tikv-jemalloc-ctl
1515
3:tikv_jemalloc_ctl:default,use_std
1616
4:tikv_jemalloc_sys:background_threads,background_threads_runtime_support,default,profiling,stats,unprefixed_malloc_on_supported_platforms

ci/test/lint-deps/aarch64-unknown-linux-gnu-default

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
# generated by ci/test/lint-deps.sh -- see ci/test/lint-deps/README.md for details
22
tikv_jemalloc_ctl
33
0::default,mz-alloc-default,tokio-console
4-
1:mz_alloc:default,jemalloc,tikv-jemallocator,workspace-hack
4+
1:mz_alloc:default,jemalloc,mz-prof,tikv-jemallocator,workspace-hack
55
2:mz_prof:jemalloc,tikv-jemalloc-ctl
66
3:tikv_jemalloc_ctl:default,use_std
77
tikv_jemallocator
88
0::default,mz-alloc-default,tokio-console
9-
1:mz_alloc:default,jemalloc,tikv-jemallocator,workspace-hack
9+
1:mz_alloc:default,jemalloc,mz-prof,tikv-jemallocator,workspace-hack
1010
2:tikv_jemallocator:background_threads,background_threads_runtime_support,default,profiling,stats,unprefixed_malloc_on_supported_platforms
1111
tikv_jemalloc_sys
1212
0::default,mz-alloc-default,tokio-console
13-
1:mz_alloc:default,jemalloc,tikv-jemallocator,workspace-hack
13+
1:mz_alloc:default,jemalloc,mz-prof,tikv-jemallocator,workspace-hack
1414
2:mz_prof:jemalloc,tikv-jemalloc-ctl
1515
3:tikv_jemalloc_ctl:default,use_std
1616
4:tikv_jemalloc_sys:background_threads,background_threads_runtime_support,default,profiling,stats,unprefixed_malloc_on_supported_platforms

ci/test/lint-deps/aarch64-unknown-linux-gnu-jemalloc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
# generated by ci/test/lint-deps.sh -- see ci/test/lint-deps/README.md for details
22
tikv_jemalloc_ctl
33
0::default,jemalloc,mz-alloc-default,tokio-console
4-
1:mz_alloc:default,jemalloc,tikv-jemallocator,workspace-hack
4+
1:mz_alloc:default,jemalloc,mz-prof,tikv-jemallocator,workspace-hack
55
2:mz_prof:jemalloc,tikv-jemalloc-ctl
66
3:tikv_jemalloc_ctl:default,use_std
77
tikv_jemallocator
88
0::default,jemalloc,mz-alloc-default,tokio-console
9-
1:mz_alloc:default,jemalloc,tikv-jemallocator,workspace-hack
9+
1:mz_alloc:default,jemalloc,mz-prof,tikv-jemallocator,workspace-hack
1010
2:tikv_jemallocator:background_threads,background_threads_runtime_support,default,profiling,stats,unprefixed_malloc_on_supported_platforms
1111
tikv_jemalloc_sys
1212
0::default,jemalloc,mz-alloc-default,tokio-console
13-
1:mz_alloc:default,jemalloc,tikv-jemallocator,workspace-hack
13+
1:mz_alloc:default,jemalloc,mz-prof,tikv-jemallocator,workspace-hack
1414
2:mz_prof:jemalloc,tikv-jemalloc-ctl
1515
3:tikv_jemalloc_ctl:default,use_std
1616
4:tikv_jemalloc_sys:background_threads,background_threads_runtime_support,default,profiling,stats,unprefixed_malloc_on_supported_platforms

ci/test/lint-deps/x86_64-apple-darwin-jemalloc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
# generated by ci/test/lint-deps.sh -- see ci/test/lint-deps/README.md for details
22
tikv_jemalloc_ctl
33
0::default,jemalloc,mz-alloc-default,tokio-console
4-
1:mz_alloc:default,jemalloc,tikv-jemallocator,workspace-hack
4+
1:mz_alloc:default,jemalloc,mz-prof,tikv-jemallocator,workspace-hack
55
2:mz_prof:jemalloc,tikv-jemalloc-ctl
66
3:tikv_jemalloc_ctl:default,use_std
77
tikv_jemallocator
88
0::default,jemalloc,mz-alloc-default,tokio-console
9-
1:mz_alloc:default,jemalloc,tikv-jemallocator,workspace-hack
9+
1:mz_alloc:default,jemalloc,mz-prof,tikv-jemallocator,workspace-hack
1010
2:tikv_jemallocator:background_threads,background_threads_runtime_support,default,profiling,stats,unprefixed_malloc_on_supported_platforms
1111
tikv_jemalloc_sys
1212
0::default,jemalloc,mz-alloc-default,tokio-console
13-
1:mz_alloc:default,jemalloc,tikv-jemallocator,workspace-hack
13+
1:mz_alloc:default,jemalloc,mz-prof,tikv-jemallocator,workspace-hack
1414
2:mz_prof:jemalloc,tikv-jemalloc-ctl
1515
3:tikv_jemalloc_ctl:default,use_std
1616
4:tikv_jemalloc_sys:background_threads,background_threads_runtime_support,default,profiling,stats,unprefixed_malloc_on_supported_platforms

ci/test/lint-deps/x86_64-unknown-linux-gnu-default

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
# generated by ci/test/lint-deps.sh -- see ci/test/lint-deps/README.md for details
22
tikv_jemalloc_ctl
33
0::default,mz-alloc-default,tokio-console
4-
1:mz_alloc:default,jemalloc,tikv-jemallocator,workspace-hack
4+
1:mz_alloc:default,jemalloc,mz-prof,tikv-jemallocator,workspace-hack
55
2:mz_prof:jemalloc,tikv-jemalloc-ctl
66
3:tikv_jemalloc_ctl:default,use_std
77
tikv_jemallocator
88
0::default,mz-alloc-default,tokio-console
9-
1:mz_alloc:default,jemalloc,tikv-jemallocator,workspace-hack
9+
1:mz_alloc:default,jemalloc,mz-prof,tikv-jemallocator,workspace-hack
1010
2:tikv_jemallocator:background_threads,background_threads_runtime_support,default,profiling,stats,unprefixed_malloc_on_supported_platforms
1111
tikv_jemalloc_sys
1212
0::default,mz-alloc-default,tokio-console
13-
1:mz_alloc:default,jemalloc,tikv-jemallocator,workspace-hack
13+
1:mz_alloc:default,jemalloc,mz-prof,tikv-jemallocator,workspace-hack
1414
2:mz_prof:jemalloc,tikv-jemalloc-ctl
1515
3:tikv_jemalloc_ctl:default,use_std
1616
4:tikv_jemalloc_sys:background_threads,background_threads_runtime_support,default,profiling,stats,unprefixed_malloc_on_supported_platforms

ci/test/lint-deps/x86_64-unknown-linux-gnu-jemalloc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
# generated by ci/test/lint-deps.sh -- see ci/test/lint-deps/README.md for details
22
tikv_jemalloc_ctl
33
0::default,jemalloc,mz-alloc-default,tokio-console
4-
1:mz_alloc:default,jemalloc,tikv-jemallocator,workspace-hack
4+
1:mz_alloc:default,jemalloc,mz-prof,tikv-jemallocator,workspace-hack
55
2:mz_prof:jemalloc,tikv-jemalloc-ctl
66
3:tikv_jemalloc_ctl:default,use_std
77
tikv_jemallocator
88
0::default,jemalloc,mz-alloc-default,tokio-console
9-
1:mz_alloc:default,jemalloc,tikv-jemallocator,workspace-hack
9+
1:mz_alloc:default,jemalloc,mz-prof,tikv-jemallocator,workspace-hack
1010
2:tikv_jemallocator:background_threads,background_threads_runtime_support,default,profiling,stats,unprefixed_malloc_on_supported_platforms
1111
tikv_jemalloc_sys
1212
0::default,jemalloc,mz-alloc-default,tokio-console
13-
1:mz_alloc:default,jemalloc,tikv-jemallocator,workspace-hack
13+
1:mz_alloc:default,jemalloc,mz-prof,tikv-jemallocator,workspace-hack
1414
2:mz_prof:jemalloc,tikv-jemalloc-ctl
1515
3:tikv_jemalloc_ctl:default,use_std
1616
4:tikv_jemalloc_sys:background_threads,background_threads_runtime_support,default,profiling,stats,unprefixed_malloc_on_supported_platforms

src/alloc/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ workspace = true
1111

1212
[dependencies]
1313
mz-ore = { path = "../ore", default-features = false }
14-
mz-prof = { path = "../prof", default-features = false }
14+
mz-prof = { path = "../prof", default-features = false, features = ["jemalloc"], optional = true }
1515
mz-prof-http = { path = "../prof-http", default-features = false }
1616
# According to jemalloc developers, `background_threads` should always be
1717
# enabled, except in "esoteric" situations that don't apply to Materialize
@@ -25,7 +25,7 @@ workspace-hack = { version = "0.0.0", path = "../workspace-hack", optional = tru
2525
[features]
2626
default = ["workspace-hack"]
2727
# Whether to use jemalloc instead of the system allocator.
28-
jemalloc = ["tikv-jemallocator", "mz-prof-http/jemalloc"]
28+
jemalloc = ["tikv-jemallocator", "mz-prof", "mz-prof-http/jemalloc"]
2929

3030
[package.metadata.cargo-udeps.ignore]
3131
# The only reason we depend on mz-prof-http from this package is so that we can

src/clusterd/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,4 @@ jemalloc = ["mz-alloc/jemalloc"]
4848
tokio-console = ["mz-ore/tokio-console"]
4949

5050
[package.metadata.cargo-udeps.ignore]
51-
normal = ["workspace-hack"]
51+
normal = ["mz-alloc-default", "workspace-hack"]

src/compute/Cargo.toml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ anyhow = "1.0.66"
1414
async-trait = "0.1.68"
1515
bytesize = "1.1.0"
1616
clap = { version = "3.2.24", features = ["derive", "env"] }
17-
core_affinity = "0.8.0"
1817
crossbeam-channel = "0.5.8"
1918
dec = { version = "0.4.8", features = ["serde"] }
2019
differential-dataflow = "0.12.0"
@@ -51,6 +50,8 @@ tracing = "0.1.37"
5150
uuid = { version = "1.7.0", features = ["serde", "v4"] }
5251
workspace-hack = { version = "0.0.0", path = "../workspace-hack" }
5352

53+
[target.'cfg(not(target_os = "macos"))'.dependencies]
54+
core_affinity = "0.8.0"
55+
5456
[package.metadata.cargo-udeps.ignore]
55-
# only used on linux
56-
normal = ["inotify", "workspace-hack"]
57+
normal = ["workspace-hack"]

src/environmentd/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,4 +185,4 @@ tokio-console = [
185185

186186
[package.metadata.cargo-udeps.ignore]
187187
# sysctl is only used on macOS.
188-
normal = ["sysctl", "workspace-hack"]
188+
normal = ["mz-alloc-default", "sysctl", "workspace-hack"]

0 commit comments

Comments
 (0)