[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 37/37] scripts/nsis.py: Run dependency check for each DLL file
From: |
Alex Bennée |
Subject: |
[PATCH v2 37/37] scripts/nsis.py: Run dependency check for each DLL file only once |
Date: |
Tue, 14 Jan 2025 11:38:21 +0000 |
From: Stefan Weil via <qemu-devel@nongnu.org>
Each DLL should only be checked once for dependencies, but
several hundred (781 in my test) unneeded checks were done.
Now the script is significantly faster (16 s in my build).
Signed-off-by: Stefan Weil <sw@weilnetz.de>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-Id: <20250111215244.1680931-1-sw@weilnetz.de>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
---
scripts/nsis.py | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/scripts/nsis.py b/scripts/nsis.py
index 03ed7608a2..af4e064819 100644
--- a/scripts/nsis.py
+++ b/scripts/nsis.py
@@ -37,10 +37,10 @@ def find_deps(exe_or_dll, search_path, analyzed_deps):
analyzed_deps.add(dep)
# locate the dll dependencies recursively
- rdeps = find_deps(dll, search_path, analyzed_deps)
+ analyzed_deps, rdeps = find_deps(dll, search_path, analyzed_deps)
deps.extend(rdeps)
- return deps
+ return analyzed_deps, deps
def main():
parser = argparse.ArgumentParser(description="QEMU NSIS build helper.")
@@ -92,18 +92,18 @@ def main():
dlldir = os.path.join(destdir + prefix, "dll")
os.mkdir(dlldir)
+ analyzed_deps = set()
for exe in glob.glob(os.path.join(destdir + prefix, "*.exe")):
signcode(exe)
# find all dll dependencies
- deps = set(find_deps(exe, search_path, set()))
+ analyzed_deps, deps = find_deps(exe, search_path, analyzed_deps)
+ deps = set(deps)
deps.remove(exe)
# copy all dlls to the DLLDIR
for dep in deps:
dllfile = os.path.join(dlldir, os.path.basename(dep))
- if (os.path.exists(dllfile)):
- continue
print("Copying '%s' to '%s'" % (dep, dllfile))
shutil.copy(dep, dllfile)
--
2.39.5
- [PATCH v2 26/37] plugins: fix kdoc annotation, (continued)
- [PATCH v2 26/37] plugins: fix kdoc annotation, Alex Bennée, 2025/01/14
- [PATCH v2 35/37] docs: add a codebase section, Alex Bennée, 2025/01/14
- [PATCH v2 10/37] system: propagate Error to gdbserver_start (and other device setups), Alex Bennée, 2025/01/14
- [PATCH v2 14/37] tests/tcg/plugins/mem: fix 32-bit build, Alex Bennée, 2025/01/14
- [PATCH v2 36/37] docs: add a glossary, Alex Bennée, 2025/01/14
- [PATCH v2 13/37] tests/tcg/plugins/syscall: fix 32-bit build, Alex Bennée, 2025/01/14
- [PATCH v2 33/37] docs/devel: add b4 for patch retrieval, Alex Bennée, 2025/01/14
- [PATCH v2 16/37] contrib/plugins/cache: fix 32-bit build, Alex Bennée, 2025/01/14
- [PATCH v2 11/37] tests/tcg/plugins/insn: remove unused callback parameter, Alex Bennée, 2025/01/14
- [PATCH v2 37/37] scripts/nsis.py: Run dependency check for each DLL file only once,
Alex Bennée <=
- [PATCH v2 18/37] contrib/plugins/cflow: fix 32-bit build, Alex Bennée, 2025/01/14
- [PATCH v2 28/37] tests/qtest: fix some copy and paste errors in kdoc, Alex Bennée, 2025/01/14
- [PATCH v2 29/37] include/exec: fix some copy and paste errors in kdoc, Alex Bennée, 2025/01/14
- [PATCH v2 24/37] docs/devel/style: add a section about bitfield, and disallow them for packed structures, Alex Bennée, 2025/01/14
- [PATCH v2 21/37] configure: reenable plugins by default for 32-bit hosts, Alex Bennée, 2025/01/14
- [PATCH v2 32/37] docs/devel: add git-publish for patch submitting, Alex Bennée, 2025/01/14
- [PATCH v2 19/37] contrib/plugins/hwprofile: fix 32-bit build, Alex Bennée, 2025/01/14
- [PATCH v2 27/37] editorconfig: update for perl scripts, Alex Bennée, 2025/01/14