-
-
Notifications
You must be signed in to change notification settings - Fork 258
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 more context for Job errors. #2479
Conversation
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 pex-tool#2113
@@ -211,7 +210,7 @@ def bdist(self): | |||
# type: () -> str | |||
get_pip( | |||
interpreter=self._interpreter, | |||
resolver=ConfiguredResolver(pip_configuration=PipConfiguration()), | |||
resolver=ConfiguredResolver.default(), |
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.
There are several ConfiguredResolver.default()
changes like this in the tests below. This makes those test more robust to combinations not run in CI; I hit a few when testing out this change.
@@ -137,6 +137,9 @@ commands = | |||
|
|||
[testenv:{typecheck,check}] | |||
deps = | |||
# We keep this compatible with Python 2.7 for the 2.7 type check. |
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.
Otherwise unrelated, but helps with dev env setup.
@@ -1566,45 +1565,6 @@ def __repr__(self): | |||
) | |||
|
|||
|
|||
def spawn_python_job( |
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.
This was only used in a test - now inlined.
ResolverVersion.default() is ResolverVersion.PIP_2020, | ||
reason=( | ||
"The PIP_2020 resolver triggers download analysis in normal resolves but this test is " | ||
"concerned with the case when there is no analysis to be performed." |
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.
There is now always Pip download log analysis; so the test was obsolete.
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.
This looks great. Thanks for improving diagnostics!
This makes several error paths that manifest when creating locks and
PEXes present better error details.
Several changes support this:
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?
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.
spot sdist build errors and surface their details.
the full Pip log content when no better analysis was found.
Fixes #2113