Skip to content

Commit 1cdecfd

Browse files
author
Alex J Lennon
committed
refactor: scaffold module + dependency hygiene script
- Collapse breakpoints/state/ui into scaffold/; re-export at crate root for API stability - Add scripts/deps_check.sh (cargo tree -d, audit, outdated); document in README/CONTRIBUTING - cargo audit: no vulnerabilities in current Cargo.lock; tree -d notes thiserror v1+v2 Made-with: Cursor
1 parent 6060adb commit 1cdecfd

8 files changed

Lines changed: 59 additions & 22 deletions

File tree

CONTRIBUTING.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,14 @@ From the repo root, run the same checks CI uses (fmt, tests with `--all-features
4646

4747
On Windows, use **Git Bash** or **WSL** so the script runs, or run the `cargo` commands from that script by hand.
4848

49+
### Optional — dependency hygiene (before releases)
50+
51+
```bash
52+
./scripts/deps_check.sh
53+
```
54+
55+
This runs **`cargo tree -d`** (duplicate transitive versions — often benign, e.g. `thiserror` v1 via `svd-parser` and v2 via `tracing-appender`), **`cargo audit`** against [RustSec](https://github.com/RustSec/advisory-db) (install: `cargo install cargo-audit`), and **`cargo outdated --workspace`** if `cargo-outdated` is installed (`cargo install cargo-outdated`). Major upgrades (e.g. `toml` 0.8 → 1.x) need a deliberate PR, not blind `cargo update`.
56+
4957
### Phase A — RSP-only regression (fast, no `gdb` binary)
5058

5159
Codec framing + proxy TCP integration tests only (~1s):
@@ -321,7 +329,8 @@ rsgdb/
321329
├── src/ # Library + binary
322330
├── tests/ # Integration tests (e.g. proxy RSP smoke)
323331
├── scripts/
324-
│ └── validate_local.sh # Local CI parity (run before PRs)
332+
│ ├── validate_local.sh # Local CI parity (run before PRs)
333+
│ └── deps_check.sh # Optional: tree -d, audit, outdated
325334
├── rsgdb.toml.example
326335
└── .github/workflows/ # CI
327336
```

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,7 @@ rsgdb/
261261
├── src/ # Library + CLI
262262
├── tests/ # Integration tests
263263
├── scripts/validate_local.sh
264+
├── scripts/deps_check.sh # optional: duplicate deps, cargo audit, cargo outdated
264265
├── scripts/e2e_gdb_smoke.sh # gdbserver → rsgdb → gdb (batch); CI E2E job
265266
├── scripts/e2e_zephyr_native_sim.sh # optional: west build native_sim + multi-printf stepping test
266267
├── scripts/e2e_rsp_regression.sh # fast: codec + proxy integration only (no gdb)

scripts/deps_check.sh

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/usr/bin/env bash
2+
# Optional dependency hygiene: duplicates, security advisories, newer crate versions.
3+
# Install helpers once (add ~/.cargo/bin to PATH): cargo install cargo-audit cargo-outdated
4+
set -euo pipefail
5+
6+
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
7+
cd "$ROOT"
8+
9+
echo "==> cargo tree -d (duplicate crate versions in the graph)"
10+
cargo tree -d
11+
12+
echo ""
13+
echo "==> cargo audit (RustSec advisory DB against Cargo.lock)"
14+
cargo audit
15+
16+
echo ""
17+
echo "==> cargo outdated --workspace"
18+
if cargo outdated --workspace 2>/dev/null; then
19+
:
20+
else
21+
echo "(Skipped — install cargo-outdated and ensure it is on PATH: cargo install cargo-outdated)"
22+
fi
23+
24+
echo ""
25+
echo "==> OK — dependency checks finished."

src/lib.rs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
//! - **Proxy**: TCP RSP forward between GDB and a stub (OpenOCD, probe-rs, etc.)
99
//! - **Recording / replay**: JSONL session capture and `replay` mock backend
1010
//! - **SVD**: Read-only peripheral/register (and field) labels for memory packets in logs
11-
//! - **Breakpoints / state / UI**: Lightweight modules and config for future work; proxy does not rewrite breakpoint RSP yet
11+
//! - **Scaffold** ([`scaffold`]): placeholder breakpoints / state / UI types; proxy does not rewrite breakpoint RSP yet
1212
//!
1313
//! ## Example
1414
//!
@@ -23,7 +23,6 @@
2323
//! ```
2424
2525
pub mod backends;
26-
pub mod breakpoints;
2726
pub mod config;
2827
pub mod error;
2928
pub mod flash;
@@ -34,9 +33,13 @@ pub mod proxy;
3433
pub mod recorder;
3534
pub mod replay;
3635
pub mod rtos;
37-
pub mod state;
36+
pub mod scaffold;
3837
pub mod svd;
39-
pub mod ui;
38+
39+
// Stable names for scaffold submodules (see `scaffold` module docs).
40+
pub use scaffold::breakpoints;
41+
pub use scaffold::state;
42+
pub use scaffold::ui;
4043

4144
// Re-export commonly used types
4245
pub use config::{Config, FlashConfig, SvdConfig};
Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
1-
//! Breakpoints module
1+
//! Breakpoints — scaffold types for future breakpoint management.
22
//!
3-
//! Advanced breakpoint management with support for named, conditional,
4-
//! and grouped breakpoints.
5-
//!
6-
//! **Status — scaffold:** types and config exist; the TCP proxy does not run a breakpoint
7-
//! manager on the wire yet (RSP `Z`/`z` packets are forwarded unchanged). Safe to ignore unless
8-
//! you are extending this API.
3+
//! **Status:** The TCP proxy forwards RSP `Z`/`z` unchanged. Safe to ignore unless extending
4+
//! this API.
95
106
/// Breakpoint type
117
#[derive(Debug, Clone, PartialEq)]

src/scaffold/mod.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
//! Placeholder APIs not wired into the TCP proxy yet (breakpoints, session state, UI).
2+
//!
3+
//! These live under one module so the crate root stays focused on the shipped proxy, recorder,
4+
//! SVD, and RTOS paths. Submodules remain **`pub`** and are re-exported at the crate root for
5+
//! stability (`rsgdb::breakpoints`, `rsgdb::state`, `rsgdb::ui`).
6+
7+
pub mod breakpoints;
8+
pub mod state;
9+
pub mod ui;
Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
1-
//! State module
1+
//! Target/session state — scaffold for future tracking.
22
//!
3-
//! State tracking and inspection for debugging sessions.
4-
//!
5-
//! **Status — scaffold:** not wired into the proxy; placeholder enum for future session/target
6-
//! state. Safe to ignore unless you are extending this API.
3+
//! **Status:** Not wired into the proxy. Safe to ignore unless extending this API.
74
85
/// Represents the target state
96
#[derive(Debug, Clone, PartialEq)]

src/ui/mod.rs renamed to src/scaffold/ui.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
1-
//! UI module
1+
//! UI — scaffold for future TUI / web frontends.
22
//!
3-
//! User interface implementations (TUI, web).
4-
//!
5-
//! **Status — scaffold:** `UiConfig`-style placeholders only; no TUI/web server in the binary yet.
6-
//! Safe to ignore unless you are extending this API.
3+
//! **Status:** No TUI or web server in the binary. Safe to ignore unless extending this API.
74
85
/// UI configuration
96
#[derive(Debug, Clone)]

0 commit comments

Comments
 (0)