Skip to content

Commit ee813ef

Browse files
committed
Add check that 7zip is 64 bit
- To use dictionary sizes above 128mb, need 64-bit 7zip
1 parent 15f5fd3 commit ee813ef

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

build.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,24 @@ def save(self):
282282
print(">>>> ERROR: Can't find 7zip as '7z' or '7za'")
283283
exit(-1)
284284

285+
# Check that 7zip is 64-bit
286+
seven_zip_bitness = None
287+
seven_zip_info = subprocess.check_output(Globals.SEVEN_ZIP_EXECUTABLE, text=True)
288+
for line in seven_zip_info.splitlines():
289+
if line.strip().startswith('7-Zip'):
290+
if 'x64' in line:
291+
seven_zip_bitness = 64
292+
elif 'x86' in line:
293+
seven_zip_bitness = 32
294+
break
295+
296+
if seven_zip_bitness == 64:
297+
print("7zip is 64-bit - OK")
298+
else:
299+
print(f">>>> ERROR: Unacceptable 7zip bitness '{seven_zip_bitness}' - need 64 bit.\n\n Please make sure your 7zip is 64-bit, or manually edit this script to use 128mb 7z dictionary size")
300+
exit(-1)
301+
302+
285303
lastModifiedManager = LastModifiedManager()
286304

287305
# Parse command line arguments

0 commit comments

Comments
 (0)