Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix default layout and use of PEX-repositories for legacy lockfiles (…
…cherrypick of #15014) (#15032) As reported in #14980 and #14991: 1) the default layout of non-internal PEXes changed to `PACKED`, and 2) the PEX-repository subsetting optimization was disabled for manual or poetry lockfiles. This change fixes those issues, and adds a test of the `pex_from_targets` codepath which decides which resolution strategy to use. But it also fairly significantly refactors the `PexRequest` consumption code to improve typesafety. In particular: * Replaces the `is_all_constraints_resolve` special case with explicitly specified `PexLayout`s for those `PexRequests` (which would have been harder at the time when the special case was originally added, since `PexRequest.layout` didn't exist yet). * Moves lockfile header parsing and PEX-native-detection into a `@rule` which produces a `LoadedLockfile`. * Moves "subsetting of a lockfile or a repository PEX" to the `PexRequirements.from_subset` field, which takes a `LoadedLockfile` and asserts (not worth introducing another type yet probably) that the lockfile is PEX-native. * Move the requirements which used to be attached to the `Lockfile`/`LockfileContents` off onto an `PexRequest.requirements = EntireLockfile` case, to assert that they are optional, and only used for metadata validation (rather than subsetting). Fixes #14980 and fixes #14991. [ci skip-rust] [ci skip-build-wheels]
- Loading branch information