Skip to content

Commit 9f5a086

Browse files
committed
flow: extend OPENROAD_EXE fix to PYTHON_EXE/YOSYS_EXE
Same origin-rebinding trap as the parent commit: `export VAR := $(VAR)` made PYTHON_EXE and YOSYS_EXE get caught by UNSET_VARIABLES_NAMES and cleared before sub-makes, so any caller relying on an environment- supplied value (e.g. bazel-orfs passing YOSYS_EXE) silently fell back to the in-tree tools/install path. Switch both to the bare `export` pattern and leave a "here be dragons" comment block near PYTHON_EXE explaining why you must not "tidy up" these lines into `export VAR := $(VAR)`. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
1 parent 72eca88 commit 9f5a086

1 file changed

Lines changed: 14 additions & 2 deletions

File tree

‎flow/scripts/variables.mk‎

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,18 @@ export NUM_CORES
7070

7171
#-------------------------------------------------------------------------------
7272
# setup all commands used within this flow
73+
#
74+
# HERE BE DRAGONS: use bare `export VAR`, never `export VAR := $(VAR)`.
75+
#
76+
# `export VAR := $(VAR)` rebinds the variable to origin "file", which makes
77+
# get_variables (below) include it in UNSET_VARIABLES_NAMES. UNSET_AND_MAKE
78+
# then unsets it before the sub-make runs, so any `?=` fallback here fires
79+
# with the wrong value in the sub-make (e.g. the in-tree tools/install path
80+
# that does not exist in a Bazel sandbox). A bare `export` preserves the
81+
# original origin (environment when bazel-orfs supplies it, file when the
82+
# local default fills in), so the value survives UNSET_VARS.
7383
PYTHON_EXE ?= $(shell command -v python3)
74-
export PYTHON_EXE := $(PYTHON_EXE)
84+
export PYTHON_EXE
7585

7686
export RUN_CMD = $(PYTHON_EXE) $(FLOW_HOME)/scripts/run_command.py
7787

@@ -92,6 +102,7 @@ else
92102
OPENSTA_EXE ?= $(abspath $(FLOW_HOME)/../tools/install/OpenROAD/bin/sta)
93103
endif
94104

105+
# See dragons comment near PYTHON_EXE: bare `export`, not `export := $(VAR)`.
95106
export OPENROAD_EXE
96107
export OPENSTA_EXE
97108

@@ -108,7 +119,8 @@ else
108119
YOSYS_EXE ?= $(abspath $(FLOW_HOME)/../tools/install/yosys/bin/yosys)
109120
endif
110121

111-
export YOSYS_EXE := $(YOSYS_EXE)
122+
# See dragons comment near PYTHON_EXE: bare `export`, not `export := $(VAR)`.
123+
export YOSYS_EXE
112124

113125
YOSYS_IS_VALID := $(if $(YOSYS_EXE),$(shell test -x $(YOSYS_EXE) && echo "true"),)
114126

0 commit comments

Comments
 (0)