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
Porting/sync-with-cpan has implicit undeclared dependencies #18109
Comments
I previously suggested adding proper error checking to the HTTP::Tiny call, which would expose the error message you found via the debugger; the error checking that is there is insufficient. |
Your example program could be improved to report such errors by changing the last line in the
|
Anything under I suggest we:
|
I'll take this ticket and work on it between other projects. jimk |
You are already working on a lot of things at the same time. Let me take this off your hands. |
Something's wrong with me. You already fixed this in 34c2009. We just need the error checking to be better. |
The original code uses HTTP::Tiny and if it fails, we try alternatives. This isn't the best strategy because it might fail for legitimate reasons and we need to separate whether it failed for a reason that other user agents will fail or if it failed without crashing. But, meh. We try to detect whether it succeeded in the function call (as in, didn't crash) but failed in the request itself, and then we surface it. I've enabled an unavailable proxy configuration and tested it. This is what it looks like: $ perl Porting/sync-with-cpan CPAN Cannot retrieve file: http://www.cpan.org/modules/02packages.details.txt Status: 599 Reason: Internal Exception Content: Could not connect to 'proxy.xxx.yyy.com:8080': No address associated with hostname Removing the proxy configuration, it succeeded.
The original code uses HTTP::Tiny and if it fails, we try alternatives. This isn't the best strategy because it might fail for legitimate reasons and we need to separate whether it failed for a reason that other user agents will fail or if it failed without crashing. But, meh. We try to detect whether it succeeded in the function call (as in, didn't crash) but failed in the request itself, and then we surface it. I've enabled an unavailable proxy configuration and tested it. This is what it looks like: $ perl Porting/sync-with-cpan CPAN Cannot retrieve file: http://www.cpan.org/modules/02packages.details.txt Status: 599 Reason: Internal Exception Content: Could not connect to 'proxy.xxx.yyy.com:8080': No address associated with hostname Removing the proxy configuration, it succeeded.
On the face of it,
Porting/sync-with-cpan
appears to depend solely on libraries that ship with the core distribution:However, its
wget()
function preferentially requires HTTP::Tiny, then calls this:... where the variables have values like these:
Note that in that
eval
, the existing code does not check for$http->response
. Note further that we're making anhttps
call, not anhttp
call.But to make an
https
support, HTTP::Tiny requires IO::Socket::SSL 1.42 and Net::SSLeay 1.49 -- neither of which ship with the core distribution. The following program extracts theHTTP::Tiny->mirror
call thatsync-with-cpan
does.If, in an environment where neither IO::Socket::SSL nor Net::SSLeay is installed, I call this program, I get:
If I run the program above through the debugger, I eventually come to this:
So, in the way that
Porting/sync-with-cpan
is typically used, it has undeclared implicit dependencies. Those committers who run this program typically have lots of CPAN modules installed. Hence, we're never tripped up on this. But this means you pretty much can't run `Porting/sync-with-cpan on just the core distribution alone.How shall we address this?
Thank you very much.
Jim Keenan
The text was updated successfully, but these errors were encountered: