From patchwork Tue Jan 14 11:38:21 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 857241 Delivered-To: patch@linaro.org Received: by 2002:a5d:525c:0:b0:385:e875:8a9e with SMTP id k28csp1872918wrc; Tue, 14 Jan 2025 03:42:31 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWxXFPWHPc5sqJSzPlEfvZTa3Tws2qI/9cCsYZ2gONyAV1EQMg+6Y4AjpII0PEwyl36YvhNng==@linaro.org X-Google-Smtp-Source: AGHT+IGMnauZJYzLi+LKp8Do+62ofZfAFP9KHFRQGzc1z8ffHIjPvCX9XzUp5oyPkd8Lkscg1BQX X-Received: by 2002:a05:620a:2add:b0:7bc:e736:27f2 with SMTP id af79cd13be357-7bce73628eamr2161962885a.18.1736854951170; Tue, 14 Jan 2025 03:42:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1736854951; cv=none; d=google.com; s=arc-20240605; b=KtYyb0sjcax4ZtyLGsGfIpuzYqBMp5A0T5soevY0+6aQsOATXEYPddzpx1NikaczHP 7Sm7eauQMEHRp4W+quE+6rEHPTaTfRu5WvKFgacIG7VRFB9WsVbvsk4McwIVYVTx+6TG OkRU90cV7LFBa+e/R5W7opNvpceeDZK2Uny4Bw5ptfexSlnjWOC+HqZZ5i6CuLd6cz+w DDqkb4vAxXMbPHdP1YI9NW0SiyeI2L0R4QDtPJYkH1wRWHHYy1xbb2Rayz1Y5ICDRN9n m2RQeV0gRCyFkacPOIoeDBpXZfCY1hHVyV7cCA21yIxr9aTSWa06UDTpCY7pl/1rxsuh Zggg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=mDXNnBxwJoyhgKzJMRdJdgCJlpb7weenjpk6uMi/xEU=; fh=uQ0JYk5mOvSh0n8VIf6uBa6ItYhOMMHEizAOzkKiW90=; b=Up9JxQV5wtzetNBUKVw/4VRPQ7FwZQaDXpNb8KGzAisOjxNtU8WW5CICTAy7hhqZKY xHEBnkCtn3vy+l47A3v+pnaor+BD9bHqvTmhT26Wy6jrVY/6eIr9Iew6DCgPuE5MeRWi gSFD14vZQ7oPfnfTlJOqzTv5sw0+QOWyewVXrzFCBk4fkKMnPJW7W8yx3+RLEIBkvaMo dLLg0wH+hah22MZI61Eg8M95JZq59LEwCuN8rtVhmtVce+Za8Pcb5AY2cHlJXFPwNI9c PpgM8yVo/JZFvP5s2SHIQkADHDJf0SmIaHi198CfsSOBolKta5v3z4ZpdHWjDFGtPaYo LL8g==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=vkTjeihM; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7bce32382fdsi1343899385a.195.2025.01.14.03.42.31 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 14 Jan 2025 03:42:31 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=vkTjeihM; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tXfG0-0005Fp-4I; Tue, 14 Jan 2025 06:38:52 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tXfFm-000588-D0 for qemu-devel@nongnu.org; Tue, 14 Jan 2025 06:38:39 -0500 Received: from mail-ej1-x634.google.com ([2a00:1450:4864:20::634]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tXfFk-0005S0-IN for qemu-devel@nongnu.org; Tue, 14 Jan 2025 06:38:37 -0500 Received: by mail-ej1-x634.google.com with SMTP id a640c23a62f3a-aaeec07b705so853684266b.2 for ; Tue, 14 Jan 2025 03:38:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736854715; x=1737459515; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=mDXNnBxwJoyhgKzJMRdJdgCJlpb7weenjpk6uMi/xEU=; b=vkTjeihMvfC4FGejwkazgVoEKymzwpqpuWa3w07fd0bgaR6WDu+E6to/KEyd9gzEsl MABI18ivqvfchtdXMjdnMeGlDLP5YrUS8xOXg5WKHgVedMNHjoULAkGdN8nY1Nja4Kt/ Obh3L72pJ/KByXixjHMzxY2+iTC9x6DsGuyn+Fg35A3dUD8NDmWEf/sf4milb8gKMPzF AQXug/vyhaSJbISRCDKs5Ca9V2lCwmCvNROm8n7HxumuYkYfDRfXomc0lQXshq4aPzHA TmGbt+Mo0Ke+9knATJub2MjlMimWr1qjISST/TAM7o+M3RgAuz5IehwwWVDgzuQo7bVA 4+WA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736854715; x=1737459515; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=mDXNnBxwJoyhgKzJMRdJdgCJlpb7weenjpk6uMi/xEU=; b=b/cRkFd5ly+l7+XU8L6Ch66EeFQKoOtPK2O81i8ONFggVVSU1OoLgSug+Kwrg51q2Z 8YE/GvKIhiJTzcSSheK7vvJ3KraAgF3BWy0LBBt0Rt9ieGEkVJsPZm8gH0QgygHkTvLW kbdRTB0YgqXxGEYYYV0wBJoGfQj/JmNchk3fwqc+jixSR7NhKLHrOsIujaVPhHfF19Np S7jpbCC6pZx9ArQO0ZuD5ajnHoqEJWCkBtX0p32AArTr6jJubYm9Vy9LRkmi9Iwiz0RP HvXkyfgRiBikrm6/f8Bih2oS5DR/DsKQ4YTuFJURIRSMu53oIz/RH0psUvWSfrnVJVvf i46Q== X-Gm-Message-State: AOJu0YzgvSIa4EmKNFA/06IB4VgcgdS2/Pkned+fCV9xxSDYR2j2N8cU adeMKIjqCIy2P4IqRdTMfqolCFn/VESM05kDb4bN4UBdFFwds7g5iD7TvvTDmetTuJE8z1AmHbT LcxQ= X-Gm-Gg: ASbGncu2EsmvLGiTYHfmVCwOVWHCt/0PYeBBq1RVgijl1KpHSbXka6KI06+iXSbALC7 gI23yRprVTu0b8Dybl7v4LDwCMNFb6wqx/Bd3GuuqBAjYdoePybJ84d2yBXI1M66Bbt2lVA0HtR DR/fhNZ5IQ5d6uctyiWfQ0kYM98dCT2BRI4cnYzfEAf54z8dWDKJY6a/Ezz1csNaEnlbYw2ewu1 Ol4VpnH1c25/ggIyxlpGFV4rR/8D971IiuEDcEfOUOMwYEcpmJmCss= X-Received: by 2002:a17:907:96a0:b0:aa6:87e8:1d08 with SMTP id a640c23a62f3a-ab2ab6bffc3mr1834463066b.8.1736854715006; Tue, 14 Jan 2025 03:38:35 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-ab2c9060b9dsm621953966b.4.2025.01.14.03.38.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Jan 2025 03:38:33 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 6397D5F8B5; Tue, 14 Jan 2025 11:38:25 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Stefan Weil , Pierrick Bouvier , =?utf-8?q?Alex_Benn=C3=A9e?= , John Snow , Cleber Rosa 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 Message-Id: <20250114113821.768750-38-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250114113821.768750-1-alex.bennee@linaro.org> References: <20250114113821.768750-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::634; envelope-from=alex.bennee@linaro.org; helo=mail-ej1-x634.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Stefan Weil via 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 Reviewed-by: Pierrick Bouvier Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20250111215244.1680931-1-sw@weilnetz.de> Signed-off-by: Alex Bennée --- 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)