From 49f42d2702bb7b84bfc0d6dd0e0bbe9adb29b007 Mon Sep 17 00:00:00 2001 From: Hugo Hromic Date: Fri, 11 Aug 2023 12:27:36 +0100 Subject: [PATCH] fix(dev): fix Rust toolchain check in Makefile The `make` command inside of the Vector environment image optimizes `$(shell ...)` such that if the command to run is simple enough, it will just call it directly without using a shell. The problem is that the `command` command used to check if the Rust toolchain is installed is a shell builtin and, when optimized, `make` invocations that use the `check-build-tools` target emit the following error: make: command: Command not found This commit fixes the issue by using a redirect, and thus forcing `make` to use the shell. Ref: https://stackoverflow.com/a/12991757 Signed-off-by: Hugo Hromic --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 8ac4e4e5e6e7b..3e0f17ae822bf 100644 --- a/Makefile +++ b/Makefile @@ -221,7 +221,7 @@ build-graphql-schema: ## Generate the `schema.json` for Vector's GraphQL API .PHONY: check-build-tools check-build-tools: ifneq ($(ENVIRONMENT), true) -ifeq (, $(shell command -v cargo)) +ifeq ($(shell command -v cargo >/dev/null || echo not-found), not-found) $(error "Please install Rust: https://www.rust-lang.org/tools/install") endif endif