-
-
Notifications
You must be signed in to change notification settings - Fork 636
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pex repository not created if [python].enable_resolves=true
and the resolve does not use a PEX lockfile
#14991
Comments
I've spent a few hours investigating this, but the code is fairly hairy. Will try to get it resolved by EOD Tuesday. |
To be more specific here, this is only an issue if the user is using a non-PEX-lockfile right? I don't see a |
So I'm not sure this is an issue. There's only 2 reasons we need the
I don't see a reason why @Eric-Arellano thoughts? |
Correct. Sorry: I meant
@thejcannon : The The reason that But most importantly: it causes repositories which are not using PEX lockfiles to fail to build (ours in particular), possibly because the |
[python].enable_resolves=true
and ![python]...resolver=pex
[python].enable_resolves=true
and ![python]...lockfile_generator=pex
An important distinction here is that Pants can and will consume a PEX lockfile regardless of |
[python].enable_resolves=true
and ![python]...lockfile_generator=pex
[python].enable_resolves=true
and the resolve uses a PEX lockfile
[python].enable_resolves=true
and the resolve uses a PEX lockfile[python].enable_resolves=true
and the resolve does not use a PEX lockfile
Reminder that [python].lockfile_generator is not sufficient to know if it's a pex lockfile or not. a lot of work into that so you can do things like have some locks be pex and some manually generated. we need to call our helper function to inspect the lock and see if its json |
Yes, and that's part of why the code is so complicated, unfortunately. We're going to need to support both for a while, so I'm trying to push the detection further upfront without too much churn. |
Ah so really one way to think of this is it being implictly true in this case. That's what I missed in #14944 |
i suspect pex_from_targets will need to inspect the lock and call our helper function to determine if repo.pex should be used. pex.py can hopefully stay unchanged from josh's pr |
…15014) 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.
…antsbuild#15014) As reported in pantsbuild#14980 and pantsbuild#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 pantsbuild#14980 and fixes pantsbuild#14991. # Rust tests and lints will be skipped. Delete if not intended. [ci skip-rust] # Building wheels and fs_util will be skipped. Delete if not intended. [ci skip-build-wheels]
…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]
A pex repository is not created when using the combination of settings from the description, which results in skipping the
--pex-repository
subsetting operation.The text was updated successfully, but these errors were encountered: