From 210861eda145e42d090bd5f0bb61e5260a5210e7 Mon Sep 17 00:00:00 2001 From: Thomas Krijnen Date: Sun, 10 May 2026 16:54:30 +0200 Subject: [PATCH] Strip to try and get back some file size increase --- nix/build-all.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/nix/build-all.py b/nix/build-all.py index cc86c9bc2d..1b02d89a4e 100644 --- a/nix/build-all.py +++ b/nix/build-all.py @@ -1562,12 +1562,14 @@ if "IfcOpenShell-Python" in targets: if platform.system() != "Darwin": if BUILD_CFG == "Release": - # TODO: This symbol name depends on the Python version? - so = glob.glob(os.path.join(module_dir, "_ifcopenshell_wrapper*.so"))[0] - if "wasm" in flags: - run(["wasm-strip", so, "-k", "dylink.0"]) - else: - run([strip, "-s", "-K", "PyInit__ifcopenshell_wrapper", so], cwd=module_dir) + for so in glob.glob(os.path.join(module_dir, "*.so")): + if "wasm" in flags: + run(["wasm-strip", so, "-k", "dylink.0"]) + elif os.path.basename(so).startswith("_ifcopenshell_wrapper"): + # TODO: This symbol name depends on the Python version? + run([strip, "-s", "-K", "PyInit__ifcopenshell_wrapper", so], cwd=module_dir) + else: + run([strip, "--strip-unneeded", so], cwd=module_dir) return module_dir