INNER CODE UNIT · Python
verify
mumu-lhl/Ciyue · tools/bundle_linux_dependencies.py:165
def verify(bundle_dir: Path) -> None:
library_dir = bundle_dir / "lib"
provided_names: set[str] = set()
for path in library_dir.iterdir():
if path.is_symlink() and not path.exists():
raise RuntimeError(f"Bundle contains a broken library symlink: {path}")
if path.is_file() and elf_metadata(path.resolve()) is not None:
provided_names.add(path.name)
missing: dict[str, list[Path]] = {}
for binary in iter_elf_files(bundle_dir):
metadata = elf_metadata(binary)
assert metadata is not None
for needed in metadata.needed:
if needed not in SYSTEM_LIBRARIES and needed not in provided_names:
missing.setdefault(needed, []).append(binary)
if missing:
details = "\n".join(