From eb2c726eb2895f9c3be7e169580f6957a6468f8b Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 13 Aug 2024 10:51:03 +0530 Subject: [PATCH] Fix xz failing to allocate memory when used in a 32-bit container --- bypy/linux/__main__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bypy/linux/__main__.py b/bypy/linux/__main__.py index fe3a183e7..0dad78acb 100644 --- a/bypy/linux/__main__.py +++ b/bypy/linux/__main__.py @@ -216,7 +216,8 @@ def create_tarfile(env, compression_level='9'): print('Compressing archive...') ans = f'{dist.rpartition(".")[0]}.txz' start_time = time.time() - subprocess.check_call(['xz', '--verbose', '--threads=0', '-f', f'-{compression_level}', dist]) + threads = 4 if arch == 'i686' else 0 + subprocess.check_call(['xz', '--verbose', f'--threads={threads}', '-f', f'-{compression_level}', dist]) secs = time.time() - start_time print('Compressed in {} minutes {} seconds'.format(secs // 60, secs % 60)) os.rename(f'{dist}.xz', ans)