-
Notifications
You must be signed in to change notification settings - Fork 6
/
Cargo.toml
247 lines (205 loc) · 9.42 KB
/
Cargo.toml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
[workspace]
members = ["hwlocality-sys"]
[workspace.package]
authors = ["Hadrien G. <[email protected]>", "Joseph Hirschfeld <[email protected]>", "Michael Nitschinger <[email protected]>"]
edition = "2021"
rust-version = "1.75.0"
repository = "https://github.com/HadrienG2/hwlocality"
license = "MIT"
keywords = ["hwloc", "locality", "cache", "numa", "hardware"]
categories = ["concurrency", "external-ffi-bindings", "hardware-support", "memory-management", "os"]
[workspace.dependencies]
proptest = { version = "1.3", default-features = false, features = ["std"] }
libc = "0.2"
static_assertions = "1.1"
windows-sys = { version = "0.59", features = ["Win32_Foundation", "Win32_System_Threading"] }
[profile.test.package.proptest]
opt-level = 3
[profile.test.package.rand_chacha]
opt-level = 3
[profile.test.package.similar]
opt-level = 3
# This profile runs tests without the assertions that are normally present in
# debug mode and used to detect release mode in code. This way we can test both
# the debug and release code paths of arithmetic ops without suffering the
# slowness and coverage quality degradation that real release builds incur.
[profile.release_like_test]
inherits = "test"
debug-assertions = false
overflow-checks = false
[package]
name = "hwlocality"
version = "1.0.0-alpha.7"
authors.workspace = true
edition.workspace = true
rust-version.workspace = true
description = "Idiomatic Rust bindings for the hwloc hardware locality library"
repository.workspace = true
license.workspace = true
keywords.workspace = true
categories.workspace = true
[features]
# Require the latest release of hwloc supported by this library
#
# It is not recommended to use this feature in production, since an update to
# hwlocality can silently bump your hwloc build requirement. But this feature is
# convenient for scenarios like CI where you want to test with all features on.
hwloc-latest = ["hwloc-2_10_0"]
# Require at least hwloc v2.0.4, which enables...
#
# - Checking if the merging of group objects with identical parents or children
# has been prevented.
hwloc-2_0_4 = ["hwlocality-sys/hwloc-2_0_4"]
# Require at least hwloc v2.1.0, which enables...
#
# - Support for ObjectType::Die, used to model CPUs with multiple dies per package.
# - Support for ObjectType::MemCache, used to model memory-side caches.
# - Blacklisting some components from being enabled in a topology via
# TopologyBuilder::blacklist_component(), for faster topology loading.
#
# ...in addition to all features listed above
hwloc-2_1_0 = ["hwlocality-sys/hwloc-2_1_0", "hwloc-2_0_4"]
# Require at least hwloc v2.2.0, which enables...
#
# - Removing SMT from a given CpuSet using CpuSet::singlify_per_core.
# - PCI devices with 32-bit domain indices. Since we currently can't tell which
# configuration was used in the hwloc build, we assume the default
# configuration, which is to disable it until v3.0 where it becomes the default.
#
# ...in addition to all features listed above
hwloc-2_2_0 = ["hwlocality-sys/hwloc-2_2_0", "hwloc-2_1_0"]
# Require at least hwloc v2.3.0, which enables...
#
# - Memory attributes, allowing latency/bandwidth queries between initiators
# (e.g. CPU cores) and NUMA nodes.
# - Topology::local_numa_nodes() for listing NUMA nodes that are local to some
# locality.
# - Export of support information in XML, which can be read back by setting the
# new BuildFlags::IMPORT_SUPPORT flag.
# - Modifying topologies using TopologyEditor. This was actually supported by
# previous hwloc versions, but in a manner that violates the Rust aliasing
# model so we could not expose it in the Rust bindings.
#
# ...in addition to all features listed above
hwloc-2_3_0 = ["hwlocality-sys/hwloc-2_3_0", "hwloc-2_2_0"]
# Require at least hwloc v2.4.0, which enables...
#
# - Discriminating different CPU kinds, for hybrid CPU support.
#
# ...in addition to all features listed above
hwloc-2_4_0 = ["hwlocality-sys/hwloc-2_4_0", "hwloc-2_3_0"]
# Require at least hwloc v2.5.0, which enables...
#
# - Querying Windows processor groups.
# - Converting between objects with same locality, e.g. NUMA nodes and Packages,
# using Topology::object_with_same_locality.
# - Modifying distance structures using Distances::transform()
# - Adding distances between objects using TopologyEditor::add_distances(). This
# was actually possible in previous versions of hwloc, but the old API was
# quite different, and is not currently supported by the Rust bindings.
# - New BuildFlags to prevent modifications of CPU and memory bindings during
# topology discovery, especially on Windows.
#
# ...in addition to all features listed above
hwloc-2_5_0 = ["hwlocality-sys/hwloc-2_5_0", "hwloc-2_4_0"]
# Require at least hwloc v2.8.0, which enables...
#
# - BuildFlags to disable the enumeration of some topology metadata in order
# to speed up topology building when they are not needed.
# - Dedicated memory attributes for read and write bandwidth and latency, rather
# than an overall figure of merit.
#
# ...in addition to all features listed above
hwloc-2_8_0 = ["hwlocality-sys/hwloc-2_8_0", "hwloc-2_5_0"]
# Require at least hwloc v2.10.0
#
# This is a maintenance release which does not affect the external hwlocality
# API, but cleans up hwlocality internals.
#
# ...in addition to all features listed above
hwloc-2_10_0 = ["hwlocality-sys/hwloc-2_10_0", "hwloc-2_8_0"]
# WIP hwloc v3.0.0 support, do not use yet!
hwloc-3_0_0 = ["hwlocality-sys/hwloc-3_0_0", "hwloc-2_10_0"]
# To support a new hwloc release that introduces API or ABI changes (see the
# NEWS file in the hwloc source tree for release notes)...
#
# - Add a new feature matching that release version.
# - Make it enable features associated with all previous versions.
# - Change hwloc-latest to point to that feature.
# - Update hwlocality-sys' Cargo.toml similarly
# - Update hwlocality-sys' build.rs to...
# * Record the new feature's hwloc version requirements in `setup_hwloc()`
# * Use a newer official tarball, with appropriate checksum (can be computed
# using `curl <tar.gz url> | sha3-256sum`), in `setup_vendored_hwloc()`
# * If this is a new major version, add support for it in `find_hwloc()`
# - Make the binding honor the API/ABI changes with the right cfg()s.
# - Bump the crate's minor release number unless previous version was unreleased.
# - Add this feature to the CI's linter matrix and both test matrices.
# - Once CI has run at least once, add new matrix entry to required checks.
# - Bump the hwloc version that's installed by CI.
# - Adjust readthedocs links to point to the new release's documentation.
# - Tag new minor releases of hwlocality and hwlocality-sys
# Automatically download and build a compatible hwloc version internally.
# Otherwise, hwlocality will use the system installation of hwloc.
#
# By default, hwloc is built with all optional features disabled, which
# minimizes the odds of hard-to-debug vendored build failures. You may instead
# let the hwloc build system automatically enable optional features, as it does
# by default, using the "vendored-extra" cargo feature.
vendored = ["hwlocality-sys/vendored"]
# Let the hwloc vendored build auto-enable optional features (libxml2, I/O
# device discovery...) as the build system deems appropriate for the host.
#
# Be warned that this autodetection process is known to have false positives,
# e.g. CUDA support may end up being enabled even when the relevant CUDA toolkit
# is not in PATHs, resulting in hwloc build failures.
vendored-extra = ["hwlocality-sys/vendored-extra", "vendored"]
# Implement required infrastructure for property-based testing
proptest = ["dep:proptest"]
[dependencies]
# === Last dependency usage review performed 2023-09-30 ===
# Used to store bounded-length variable-sized results in cache analysis
arrayvec = "0.7"
# Used to interface hwloc's C flags
bitflags = "2.3"
# Used to simplify the implementation of newtypes
derive_more = { version = "1.0", default-features = false, features = ["as_ref", "display", "from", "into", "into_iterator", "not"] }
# Used for optional proptest feature and in topology debug output
enum-iterator = "2.0"
# Used to interpret and report hwloc error codes
errno = "0.3"
# Part of this project (raw FFI binding)
hwlocality-sys = { path = "./hwlocality-sys" }
# Used for malloc, free, OS typedefs, and example thread queries
libc.workspace = true
# Used to interface hwloc enums
num_enum = { version = "0.7", default-features = false }
# Used to simplify error reporting
thiserror = "2.0"
# Used for optional proptest feature
proptest = { workspace = true, optional = true }
[target.'cfg(windows)'.dependencies]
# Used for current_thread_id
windows-sys.workspace = true
[dev-dependencies]
# Used to simplify examples and test error reporting
eyre = "0.6"
# Used to ease debugging of string tests
similar-asserts = "1.5"
# Used for random testing
proptest.workspace = true
# Used to check trait implementations
static_assertions.workspace = true
# Used in examples to portably query the OS process list
sysinfo = { version = "0.32", default-features = false, features = ["system"] }
# Used to test file I/O
tempfile = "3.14"
# Used to trace control flow in some tests to make failure investigation easier
tracing = "0.1.40"
tracing-subscriber = { version = "0.3.18", default-features = false, features = ["std", "fmt"] }
tracing-error = { version = "0.2.0", default-features = false }
[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]
[lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = ["cfg(tarpaulin_include)"] }