From 246fa799677dd3818bcd5504776aa7795866f462 Mon Sep 17 00:00:00 2001 From: Ethan Dieterich Date: Thu, 20 Feb 2025 13:46:40 -0500 Subject: [PATCH] Makefile: Do not export SHELL The intent for exporting the SHELL variable is to ensure that all Makefile target comands are run with the amended PATH value that is set via the "export PATH := ..." directive. However, exporting PATH value is all that is necessary to ensure that all target commands run with the amended PATH. It is not necessary to *also* export a SHELL command that explicitly sets the PATH value. Specifically: setting SHELL to use "env" to set the PATH environment variable gets difficult if the PATH includes whitespace. make's assignment right hand side parsing does not treat quotes as delimiters of tokens. For example, the following directive in a Makefile results in the FOO variable having 3 tokens, not 2: FOO := bar "baz yow" Therefore, achieving the overall goal of amending the PATH for all Makefile target commands -- even if the PATH includes whitespace -- is best achieved simply by not exporting the SHELL. Signed-off-by: Ethan Dieterich Signed-off-by: Jeff Squyres --- Makefile | 1 - 1 file changed, 1 deletion(-) diff --git a/Makefile b/Makefile index 3cc72405..349dbc57 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,4 @@ export PATH := $(abspath bin/protoc/bin/):$(abspath bin/):${PATH} -export SHELL := env PATH=$(PATH) /bin/sh OS = $(shell uname | tr A-Z a-z)