Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork33.7k
Open
Description
Bug report
Bug description:
This loop can run forever if there's a cycle in the Makefile variable definitions:
cpython/Lib/sysconfig/__main__.py
Line 79 in5334732
| whilelen(variables)>0: |
To reproduce:
make cleanecho'foo=$(foo)'> ./Modules/Setup.local./configuremake# hangs forever
Or more minimally:
make cleanecho'foo=$(foo)'> ./Modules/Setup.localmake Makefile./python -m sysconfig --generate-posix-vars# hangs forever
Longer cycles are also possible, e.g.v1=$(v2),v2=$(v3), ....,v999=$(v1).
Note that this is less of an issue if the recursive variable definition gets expanded in the Makefile beforepython -m sysconfig --generate-posix-vars gets invoked. In that case, Make will detect the cycle and exit before the infinite loop occurs.
@serhiy-storchaka you may be interested, this is very similar to#136073
CPython versions tested on:
CPython main branch
Operating systems tested on:
Linux