-
Notifications
You must be signed in to change notification settings - Fork 8
/
Cargo.toml
291 lines (273 loc) · 13.8 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
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
[workspace]
members = [
"all-is-cubes",
"all-is-cubes-base",
"all-is-cubes-content",
"all-is-cubes-desktop",
"all-is-cubes-gpu",
"all-is-cubes-mesh",
"all-is-cubes-port",
"all-is-cubes-render",
"all-is-cubes-server",
"all-is-cubes-ui",
"test-renderers",
"tools/xtask",
# Workspaces generally expect to be able to compile everything for the same target,
# but all-is-cubes-wasm only compiles on wasm and all-is-cubes-desktop doesn't.
# Specific advantages:
# * The wasm workspace has Cargo config telling it to be built for wasm32-unknown-unknown,
# which rust-analyzer picks up, so all IDE assistance works.
#
# Disadvantages, or advantages of the alternative of merely `cfg`-disabling all the wasm-only
# code:
# * `cargo fmt`, `cargo tree`, etc. don't work on this code (but `xtask` provides
# all-workspaces commands).
#
# "all-is-cubes-wasm",
# Including this makes the fuzz targets automatically built so we know they aren't broken.
# But, `cargo test` sometimes ignores `[[bin]] test = false` directives,
# https://github.com/rust-lang/cargo/issues/8338
# so doing this causes test failures in thise circumstances.
# As a substitute, I've included explicitly building the fuzz targets in the `xtask` build process.
#
# "fuzz",
]
# Use feature resolver version 2 (latest). (This must be specified explicitly
# in a workspace, but would be implicit in a single package with edition="2021".)
resolver = "2"
[workspace.package]
# When changing any of these values, be sure to also update the non-workspace packages
# as listed above, if applicable.
edition = "2021"
rust-version = "1.82"
license = "MIT OR Apache-2.0"
authors = ["Kevin Reid <[email protected]>"]
# TODO: add homepage = "..." when we have one
repository = "https://github.com/kpreid/all-is-cubes"
[workspace.dependencies]
# Note: Every package here should have `default-features = false`, unless the intent is specifically
# to use it with default features enabled everyhwere it is used.
# This is because if `default-features` is unset (and thus defaults to true), default features are
# enabled for *all* uses, even those which specify `default-features = false` themselves.
# See <https://github.com/rust-lang/cargo/issues/12162> for more information; we may be able to
# revisit this policy after the 2024 Edition is released.
#
all-is-cubes = { path = "all-is-cubes", version = "0.8.0", default-features = false }
all-is-cubes-base = { path = "all-is-cubes-base", version = "0.8.0", default-features = false }
all-is-cubes-content = { path = "all-is-cubes-content", version = "0.8.0", default-features = false }
all-is-cubes-desktop = { path = "all-is-cubes-desktop", version = "0.8.0", default-features = false }
all-is-cubes-gpu = { path = "all-is-cubes-gpu", version = "0.8.0", default-features = false }
all-is-cubes-mesh = { path = "all-is-cubes-mesh", version = "0.8.0", default-features = false }
all-is-cubes-port = { path = "all-is-cubes-port", version = "0.8.0", default-features = false }
all-is-cubes-render = { path = "all-is-cubes-render", version = "0.8.0", default-features = false }
all-is-cubes-server = { path = "all-is-cubes-server", version = "0.8.0", default-features = false }
all-is-cubes-ui = { path = "all-is-cubes-ui", version = "0.8.0", default-features = false }
allocation-counter = { version = "0.8.1", default-features = false }
# Only used in std-using packages, so default features enabled
anyhow = "1.0.70"
# Each use should be { optional = true }.
arbitrary = { version = "1.4.1", features = ["derive"] }
arrayvec = { version = "0.7.4", default-features = false }
async_fn_traits = { version = "0.1.1", default-features = false }
base64 = { version = "0.22.1", default-features = false }
bitflags = { version = "2.6.0", default-features = false }
bitvec = { version = "1.0.0", default-features = false, features = ["alloc"] }
bytemuck = { version = "1.19.0", default-features = false, features = ["derive", "must_cast"] }
cfg-if = { version = "1.0.0", default-features = false }
# When upgrading clap, beware text output changes causing integration tests to fail.
clap = { version = "4.2.4", default-features = false, features = ["cargo", "deprecated", "derive", "help", "std", "suggestions", "usage", "wrap_help"] }
# Note: async_tokio feature is not needed globally but is enabled to avoid compiling two versions
# when benching/testing specific packages
criterion = { version = "0.5.1", features = ["async_tokio", "cargo_bench_support", "html_reports"] }
displaydoc = { version = "0.2.4", default-features = false}
downcast-rs = { version = "1.2.0", default-features = false }
either = { version = "1.10.0", default-features = false }
# embedded-graphics and embedded-graphics-core must match
embedded-graphics = { version = "0.8.0", default-features = false }
embedded-graphics-core = { version = "0.4.0", default-features = false }
euclid = { version = "0.22.11", default-features = false }
exhaust = { version = "0.2.0", default-features = false }
flume = { version = "0.11.0", default-features = false, features = ["async"] }
futures-channel = { version = "0.3.31", default-features = false, features = ["alloc"] }
futures-core = { version = "0.3.31", default-features = false, features = ["alloc"] }
futures-task = { version = "0.3.31", default-features = false }
futures-util = { version = "0.3.31", default-features = false, features = ["alloc"] }
# TODO: evaluate which gilrs features should be enabled
gilrs = { version = "0.10.4" }
gloo-timers = { version = "0.3.0", default-features = false }
half = { version = "2.3.1", default-features = false, features = ["bytemuck"] }
hashbrown = { version = "0.14.0", default-features = false, features = ["ahash", "inline-more"] }
image = { version = "0.25.1", default-features = false }
imgref = { version = "1.10.1", default-features = false }
indoc = { version = "2.0.1", default-features = false }
itertools = { version = "0.13.0", default-features = false, features = ["use_alloc"] }
libm = { version = "0.2.8", default-features = false }
log = { version = "0.4.17", default-features = false }
macro_rules_attribute = { version = "0.2.0", default-features = false }
manyfmt = { version = "0.1.0", default-features = false }
mutants = { version = "0.0.3", default-features = false }
noise = { version = "0.9.0", default-features = false }
num-traits = { version = "0.2.19", default-features = false }
ordered-float = { version = "4.2.0", default-features = false }
paste = {version = "1.0.15", default-features = false }
petgraph = { version = "0.6.2", default-features = false, features = ["graphmap"] }
png-decoder = { version = "0.1.1", default-features = false } # used by all-is-cubes for no_std-compatible reading pngs
png = { version = "0.17.6", default-features = false } # used by all-is-cubes-desktop for writing pngs
pollster = { version = "0.3.0", default-features = false }
pretty_assertions = { version = "1.2.0" }
rand = { version = "0.8.3", default-features = false }
rand_xoshiro = { version = "0.6.0", default-features = false }
rayon = { version = "1.8.0", default-features = false }
re_log_types = { version = "0.19.0", default-features = false }
re_sdk = { version = "0.19.0", default-features = false }
re_types = { version = "0.19.0", default-features = false }
rectangle-pack = { version = "0.4.2" } # currently only used in all-is-cubes-port which is currently std only
rendiff = { version = "0.2.0", default-features = false }
# We use rstest for parameterized tests where each case can fail or succeed independently.
# If there are too many cases to write literally, use `all_is_cubes::util::MultiFailure` instead.
rstest = { version = "0.23.0", default-features = false }
scopeguard = { version = "1.2.0", default-features = false }
# "futures" feature is used by all-is-cubes-gpu, but it's small so we enable it everywhere
send_wrapper = { version = "0.6.0", default-features = false, features = ["futures"] }
serde = { version = "1.0.204", default-features = false, features = ["derive"] }
# TODO: currently all crates that use serde_json also need std, but that should change
serde_json = { version = "1.0.79", default-features = false, features = ["std"] }
simplelog = { version = "0.12.0", default-features = false, features = ["local-offset"] }
snapbox = "0.6.10" # keep in sync with `trycmd`
strum = { version = "0.26.3", default-features = false, features = ["derive"] }
sync_wrapper = { version = "1.0.0", default-features = false }
tempfile = { version = "3.3.0", default-features = false }
thiserror = { version = "1.0.65", default-features = false }
time = { version = "0.3.36", default-features = false }
# Tokio is used for async test-running and for certain binaries.
# The library crates do not require Tokio.
tokio = { version = "1.28.0", default-features = false }
trycmd = "0.15.4" # keep in sync with `snapbox`
unicode-segmentation = { version = "1.10.1", default-features = false }
unicode-width = { version = "0.2", default-features = false }
wasm-bindgen-futures = { version = "0.4.45", default-features = false }
web-time = { version = "1.1.0", default-features = false }
wgpu = { version = "23.0.0", default-features = false, features = ["wgsl"] }
yield-progress = { version = "0.1.6", default-features = false }
# Note: Lints are also necessarily redefined in the workspaces other than this one.
[workspace.lints.rust]
# rustc lints that are set to deny
rust_2018_idioms = { level = "deny", priority = -1 }
unsafe_op_in_unsafe_fn = "deny"
# rustc lints that are set to warn
explicit_outlives_requirements = "warn"
missing_debug_implementations = "warn"
missing_docs = "warn"
noop_method_call = "warn"
redundant_lifetimes = "warn"
trivial_casts = "warn"
trivial_numeric_casts = "warn"
unnameable_types = "warn"
unused_extern_crates = "warn"
unused_lifetimes = "warn"
unused_qualifications = "warn"
# This lint has false positives on dev-dependencies. Occasionally turn it on to audit non-dev deps.
# unused_crate_dependencies = "warn"
[workspace.lints.clippy]
# clippy default lints that are set to allow
collapsible_else_if = "allow"
collapsible_if = "allow"
duplicated_attributes = "allow" # false positive prone <https://github.com/rust-lang/rust-clippy/issues/13355>
match_ref_pats = "allow"
needless_update = "allow"
single_match = "allow"
# clippy::pedantic lints that are set to allow
cast_possible_truncation = "allow" # we would need an alternative for intentional from-float saturation and to-float precision loss
cast_precision_loss = "allow" # consider enabling
cast_sign_loss = "allow" # consider enabling
default_trait_access = "allow"
empty_enum = "allow"
enum_glob_use = "allow"
explicit_iter_loop = "allow" # I prefer the opposite style
float_cmp = "allow"
from_iter_instead_of_collect = "allow" # <https://github.com/rust-lang/rust-clippy/issues/7213>
if_not_else = "allow"
inline_always = "allow"
items_after_statements = "allow" # we use this sparingly
manual_assert = "allow"
many_single_char_names = "allow"
match_bool = "allow"
match_same_arms = "allow"
missing_errors_doc = "allow" # consider enabling
missing_panics_doc = "allow" # consider enabling
must_use_candidate = "allow" # consider enabling
no_effect_underscore_binding = "allow"
range_plus_one = "allow" # https://github.com/rust-lang/rust-clippy/issues/3307
redundant_closure_for_method_calls = "allow" # consider enabling
redundant_else = "allow"
semicolon_if_nothing_returned = "allow"
similar_names = "allow"
single_match_else = "allow"
struct_excessive_bools = "allow"
too_many_lines = "allow"
unreadable_literal = "allow"
wildcard_imports = "allow" # we use this sparingly
# clippy::restriction lints that are set to allow (to note why we aren't using them)
shadow_unrelated = "allow" # would use except for <https://github.com/rust-lang/rust-clippy/issues/10780>
# clippy lints that are set to deny
should_panic_without_expect = "deny"
# clippy lints that are set to warn
pedantic = { level = "warn", priority = -1 }
assigning_clones = "warn"
cast_lossless = "warn"
cast_possible_wrap = "warn"
doc_markdown = "warn"
exhaustive_enums = "warn"
exhaustive_structs = "warn"
into_iter_without_iter = "warn"
inconsistent_struct_constructor = "warn"
infinite_loop = "warn"
iter_without_into_iter = "warn"
large_futures = "warn"
large_stack_frames = "warn"
manual_let_else = "warn"
map_unwrap_or = "warn"
missing_fields_in_debug = "warn"
module_name_repetitions = "warn"
modulo_arithmetic = "warn"
needless_pass_by_value = "warn"
option_as_ref_cloned = "warn"
pub_without_shorthand = "warn"
return_self_not_must_use = "warn"
suboptimal_flops = "warn"
trivially_copy_pass_by_ref = "warn"
undocumented_unsafe_blocks = "warn"
uninlined_format_args = "warn"
unnecessary_self_imports = "warn"
unnecessary_wraps = "warn"
unused_async = "warn"
wrong_self_convention = "warn"
[profile.dev]
# Enable some optimization to improve interactive performance in manual testing/experimenting.
# In particular, inlining is crucial.
opt-level = 2
# Yes, this is the default for dev, but I want to be precise here: overflow checks are enabled
# for ALL profiles. (Because not catching overflows in release mode is unwise when this is
# precisely where the program is *likely to encounter bigger numbers than in testing*.)
overflow-checks = true
# Faster builds at the cost of pathname-sensitive debug info.
# TODO: Disabled for <https://github.com/rust-lang/rust/issues/103976> in CI
# split-debuginfo = "unpacked"
# For packages whose code is not as performance-critical, spend less time optimizing
package.all-is-cubes-content.opt-level = 1
package.all-is-cubes-port.opt-level = 1
package.all-is-cubes-server.opt-level = 1
package.all-is-cubes-ui.opt-level = 1
package.test-renderers.opt-level = 1
[profile.release]
# TODO: review recommended options for wasm releases
overflow-checks = true
[profile.test]
overflow-checks = true
[profile.bench]
overflow-checks = true
[patch.crates-io]
# Here are some patches we might want to apply for development:
#
# wgpu = { git = "https://github.com/gfx-rs/wgpu/", branch = "trunk" }
# exhaust = { git = "https://github.com/kpreid/exhaust/", branch = "main" }