From a89d7aeccc1660a323b6b5c8e025b5a4e4420733 Mon Sep 17 00:00:00 2001 From: Bruno Lopes Date: Sat, 26 Apr 2025 18:19:42 -0300 Subject: [PATCH] build/windows: Do not ship orphan .pdb files Actually babl.pdb and gegl-imgcmp.pdb --- build/windows/2_bundle-gimp-uni_base.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/build/windows/2_bundle-gimp-uni_base.py b/build/windows/2_bundle-gimp-uni_base.py index fcd718ead8..0a18369331 100644 --- a/build/windows/2_bundle-gimp-uni_base.py +++ b/build/windows/2_bundle-gimp-uni_base.py @@ -198,6 +198,14 @@ for dir in ["bin", "lib"]: ### .pdb (CodeView) debug symbols from babl, gegl and GIMP binaries bundle(GIMP_PREFIX, "bin/*.pdb") +### Remove .pdb without corresponding binaries (depends on what was choosen to be bundled above) +files = os.listdir(GIMP_DISTRIB / "bin") +binaries = {os.path.splitext(file)[0] for file in files if file.endswith(('.exe', '.dll'))} +for file in files: + if file.endswith('.pdb'): + if os.path.splitext(file)[0] not in binaries: + print(f"(INFO): removing orphan {file}") + os.remove(os.path.join(GIMP_DISTRIB / "bin", file)) ### Remove ancient COFF symbol table (not used for debugging) from MSYS2 binaries for bin_path in GIMP_DISTRIB.rglob("*"): if bin_path.suffix.lower() in (".dll", ".exe", ".pyd"):