Skip to content
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

Add --preserve-pip-download-log flag #21980

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

telekid
Copy link

@telekid telekid commented Feb 19, 2025

Resolves #21979.

@sureshjoshi
Copy link
Member

Note: As per #21979 - telekid is @jake-normal

@tgolsson
Copy link
Contributor

tgolsson commented Feb 23, 2025

A small note in the release notes since this might be a "good to know" despite the small size.

@sureshjoshi
Copy link
Member

sureshjoshi commented Feb 23, 2025

Oh yeah, I completely forgot about this one - thought it was merged.
@jake-normal do you know how we can test this locally? Where does the file end up if I want to see it?

If I can confirm it works locally, I can write some release notes and push it forward.

Copy link
Contributor

@benjyw benjyw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @jake-normal ! Seconding the question of documenting where the download log ends up when this is run in a process sandbox, and maybe we could debug-log its location.

@sureshjoshi
Copy link
Member

Per John in the accompanying issue (me asking about performance):

No perf hit. Pex needs to capture the Pip log in full already to create a universal lock. The flag with no arg just skips a tempdir teardown.

So, this makes me think it's part of the pex created folders - I'll take a look shortly when I get to my computer.

@sureshjoshi
Copy link
Member

pex-tool/pex#2536

Although --pip-log is just an alias for the pre-existing
--preserve-pip-download-log option, the option gains the ability to
accept an optional log path value. In addition to this pro-active means
of starting a debuggable Pex session with Pip, the log is also made more
useful in the face of a multi-target resolve by serializing the log on
targets and prefixing log lines per target. The log now also includes
the compatibility tags calculated via pip -v debug ... for any
abbreviated --platforms used in the resolve.

Sounds like stderr by default?

@sureshjoshi
Copy link
Member

I'm not positive, but I think we should also add a log location, so that it ends up in the sandbox.

  "--preserve-pip-download-log",
  "pip-sj.log",
⏺ T/pants-sandbox-RknX7O % tree
.
|____pex
|____lock.json
|____.python-build-standalone
|____pip-sj.log
|______run.sh
|____.tmp
|____.cache
| |____pex_root

@sureshjoshi
Copy link
Member

Turns out I have absolutely no idea how to use Github to update a PR - instead of going to this PR, using gh pushed it to a new branch in this repo: main...preserve-pip-download-log

I hate Github sometimes.

@tgolsson
Copy link
Contributor

@sureshjoshi might be easier to make a change suggestion? :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

pex: --preserve-pip-download-log
4 participants