-
-
Notifications
You must be signed in to change notification settings - Fork 645
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
Upgrade to Pex 2.1.48 and leverage packed layout. #12808
Conversation
…omposition. (pantsbuild#12736)" This reverts commit 10ed875. [ci skip-rust] [ci skip-build-wheels]
This reverts commit 30a1459. [ci skip-rust] [ci skip-build-wheels]
Pex 2.1.48 brings `--layout {packed,loose}` alternate layouts for PEXes. These are both more friendly to remote caching, leading to smaller artifacts to cache and greater cache hit ratios in the face of requirement changes. Since the loose layout still does not perform well with the local CAS scheme, we use packed for now. [ci skip-rust] [ci skip-build-wheels]
# 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]
# 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]
I could really use eyes on the revert of #12675 in 3e1f3bc. That was not a clean revert. I don't want to stomp the subsequent lock file work that tangled the clean revert. I'll update with a re-run of the local CAS space savings and timing tests I ran earlier this week and add that report here, but the numbers should be exactly the same. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉
|
||
|
||
@dataclass(frozen=True) | ||
class PexData: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
@@ -51,9 +51,7 @@ async def resolve_plugins( | |||
`named_caches` directory), but consequently needs to disable the process cache: see the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI changes to this file can be reverted. apply_requirement_constraints
defaults to False
. (Not blocking)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm going to leave Stu's comment and explicit False in in the follow-up since it looks like it marks danger in a useful way.
@@ -100,39 +99,28 @@ class ToolCustomLockfile(Lockfile, _ToolLockfileMixin): | |||
@dataclass(unsafe_hash=True) | |||
class PexRequirements: | |||
req_strings: FrozenOrderedSet[str] | |||
apply_constraints: bool |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I could really use eyes on the revert of #12675 in 3e1f3bc. That was not a clean revert. I don't want to stomp the subsequent lock file work that tangled the clean revert.
I think it was better modeling to define apply_constraints
on PexRequirements
than PexRequest
because it's better namespaced. But either approach is valid - not blocking.
Not a big deal either way because I believe this current plan* is to deprecate [python-setup].requirement_constraints
in favor of the new lockfile feature, meaning this code will be deleted.
*I know you've mentioned constraints files could still be useful to pin certain transitive deps, which I agree. But we co-opted them too much with [python-setup].resolve_all_constraints
(on by default) that to get people to migrate to lockfiles, deprecating constraints files seems the clearest path. And then maybe we retcon the mechanism after it was removed to behave how you intend. (This plan is open to change.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The other reason it was moved here was that the two LockFile cases never use the constraints / are "for" the constraints, and so this field was only relevant to directly specified constraints (afaict). But I should have done it as prework, and as Eric says: not a big deal.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I'd prefer to keep a revert a revert and follow up with the re-improvement post cherry pick if that makes sense.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Noting I still intend to do this but my stack got deeper here temporarily with the bug this upgrade exposed.
@@ -100,39 +99,28 @@ class ToolCustomLockfile(Lockfile, _ToolLockfileMixin): | |||
@dataclass(unsafe_hash=True) | |||
class PexRequirements: | |||
req_strings: FrozenOrderedSet[str] | |||
apply_constraints: bool |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The other reason it was moved here was that the two LockFile cases never use the constraints / are "for" the constraints, and so this field was only relevant to directly specified constraints (afaict). But I should have done it as prework, and as Eric says: not a big deal.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
# 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]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! I caught one more place that needs updating:
zip_safe: bool = False, |
Co-authored-by: Eric Arellano <[email protected]>
# 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]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm glad to see the zip_safe
arg go :)
Pex 2.1.48 brings `--layout {packed,loose}` alternate layouts for PEXes. These are both more friendly to remote caching, leading to smaller artifacts to cache and greater cache hit ratios in the face of requirement changes. Since the loose layout still does not perform well with the local CAS scheme, we use packed for now. Fixes pantsbuild#12548 Fixes pantsbuild#12688 Fixes pantsbuild#12803 [ci skip-rust] [ci skip-build-wheels]
…uild#12778)) * Add python-docx to the module mapping dictionary ([pantsbuild#12775](pantsbuild#12775)) * Add python-pptx to the module mapping dictionary ([pantsbuild#12776](pantsbuild#12776)) * Add `opencv-python` to the default Python module mapping ([pantsbuild#12777](pantsbuild#12777)) * Add `PyMuPDF` to the default Python module mapping ([pantsbuild#12774](pantsbuild#12774)) * Deprecate `--list-provides` option. ([pantsbuild#12759](pantsbuild#12759)) * Upgrade default `isort` to latest `isort==5.9.3` ([pantsbuild#12756](pantsbuild#12756)) * `OutputPathField.value_or_default()` no longer has an `Address` argument ([pantsbuild#12837](pantsbuild#12837)) * Properly include file dependencies in docker build context ([pantsbuild#12758](pantsbuild#12758)) * DigestSubset should not short-circuit when there are ignores involved. ([pantsbuild#12648](pantsbuild#12648)) * Improve cache reuse for `./pants package` when using a constraints file or lockfile ([pantsbuild#12807](pantsbuild#12807)) * Upgrade to Pex 2.1.48 and leverage packed layout. ([pantsbuild#12808](pantsbuild#12808)) * Fix backports of std lib modules like `dataclasses` not working with dependency inference ([pantsbuild#12818](pantsbuild#12818)) * Warn if `[python-repos]` is set during lockfile generation ([pantsbuild#12800](pantsbuild#12800)) * Add `version` to lockfile metadata headers ([pantsbuild#12788](pantsbuild#12788)) * jvm: add missing space to avoid two words running together ([pantsbuild#12793](pantsbuild#12793)) * Fix a markdown issue in a help string. ([pantsbuild#12766](pantsbuild#12766)) [ci skip-rust]
According to
All the tests in src/python/pants/backend/python/goals/run_pex_binary_integration_test.py fail, I singled one out above for simplicity. |
This was fixed in PEX as pex-tool/pex#1443, and should be released soon. In the meantime, you can fix it by (re)moving |
That doesn't appear to fix it. |
Oh, shoot... |
The refactor was a step forward, it was just all the remaining code in the PR that was target of the revert. Follow-up to pantsbuild#12808. # 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]
Pex 2.1.48 brings `--layout {packed,loose}` alternate layouts for PEXes. These are both more friendly to remote caching, leading to smaller artifacts to cache and greater cache hit ratios in the face of requirement changes. Since the loose layout still does not perform well with the local CAS scheme, we use packed for now. Fixes pantsbuild#12548 Fixes pantsbuild#12688 Fixes pantsbuild#12803 (cherry picked from commit 433a4dd) # 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]
…3a4dd 0d36002 7ba06a5) (#13078) This is a three-part-cherry-pick: 1. Upgrade to Pex 2.1.48 and leverage packed layout. (#12808) Pex 2.1.48 brings `--layout {packed,loose}` alternate layouts for PEXes. These are both more friendly to remote caching, leading to smaller artifacts to cache and greater cache hit ratios in the face of requirement changes. Since the loose layout still does not perform well with the local CAS scheme, we use packed for now. Fixes #12548 Fixes #12688 Fixes #12803 (cherry picked from commit 433a4dd) 2. Upgrade to Pex 2.1.49. (#12853) This fixes a bug activating previously `--not-zip-safe` dependency-only PEXes, which Pants used extensively before the Pex 2.1.48 upgrade. (cherry picked from commit 0d36002) 3. Upgrade to Pex 2.1.50. (#12888) This fixes a bug executing PEX zipapps that do not have the execute bit set, which is the case for the Pex PEX we download and run in the release script. (cherry picked from commit 7ba06a5) With a fourth commit that applies `./build-support/bin/generate_all_lockfiles.sh`. Fixes #13075
Pex 2.1.48 brings
--layout {packed,loose}
alternate layouts for PEXes.These are both more friendly to remote caching, leading to smaller
artifacts to cache and greater cache hit ratios in the face of
requirement changes. Since the loose layout still does not perform well
with the local CAS scheme, we use packed for now.
Fixes #12548
Fixes #12688
Fixes #12803
[ci skip-rust]
[ci skip-build-wheels]