Skip to content

Commit

Permalink
fix(dev): fix Rust toolchain check in Makefile
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
hhromic committed Aug 11, 2023
1 parent f39a0e9 commit 49f42d2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 49f42d2

Please sign in to comment.