Skip to content

Commit 354e43d

Browse files
generate.py: fix build on 32 bit system (project-chip#36942)
setting max-old-space-size to more than 4GB cause node to fail instantly on 32 bit systems, even to run zap-cli --version. Co-authored-by: Andrei Litvin <andy314@gmail.com>
1 parent daf2c42 commit 354e43d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

scripts/tools/zap/generate.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -370,8 +370,9 @@ def main():
370370
if cmdLineArgs.runBootstrap:
371371
subprocess.check_call(getFilePath("scripts/tools/zap/zap_bootstrap.sh"), shell=True)
372372

373-
# The maximum memory usage is over 4GB (#15620)
374-
os.environ["NODE_OPTIONS"] = "--max-old-space-size=8192"
373+
# on 64 bit systems, allow maximum memory usage to go over 4GB (#15620)
374+
if sys.maxsize >= 2**32:
375+
os.environ["NODE_OPTIONS"] = "--max-old-space-size=8192"
375376

376377
# `zap-cli` may extract things into a temporary directory. ensure extraction
377378
# does not conflict.

0 commit comments

Comments
 (0)