`sysconfig --generate-posix-vars` can hang on cyclic variable definitions · Issue #136097 · python/cpython · GitHub | Latest TMZ Celebrity News & Gossip | Watch TMZ Live
Skip to content

sysconfig --generate-posix-vars can hang on cyclic variable definitions #136097

Open
@brianschubert

Description

@brianschubert

Bug report

Bug description:

This loop can run forever if there's a cycle in the Makefile variable definitions:

while len(variables) > 0:

To reproduce:

make clean
echo 'foo=$(foo)' > ./Modules/Setup.local
./configure
make  # hangs forever

Or more minimally:

make clean
echo 'foo=$(foo)' > ./Modules/Setup.local
make 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 before python -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

Linked PRs

Metadata

Metadata

Labels

buildThe build process and cross-buildstdlibPython modules in the Lib dirtopic-sysconfigtype-bugAn unexpected behavior, bug, or error

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    TMZ Celebrity News – Breaking Stories, Videos & Gossip

    Looking for the latest TMZ celebrity news? You've come to the right place. From shocking Hollywood scandals to exclusive videos, TMZ delivers it all in real time.

    Whether it’s a red carpet slip-up, a viral paparazzi moment, or a legal drama involving your favorite stars, TMZ news is always first to break the story. Stay in the loop with daily updates, insider tips, and jaw-dropping photos.

    🎥 Watch TMZ Live

    TMZ Live brings you daily celebrity news and interviews straight from the TMZ newsroom. Don’t miss a beat—watch now and see what’s trending in Hollywood.