Skip to content

fix make issue PYTHON_EXE - #4792

Merged
maliberty merged 2 commits into
The-OpenROAD-Project:masterfrom
gudeh:fix-make-issue
Nov 9, 2026
Merged

maliberty merged 2 commits into
The-OpenROAD-Project:masterfrom
gudeh:fix-make-issue

Conversation

@gudeh

@gudeh gudeh commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

I see the following error when executing a run-me (including -gui), generated with make global_place_issue. Tested with private 12nm design and nangate45/gcd both reproduce the issue.

[ERROR GUI-0070] can't read "::env(PYTHON_EXE)": no such variable
no such variable
    (read trace on "::env(PYTHON_EXE)")
    invoked from within
"exec -- $::env(PYTHON_EXE)  $::env(SCRIPTS_DIR)/non_stage_variables.py $stage_name"
    (procedure "erase_non_stage_variables" line 11)
    invoked from within
"erase_non_stage_variables place"
    (file "./scripts/global_place.tcl" line 3)
    invoked from within
"source ./scripts/global_place.tcl"

gudeh and others added 2 commits November 5, 2026 14:53
0772900 switched the Tcl scripts from python3 to $::env(PYTHON_EXE),
but generate-vars.sh leaves out *_EXE vars and only the yosys run-me
script exported it. So OpenROAD-stage issues (e.g. global_place) failed
in erase_non_stage_variables.

Write a portable python3 default into both vars.sh and vars.tcl, and
remove the export that only the yosys run-me script had.

Signed-off-by: Augusto Berndt <augusto.berndt@precisioninno.com>
Co-authored-by: Claude <noreply@anthropic.com>
Signed-off-by: Augusto Berndt <augusto.berndt@precisioninno.com>

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request configures a default PYTHON_EXE (defaulting to python3) in the generated shell and Tcl variable files within flow/util/generate-vars.sh, allowing the redundant fallback to be removed from flow/util/makeIssue.sh. The review feedback recommends using the fully-qualified ::env global namespace instead of env in the generated Tcl script to prevent scoping issues and maintain consistency.

echo 'export FLOW_HOME=${FLOW_HOME:-$(pwd)}' > $1.sh
# *_EXE paths are machine specific and excluded below; default to PATH lookup.
echo 'export PYTHON_EXE=${PYTHON_EXE:-python3}' >> $1.sh
echo 'if { ![info exists env(PYTHON_EXE)] } { set env(PYTHON_EXE) python3 }' > $1.tcl

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Using the fully-qualified ::env global namespace is more robust in Tcl than the unqualified env array. This avoids potential scoping issues if the generated Tcl script is sourced within a non-global scope (such as inside a procedure or namespace). It also maintains consistency with how other environment variables are referenced in the codebase (e.g., $::env(FLOW_HOME)).

Suggested change
echo 'if { ![info exists env(PYTHON_EXE)] } { set env(PYTHON_EXE) python3 }' > $1.tcl
echo 'if { ![info exists ::env(PYTHON_EXE)] } { set ::env(PYTHON_EXE) python3 }' > $1.tcl

@gudeh
gudeh requested a review from vvbandeira November 5, 2026 15:02
@openroad-ci

Copy link
Copy Markdown
Member

🔍 QoR check

Metrics reflect the PR merge build — i.e. what will land on the target branch.

Commit d8a212b · Jenkins build #1 · Baseline: build · View build on dashboard

62 design(s) checked — 0 with regression(s), 0 without a comparable baseline.

@oharboe

oharboe commented Nov 7, 2026

Copy link
Copy Markdown
Collaborator

Non-sequitor: perhaps this should be rewritten to Python now by AI and add unit-tests with mocking...

@maliberty
maliberty merged commit f34d4d9 into The-OpenROAD-Project:master Nov 9, 2026
11 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants