Skip to content

core: make test-log a dev dependency#18846

Merged
bolinfest merged 1 commit intomainfrom
pr18846
Apr 21, 2026
Merged

core: make test-log a dev dependency#18846
bolinfest merged 1 commit intomainfrom
pr18846

Conversation

@bolinfest
Copy link
Copy Markdown
Collaborator

@bolinfest bolinfest commented Apr 21, 2026

The test-log crate is only used by codex-core tests, so it does not need
to be part of the normal codex-core dependency graph. Keeping test-log in
dev-dependencies removes it from normal codex-core builds and keeps the
production dependency set a little smaller.

Verification:

  • cargo tree -p codex-core --edges normal --invert test-log
  • cargo check -p codex-core --lib
  • cargo test -p codex-core --lib

@bolinfest bolinfest requested a review from a team as a code owner April 21, 2026 14:37
@bolinfest bolinfest changed the base branch from main to pr18844 April 21, 2026 14:37
bolinfest added a commit that referenced this pull request Apr 21, 2026
## What changed

This PR makes the default Cargo dev profile use line-tables-only debug
info:

```toml
[profile.dev]
debug = 1
```

That keeps useful backtraces while avoiding the cost of full variable
debug
info in normal local dev builds.

This also makes the Bazel CI setting explicit with `-Cdebuginfo=0` for
target
and exec-configuration Rust actions. Bazel/rules_rust does not read
Cargo
profiles for this setting, and the current fastbuild action already
emitted
`--codegen=debuginfo=0`; the Bazel part of this PR makes that choice
direct in
our build configuration.

## Why

The slow codex-core rebuilds are dominated by debug-info codegen, not
parsing
or type checking. On a warm-dependency package rebuild, the baseline
codex-core compile was about 39.5s wall / 38.9s rustc total, with
codegen_crate around 14.0s and LLVM_passes around 13.4s. Setting
codex-core
to line-tables-only debug info brought that to about 27.2s wall / 26.7s
rustc
total, with codegen_crate around 3.1s and LLVM_passes around 2.8s.

`debug = 0` was only about another 0.7s faster than `debug = 1` in the
codex-core measurement, so `debug = 1` is the better default dev
tradeoff: it
captures nearly all of the compile-time win while preserving basic
debuggability.

I also sampled other first-party crates instead of keeping a
codex-core-only
package override. codex-app-server showed the same pattern: rustc total
dropped from 15.85s to 10.48s, while codegen_crate plus LLVM_passes
dropped
from about 13.47s to 3.23s. codex-app-server-protocol had a smaller but
still
real improvement, 16.05s to 14.58s total, and smaller crates showed
modest
wins. That points to a workspace dev-profile policy rather than a
hand-maintained list of large crates.

## Relationship to #18612

[#18612](#18612) added the
`dev-small`
profile. That remains useful when someone wants a working local build
quickly
and is willing to opt in with `cargo build --profile dev-small`.

This PR is deliberately less aggressive: it changes the common default
dev
profile while preserving line tables/backtraces. `dev-small` remains the
explicit "build quickly, no debuggability concern" path.

## Other investigation

I looked for another structural win comparable to
[#16631](#16631) and
[#16630](#16630), but did not find
one.
The attempted TOML monomorphization changes were noisy or worse in
measurement, and the async task changes reduced some instantiations but
only
translated to roughly a one-second improvement while being much more
disruptive. The debug-info setting was the one repeatable, material win
that
survived measurement.

## Verification

- `just bazel-lock-update`
- `just bazel-lock-check`
- `cargo check -p codex-core --lib`
- `cargo test -p codex-core --lib`
- Bazel `aquery --config=ci-linux` confirmed `--codegen=debuginfo=0` and
  `-Cdebuginfo=0` for `//codex-rs/core:core`


---
[//]: # (BEGIN SAPLING FOOTER)
Stack created with [Sapling](https://sapling-scm.com). Best reviewed
with [ReviewStack](https://reviewstack.dev/openai/codex/pull/18844).
* #18846
* __->__ #18844
Base automatically changed from pr18844 to main April 21, 2026 16:00
test-log is only used by codex-core tests, so it does not need to be part of
the normal codex-core dependency graph. Keeping it in dev-dependencies removes
it from normal builds and keeps the production dependency set a little smaller.

Verification:

- `cargo tree -p codex-core --edges normal --invert test-log`
- `cargo check -p codex-core --lib`
- `cargo test -p codex-core --lib`
@bolinfest bolinfest requested a review from aibrahim-oai April 21, 2026 16:02
@bolinfest bolinfest merged commit b06fc8b into main Apr 21, 2026
49 of 50 checks passed
@bolinfest bolinfest deleted the pr18846 branch April 21, 2026 16:48
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 21, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant