-
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathCargo.toml
More file actions
235 lines (207 loc) · 8.5 KB
/
Copy pathCargo.toml
File metadata and controls
235 lines (207 loc) · 8.5 KB
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
# Copyright (C) 2026 rezky_nightky
# SPDX-License-Identifier: GPL-3.0-only
[package]
name = "cosmostrix"
version = "80.0.0-beta.2"
edition = "2021"
rust-version = "1.98"
authors = ["rezky_nightky (oxyzenQ)"]
description = "Professional-grade cinematic Matrix rain renderer for serious terminal environments."
license = "GPL-3.0-only"
repository = "https://github.com/oxyzenQ/cosmostrix"
# crates.io discoverability metadata. Categories are validated slugs
# from the official list (https://crates.io/categories — 58 slugs as
# of 2026-08-31, re-validated against the live registry API):
# - "command-line-utilities": the primary bucket for a terminal binary.
# - "games": "Applications for fun and entertainment" — a cinematic
# screensaver fits.
# - "science": owner-mandated addition — the project's engineering
# posture (OKLab color science, statistics-grade HUD/benchmarks,
# LTS audits) earns it.
# - "rendering": maps the owner's "cinematic"/"masterpiece" intent —
# neither is a valid registry slug (checked against the live list),
# and "rendering" is the closest official bucket for a cinematic
# renderer (the description already calls cosmostrix one).
# Registry limit is 5 categories; 4 used.
keywords = ["matrix", "matrix-rain", "terminal", "screensaver", "cli"]
categories = [
"command-line-utilities",
"games",
"science",
"rendering",
]
build = "build.rs"
exclude = [
"benchmark/*",
"docs/research/*",
"docs/archive/*",
"docs/audits/*",
"assets/*.gif",
"assets/*.png",
"scripts/*",
"aur/*",
".github/*",
".git/*",
# Repo-local build/lint configuration is dead weight downstream:
# .cargo/config.toml only applies to this repository's invocations,
# and the lint dotfiles (.codespellrc/.yamllint/.markdownlint.yaml)
# only matter to contributors. Not part of the shipped crate.
".cargo/*",
".codespellrc",
".yamllint",
".markdownlint.yaml",
# dst.
]
[dependencies]
clap = { version = ">=4.5, <4.6", default-features = false, features = ["std", "color", "help", "usage", "error-context", "derive", "suggestions"] }
crossterm = { version = "0.29", default-features = false, features = ["bracketed-paste", "events", "windows"] }
rand = "0.9"
bitvec = "1"
smallvec = "1"
unicode-width = "0.2"
# chrono dropped (Hinnant-style). Was: `chrono = { version = ">=0.4.38, <0.5", default-features = false, features = ["clock"] }`.
# The `clock` feature dragged in 8 transitive crates (wasm-bindgen, js-sys,
# iana-time-zone-haiku, core-foundation-sys, etc.) for 2 production call sites
# that only needed `[HH:MM]` log stamps and a local-hour fraction. Replaced by
# direct `libc::localtime_r` / `libc::gmtime_r` calls in the `src/clock`
# module (the historical `local_secs_since_midnight` helper now lives in
# `src/central_control_dragon_power/phase_predictor.rs`).
notify = { version = ">=7, <8", default-features = false }
# SHA-512 for config.toml content hashing (live-reload change
# detection, --dump-config fingerprint, --testconf fingerprint).
# Owner contract requires cryptographic hash strength rather
# than the previous FNV-1a 64-bit hash. sha2 is pure-Rust, no unsafe, and
# ~50KB compiled. Upgraded from SHA-256 to SHA-512 for higher
# security margin (256-bit collision resistance) at negligible cost
# for small config files (<5 KB). Used by:
# - live_config_poll::hash_file_prefix (change detection)
# - configfile::sha512_hex (dump-config + testconf fingerprinting)
sha2 = "0.10"
# Bug 1 fix: enable kqueue backend on FreeBSD/GhostBSD/macOS (iOS too).
# Without these target-specific features, notify's RecommendedWatcher
# falls back to a no-op backend on BSDs, silently breaking live reload.
# `macos_fsevent` is also kept for macOS to preserve the existing behavior
# (FSEvents is more efficient than kqueue on macOS).
[target.'cfg(target_os = "macos")'.dependencies]
notify = { version = ">=7, <8", default-features = false, features = ["macos_fsevent"] }
[target.'cfg(any(target_os = "freebsd", target_os = "netbsd", target_os = "openbsd", target_os = "dragonfly", target_os = "ios"))'.dependencies]
notify = { version = ">=7, <8", default-features = false, features = ["kqueue"] }
[target.'cfg(unix)'.dependencies]
signal-hook = "0.3"
libc = "0.2"
[target.'cfg(windows)'.dependencies]
ctrlc = "3.4"
[profile.dev]
opt-level = 0
debug = true
split-debuginfo = "unpacked"
incremental = true
codegen-units = 256
[profile.release]
opt-level = 3
debug = false
strip = true
lto = "fat"
codegen-units = 1
panic = "unwind"
overflow-checks = false
incremental = false
[profile.pro]
inherits = "release"
opt-level = 3
debug = false
strip = true
lto = "fat"
codegen-units = 1
panic = "unwind"
overflow-checks = false
incremental = false
# pro-native: same as pro but outputs to target/pro-native/ (owner request).
# The alias in .cargo/config.toml uses --profile pro-native so the binary
# lands in target/pro-native/cosmostrix instead of target/pro/cosmostrix.
[profile.pro-native]
inherits = "pro"
[profile.pro-linux-v3]
inherits = "pro"
[profile.pro-linux-v4]
inherits = "pro"
[profile.pro-linux-musl]
inherits = "pro"
[profile.pro-macos-aarch64-native]
inherits = "pro"
[profile.pro-win-amd64]
inherits = "pro"
[profile.pro-win-aarch64]
inherits = "pro"
[profile.pro-android-aarch64]
inherits = "pro"
[profile.pro-freebsd-amd64]
inherits = "pro"
# v18: PGO (Profile-Guided Optimization) nitro build.
# Two-stage: instrument → run benchmark → recompile with profile data.
# Use: ./scripts/build.sh pgo
# Or manually:
# 1. COSMOSTRIX_BUILD=nitro cargo build --profile pgo-instrument
# 2. ./target/debug/cosmostrix --benchmark --bench-duration 10
# 3. COSMOSTRIX_BUILD=nitro COSMOSTRIX_LTO=fat cargo build --profile pgo-use
[profile.pgo-instrument]
inherits = "pro"
debug = false
strip = false
# Instrumentation flags set via RUSTFLAGS in build.sh
incremental = false
[profile.pgo-use]
inherits = "pro"
debug = false
strip = true
# Profile-use flag set via RUSTFLAGS in build.sh
incremental = false
[profile.release-with-debug]
inherits = "release"
debug = true
strip = false
# ── Lint policy ────────────────────────────────────────────────────────
#
# Project-wide lint configuration. The actual enforcement happens in
# scripts/build.sh::run_clippy via `cargo clippy -- -D warnings`
# (warnings are errors). This table centralizes project-wide allows
# that would otherwise need a file-level `#![allow(...)]` attr.
#
# File-level `#![allow(...)]` attrs that remain in the source tree:
#
# - `#![cfg_attr(not(test), allow(dead_code))]` in cloud/monolith_tests.rs
# (Dragon Hunt v2 Phase 2 surgical marker for a test-only API surface
# that is deliberately kept but not yet wired into the production
# render path). A global `[lints]` setting cannot replace it —
# `dead_code = "deny"` would break the build, `dead_code = "allow"`
# would silence ALL dead code and undo Phase 2's triage. Leave it
# file-local. The 6 atmosphere_*.rs markers from DHv2 Phase 2 were
# removed when those files were deleted in commit 07b44b5.
[lints.clippy]
# Project-wide clippy lint configuration. The default clippy policy (all
# lints warn) is enforced via `cargo clippy -- -D warnings` in
# scripts/build.sh. Entries below are deliberate deviations:
# - `allow` entries silence default nits project-wide.
# - `deny` entries promote specific lints so they fail EVERY cargo
# invocation (plain `cargo clippy`, IDE runs, rust-analyzer) —
# not just under build.sh's -D warnings flag.
#
# excessive_precision: was previously a file-local
# `#![allow(clippy::excessive_precision)]` in src/chroma/gradient.rs.
# Moved to project-wide because the high-precision floats are
# intentional for color math throughout the chroma module, and
# verification showed no other file triggers this lint — so the
# project-wide allow is equivalent in effect to the file-local one.
excessive_precision = "allow"
# manual_slice_fill: added in Rust 1.98.0. Flags manual
# `for x in &mut slice { *x = val; }` loops that should be
# `slice.fill(val)` (stable since 1.50, identical codegen). Fired
# once during the 1.98.0 toolchain bump (terminal/tier2.rs ring
# buffer reset — fixed in commit 80d82fa). Promoted to deny per
# owner approval so every future occurrence fails any clippy run,
# not just the build.sh gate.
manual_slice_fill = "deny"
[dev-dependencies]
proptest = { version = "1.8.0", default-features = false, features = ["std"] }
# Platform-specific optimizations
# At .cargo/config.toml