qemu-trivial.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: Stefan Weil <sw@weilnetz.de>, Bin Meng <bin.meng@windriver.com>,
	John Snow <jsnow@redhat.com>, Cleber Rosa <crosa@redhat.com>
Cc: qemu-devel@nongnu.org, qemu-trivial@nongnu.org,
	Pierrick Bouvier <pierrick.bouvier@linaro.org>
Subject: Re: [PATCH] scripts/nsis.py: Run dependency check for each DLL file only once
Date: Sun, 12 Jan 2025 18:32:19 +0100	[thread overview]
Message-ID: <dd12a227-0990-42b7-b241-301bca90915c@linaro.org> (raw)
In-Reply-To: <20250111215244.1680931-1-sw@weilnetz.de>

On 11/1/25 22:52, Stefan Weil via wrote:
> 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>
> ---
>   scripts/nsis.py | 10 +++++-----
>   1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/scripts/nsis.py b/scripts/nsis.py
> index d0914c88a7..d0ac61f6ab 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)
>   

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>



  reply	other threads:[~2025-01-12 17:32 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-11 21:52 [PATCH] scripts/nsis.py: Run dependency check for each DLL file only once Stefan Weil
2025-01-12 17:32 ` Philippe Mathieu-Daudé [this message]
2025-01-12 17:52 ` Pierrick Bouvier
2025-01-14 11:18 ` Alex Bennée

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=dd12a227-0990-42b7-b241-301bca90915c@linaro.org \
    --to=philmd@linaro.org \
    --cc=bin.meng@windriver.com \
    --cc=crosa@redhat.com \
    --cc=jsnow@redhat.com \
    --cc=pierrick.bouvier@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-trivial@nongnu.org \
    --cc=sw@weilnetz.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).