Detect ripgrep and cmake in dev setup and never install without asking - #443
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #383. Closes #344.
ripgrep (#383)
just lintrunspre-commit run --all-files, whosedependency-integrity-checkhook (always_run: true) executesscripts/dependency-integrity-check.sh. That script hard-requiresrg— 36 call sites, including--files,--globexclusion lists, and{40}interval regexes that the script's own comment explains cannot be done in awk. Nothing inpecos setuporjust doctormentioned ripgrep, so the first sign of trouble was a failed lint run.ripgrep is now a detected dependency:
pecos setupreports and offers it,pecos install ripgrepinstalls it on demand, andjust doctorreports it. The install action iscargo 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-rgfailure now names the fix instead of only the requirement.Declining is a supported answer everywhere: setup, doctor, and the script all print
pecos install ripgreppluscargo install ripgrep --locked/brew install ripgrep/apt install ripgrep/winget install BurntSushi.ripgrepand a docs link.cmake (#344)
The setup prompt for cmake already existed and works. The remaining gap was downstream:
pecos rust test,check, andclippyall pass--all-features, which enablesmwpf, 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:Consent fix
prompt::confirmreturneddefault_yeswhen stdin was not a terminal, and install prompts default to yes — so a non-TTY invocation without--yessilently downloaded and installed. It now declines and explains that--yesaccepts prompts non-interactively.PromptMode::AcceptAllandDeclineAllare unchanged, and no CI lane relied on the old behavior (no workflow invokesjust build,setup-quiet,just setup, orpecos setup).just buildat 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.cmakeandrg:pecos setup --no --skip-llvm --skip-cudaprints both decline blocks with all install routes;pecos setup --quiet < /dev/nullauto-declines and installs nothing;pecos rust testfails fast with the message above.scripts/dependency-integrity-check.shexits 1 with the new guidance whenrgis hidden, and exits 0 unchanged when it is present.A shared
executable::which_in_pathhelper 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.