anvilsign in

collin/anvil · e4b80fbe

Shed six crates: syntect's runtime loaders, tokio's process/signal, jaq-std

Collin Richards · 2026-08-25 07:03 UTC · e4b80fbeeca80c0b6f177dfa0b0cf1fa826182f3 · parent f98caac9 · browse files

modifiedCargo.toml+16 −3
⋯ 67 unchanged lines
6868 # (aws-lc-rs, which the maintained JWT crates default to, needs cmake and does
6969 # not), and one signature check over `header.payload` is all we need.
7070
71-# `default-onig` (C Oniguruma regex engine) over the pure-Rust `default-fancy`:
71+# `regex-onig` (C Oniguruma regex engine) over the pure-Rust `regex-fancy`:
7272 # several times faster on large files, and zig's cc cross-compiles the C just
7373 # fine for the static musl build (verified via deploy/build.sh's toolchain).
74+# Spelled out rather than taking the `default-onig` bundle, which also turns on
75+# `plist-load` and `yaml-load` — those are for building a SyntaxSet/ThemeSet
76+# out of .sublime-syntax / .tmTheme files at runtime, and ui.rs only ever calls
77+# `load_defaults_newlines`/`load_defaults`, which read the baked-in bincode
78+# dumps (`dump-load`, still on). Dropping them takes plist, quick-xml,
79+# yaml-rust and linked-hash-map out of the tree.
7480
7581 # ssh — use the `ring` crypto backend instead of the default `aws-lc-rs`:
7682 # ring is far cheaper to compile (no cmake/perl) and cross-compiles cleanly
⋯ 2 unchanged lines
7985 # ssh-key parsing/fingerprinting, shared by anvil-core (storage) and anvil-ssh
8086 # (auth). Pinned to match russh's transitive ssh-key so fingerprints agree.
8187
88+# The features we actually use, rather than `full`. Nothing here spawns a
89+# child process or installs a signal handler — the design rule is that the
90+# product never shells out, and the `Command::new("git")` calls in the tree are
91+# all test fixtures using `std::process` — so `process` and `signal` were
92+# paying for `signal-hook-registry` and `errno` and a chunk of tokio's own
93+# compile for nothing. Add a feature back the moment something needs it.
94+
8295 aes-gcm = { version = "0.11.1" }
8396 anyhow = { version = "1.0.104" }
8497 argon2 = { version = "0.6.0-rc.8", features = ["rand_core"] }
⋯ 26 unchanged lines
111124 sha2 = { version = "0.11.0" }
112125 similar = { version = "3.2.0" }
113126 ssh-key = { version = "0.7.0-rc.11" }
114-syntect = { version = "5.3.0", default-features = false, features = ["default-onig"] }
127+syntect = { version = "5.3.0", default-features = false, features = ["default-syntaxes", "default-themes", "html", "regex-onig"] }
115128 tar = { version = "0.4.46" }
116129 thiserror = { version = "2.0.20" }
117130 time = { version = "0.3.55", features = ["serde", "formatting"] }
118131 toasty = { version = "0.10.0", features = ["sqlite"] }
119-tokio = { version = "1.53.1", features = ["full"] }
132+tokio = { version = "1.53.1", features = ["fs", "io-util", "macros", "net", "rt-multi-thread", "sync", "time"] }
120133 tokio-util = { version = "0.7.19", features = ["io"] }
121134 toml = { version = "1.1.4" }
122135 tower = { version = "0.5.3" }
⋯ 2 unchanged lines
modifiedcrates/anvil-core/Cargo.toml+0 −1
⋯ 33 unchanged lines
3434 pulldown-cmark.workspace = true
3535 jaq-core = { version = "3.1.0" }
3636 jaq-json = { version = "2.0.2" }
37-jaq-std = { version = "3.0.2", default-features = false, features = ["std"] }
3837
3938 [dev-dependencies]
4039 tokio = { workspace = true }
⋯ 5 unchanged lines
modifiedcrates/anvil-core/src/secrets.rs+3 −1
⋯ 511 unchanged lines
512512 // for the few basics jaq_json's own defs lean on drags in every other
513513 // definition too, including ones behind features (format/log/math/regex/
514514 // time) this crate does not enable, which then fail to resolve even
515- // though nothing here calls them.
515+ // though nothing here calls them. Which is why jaq-std is not a
516+ // dependency of this crate — it is only in the tree because jaq-json
517+ // requires it.
516518 //
517519 // Real jq auto-creates missing intermediate objects (`{} | .a.b = 1`
518520 // gives `{"a":{"b":1}}`); jaq 3.1.1 does not — `setpath`/`=` error with
⋯ 575 unchanged lines