Skip to content

Conversation

@TheJostler
Copy link

I was getting this error when trying to build the project for the first time using the ./configure --download-nyan command:

Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/home/josj/scr/openage/.bin/g++-debug-Oauto-sanitize-none/openage/__main__.py", line 178, in <module>
    multiprocessing.set_start_method('spawn')
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^
  File "/usr/lib64/python3.14/multiprocessing/context.py", line 247, in set_start_method
    raise RuntimeError('context has already been set')
RuntimeError: context has already been set
CMake Error at buildsystem/codegen.cmake:32 (message):
  failed to get target list from codegen invocation
Call Stack (most recent call first):
  buildsystem/python.cmake:495 (codegen_run)
  CMakeLists.txt:261 (python_finalize)

It required a very simple fix, just added a check before setting the multiprocessing start method to ensure that it only gets set once. After this change was made to the build script worked perfectly.

Handle cases where multiprocessing start method has already been set.
@TheJostler TheJostler changed the title Set multiprocessing start method if not already set Set multiprocessing start method only if not already set Nov 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant