Repository navigation
fix: make issue tarballs self-contained when WORK_HOME differs - #4274
vvbandeira merged 2 commits into
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>
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>
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>
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>
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>
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: