From 290a8f53b9e13a8c26b2c37ba641d970e25f203c Mon Sep 17 00:00:00 2001 From: Guillaume Girol Date: Sat, 28 Dec 2024 12:00:00 +0000 Subject: [PATCH] generate.py: fix build on 32 bit system setting max-old-space-size to more than 4GB cause node to fail instantly on 32 bit systems, even to run zap-cli --version. --- scripts/tools/zap/generate.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/tools/zap/generate.py b/scripts/tools/zap/generate.py index b979573682f017..0da60bd176a9cc 100755 --- a/scripts/tools/zap/generate.py +++ b/scripts/tools/zap/generate.py @@ -370,8 +370,9 @@ def main(): if cmdLineArgs.runBootstrap: subprocess.check_call(getFilePath("scripts/tools/zap/zap_bootstrap.sh"), shell=True) - # The maximum memory usage is over 4GB (#15620) - os.environ["NODE_OPTIONS"] = "--max-old-space-size=8192" + # on 64 bit systems, allow maximum memory usage to go over 4GB (#15620) + if sys.maxsize >= 2**32: + os.environ["NODE_OPTIONS"] = "--max-old-space-size=8192" # `zap-cli` may extract things into a temporary directory. ensure extraction # does not conflict.