From b3c67e12b1eba44afbf54b9c06509a2783cae1b8 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Sun, 10 Nov 2024 22:40:23 +0700 Subject: [PATCH] #4050 delete extra modules before recording sbom --- packaging/MSWindows/BUILD.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/packaging/MSWindows/BUILD.py b/packaging/MSWindows/BUILD.py index 2bc7e3e5b0..d7a4650a4b 100644 --- a/packaging/MSWindows/BUILD.py +++ b/packaging/MSWindows/BUILD.py @@ -725,7 +725,7 @@ def zip_modules(light: bool) -> None: ZIPPED = [ "OpenGL", "encodings", "future", "paramiko", "html", "pyasn1", "asn1crypto", "async_timeout", - "certifi", "OpenSSL", "pkcs11", "keyring", + "certifi", "OpenSSL", "keyring", "ifaddr", "pyaes", "service_identity", "re", "platformdirs", "attr", "setproctitle", "pyvda", "zipp", "distutils", "comtypes", "email", "multiprocessing", "packaging", @@ -1049,8 +1049,9 @@ def rec_cuda(path: str) -> None: cuda_version = version_data["cuda"]["version"] sbom[path] = (0, "", "cuda", cuda_version) - debug("adding DLLs and EXEs") - for globbed_path in find_glob_paths(DIST, "*.dll") + find_glob_paths(LIB_DIR, "*.exe"): + globbed_paths = find_glob_paths(DIST, "*.dll") + find_glob_paths(LIB_DIR, "*.exe") + debug(f"adding DLLs and EXEs: {globbed_paths}") + for globbed_path in globbed_paths: path = globbed_path[len(DIST)+1:] if path.startswith("lib/PyQt6"): rec_pyqt_lib(path) @@ -1296,6 +1297,8 @@ def build(args) -> None: trim_python_libs() trim_pillow() fixup_zeroconf() + if args.light: + delete_libs(*EXTRA_PYTHON_MODULES) rm_empty_dirs() add_cuda(args.cuda) @@ -1325,9 +1328,6 @@ def build(args) -> None: rec_sbom() export_sbom() - if args.light: - delete_libs(EXTRA_PYTHON_MODULES) - if args.zip_modules: zip_modules(args.light)