Skip to content

fix: make issue tarballs self-contained when WORK_HOME differs - #4274

Merged
vvbandeira merged 2 commits into
The-OpenROAD-Project:masterfrom
The-OpenROAD-Project-staging:make-issue-paths
Jun 4, 2026
Merged

vvbandeira merged 2 commits into
The-OpenROAD-Project:masterfrom
The-OpenROAD-Project-staging:make-issue-paths

Conversation

@vvbandeira

Copy link
Copy Markdown
Member

CI runs ORFS from a docker image (/OpenROAD-flow-scripts) with WORK_HOME set to the Jenkins workspace (/tmp/workspace/...). The issue tarballs then recreated the absolute workspace path (tmp/ folder) and run-me sourced the vars file via a hardcoded CI path, so extracted reproducibles failed out of the box:

run-me-*.sh: line 2: /tmp/workspace/.../vars-*.sh: No such file
[ERROR STA-0340] cannot open '/final_report.tcl'.
  • makeIssue.sh: source vars relative to run-me location; strip WORK_HOME prefix (literal and symlink-resolved) from tar members
  • generate-vars.sh: relativize paths under WORK_HOME instead of only the hardcoded /workspace prefix
  • test_make_issue.sh: run the extracted run-me script instead of the WORK_HOME copy via absolute path

CI runs ORFS from a docker image (/OpenROAD-flow-scripts) with
WORK_HOME set to the Jenkins workspace (/tmp/workspace/...). The
issue tarballs then recreated the absolute workspace path (tmp/
folder) and run-me sourced the vars file via a hardcoded CI path,
so extracted reproducibles failed out of the box:

  run-me-*.sh: line 2: /tmp/workspace/.../vars-*.sh: No such file
  [ERROR STA-0340] cannot open '/final_report.tcl'.

- makeIssue.sh: source vars relative to run-me location; strip
  WORK_HOME prefix (literal and symlink-resolved) from tar members
- generate-vars.sh: relativize paths under WORK_HOME instead of
  only the hardcoded /workspace prefix
- test_make_issue.sh: run the extracted run-me script instead of
  the WORK_HOME copy via absolute path

Signed-off-by: Vitor Bandeira <vvbandeira@precisioninno.com>
@vvbandeira vvbandeira self-assigned this Jun 3, 2026

@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 improves the portability of reproducible test archives generated by makeIssue.sh when run in environments with custom workspace directories (such as CI). It relativizes paths under WORK_HOME and ensures the generated run script sources the environment variables relatively. The review feedback highlights two issues: first, the path relativization in generate-vars.sh can corrupt paths if work_path is a prefix of another directory name (e.g., /tmp/work matching /tmp/work_other); second, a trailing slash in WORK_HOME can cause double slashes in the tar transform pattern in makeIssue.sh, preventing the prefix from being stripped correctly. Code suggestions are provided to address both issues.

Comment thread flow/util/generate-vars.sh Resolved
Comment thread flow/util/makeIssue.sh Resolved
Address review:

- generate-vars.sh: require a path boundary after WORK_HOME so a
  prefix (e.g. /tmp/work) does not corrupt sibling paths
  (e.g. /tmp/work_other)
- makeIssue.sh: tolerate trailing slash in WORK_HOME and slash runs
  in tar member names (${WORK_HOME}/x yields ws//x when WORK_HOME
  ends in /)

Signed-off-by: Vitor Bandeira <vvbandeira@precisioninno.com>
@vvbandeira
vvbandeira merged commit eb14d76 into The-OpenROAD-Project:master Jun 4, 2026
8 checks passed
@vvbandeira
vvbandeira deleted the make-issue-paths branch June 4, 2026 20:18
oharboe added a commit to oharboe/OpenROAD-flow-scripts that referenced this pull request Nov 18, 2026
Files under FLOW_HOME lose its path in the archive, so a design outside
the ORFS checkout gives a working archive (The-OpenROAD-Project#1410). Files under an
absolute WORK_HOME, such as a CI workspace, lose its path too, through a
symlink and with a trailing slash, while a directory that only starts
with WORK_HOME's name keeps its path (The-OpenROAD-Project#4274).

The tests make archives with WORK_HOME ".", absolute, absolute with a
trailing slash and through a symlink, and check the logs, results,
scripts, design, platform, run-me and vars files are at the archive's
root and no absolute path is recreated. Without the --transform
expressions four of the five fail.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
oharboe added a commit to oharboe/OpenROAD-flow-scripts that referenced this pull request Nov 18, 2026
generate-vars.sh writes the archive's vars files, and they have been
fixed for running somewhere else: python3 is the default PYTHON_EXE in
both the shell and the Tcl vars (The-OpenROAD-Project#4792), paths under an absolute
WORK_HOME are relative to the archive's root while a directory that
only starts with WORK_HOME's name keeps its path (The-OpenROAD-Project#4274), and paths
under a docker image's /workspace and /platforms are relative (The-OpenROAD-Project#3870).
PRESERVE_PATHS keeps every path as it is.

The tests make an archive and read its vars files. The stub flow moves
one level down, so that the stub's WORK_HOME, like a CI workspace, is
outside the ORFS root the vars files spell ${FLOW_HOME}/...

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
oharboe added a commit to oharboe/OpenROAD-flow-scripts that referenced this pull request Nov 18, 2026
Files under FLOW_HOME lose its path in the archive, so a design outside
the ORFS checkout gives a working archive (The-OpenROAD-Project#1410). Files under an
absolute WORK_HOME, such as a CI workspace, lose its path too, through a
symlink and with a trailing slash, while a directory that only starts
with WORK_HOME's name keeps its path (The-OpenROAD-Project#4274).

The tests make archives with WORK_HOME ".", absolute, absolute with a
trailing slash and through a symlink, and check the logs, results,
scripts, design, platform, run-me and vars files are at the archive's
root and no absolute path is recreated. Without the --transform
expressions four of the five fail.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
oharboe added a commit to oharboe/OpenROAD-flow-scripts that referenced this pull request Nov 18, 2026
generate_vars.py writes the archive's vars files, and they have been
fixed for running somewhere else: python3 is the default PYTHON_EXE in
both the shell and the Tcl vars (The-OpenROAD-Project#4792), paths under an absolute
WORK_HOME are relative to the archive's root while a directory that
only starts with WORK_HOME's name keeps its path (The-OpenROAD-Project#4274), and paths
under a docker image's /workspace and /platforms are relative (The-OpenROAD-Project#3870).
PRESERVE_PATHS keeps every path as it is.

The tests make an archive and read its vars files. The stub flow moves
one level down, so that the stub's WORK_HOME, like a CI workspace, is
outside the ORFS root the vars files spell ${FLOW_HOME}/...

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
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.

1 participant