better-van-82973
12/20/2024, 7:30 PMcurved-manchester-66006
12/20/2024, 7:48 PMpants lock generate
# everything type of lockfile supports this
• pants lock sync
# specific to pex lockfiles, be a thin wrapper and avoid the 200% problem
• pants lock some-other-pex-verb
https://github.com/pantsbuild/pants/issues/15568
https://github.com/pantsbuild/pants/issues/13694
I think maybe @happy-kitchen-89482 mentioned with the new option subsystem that was more viable now?curved-manchester-66006
12/20/2024, 7:48 PMbetter-van-82973
12/20/2024, 7:50 PMupdate-lockfiles
goal similar to generate-lockfiles
that could analogously do incremental updates for a single resolve.curved-manchester-66006
12/20/2024, 7:58 PMexperimental-sync-lockfiles
which would map to pex3 lock sync
bikeshed: maybe have pex
in those names?
(I forget if sync
handles both the "update from the existing inputs" and "update within the existing range" use cases)
I recommend not exposing the pex "sharp knife" variantcurved-manchester-66006
12/20/2024, 7:58 PMhappy-kitchen-89482
12/20/2024, 11:46 PMpex3 lock sync
is not faster than regenerating a full lockfile, it still does a full resolve, but applies constraints from the previous lockfile so that the actual updates are conservative. See https://github.com/pex-tool/pex/discussions/2565 for John patiently explaining this to me.
So while I think this is an important change and would be happy to help guide you through it, keep in mind that it won’t improve lock performance.happy-kitchen-89482
12/20/2024, 11:48 PMlock
goal, So you have lock --generate
, lock --sync
etcbetter-van-82973
12/20/2024, 11:54 PMpex3 lock sync
. The rough outline of the change I had in mind would actually address a different use case, and hopefully one where lock performance would be improved: updating or deleting dependencies from a lockfile. My idea here was as follows:
1. Create a new goal called update-lockfile-dependencies
and allow specifying a resolve.
2. For this resolve, compute the set of input package requirements based on generated and explicit python_requirements
targets, and diff that against the lockfile metadata to find any changes.
a. Not sure how feasible this is.
b. Meta-goal here is to overcome the constraint outlined in https://github.com/pantsbuild/pants/pull/20364/files#r1451604634: Pants combines Python dependencies from a variety of sources and it might not be easy to update the source file that Pants depends on for a particular requirement.
3. Then, use the replace/delete functionality introduced in PEX 2.1.160 to delete and then replace the appropriate dependencies from the lockfile.better-van-82973
12/21/2024, 12:00 AMEvery lock subcommand (create, update, sync) currently performs a complete fresh lock from scratch. The only difference is that update and sync apply constraints based on a prior lock. Thecommands get you incremental lock updates. They have 0 to do with speed of locking.pex3 lock {update,sync}