fix: make issue tarballs self-contained when WORK_HOME differs#4274
Conversation
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>
There was a problem hiding this comment.
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.
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>
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: