Skip to content

🐛 fix(builder): validate backend-path entries exist on disk#1016

Merged
gaborbernat merged 2 commits into
pypa:mainfrom
gaborbernat:fix/validate-in-tree-backend-path
Apr 9, 2026
Merged

🐛 fix(builder): validate backend-path entries exist on disk#1016
gaborbernat merged 2 commits into
pypa:mainfrom
gaborbernat:fix/validate-in-tree-backend-path

Conversation

@gaborbernat
Copy link
Copy Markdown
Collaborator

When backend-path in pyproject.toml points to a nonexistent directory (typo, missing checkout, wrong relative path), the error only surfaces deep inside a subprocess as an opaque BackendUnavailable exception from pyproject_hooks. This makes it hard to diagnose what went wrong.

This adds early validation in ProjectBuilder.__init__ that checks each backend-path entry resolves to an existing directory relative to the source directory. When it doesn't, a BuildSystemTableValidationError is raised immediately with a clear message identifying the bad path. This is consistent with the existing type validation already performed on [build-system] table fields.

Closes #145

@gaborbernat gaborbernat requested review from FFY00 and layday as code owners April 9, 2026 19:48
@gaborbernat gaborbernat added the enhancement New feature or request label Apr 9, 2026
@gaborbernat gaborbernat requested a review from henryiii as a code owner April 9, 2026 19:48
Early-fail with a clear error when backend-path entries in
pyproject.toml don't exist or aren't directories, instead of
surfacing an opaque BackendUnavailable from the subprocess.

Closes pypa#145
@gaborbernat gaborbernat force-pushed the fix/validate-in-tree-backend-path branch from 723d5e6 to 2cba2de Compare April 9, 2026 19:50
Signed-off-by: Henry Schreiner <henryfs@princeton.edu>
@gaborbernat gaborbernat merged commit d896c72 into pypa:main Apr 9, 2026
65 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Validate the project for in-tree backends

2 participants