pex-tool / pex

A tool for generating .pex (Python EXecutable) files, lock files and venvs.
https://docs.pex-tool.org/
Apache License 2.0
2.52k stars 258 forks source link

Add more context for Job errors. #2479

Closed jsirois closed 1 month ago

jsirois commented 1 month ago

This makes several error paths that manifest when creating locks and PEXes present better error details.

Several changes support this:

  1. Jobs can now have a context label which is used, when set, to prefix all job error output. This should help root cause the problem; i.e.: is it fundamentally Pex or is it Pip or is it a problem with a bad package?
  2. When a Pip download errors, we now show all STDERR output instead of just the last line whenever the last line contains "See above for details", which Pip emits to indicate an error buried deeper in the logs.
  3. A new log analyzer is added to all Pip downloads that knows how to spot sdist build errors and surface their details.
  4. A fail-safe is added to the Pip download log scraper to just report the full Pip log content when no better analysis was found.

Fixes #2113