From ab137cbfe2763f2306e52c7c5f1860d87defc636 Mon Sep 17 00:00:00 2001 From: fanquake Date: Tue, 10 Mar 2026 16:42:59 +0000 Subject: [PATCH] macdeploy: subprocess out to zip rather than shutil.make_archive Calling shutil.make_archive(), does not preserve symlinks when using the zip format, see https://github.com/python/cpython/issues/139679. Call `zip` using subprocess instead. This code is only run when using a macos machine, and I think it's safe to assume that zip is available, same as codesign, and all other tools we call in this script. --- contrib/macdeploy/macdeployqtplus | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/macdeploy/macdeployqtplus b/contrib/macdeploy/macdeployqtplus index 476ac133ebf..dc03d710889 100755 --- a/contrib/macdeploy/macdeployqtplus +++ b/contrib/macdeploy/macdeployqtplus @@ -499,7 +499,7 @@ if config.zip is not None: print("+ Removing existing .zip +") os.unlink(name + ".zip") - shutil.make_archive('{}'.format(name), format='zip', root_dir='dist', base_dir='Bitcoin-Qt.app') + subprocess.check_call(["zip", "-ry", os.path.abspath(name + ".zip"), 'Bitcoin-Qt.app'], cwd='dist') # ------------------------------------------------