Skip to content

fix: fail early when build prerequisites are missing or broken#375

Open
leseb wants to merge 2 commits into
praxis-proxy:mainfrom
leseb:leseb/fix-build-error
Open

fix: fail early when build prerequisites are missing or broken#375
leseb wants to merge 2 commits into
praxis-proxy:mainfrom
leseb:leseb/fix-build-error

Conversation

@leseb
Copy link
Copy Markdown
Contributor

@leseb leseb commented May 21, 2026

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 make time instead of letting them fail deep inside a Cargo build script with a cryptic error.

Why: cmake on macOS can appear installed (command -v cmake succeeds) but be broken — e.g. a Homebrew cmake whose Python shebang points to a removed interpreter. The build script for libz-ng-sys then panics with "is cmake not installed?" after minutes of compilation. Same for a missing Rust nightly toolchain failing only at the cargo +nightly fmt step at the end of make lint.

What:

  • check-prereqs validates cargo using --version (catches broken installs, not just missing binaries)
  • check-prereqs-cmake validates cmake --version — only wired as a dependency for targets that compile Rust (build, test, bench, lint, etc.)
  • check-prereqs-nightly validates cargo +nightly --version — only wired for targets that need nightly (lint, fmt, fuzz)
  • Targets that don't need these tools (container, help, tools) are unaffected

Test plan

  • make check-prereqs passes when cargo is available
  • make check-prereqs fails with clear message when cargo is missing from PATH
  • make check-prereqs-cmake fails with clear message when cmake is broken (dead shebang)
  • make check-prereqs-nightly fails with clear message when nightly toolchain is not installed
  • Container and help targets are not gated by prerequisite checks

🤖 Generated with Claude Code

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>
@leseb leseb requested a review from a team May 21, 2026 07:48
@shaneutt shaneutt self-assigned this May 21, 2026
@github-project-automation github-project-automation Bot moved this to Backlog in AI Gateway May 21, 2026
@shaneutt shaneutt moved this from Backlog to Review in AI Gateway May 21, 2026
@shaneutt shaneutt added this to the v0.4.0 milestone May 21, 2026
shaneutt
shaneutt previously approved these changes May 21, 2026
Copy link
Copy Markdown
Member

@shaneutt shaneutt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One comment, when that's resolved 👍

Comment thread Makefile Outdated
# -------------------------------------------------------------------

REQUIRED_CMDS := cargo
RUST_TARGETS := all build release check clean \
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
RUST_TARGETS := all build release check clean \
RUST_TARGETS := all build release check \

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in 8d13e8e

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Review

Development

Successfully merging this pull request may close these issues.

2 participants