The Bootstrapper class in src/fromager/bootstrapper.py currently uses recursive calls to process dependency trees. @dhellmann discovered that when bootstrapping packages with very deep or wide dependency graphs (especially with --multiple-versions mode enabled), this hits Python's recursion depth limit and causes stack overflow errors.
The recursion occurs at two critical points:
Line 521: Install dependencies (processed AFTER building the package)
Line 708: Build dependencies (BUILD_SYSTEM, BUILD_BACKEND, BUILD_SDIST - processed BEFORE building)
We should convert Bootstrapper to iterative approach
The Bootstrapper class in
src/fromager/bootstrapper.pycurrently uses recursive calls to process dependency trees. @dhellmann discovered that when bootstrapping packages with very deep or wide dependency graphs (especially with --multiple-versions mode enabled), this hits Python's recursion depth limit and causes stack overflow errors.The recursion occurs at two critical points:
Line 521: Install dependencies (processed AFTER building the package)
Line 708: Build dependencies (BUILD_SYSTEM, BUILD_BACKEND, BUILD_SDIST - processed BEFORE building)
We should convert Bootstrapper to iterative approach