Fix xz failing to allocate memory when used in a 32-bit container

This commit is contained in:
Kovid Goyal
2024-08-13 10:51:03 +05:30
parent 81061a8d43
commit eb2c726eb2

View File

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