perl11 / cperl

A perl5 with classes, types, compilable, company friendly, security
http://perl11.org/
Other
142 stars 17 forks source link

CPAN: infinite loop during checking dependencies #361

Closed sten22 closed 6 years ago

sten22 commented 6 years ago

cperl-5.26.2 on darwin With some modules, e.g. Protocol::HTTP2, App::cpm:

$ cpan Protocol::HTTP2
Loading internal null logger. Install Log::Log4perl for logging messages
Reading '/Users/user/.cpan/Metadata'
  Database was generated on Sun, 29 Apr 2018 03:54:37 GMT
Running install for module 'Protocol::HTTP2'
Checksum for /Users/user/.cpan/sources/authors/id/C/CR/CRUX/Protocol-HTTP2-1.08.tar.gz ok
---- Unsatisfied dependencies detected during ----
----      CRUX/Protocol-HTTP2-1.08.tar.gz     ----
    Module::Build::Tiny [build_requires]
Running install for module 'Module::Build::Tiny'
Checksum for /Users/user/.cpan/sources/authors/id/L/LE/LEONT/Module-Build-Tiny-0.039.tar.gz ok
  LEONT/Module-Build-Tiny-0.039.tar.gz
  [configure_requires] -- NOT OK
  CRUX/Protocol-HTTP2-1.08.tar.gz
  Has already been unwrapped into directory /Users/user/.cpan/build/Protocol-HTTP2-1.08-3
---- Unsatisfied dependencies detected during ----
----      CRUX/Protocol-HTTP2-1.08.tar.gz     ----
    Module::Build::Tiny [build_requires]
Running install for module 'Module::Build::Tiny'
...
rurban commented 6 years ago

For me it fails at the AnyEvent ssl tests before. 80_ssltest.t, 81_hosts.t No cpan loop.

AnyEvent fails because of the empty default_loop_sv

sten22 commented 6 years ago

That's strange, I use Net::SSLeay 1.85 with OpenSSL-1.0.2o installed in /usr/local/opt/openssl and all tests pass. If you have newer openssl and get error related with ST_OK you can try this patch for Net::SSLeay:

--- a/helper_script/regen_openssl_constants.pl
+++ b/helper_script/regen_openssl_constants.pl
@@ -148,7 +148,13 @@ while (<DATA>) {
 }

 if ($ARGV[0] && $ARGV[0] eq '-gen-c') {
-  my $src = "/* DO NOT EDIT THIS FILE - update __DATA__ section of helper_script/regen_openssl_constants.pl */\n\n";
+  my $src = <<'END';
+/* DO NOT EDIT THIS FILE - update __DATA__ section of helper_script/regen_openssl_constants.pl */
+
+#ifndef SSL_ST_OK
+#define SSL_ST_OK TLS_ST_OK
+#endif
+END
   $src .= MySubClass->C_constant({breakout=>~0,indent=>20}, @constants);
   print_output($src, $ARGV[1]);
   warn "\n### do not forget to update (manually) SSLeay.pod(constants list) + SSLeay.pm(\@EXPORT_OK)\n\n";
rurban commented 6 years ago

Found the problem. I need to use my EV-loop.patch for EV.

Error is not repro for me. No cpan loop. Protocol::HTTP2 installed fine. Errors in cpan modules need to be fixed manually, possibly by adjusting the distroprefs patches and yml recipes. Mostly by adding a new version number to the YAML.

sten22 commented 6 years ago

Some investigation:

$ cpan Module::Build::Tiny
Reading '/Users/user/.cpan/Metadata'
  Database was generated on Sun, 29 Apr 2018 03:54:37 GMT
Running install for module 'Module::Build::Tiny'
Checksum for /Users/user/.cpan/sources/authors/id/L/LE/LEONT/Module-Build-Tiny-0.039.tar.gz ok
  LEONT/Module-Build-Tiny-0.039.tar.gz
  [configure_requires] -- NOT OK

No information whats is wrong... I've use dtruss to found that CPAN needs File::HomeDir, after installing File::HomeDir:

$ cpan Module::Build::Tiny
Reading '/Users/user/.cpan/Metadata'
  Database was generated on Sun, 29 Apr 2018 03:54:37 GMT
Running install for module 'Module::Build::Tiny'
CPAN: YAML::XS loaded ok (v0.75)
CPAN: CPAN::Kwalify loaded ok (v5.50)
CPAN: Digest::SHA loaded ok (v6.01)
CPAN: Compress::Zlib loaded ok (v2.074)
Checksum for /Users/user/.cpan/sources/authors/id/L/LE/LEONT/Module-Build-Tiny-0.039.tar.gz ok
CPAN: CPAN::Meta::Requirements loaded ok (v3.140)
CPAN: Parse::CPAN::Meta loaded ok (v1.5000)
CPAN: CPAN::Meta loaded ok (v2.150010)
CPAN: Module::Build loaded ok (v0.4224)
CPAN: Module::CoreList loaded ok (v5.20180108)
  LEONT/Module-Build-Tiny-0.039.tar.gz
  [configure_requires] -- NOT OK

Again no information, then I've found 'o conf debug all' option in cpan's shell:

...
Debug(Distribution,Distribution.pm,700,[Distribution,Distribution.pm,746,satisfy_configure_requires]): configure_requires[DynaLoader/b/]
Debug(
$VAR1 = [
          [
            'DynaLoader',
            'b',
            ''
          ]
        ];
)
Debug(Distribution,Distribution.pm,2631,[Distribution,Distribution.pm,727,follow_prereqs]): DynaLoader builtin
  LEONT/Module-Build-Tiny-0.039.tar.gz
  [configure_requires] -- NOT OK

So it didn't see DynaLoader package. How it possible that you don't get same error?

rurban commented 6 years ago

Maybe you have a wrong CPAN::Distribution in site_cperl? The core CPAN treats DynaLoader as core builtin, the CPAN variant not.

sten22 commented 6 years ago

I've added pull request for this issue: https://github.com/perl11/cperl/pull/363 In my case I've had only DynaLoader in @prereq returned from unsat_prereq

rurban commented 6 years ago

Thanks, merged PR with 84090a32e95396865be442e957e903bb49a0cf6f