Windows build: Double the stack size

Python assumes a stack size of 2MB on windows. The windows default is
1MB. Presumably whoever builds python.exe changes it. Do the same to
avoid crashes due to too much recursion. Fixes #2000888 [BS4 str(soup) crashes Calibre instead of raising RecursionError](https://bugs.launchpad.net/calibre/+bug/2000888)
This commit is contained in:
Kovid Goyal 2023-01-04 15:58:41 +05:30
parent 8ad001a64d
commit d1a6bfa7b5
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -496,6 +496,7 @@ def build_launchers(env, incdir, debug=False):
'/LIBPATH:' + env.obj_dir, '/SUBSYSTEM:' + subsys,
'/LIBPATH:%s/libs' % env.python_base, '/RELEASE',
'/MANIFEST:EMBED', '/MANIFESTINPUT:' + mf,
'/STACK:2097152', # Set stack size to 2MB which is what python expects. Default on windows is 1MB
'user32.lib', 'kernel32.lib',
'/OUT:' + exe] + u32 + dlflags + [embed_resources(env, exe), dest, lib]
run(*cmd)