Skip to content

Commit bbf8f9a

Browse files
committed
cargo-rail: added the 'remove_deps' to the rail.toml config; prepped the VHS tapes for examples/ repos; added the gifs themselves for each repo. updating the docs & adding justfile command for docs-gen; cleaned up readme.md - GIF examples need reviews
1 parent 8197275 commit bbf8f9a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+1174
-214
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ rules.md
2626
ARCHITECTURE.md
2727
style.md
2828
demos/
29-
setup
29+
test.md
3030

3131
# Cargo-Rail (Testing)
3232
*rail.toml

README.md

Lines changed: 42 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ Native changelog generation. Configurable publish delays. GitHub releases via `g
142142
143143
## Why cargo-rail
144144
145-
### 12 dependencies, 92 resolved
145+
### 12 dependencies, 98 resolved
146146
147147
Compare: cargo-hakari pulls ~40 direct via guppy. release-plz pulls 600+ resolved.
148148
@@ -206,28 +206,57 @@ Run `cargo rail <command> --help` for details, or see [docs/commands.md](docs/co
206206
## Configuration
207207
208208
```bash
209-
cargo rail init # Auto-detects targets, generates rail.toml
209+
cargo rail init # Auto-detects targets, generates .config/rail.toml
210210
```
211211
212+
Generated config with all options and defaults:
213+
212214
```toml
213-
# .config/rail.toml or rail.toml
215+
# .config/rail.toml (or rail.toml, .rail.toml, .cargo/rail.toml)
216+
217+
# Platform targets for multi-target validation (auto-detected from rust-toolchain.toml, .cargo/config.toml, etc.)
214218
targets = ["x86_64-unknown-linux-gnu", "aarch64-apple-darwin", "x86_64-pc-windows-msvc"]
215219
216220
[unify]
217-
pin_transitives = true # Pin transitive-only deps (workspace-hack replacement)
218-
msrv = true # Compute and set workspace MSRV
219-
detect_unused = true # Find unused dependencies
220-
remove_unused = true # Remove them automatically
221-
prune_dead_features = true # Remove features never used
222-
exclude = ["openssl"] # Skip specific deps
221+
include_paths = true # Handle path dependencies (default: true)
222+
include_renamed = false # Handle renamed deps with package = "..." (default: false)
223+
pin_transitives = false # Pin transitive-only deps - enable for hakari users (default: false)
224+
transitive_host = "root" # Where to put pinned transitive dev-deps: "root" or "crates/foo"
225+
exclude = [] # Dependencies to skip unification
226+
include = [] # Dependencies to force-include
227+
msrv = true # Compute workspace MSRV from deps (default: true)
228+
strict_version_compat = true # Treat version mismatches as errors (default: true)
229+
exact_pin_handling = "warn" # How to handle =x.y.z pins: skip, preserve, warn (default: warn)
230+
detect_unused = true # Detect unused dependencies (default: true)
231+
remove_unused = true # Auto-remove unused deps (default: true)
232+
max_backups = 3 # Number of backup files to keep (default: 3)
233+
prune_dead_features = true # Remove features never enabled in graph (default: true)
223234
224235
[release]
225-
publish_delay = 5 # Seconds between crates.io publishes
226-
create_github_release = true
227-
236+
tag_prefix = "v" # Prefix for tags
237+
tag_format = "{crate}-{prefix}{version}" # Tag template: {crate}, {prefix}, {version}
238+
require_clean = true # Require clean working directory
239+
publish_delay = 5 # Seconds between crates.io publishes
240+
create_github_release = false # Create GitHub releases via gh CLI
241+
sign_tags = false # Sign tags with GPG/SSH
242+
changelog_path = "CHANGELOG.md" # Path to changelog file
243+
changelog_relative_to = "crate" # "crate" or "workspace"
244+
skip_changelog_for = [] # Crates to skip changelog generation
245+
require_changelog_entries = false # Error if no changelog entries
246+
247+
[change-detection]
248+
# Files that trigger full workspace rebuild
249+
infrastructure = [".github/**", "scripts/**", "justfile", "Makefile", "*.sh"]
250+
# custom.verify = ["verify/**/*.rs"] # Custom path categories
251+
252+
# Per-crate configuration
228253
[crates.my-crate.split]
229254
remote = "[email protected]:org/my-crate.git"
230-
mode = "single" # or "multi", "workspace"
255+
branch = "main"
256+
mode = "single" # single, combined, or monorepo
257+
258+
[crates.my-crate.release]
259+
publish = true
231260
```
232261
233262
---

docs/config.md

Lines changed: 24 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -34,27 +34,25 @@ Dependency unification settings.
3434

3535
```toml
3636
[unify]
37-
pin_transitives = true
38-
detect_unused = false
39-
remove_unused = false
40-
msrv = false
37+
pin_transitives = true # Enable for hakari/workspace-hack users
4138
exclude = ["problem-dep"]
4239
```
4340

4441
| Option | Type | Default | Description |
4542
|--------|------|---------|-------------|
4643
| `include_paths` | bool | `true` | Unify path dependencies |
4744
| `include_renamed` | bool | `false` | Include `package = "..."` deps |
48-
| `pin_transitives` | bool | `true` | Pin fragmented transitives (hakari replacement) |
45+
| `pin_transitives` | bool | `false` | Pin fragmented transitives (enable for hakari users) |
4946
| `transitive_host` | string | `"root"` | Where to put pinned dev-deps |
5047
| `exclude` | string[] | `[]` | Dependencies to skip |
5148
| `include` | string[] | `[]` | Dependencies to force-unify |
5249
| `max_backups` | int | `3` | Backups to keep |
53-
| `msrv` | bool | `false` | Compute and write MSRV |
50+
| `msrv` | bool | `true` | Compute and write MSRV |
5451
| `strict_version_compat` | bool | `true` | Error on version conflicts |
5552
| `exact_pin_handling` | enum | `"warn"` | `"skip"`, `"preserve"`, `"warn"` |
56-
| `detect_unused` | bool | `false` | Detect unused dependencies |
57-
| `remove_unused` | bool | `false` | Auto-remove unused (requires detect_unused) |
53+
| `detect_unused` | bool | `true` | Detect unused dependencies |
54+
| `remove_unused` | bool | `true` | Auto-remove unused (requires detect_unused) |
55+
| `prune_dead_features` | bool | `true` | Remove features never enabled in graph |
5856

5957
---
6058

@@ -64,15 +62,15 @@ Release automation settings.
6462

6563
```toml
6664
[release]
67-
tag_format = "{crate}@{version}"
65+
tag_format = "{crate}-{prefix}{version}"
6866
create_github_release = true
6967
publish_delay = 5
7068
```
7169

7270
| Option | Type | Default | Description |
7371
|--------|------|---------|-------------|
74-
| `tag_prefix` | string | `""` | Git tag prefix |
75-
| `tag_format` | string | `"{crate}@{version}"` | Tag template (`{crate}`, `{version}`, `{prefix}`) |
72+
| `tag_prefix` | string | `"v"` | Git tag prefix (used via `{prefix}`) |
73+
| `tag_format` | string | `"{crate}-{prefix}{version}"` | Tag template (`{crate}`, `{version}`, `{prefix}`) |
7674
| `require_clean` | bool | `true` | Require clean working directory |
7775
| `publish_delay` | int | `5` | Seconds between publishes |
7876
| `create_github_release` | bool | `false` | Create GitHub release via `gh` |
@@ -169,20 +167,29 @@ skip = true
169167
### Minimal
170168

171169
```toml
172-
# Just enable unification with defaults
170+
# Just run `cargo rail init` - defaults are sensible
171+
# msrv, detect_unused, remove_unused, prune_dead_features all default to true
172+
```
173+
174+
### Hakari/workspace-hack users
175+
176+
```toml
173177
[unify]
178+
pin_transitives = true # Enable transitive pinning (replaces workspace-hack)
179+
```
180+
181+
### With renamed dependencies
182+
183+
```toml
184+
[unify]
185+
include_renamed = true # Handle package = "..." renames
174186
```
175187

176188
### CI-optimized monorepo
177189

178190
```toml
179191
targets = ["x86_64-unknown-linux-gnu"]
180192

