From 793b0132b682ca32ebe5c0d0f02e9f08eea08274 Mon Sep 17 00:00:00 2001 From: leynos Date: Thu, 30 Apr 2026 22:53:56 +0200 Subject: [PATCH] Handle empty CARGO overrides in Makefile Resolve the cargo executable before target definitions and treat an explicitly empty `CARGO` value as unset. This keeps local caller overrides working while preventing CI environments that export `CARGO=` from building commands with an empty executable. --- Makefile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 8aa6ad7b6..1eb17920f 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,8 @@ -CARGO ?= $(shell command -v cargo 2>/dev/null || printf '%s' "$$HOME/.cargo/bin/cargo") +CARGO_RESOLVED := $(shell command -v cargo 2>/dev/null || printf '%s' "$$HOME/.cargo/bin/cargo") +# Some CI environments export CARGO as an empty string; treat that as unset. +ifeq ($(strip $(CARGO)),) +override CARGO := $(CARGO_RESOLVED) +endif NEXTEST ?= $(CARGO) nextest BUNX ?= $(shell command -v bunx 2>/dev/null || printf '%s' "$$HOME/.bun/bin/bunx") TEST_FEATURES ?= --features test-helpers