From 354e43d780086dbbfec13b48ffaff06568fdde27 Mon Sep 17 00:00:00 2001 From: Guillaume Girol Date: Tue, 7 Jan 2025 17:13:21 +0100 Subject: [PATCH] generate.py: fix build on 32 bit system (#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 --- 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.