Skip to content

Commit 4c7395d

Browse files
oharboeclaude
andcommitted
makeIssue: EXCLUDE_PLATFORM with any WORK_HOME
EXCLUDE_PLATFORM drops the liberty and LEF files from the archive by decompressing it, deleting them and compressing it again. Since the archive moved into WORK_HOME (#3466), the decompression has found it there and the deletion and compression have looked for it in the current directory, where it is only when WORK_HOME is ".": tar: detail_place_test.tar: Cannot open: No such file or directory All three now use the archive's path. The test makes archives with WORK_HOME ".", relative and absolute; the last two failed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
1 parent fdca039 commit 4c7395d

2 files changed

Lines changed: 26 additions & 3 deletions

File tree

‎flow/test/test_make_issue.py‎

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -573,5 +573,28 @@ def test_full_issue_archives_everything(self):
573573
self.assertIn("rtl.v", names)
574574

575575

576+
class TestExcludePlatformWorkHome(StubFlowTestCase):
577+
"""EXCLUDE_PLATFORM drops the liberty and LEF files from the archive
578+
makeIssue writes in WORK_HOME, wherever WORK_HOME is."""
579+
580+
def assert_excluded(self, work_home):
581+
for name in ["cells.lib", "cells.lef"]:
582+
self.stub.write(os.path.join(self.stub.platform_dir, name), "\n")
583+
archive = self.stub.make_issue(work_home, EXCLUDE_PLATFORM="1", FULL_ISSUE="1")
584+
names = [os.path.basename(m) for m in self.stub.members(archive)]
585+
self.assertNotIn("cells.lib", names)
586+
self.assertNotIn("cells.lef", names)
587+
self.assertIn("pdn.tcl", names)
588+
589+
def test_work_home_default(self):
590+
self.assert_excluded(".")
591+
592+
def test_work_home_absolute(self):
593+
self.assert_excluded(os.path.join(self.stub.tmp, "work"))
594+
595+
def test_work_home_relative(self):
596+
self.assert_excluded("work/stub")
597+
598+
576599
if __name__ == "__main__":
577600
unittest.main()

‎flow/util/makeIssue.py‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -187,9 +187,9 @@ def tar_command(env, tar_name, issue_name, files):
187187
)
188188

189189

190-
def exclude_platform_library(tar_name, issue_name):
190+
def exclude_platform_library(tar_name):
191191
"""Drops the liberty and LEF files from the archive."""
192-
tar = f"{issue_name}.tar"
192+
tar = tar_name[: -len(".gz")]
193193
subprocess.run(["gunzip", "-f", tar_name], check=True)
194194
members = subprocess.run(
195195
["tar", "--list", "--file", tar],
@@ -232,7 +232,7 @@ def make_issue(target, env):
232232
subprocess.run(tar_command(env, tar_name, issue_name, files), check=True)
233233

234234
if "EXCLUDE_PLATFORM" in env:
235-
exclude_platform_library(tar_name, issue_name)
235+
exclude_platform_library(tar_name)
236236

237237
if "COPY_ISSUE" in env:
238238
os.makedirs(env["COPY_ISSUE"], exist_ok=True)

0 commit comments

Comments
 (0)