chore(parser_app): address PR #303 follow-up review comments#309
Conversation
prasanna-anchorage approved #303 with four follow-up asks. This commit addresses all of them: 1. Restore dynamic chain discovery via $(wildcard) wrapped in $(sort). The hardcoded list required editing two places (Makefile + Cargo.toml [features]) for every new chain crate. The sorted wildcard gives the same stable ordering the depth-2 pair generator relied on, with no manual sync. 2. Swap `cargo build` for `cargo check` in both narrow-build-check and feature-matrix-check. The regression class these targets guard (unconditional chain crate references in parser_app) is compile-level, so `check` is sufficient. Roughly 2x faster on per-PR runs, and the feature-matrix target dir grows by ~2GB instead of ~28GB. 3. Add `--no-default-features --features diagnostics` (no chains) to feature-matrix-check so the diagnostics axis is symmetric. 4. Tighten the narrow-build-check comment to reflect the auto-pickup behavior the dynamic variable provides; rewrite the CI cache note so it's accurate (parser_app re-type-checks under each feature set while workspace deps reuse the cache). Verified locally: make narrow-build-check (6 checks + 6 clippy, exit 0); make feature-matrix-check (31 checks across the matrix, exit 0, +~2GB in src/target).
There was a problem hiding this comment.
Pull request overview
This PR updates the parser_app feature-gating verification targets in src/Makefile to be more maintainable and faster, addressing follow-up review items from PR #303.
Changes:
- Restore dynamic chain discovery for
PARSER_APP_CHAINSvia$(wildcard)+$(sort)so newchain_parsers/visualsign-*/directories are auto-included. - Switch
narrow-build-checkandfeature-matrix-checkfromcargo buildtocargo checkto reduce runtime and disk usage while still catching compile-level feature-gating regressions. - Extend
feature-matrix-checkto include a--no-default-features --features diagnostics(diagnostics-only, no chains) combo and tighten comments to reflect current behavior/CI caching.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
prasanna-anchorage
left a comment
There was a problem hiding this comment.
Approving — all four follow-ups from my #303 review are correctly addressed, and I verified each:
- Dynamic chain discovery —
$(sort $(patsubst visualsign-%,%,$(notdir $(wildcard chain_parsers/visualsign-*))))expands to exactlyethereum solana sui tron unspecified, identical to the old hardcoded list, and parser_app's[features]block has a matching feature per chain. The$(sort)gives the stable, deduped ordering the pair generator needs. The "add a chain crate without wiring its feature -> fails loudly at narrow-build-check" behavior is exactly what I wanted. cargo build->cargo check— correct: the regression class (unconditional, un-cfg-gated chain-crate refs) is compile-level, socheckis sufficient and clippy still covers the lint axis. Nice target-dir savings too.- diagnostics-only combo — verified
cargo check -p parser_app --no-default-features --features diagnosticscompiles locally; makes the diagnostics axis symmetric. Invocation count math checks out (31 = 1 + 5 + 5 + 10 + 10). - Comments — accurate now, including the CI-cache note.
No conflicts with main, CI green.
Non-blocking nit: the new standalone echo "==> features: diagnostics" line isn't @-prefixed, so make echoes the echo command itself before running it. Harmless and roughly consistent with how these targets already surface their cargo lines, but @echo would be tidier. Fine to leave.
LGTM.
Summary
Addresses all four follow-up items prasanna-anchorage raised on his approval of #303 (the per-PR narrow-build-check + local feature-matrix-check work). Single PR — all items are small, touch the same Makefile, and don't depend on each other.
Changes
1. Restore dynamic chain discovery (
$(sort)+$(wildcard)).The hardcoded list from #303 required editing both the Makefile variable and
parser_app/Cargo.toml's[features]block whenever a chain was added. The sorted wildcard gives the same stable, deduplicated ordering the depth-2 pair generator needs, and the matrix auto-extends when a newchain_parsers/visualsign-<name>/lands.2.
cargo build→cargo checkin both targets.The regression class these targets guard — unconditional chain-crate references that should have been
#[cfg]-gated — is compile-level.cargo checkis sufficient and roughly 2× faster thancargo build; the clippy invocations already cover lint coverage. As a bonus,feature-matrix-checknow grows the target dir by ~2GB instead of ~28GB across its 31 invocations.3. Add empty + diagnostics combo to
feature-matrix-check.--no-default-features --features diagnostics(no chains compiled in) makes the diagnostics axis symmetric with the rest of the matrix.4. Tighten comments.
narrow-build-checkcomment now reflects the auto-pickup behavior the dynamic variable provides.Test plan
make -C src narrow-build-check— 6cargo check+ 6 clippy invocations, exit 0.make -C src feature-matrix-check— 31cargo checkinvocations (1 diagnostics-only + 5 singles + 5 singles+diagnostics + 10 pairs + 10 pairs+diagnostics), exit 0. Cargo target dir grew by ~2GB.References