Skip to contentSkip to conversation

Windows installer: keep dependency cache

PATCH Superseded Arthur Sengileyev 3 participants 3 messages Jan 3, 2023 – Jan 7, 2023

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Windows installer: keep dependency cache

It should be possible to reuse cache built by previous iteration processing next executables. Already processed dependencies are already skipped later based on dll name.

---
 scripts/nsis.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
scripts/nsis.py +2 -1
index 03ed7608a2..a2e52df556 100644
@@ -91,12 +91,13 @@ def main():
         print("Searching '%s' for the dependent dlls ..." % search_path)
         dlldir = os.path.join(destdir + prefix, "dll")
         os.mkdir(dlldir)
+        depscache = 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()))
+            deps = set(find_deps(exe, search_path, depscache))
             deps.remove(exe)
 
             # copy all dlls to the DLLDIR
Signature · 1 line
2.39.0
#1 lore raw
Quoted 30 lines · Arthur Sengileyev

It should be possible to reuse cache built by previous iteration processing next executables. Already processed dependencies are already skipped later based on dll name.

---
 scripts/nsis.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
scripts/nsis.py +2 -2
index 03ed7608a2..a2e52df556 100644
@@ -91,12 +91,13 @@ def main():
         print("Searching '%s' for the dependent dlls ..." % search_path)
         dlldir = os.path.join(destdir + prefix, "dll")
         os.mkdir(dlldir)
+        depscache = 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()))
+            deps = set(find_deps(exe, search_path, depscache))
             deps.remove(exe)
 
             # copy all dlls to the DLLDIR
--
Quoted 2 lines

2.39.0

ACK for python changes, which seem sane. I've not used the NSIS script before, though, so I won't grant RB/TB here.

--js

Reviewed-by on v1 1/1
#2 lore raw
In reply to Arthur Sengileyev
Quoted 3 lines · Arthur Sengileyev

It should be possible to reuse cache built by previous iteration processing next executables. Already processed dependencies are

s/processing/to process

Quoted 12 lines

already skipped later based on dll name.

---
 scripts/nsis.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
scripts/nsis.py +0 -0
index 03ed7608a2..a2e52df556 100644

scripts/nsis.py def main(): · line 94

Quoted 4 lines
scripts/nsis.py +1 -0
@@ -91,12 +91,13 @@ def main():
         print("Searching '%s' for the dependent dlls ..." % search_path)
         dlldir = os.path.join(destdir + prefix, "dll")
         os.mkdir(dlldir)
+        depscache = set()

nits: I would use deps_cache as the name

scripts/nsis.py def main():

Quoted 11 lines
scripts/nsis.py +1 -2
         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()))
+            deps = set(find_deps(exe, search_path, depscache))
             deps.remove(exe)
 
             # copy all dlls to the DLLDIR
--

Otherwise LGTM