You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: AGENTS.md
+42Lines changed: 42 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -48,6 +48,48 @@ In the codex-rs folder where the rust code lives:
48
48
trivial; prefer new modules/files and keep `chatwidget.rs` focused on orchestration.
49
49
- When running Rust commands (e.g. `just fix` or `cargo test`) be patient with the command and never try to kill them using the PID. Rust lock can make the execution slow, this is expected.
50
50
51
+
## Fast Rust Builds
52
+
53
+
The workspace is large (~90 crates). Use these defaults for fast dev builds:
54
+
55
+
### Prerequisites (one-time)
56
+
```bash
57
+
sudo apt install -y mold # fast linker
58
+
cargo install sccache # compile cache
59
+
```
60
+
61
+
### Global cargo config (`~/.cargo/config.toml`)
62
+
```toml
63
+
[build]
64
+
jobs = 72# match core count (nproc)
65
+
rustc-wrapper = "sccache"
66
+
rustflags = ["-C", "link-arg=-fuse-ld=mold"]
67
+
target-dir = "/nvme0n1-disk/cargo-target"# fast disk; adjust per machine
68
+
```
69
+
70
+
### Environment (`~/.bashrc` or `~/.zshrc`)
71
+
```bash
72
+
export SCCACHE_DIR=/nvme0n1-disk/sccache # keep cache on fast disk
73
+
export SCCACHE_CACHE_SIZE=50G
74
+
```
75
+
76
+
### Dev profile (already in `codex-rs/Cargo.toml`)
77
+
```toml
78
+
[profile.dev]
79
+
codegen-units = 512# trades binary size for parallel codegen speed
80
+
```
81
+
82
+
### Verifying
83
+
```bash
84
+
cargo build --timings # produces HTML timing report in target/cargo-timings/
85
+
sccache --show-stats # check cache hit rate
86
+
```
87
+
88
+
### Portable setup
89
+
`~/code/dotfiles/linux-setup.sh` auto-detects the fastest available disk (`/nvme0n1-disk` → `/scratch` → `$HOME`) and configures all of the above.
90
+
91
+
---
92
+
51
93
Run `just fmt` (in `codex-rs` directory) automatically after you have finished making Rust code changes; do not ask for approval to run it. Additionally, run the tests:
52
94
53
95
1. Run the test for the specific project that was changed. For example, if changes were made in `codex-rs/tui`, run `cargo test -p codex-tui`.
0 commit comments