Skip to content

Drop extras from _resolved_key to prevent re-entrant bootstrap failure#985

Closed
LalatenduMohanty wants to merge 2 commits intopython-wheel-build:mainfrom
LalatenduMohanty:fix/issue-984-resolved-key-extras
Closed

Drop extras from _resolved_key to prevent re-entrant bootstrap failure#985
LalatenduMohanty wants to merge 2 commits intopython-wheel-build:mainfrom
LalatenduMohanty:fix/issue-984-resolved-key-extras

Conversation

@LalatenduMohanty
Copy link
Copy Markdown
Member

@LalatenduMohanty LalatenduMohanty commented Mar 25, 2026

Extras were included in the seen-check key, so the same package with different extras (e.g. setuptools-scm vs setuptools-scm[toml]) bypassed cycle detection and tried to install dependencies whose wheels hadn't been built yet.

Also reverting the setuptools-scm<10 constraint as we do not need this constraint anymore.

Closes: #984

@LalatenduMohanty LalatenduMohanty requested a review from a team as a code owner March 25, 2026 21:54
@mergify mergify bot added the ci label Mar 25, 2026
@LalatenduMohanty LalatenduMohanty force-pushed the fix/issue-984-resolved-key-extras branch from 8a006b5 to ce98211 Compare March 25, 2026 21:58
…nt bootstrap failure

Extras were included in the seen-check key, so the same package with
different extras (e.g. setuptools-scm vs setuptools-scm[toml]) bypassed
cycle detection and tried to install dependencies whose wheels hadn't
been built yet.

Closes: python-wheel-build#984
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Lalatendu Mohanty <lmohanty@redhat.com>
LalatenduMohanty added a commit to LalatenduMohanty/fromager that referenced this pull request Mar 25, 2026
The constraint was a workaround for python-wheel-build#982, which was caused by extras
in _resolved_key triggering re-entrant bootstrap failures. The root
cause is now fixed by PR 985 [1], making
this pin unnecessary.

[1] python-wheel-build#985

Reverts: python-wheel-build#983
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Lalatendu Mohanty <lmohanty@redhat.com>
@LalatenduMohanty LalatenduMohanty force-pushed the fix/issue-984-resolved-key-extras branch from ce98211 to f388ade Compare March 25, 2026 22:47
The constraint was a workaround for the issue (commit
141d857), which was caused by extras
in _resolved_key triggering re-entrant bootstrap failures. The root
cause is now fixed by PR 985 [1], making
this pin unnecessary.

[1] python-wheel-build#985

Reverts: python-wheel-build#983
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Lalatendu Mohanty <lmohanty@redhat.com>
@LalatenduMohanty LalatenduMohanty force-pushed the fix/issue-984-resolved-key-extras branch from f388ade to 344fc01 Compare March 25, 2026 22:49
@LalatenduMohanty
Copy link
Copy Markdown
Member Author

LalatenduMohanty commented Mar 26, 2026

The CI is failing because of a circular build dependency issue: hatchling → (transitive) → setuptools-scm 10.0.2 → vcs-versioning → hatchling. The bootstrapper's depth-first walk detects the
cycle via the "seen" check (prevents infinite recursion), but build_env.install() then fails because the wheel hasn't been built yet.

Upstream circular dependency issue pypa/setuptools-scm#1302

Copy link
Copy Markdown
Member

@dhellmann dhellmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change is not correct.

"""Return a key for tracking whether a package has already been resolved.

Extras are intentionally excluded because a build is the same
regardless of extras.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not the same at all. That's the point of extras. If we don't include extras here then building torch appears to be the same as building torch[cuda] except it does not include the cuda dependencies.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. Going to close this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

_resolved_key includes extras, causing re-entrant bootstrap failure

3 participants