From 5d42ead86fbc439c723f2cf5aaa5f902e1af08c7 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 27 Oct 2026 09:42:59 +0530 Subject: [PATCH] Fix freeze build failure on macOS --- bypy/macos/__main__.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/bypy/macos/__main__.py b/bypy/macos/__main__.py index a1ebe6bb2..1692d78df 100644 --- a/bypy/macos/__main__.py +++ b/bypy/macos/__main__.py @@ -514,11 +514,13 @@ class Freeze(object): os.symlink('/Applications', join(tdir, 'Applications')) size_in_mb = int(subprocess.check_output(['du', '-s', '-k', tdir]).decode('utf-8').split()[0]) / 1024.0 cmd = ['/usr/bin/hdiutil', 'create', '-srcfolder', tdir, '-volname', volname, '-format', format] - if 190 < size_in_mb < 250: - # We need -size 255m because of a bug in hdiutil. When the size of + if size_in_mb > 190: + # We need an explicit -size because of a bug in hdiutil. When the size of # srcfolder is close to 200MB hdiutil fails with # diskimages-helper: resize request is above maximum size allowed. - cmd += ['-size', '255m'] + # Leave headroom for filesystem overhead, otherwise hdiutil fails + # with No space left on device. + cmd += ['-size', f'{max(255, int(size_in_mb * 1.2) + 32)}m'] print('\nCreating dmg...') with timeit() as times: subprocess.check_call(cmd + [dmg])