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
{{ message }}
Repository navigation
feat(cli): friendly error when record/watch runs outside a Cargo project #70
Running cargo-chronoscope record (or watch) in a directory without a Cargo.toml currently surfaces cargo's raw error through the supervisor pipeline, which is noisy. The user gets:
error: could not find `Cargo.toml` in `/some/path` or any parent directory
— wrapped in JSON event-stream warnings that are hard to parse for someone who just typo'd a cd.
Proposal
Detect the missing manifest before spawning cargo and exit with a clean error:
error: no Cargo.toml in /some/path or any parent directory.
cargo-chronoscope must be run from inside a Rust project (the same place `cargo build` would work). Try:
cd /path/to/your/rust/project
cargo-chronoscope record
Walk up from workspace_dir looking for Cargo.toml, identical to what cargo does. If none found, return a friendly anyhow! error from cmd_record / cmd_watch before reaching supervisor::spawn_build.
Acceptance
In a directory with no Cargo.toml (and no parent with one), cargo-chronoscope record exits non-zero with the friendly message above.
In a workspace root (Cargo.toml exists), behavior is unchanged.
In a workspace member (nested directory whose parent has Cargo.toml), behavior is unchanged.
Existing tests still pass; one new test covers the no-Cargo.toml case.
Files
src/main.rs — cmd_record, cmd_watch get a pre-flight check, or a small helper
tests/ — new integration test using tempfile::TempDir
Activity
txhno commentedon May 5, 2026
ive fixed it here: #72