181-
[unify]
182-
pin_transitives = true
183-
detect_unused = true
184-
remove_unused = true
185-
186193
[release]
187194
require_changelog_entries = true
188195
create_github_release = true
@@ -217,7 +224,5 @@ targets = [
217224
]
218225

219226
[unify]
220-
pin_transitives = true
221-
msrv = true
222227
exclude = ["openssl"] # platform-specific, skip
223228
```

examples/README.md

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,19 @@ Each subdirectory contains:
1414

1515
| Project | Focus | Key Result |
1616
|---------|-------|------------|
17-
| [tokio](./tokio/) | Async runtime | 10 deps unified, 35 edits saved |
18-
| [polars](./polars/) | DataFrame library | Already well-maintained (2 deps) |
19-
| [ruff](./ruff/) | Python linter | 47% CI reduction with `affected` |
20-
| [vello](./vello/) | GPU 2D rendering | 7 deps unified (virtual workspace) |
21-
| [helix](./helix/) | Text editor | 62% CI reduction, 16 deps unified |
22-
| [tikv](./tikv/) | Distributed KV store | 56 deps unified, 514 edits saved |
23-
| [iced](./iced/) | GUI framework | 164 transitives pinned |
24-
| [meilisearch](./meilisearch/) | Search engine | 46 deps unified + 47% CI reduction |
25-
| [ripgrep](./ripgrep/) | Search tool | 9 deps unified (10 crates, not 1!) |
17+
| [codex](./codex/) | AI CLI (48 crates) | 2 deps unified, 132 transitives pinned |
18+
| [helix](./helix/) | Text editor (13 crates) | 16 deps unified, 66 edits saved |
19+
| [helix-db](./helix-db/) | Graph database (6 crates) | 16 deps unified, 44 edits saved |
20+
| [iced](./iced/) | GUI framework (71 crates) | 6 deps unified, 161 transitives pinned |
21+
| [jj](./jj/) | Git-compatible VCS (5 crates) | Well-maintained, 109 transitives |
22+
| [meilisearch](./meilisearch/) | Search engine (19 crates) | 46 deps unified, 209 edits saved |
23+
| [neon](./neon/) | Serverless Postgres (49 crates) | Uses hakari, pin_transitives=true |
24+
| [polars](./polars/) | DataFrame library (33 crates) | Well-maintained, 2 deps unified |
25+
| [ripgrep](./ripgrep/) | Search tool (10 crates) | 9 deps unified, 35 edits saved |
26+
| [ruff](./ruff/) | Python linter (43 crates) | Well-maintained, 86 transitives |
27+
| [tikv](./tikv/) | Distributed KV (83 crates) | 57 deps unified, 516 edits saved |
28+
| [tokio](./tokio/) | Async runtime (10 crates) | 10 deps unified, 35 edits saved |
29+
| [vello](./vello/) | GPU 2D rendering (26 crates) | 7 deps unified, 70 transitives |
2630

2731
## Quick Start
2832

examples/codex/README.md

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# codex + cargo-rail
2+
3+
**Repo:** <https://github.com/openai/codex>
4+
**Commit:** `cbd7d0d54` (2025-11-30)
5+
6+
## Demo
7+
8+
![codex demo](./demo.gif)
9+
10+
## Commands
11+
12+
```bash
13+
# Clone and enter
14+
git clone https://github.com/openai/codex
15+
cd codex/codex-rs
16+
17+
# Initialize cargo-rail
18+
cargo rail init
19+
20+
# Check and apply unification
21+
cargo rail unify --check
22+
cargo rail unify
23+
24+
# See affected crates
25+
cargo rail affected --since HEAD~5
26+
```
27+
28+
## Impact Summary
29+
30+
| Metric | Value |
31+
|--------|-------|
32+
| Workspace members | 48 |
33+
| Dependencies unified | 0 |
34+
| Transitives pinned | 20 |
35+
36+
**Note:** Already well-maintained, no direct unification needed.
37+
38+
## Configuration
39+
40+
```toml
41+
# .config/rail.toml (generated by cargo rail init)
42+
[unify]
43+
include_paths = true
44+
include_renamed = false
45+
pin_transitives = false
46+
transitive_host = "root"
47+
exclude = []
48+
include = []
49+
msrv = true
50+
strict_version_compat = true
51+
exact_pin_handling = "warn"
52+
detect_unused = true
53+
```
54+
55+
## Notes
56+
57+
- OpenAI's Codex CLI (mixed TypeScript/Rust repo)
58+
- Rust workspace in `codex-rs/` subdirectory
59+
- Large workspace (48 crates)
60+
- Already well-maintained with consistent dependency versions
61+
- MSRV detection enabled
62+
63+
Details in [`summary.toml`](./summary.toml).

examples/codex/demo.gif

1010 KB
Loading

examples/codex/demo.tape

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# codex - cargo-rail demo
2+
3+
Output examples/codex/demo.gif
4+
5+
Set FontSize 14
6+
Set Width 900
7+
Set Height 600
8+
Set Theme "Catppuccin Mocha"
9+
Set Padding 20
10+
Set TypingSpeed 75ms
11+
12+
Type "cd ~/loadingalias/testing/codex/codex-rs"
13+
Enter
14+
Sleep 1s
15+
16+
Type "cargo rail init"
17+
Enter
18+
Sleep 3s
19+
20+
Type "cargo rail unify --check"
21+
Enter
22+
Sleep 5s
23+
24+
Type "cargo rail unify"
25+
Enter
26+
Sleep 4s
27+
28+
Type "cargo rail affected --since HEAD~5"
29+
Enter
30+
Sleep 4s
31+
32+
Sleep 2s

examples/codex/summary.toml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
repo = "openai/codex"
2+
commit = "cbd7d0d54"
3+
date = "2025-11-30"
4+
5+
[workspace]
6+
members = 48
7+
lock_deps = 757
8+
9+
[unify]
10+
deps_unified = 2
11+
member_edits = 19
12+
transitives_pinned = 132
13+
deps = ["reqwest", "serde"]
14+
15+
[config]
16+
special = false
17+
pin_transitives = false # No workspace-hack
18+
msrv = true
19+
detect_unused = true
20+
note = "Mixed TS/Rust repo, workspace in codex-rs/"

examples/helix-db/README.md

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# helix-db + cargo-rail
2+
3+
**Repo:** <https://github.com/HelixDB/helix-db>
4+
**Commit:** `5a5c21d8` (2025-11-30)
5+
6+
## Demo
7+
8+
![helix-db demo](./demo.gif)
9+
10+
## Commands
11+
12+
```bash
13+
# Clone and enter
14+
git clone https://github.com/HelixDB/helix-db
15+
cd helix-db
16+
17+
# Initialize cargo-rail
18+
cargo rail init
19+
20+
# Check and apply unification
21+
cargo rail unify --check
22+
cargo rail unify
23+
24+
# See affected crates
25+
cargo rail affected --since HEAD~5
26+
```
27+
28+
## Impact Summary
29+
30+
| Metric | Value |
31+
|--------|-------|
32+
| Workspace members | 6 |
33+
| Dependencies unified | 16 |
34+
| Member edits | 44 |
35+
| Transitives pinned | 0 |
36+
37+
**Dependencies unified:** reqwest, inventory, uuid, heed3, clap, rand, flume, tokio, dotenvy, tempfile, serde_json, chrono, num_cpus, tracing, serde, bumpalo
38+
39+
## Configuration
40+
41+
```toml
42+
# .config/rail.toml (generated by cargo rail init)
43+
[unify]
44+
include_paths = true
45+
include_renamed = false
46+
pin_transitives = false
47+
transitive_host = "root"
48+
exclude = []
49+
include = []
50+
msrv = true
51+
strict_version_compat = true
52+
exact_pin_handling = "warn"
53+
detect_unused = true
54+
```
55+
56+
## Notes
57+
58+
- Graph database written in Rust
59+
- Compact workspace (6 crates) with significant unification potential
60+
- 16 dependencies can be unified across crates
61+
- Good example of `unify` command benefits
62+
- MSRV detection enabled
63+
64+
Details in [`summary.toml`](./summary.toml).

examples/helix-db/demo.gif

713 KB
Loading

0 commit comments

Comments
 (0)