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.
This commit is contained in:
fanquake 2026-03-10 16:42:59 +00:00
parent b62abc7eec
commit ab137cbfe2
No known key found for this signature in database
GPG Key ID: 2EEB9F5CC09526C1

View File

@ -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')
# ------------------------------------------------