From 8826393c51857d1870c692af089958c44ae97ad2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=98yvind=20Harboe?= Date: Fri, 17 Apr 2026 18:08:18 +0200 Subject: [PATCH 1/2] make: preserve tool *_EXE env vars across UNSET_AND_MAKE MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Commit df79ba1d9 ("make: immediately expand deferred vars") changed the tool-path setup from export OPENROAD_EXE ?= $(abspath ...) to OPENROAD_EXE ?= $(abspath ...) export OPENROAD_EXE := $(OPENROAD_EXE) The := reassign gives the variable origin "file" even when the value was supplied through the environment. UNSET_VARIABLES_NAMES collects every file-origin variable and $(UNSET_AND_MAKE) unsets them in the bash wrapper before invoking the submake. That strips a caller- supplied OPENROAD_EXE / OPENSTA_EXE / YOSYS_EXE from the submake's environment, and variables.mk re-derives them via the $(FLOW_HOME)/../tools/install/... fallback — a path that does not exist in hermetic builds (e.g. bazel-orfs). Extend the unset exclusion list to cover OPENROAD%, OPENSTA%, YOSYS%, mirroring the KLAYOUT% entry already there for the same reason. This restores the pre-df79ba1d9 behavior for callers that pass tool paths through the environment, without reverting the immediate- expansion fix. Signed-off-by: Øyvind Harboe --- flow/scripts/variables.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flow/scripts/variables.mk b/flow/scripts/variables.mk index 35b4457729..3f33c157a1 100644 --- a/flow/scripts/variables.mk +++ b/flow/scripts/variables.mk @@ -188,7 +188,7 @@ export RESULTS_V = $(notdir $(sort $(wildcard $(RESULTS_DIR)/*.v))) export GDS_MERGED_FILE = $(RESULTS_DIR)/6_1_merged.$(STREAM_SYSTEM_EXT) define get_variables -$(foreach V, $(.VARIABLES),$(if $(filter-out $(1), $(origin $V)), $(if $(filter-out .% %QT_QPA_PLATFORM% KLAYOUT% GENERATE_ABSTRACT_RULE% do-step% do-copy% OPEN_GUI% OPEN_GUI_SHORTCUT% SUB_MAKE% UNSET_VARS% export%, $(V)), $V$ ))) +$(foreach V, $(.VARIABLES),$(if $(filter-out $(1), $(origin $V)), $(if $(filter-out .% %QT_QPA_PLATFORM% KLAYOUT% OPENROAD% OPENSTA% YOSYS% GENERATE_ABSTRACT_RULE% do-step% do-copy% OPEN_GUI% OPEN_GUI_SHORTCUT% SUB_MAKE% UNSET_VARS% export%, $(V)), $V$ ))) endef export UNSET_VARIABLES_NAMES := $(call get_variables,command% line environment% default automatic) From 5c190f6bc07be0bb103939dde1764b57e05bccc8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=98yvind=20Harboe?= Date: Fri, 17 Apr 2026 18:20:16 +0200 Subject: [PATCH 2/2] make: also preserve PYTHON_EXE across UNSET_AND_MAKE MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PYTHON_EXE follows the same `?=` then `export := $(PYTHON_EXE)` pattern as OPENROAD_EXE / OPENSTA_EXE / YOSYS_EXE, so a caller-supplied value is similarly stripped by UNSET_AND_MAKE because the re-export gives it origin "file". Add PYTHON% to the exclusion list alongside the other tool prefixes. Addresses gemini-code-assist review feedback on PR #4159. Signed-off-by: Øyvind Harboe --- flow/scripts/variables.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flow/scripts/variables.mk b/flow/scripts/variables.mk index 3f33c157a1..830d4b1ef0 100644 --- a/flow/scripts/variables.mk +++ b/flow/scripts/variables.mk @@ -188,7 +188,7 @@ export RESULTS_V = $(notdir $(sort $(wildcard $(RESULTS_DIR)/*.v))) export GDS_MERGED_FILE = $(RESULTS_DIR)/6_1_merged.$(STREAM_SYSTEM_EXT) define get_variables -$(foreach V, $(.VARIABLES),$(if $(filter-out $(1), $(origin $V)), $(if $(filter-out .% %QT_QPA_PLATFORM% KLAYOUT% OPENROAD% OPENSTA% YOSYS% GENERATE_ABSTRACT_RULE% do-step% do-copy% OPEN_GUI% OPEN_GUI_SHORTCUT% SUB_MAKE% UNSET_VARS% export%, $(V)), $V$ ))) +$(foreach V, $(.VARIABLES),$(if $(filter-out $(1), $(origin $V)), $(if $(filter-out .% %QT_QPA_PLATFORM% KLAYOUT% OPENROAD% OPENSTA% PYTHON% YOSYS% GENERATE_ABSTRACT_RULE% do-step% do-copy% OPEN_GUI% OPEN_GUI_SHORTCUT% SUB_MAKE% UNSET_VARS% export%, $(V)), $V$ ))) endef export UNSET_VARIABLES_NAMES := $(call get_variables,command% line environment% default automatic)