Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion flow/scripts/util.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,8 @@ proc erase_non_stage_variables { stage_name } {
# Tcl yaml package can't be imported in the sta/openroad environment:
#
# https://github.com/The-OpenROAD-Project/OpenROAD/issues/5875
set variables [exec $::env(SCRIPTS_DIR)/non_stage_variables.py $stage_name]
set variables [exec -- $::env(PYTHON_EXE) \
$::env(SCRIPTS_DIR)/non_stage_variables.py $stage_name]
Comment thread
oharboe marked this conversation as resolved.
Resolved
foreach var $variables {
if { [info exists ::env($var)] } {
unset ::env($var)
Expand Down
16 changes: 10 additions & 6 deletions flow/scripts/variables.mk
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,13 @@ endif

include $(PLATFORM_DIR)/config.mk

# defaults.py below runs with PYTHON_EXE, so set it first. See the dragons
# comment near "setup all commands used within this flow" for why.
ifeq ($(origin PYTHON_EXE), undefined)
PYTHON_EXE := $(shell command -v python3)
endif
export PYTHON_EXE

# __SPACE__ is a workaround for whitespace hell in "foreach"; there
# is no way to escape space in defaults.py and get "foreach" to work.
$(foreach line,$(shell $(PYTHON_EXE) $(SCRIPTS_DIR)/defaults.py),$(eval export $(subst __SPACE__, ,$(line))))
Expand Down Expand Up @@ -104,12 +111,9 @@ export NUM_CORES
# Python is not built by ORFS, and as such its absolute path has to be fetched
# from the environment. Use `ifeq ($(origin PYTHON_EXE), undefined)` to check if
# the variable hasn't been defined yet and run a single shell instance to fetch
# the absolute path if so. The other tools should've been built by ORFS, and can
# use a pre-specified path, which we can just use ?= for.
ifeq ($(origin PYTHON_EXE), undefined)
PYTHON_EXE := $(shell command -v python3)
endif
export PYTHON_EXE
# the absolute path if so. That is done further up, before defaults.py runs.
# The other tools should've been built by ORFS, and can use a pre-specified
# path, which we can just use ?= for.

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

Expand Down