-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Improve logging in the case of a failed legacy build. #6260
Conversation
@pfmoore See here. This is a tweak to a recent fix for a regression in 19.0.2. My question: do you think the full command output for legacy build failures should be included in the logs? Would that be useful? Or should the output be truncated? My concern is a wall of text if there are any cases where builds have lots of output. |
@cjerdonek I honestly don't know. We have no control over what output the build process produces so the "wall of test" problem is a very real one. On the other hand, if we suppress it we could end up in a situation where pip says "there's a problem" but gives the user no details on how to debug it. Obviously the user can always specify (Much longer term, maybe PEP 517 backends should provide richer error details than just the raw stdout/stderr, but that will take a new PEP and a lot of backend changes, so that won't happen soon). |
@pfmoore Okay, sounds good. Thanks. I'll tweak the PR to use a short message by default in both cases, and include the command output only when the log level is DEBUG. And to be clear, I'll make this change in both cases covered by this PR of (1) the build command exiting with 0 status code but creating no file, and (2) the build command exiting with 0 status code and creating more than one file (exactly one file is supposed to be created). |
@cjerdonek Do you want me to hold off 19.0.3 for this PR? I am OK to do so. |
@pradyunsg Yes, thank you. I'll be able to get to it about 12 hours from now, and it will be quick. |
No hurries, I have a looong weekend so I'll be able cut a release whenever this is ready. :) |
1a014a0
to
c74c683
Compare
@pradyunsg Okay, I think this is good to go now. |
a2db686
to
5f7ea19
Compare
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 error message should suggest using --verbose instead of suggesting raising at logging level.
5f7ea19
to
d3a1b85
Compare
@pradyunsg Done. |
Minor code style not of using single quotes in the newly added changes but not something that'd block approval from me. |
Thanks for the review, @pradyunsg. I believe I was using single quotes everywhere I was able (the places where I'm not are strings that contain single quotes). That's normally my preference, but I'm not dogmatic about it. |
I was specifically refering to https://github.com/pypa/pip/pull/6260/files#diff-8eace9d800faa06b69c7a7ccd7571e36R192; where there's inconsistency. |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Fixes #6259.
In at least one case, if the legacy build fails, it's not a critical failure, so this PR changes the log message from an error to a warning and gives a better explanation. I'm not sure if there are any cases where this failure results in a critical failure for pip. If we knew for sure that there weren't any such cases, we could tell the user that here.
The one thing I'm not sure about is whether the command output should be truncated since it's not a critical failure (in at least one case). My concern is the possibility of some users facing a wall of text on a regular basis. Before, the behavior was for this failure to be swallowed with no logging message, which doesn't seem right to me either.