-
-
Notifications
You must be signed in to change notification settings - Fork 287
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
Use symlinks to add dists in the Pex CLI. #1185
Use symlinks to add dists in the Pex CLI. #1185
Conversation
This avoids copying dists from ~/.pex/installed_wheels to a PEXBuilder tmpdir before finally zipping up the tmpdir. Instead, with just a single symlink added to the PEXBuilder tmpdir for each dist, the zip is created directly from the sources under ~/.pex/installed_wheels providing a modest speed up when building large PEX files.
For
|
@@ -402,9 +441,14 @@ def add_distribution(self, dist, dist_name=None): | |||
this will be inferred from the distribution itself should it be formatted in a standard way. | |||
:type dist: :class:`pkg_resources.Distribution` | |||
""" | |||
if dist.location in self._distributions: |
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 new SYMLINK
copy_mode
brought to light the fact we were doing over-writes here when populating the PEXBuilder with the results of multi-target resolves whenever a distribution applied to more than one target (say a universal wheel). This was a harmless time-waste previously.
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!
This avoids copying dists from ~/.pex/installed_wheels to a PEXBuilder
tmpdir before finally zipping up the tmpdir. Instead, with just a single
symlink added to the PEXBuilder tmpdir for each dist, the zip is created
directly from the sources under ~/.pex/installed_wheels providing a
modest speed up when building large PEX files.