Conversation
Signed-off-by: Henry Schreiner <henryfs@princeton.edu>
src/build/env.py
Outdated
| # Detect that by checking if pip._vendor` module exists. | ||
| if (spec := importlib.util.find_spec('pip')) is not None: | ||
| for loc in spec.submodule_search_locations: | ||
| vendor_loc = Path(loc) / '_vendor' |
There was a problem hiding this comment.
This won't work with a zipapp copy of pip because its paths are not filesystem paths - we'd have to use importlib.resources.Traversable. Personally, I'd rather rip this whole thing out and agree with distros some way they could signal that pip is debundled in its metadata.
There was a problem hiding this comment.
If it is a zipapp pip, couldn't we assume this is not debundled (that's the opposite of what happens here, but I think we could do it).
Working out some mechanics to declare this would be harder, take longer, and would probably need standardization. Gentoo isn't even supporting distribution.files as it is.
There was a problem hiding this comment.
It also still triggers the distutils hack warning, by the way.
There was a problem hiding this comment.
I guess? But it feels like we're just stacking hack upon hack at this point.
There was a problem hiding this comment.
Pushed new version with different logic.
There was a problem hiding this comment.
New version looks better. Does Gentoo write out a RECORD then?
There was a problem hiding this comment.
No, if the RECORD is missing, it is assumed broken in the current form, so Gentoo won't be used. Homebrew 3.14 also won't be used when it could be due to missing RECORD.
Signed-off-by: Henry Schreiner <henryfs@princeton.edu>
b5ddb18 to
04aaf1f
Compare
Signed-off-by: Henry Schreiner <henryfs@princeton.edu>
Attempt to work around pip hack for Gentoo, close #978.
If pip doesn't have
RECORD, then this will no longer use it. We could require non-empty RECORD for the check, which would require Gentoo to include a working RECORD without the_vendorfiles. In general, though, I think if RECORD is missing, this might be a modified pip and we probably shouldn't trust it.