fix: fail early when build prerequisites are missing or broken#375
Open
leseb wants to merge 2 commits into
Open
fix: fail early when build prerequisites are missing or broken#375leseb wants to merge 2 commits into
leseb wants to merge 2 commits into
Conversation
Uses --version rather than command -v so we catch both missing installs and broken ones (e.g. cmake with a dead Python shebang). Checks are scoped per-target: cmake only for build targets, nightly only for fmt/lint/fuzz. Assisted-By: Claude Code (claude-opus-4-6) Signed-off-by: Sébastien Han <seb@redhat.com>
shaneutt
previously approved these changes
May 21, 2026
Member
shaneutt
left a comment
There was a problem hiding this comment.
One comment, when that's resolved 👍
| # ------------------------------------------------------------------- | ||
|
|
||
| REQUIRED_CMDS := cargo | ||
| RUST_TARGETS := all build release check clean \ |
Member
There was a problem hiding this comment.
Suggested change
| RUST_TARGETS := all build release check clean \ | |
| RUST_TARGETS := all build release check \ |
cargo clean does not need a working cargo --version check. Assisted-By: Claude Code (claude-opus-4-6) Signed-off-by: Sébastien Han <seb@redhat.com>
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.
Summary
Adds prerequisite checks to the Makefile that run before any build/test/lint target. Catches missing or broken tools (cargo, cmake, nightly toolchain) at
maketime instead of letting them fail deep inside a Cargo build script with a cryptic error.Why: cmake on macOS can appear installed (
command -v cmakesucceeds) but be broken — e.g. a Homebrew cmake whose Python shebang points to a removed interpreter. The build script forlibz-ng-systhen panics with "is cmake not installed?" after minutes of compilation. Same for a missing Rust nightly toolchain failing only at thecargo +nightly fmtstep at the end ofmake lint.What:
check-prereqsvalidatescargousing--version(catches broken installs, not just missing binaries)check-prereqs-cmakevalidatescmake --version— only wired as a dependency for targets that compile Rust (build, test, bench, lint, etc.)check-prereqs-nightlyvalidatescargo +nightly --version— only wired for targets that need nightly (lint, fmt, fuzz)Test plan
make check-prereqspasses when cargo is availablemake check-prereqsfails with clear message when cargo is missing from PATHmake check-prereqs-cmakefails with clear message when cmake is broken (dead shebang)make check-prereqs-nightlyfails with clear message when nightly toolchain is not installed🤖 Generated with Claude Code