Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions build_tools/packaging/linux/packaging_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1084,6 +1084,13 @@ def filter_components_fromartifactory(
if match_found and line.strip():
logger.debug(f"Matching line: {line.strip()}")
source_path = source_dir / line.strip()
# Split artifacts retain original manifest roots even
# when all of a root's device images were moved into
# a shared kpack under another root. Match the artifact
# flattener's handling of these absent roots, while
# retaining validation of every existing payload.
if enable_kpack and not source_path.exists():
continue
sourcedir_list.append(source_path)
except OSError as e:
logger.warning(f"Could not read manifest {filename}: {e}")
Expand Down
18 changes: 18 additions & 0 deletions build_tools/packaging/linux/tests/build_package_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,24 @@ def test_deb_retains_only_selected_payloads(self, mock_build, _mock_move):
STAGING_PAYLOAD_BYTES,
)

@patch.object(deb_package, "move_packages_to_destination", return_value=[])
@patch.object(deb_package, "package_with_dpkg_build")
def test_deb_retains_kpacks_with_absent_manifest_roots(self, mock_build, _move):
cfg = self._stage_targets(("gfx1250", "gfx1250-strict"))
for target in cfg.gfxarch_list:
manifest = cfg.artifacts_dir / f"fft_lib_{target}" / "artifact_manifest.txt"
# A split archive can retain a root with no remaining files.
with manifest.open("a") as stream:
stream.write("empty/rocFFT/stage\n")
deb_package.create_versioned_deb_package(PKG_FFT, cfg)
payload_dir = (
mock_build.call_args.args[0] / cfg.install_prefix.lstrip("/") / ".kpack"
)
self.assertEqual(
{path.name: path.read_bytes() for path in payload_dir.iterdir()},
{f"fft_{target}.kpack": STAGING_PAYLOAD_BYTES for target in cfg.gfxarch_list},
)

@patch.object(rpm_package, "move_packages_to_destination", return_value=[])
@patch.object(rpm_package, "package_with_rpmbuild")
def test_rpm_spec_includes_only_selected_roots(self, _mock_build, _mock_move):
Expand Down
Loading