From 2b672f1e8c5d9589a56787d8093936d93652fdac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=98yvind=20Harboe?= Date: Sun, 22 Feb 2026 08:22:09 +0100 Subject: [PATCH] make: print-FOO race condition global env var fix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit avoid race conditions for global variables and temp files Signed-off-by: Øyvind Harboe --- flow/scripts/variables.mk | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/flow/scripts/variables.mk b/flow/scripts/variables.mk index 305818b1eb..7300f9d8d6 100644 --- a/flow/scripts/variables.mk +++ b/flow/scripts/variables.mk @@ -217,16 +217,5 @@ vars: .PHONY: print-% print-%: - # HERE BE DRAGONS! - # - # We have to use /tmp. $(OBJECTS_DIR) may not exist - # at $(file) expansion time, which is before commands are run - # here, so we can't mkdir -p $(OBJECTS_DIR) either - # - # We have to use $(file ...) because we want to be able - # to print variables that contain newlines. - $(eval TEMP_FILE := $(shell mktemp /tmp/print_tmp.XXXXXX)) - @$(file >$(TEMP_FILE),$($*)) - @echo -n "$*: " - @cat $(TEMP_FILE) - @rm -f $(TEMP_FILE) + $(info $*: $($*)) + @true