From b1265cbeffb6778951a4f2d7a53bd4fc18607a5c Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Wed, 21 Apr 2021 11:36:41 +0200 Subject: Update PE checksum patching after PyInstaller update --- scripts/dev/build_release.py | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) (limited to 'scripts') diff --git a/scripts/dev/build_release.py b/scripts/dev/build_release.py index 4b0e2f072..be6492358 100755 --- a/scripts/dev/build_release.py +++ b/scripts/dev/build_release.py @@ -206,21 +206,11 @@ def smoke_test(executable, debug): raise Exception("\n".join(lines)) -def patch_windows_exe(exe_path): - """Make sure the Windows .exe has a correct checksum. - - WORKAROUND for https://github.com/pyinstaller/pyinstaller/issues/5579 - """ +def verify_windows_exe(exe_path): + """Make sure the Windows .exe has a correct checksum.""" import pefile pe = pefile.PE(exe_path) - - # If this fails, a PyInstaller upgrade fixed things, and we can remove the - # workaround. Would be a good idea to keep the check, though. - assert not pe.verify_checksum() - - pe.OPTIONAL_HEADER.CheckSum = pe.generate_checksum() - pe.close() - pe.write(exe_path) + assert pe.verify_checksum() def patch_mac_app(): @@ -364,8 +354,8 @@ def _build_windows_single(*, x64, skip_packaging, debug): shutil.move(out_pyinstaller, outdir) exe_path = os.path.join(outdir, 'qutebrowser.exe') - utils.print_title(f"Patching {human_arch} exe") - patch_windows_exe(exe_path) + utils.print_title(f"Verifying {human_arch} exe") + verify_windows_exe(exe_path) utils.print_title(f"Running {human_arch} smoke test") smoke_test(exe_path, debug=debug) -- cgit v1.2.3-54-g00ecf