Skip to content

Detect ripgrep and cmake in dev setup and never install without asking - #443

Merged
ciaranra merged 2 commits into
devfrom
feat/dev-tool-prompts
Aug 6, 2026
Merged

Detect ripgrep and cmake in dev setup and never install without asking#443
ciaranra merged 2 commits into
devfrom
feat/dev-tool-prompts

Conversation

@ciaranra

@ciaranra ciaranra commented Aug 6, 2026

Copy link
Copy Markdown
Member

Closes #383. Closes #344.

ripgrep (#383)

just lint runs pre-commit run --all-files, whose dependency-integrity-check hook (always_run: true) executes scripts/dependency-integrity-check.sh. That script hard-requires rg — 36 call sites, including --files, --glob exclusion lists, and {40} interval regexes that the script's own comment explains cannot be done in awk. Nothing in pecos setup or just doctor mentioned ripgrep, so the first sign of trouble was a failed lint run.

ripgrep is now a detected dependency: pecos setup reports and offers it, pecos install ripgrep installs it on demand, and just doctor reports it. The install action is cargo install ripgrep --locked — cargo is already required by every Just recipe, and one command covers macOS, Linux and Windows, so no vendored download, checksum table, or platform matrix was added. The script's missing-rg failure now names the fix instead of only the requirement.

Declining is a supported answer everywhere: setup, doctor, and the script all print pecos install ripgrep plus cargo install ripgrep --locked / brew install ripgrep / apt install ripgrep / winget install BurntSushi.ripgrep and a docs link.

cmake (#344)

The setup prompt for cmake already existed and works. The remaining gap was downstream: pecos rust test, check, and clippy all pass --all-features, which enables mwpf, which needs cmake. A developer who declined the cmake prompt hit a raw highs-sys build error with no route back. All three lanes now preflight cmake and fail fast:

Error: Config("`pecos rust test` runs `cargo test -p pecos-decoders --all-features`,
which enables the `mwpf` feature and requires cmake. Install cmake with
`pecos install cmake`. See https://github.com/.../cmake-setup.md")

Consent fix

prompt::confirm returned default_yes when stdin was not a terminal, and install prompts default to yes — so a non-TTY invocation without --yes silently downloaded and installed. It now declines and explains that --yes accepts prompts non-interactively. PromptMode::AcceptAll and DeclineAll are unchanged, and no CI lane relied on the old behavior (no workflow invokes just build, setup-quiet, just setup, or pecos setup).

just build at a terminal prompts as before. Without a terminal it now declines and the build fails later with the existing LLVM guidance, rather than installing unasked.

Verification

  • cargo fmt --all -- --check, cargo clippy --locked --workspace --all-targets -- -D warnings, cargo test --locked -p pecos-build -p pecos-cli (43 + 4 + 3 doctests), cargo build --locked -p pecos-cli — all pass.
  • pre-commit run --all-files — clean.
  • With shims hiding both cmake and rg: pecos setup --no --skip-llvm --skip-cuda prints both decline blocks with all install routes; pecos setup --quiet < /dev/null auto-declines and installs nothing; pecos rust test fails fast with the message above.
  • scripts/dependency-integrity-check.sh exits 1 with the new guidance when rg is hidden, and exits 0 unchanged when it is present.

A shared executable::which_in_path helper replaces two near-duplicate PATH lookups. It takes the caller's filename-suffix policy, so LLVM tool discovery stays .exe-only on Windows and cmake keeps its .exe/.bat/extensionless policy.

@ciaranra
ciaranra merged commit 5269c5e into dev Aug 6, 2026
62 checks passed
@ciaranra
ciaranra deleted the feat/dev-tool-prompts branch August 6, 2026 03:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ripgrep not installed automatically during dev environment setup cmake

1 participant