Skip Menu |

This queue is for tickets about the ExtUtils-AutoInstall CPAN distribution.

Report information
The Basics
Id: 96782
Status: new
Priority: 0/
Queue: ExtUtils-AutoInstall

People
Owner: Nobody in particular
Requestors: gregoa [...] cpan.org
KENTNL [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



From: gregoa [...] cpan.org
Subject: libextutils-autoinstall-perl: FTBFS with Perl 5.20: busy loop configuring CPAN
We have the following bug reported to the Debian package of ExtUtils-AutoInstall (https://bugs.debian.org/752930): It doesn't seem to be a bug in the packaging, so you may want to take a look. Thanks! ------8<-----------8<-----------8<-----------8<-----------8<----- Package: libextutils-autoinstall-perl Version: 0.63-2 Severity: important User: debian-perl@lists.debian.org Usertags: perl-5.20-transition Building this package with Perl 5.20 (currently in experimental) hangs in a busy loop in t/1-basic.t test 6. The loop is fully reproducible manually. With tracing on in the Perl debugger, I see it's looping around CPAN::FirstTime::my_prompt_loop(), with this question: Warning: You do not have write permission for Perl library directories. To install modules, you need to configure a local Perl library directory or escalate your privileges. CPAN can help you by bootstrapping the local::lib module or by configuring itself to use \'sudo\' (if available). You may also resolve this problem manually if you need to customize your setup. What approach do you want? (Choose \'local::lib\', \'sudo\' or \'manual\') and always getting 'n' for a default answer. (This requires a clean $HOME/.cpan directory, which we have as debian/rules explicitly resets $HOME.) Not sure if this is a regression in CPAN or a deficiency in EU::AutoInstall, but I suspect the latter. -- Niko Tyni ntyni@debian.org ------8<-----------8<-----------8<-----------8<-----------8<----- Thanks for considering, gregor herrmann, Debian Perl Group


Attached is a hacky way of doing this, but there could be a more proper equivalent of this.

Basically, I cheat CPAN initialization by re-using a templated CPAN config and putting it in a tempdir and pretending that's my home, which on Linux does the trick. Its kinda nasty because there's room for code execution if the value of $tempdir is really clever, but where I run this is sandboxed and predictable so the surface area is pretty tiny.

But all the same, a safer, more narrowly defined equivalent should probably be added to this test suite.

-- 
- CPAN kentnl@cpan.org
- Gentoo Perl Maintainer kentnl@gentoo.org ( perl@gentoo.org )
 

Subject: 0002-Patch-around-annoying-CPAN-initialization-test.patch
From fe02934c5a5bba11e351be5a2f3f95a4461779af Mon Sep 17 00:00:00 2001 From: Kent Fredric <kentnl@gentoo.org> Date: Sat, 21 Oct 2017 15:37:11 +1300 Subject: Patch around annoying CPAN-initialization test This is a terrible way of doing this, but its good enough for now and convinces CPAN that its already configured and doesn't block waiting for input. A more sensible narrow set is probably viable, and OS specifics probably need to be considered. Bug: https://rt.cpan.org/Ticket/Display.html?id=96782 --- t/1-basic.t | 75 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) diff --git a/t/1-basic.t b/t/1-basic.t index dbf7e27..2cdffab 100644 --- a/t/1-basic.t +++ b/t/1-basic.t @@ -10,6 +10,7 @@ my $mm_args; my @prompts = qw/y n n y y/; use ExtUtils::MakeMaker; +use File::Temp qw( tempdir ); sub ExtUtils::MakeMaker::WriteMakefile { $mm_args = {@_} } sub ExtUtils::MakeMaker::prompt ($;$) { return 'n' } @@ -24,6 +25,80 @@ my $fh = Symbol::gensym; my $out = tie *$fh, __PACKAGE__; select(*$fh); +my $tempdir = tempdir( 'tmp-XXXXXXX', DIR => './t' , CLEANUP => 1 ); +$ENV{HOME} = $tempdir; +mkdir "$tempdir/.cpan"; +mkdir "$tempdir/.cpan/CPAN"; +{ + open my $fh, '>', "$tempdir/.cpan/CPAN/MyConfig.pm" or die "can't open test MyConfig.pm: $! $?"; + print $fh <<"EOF"; +\$CPAN::Config = { + 'applypatch' => q[], + 'auto_commit' => q[0], + 'build_cache' => q[100], + 'build_dir' => q[\Q$tempdir\E/build], + 'build_dir_reuse' => q[0], + 'build_requires_install_policy' => q[yes], + 'bzip2' => q[/bin/bzip2], + 'cache_metadata' => q[1], + 'check_sigs' => q[0], + 'colorize_output' => q[0], + 'commandnumber_in_prompt' => q[1], + 'connect_to_internet_ok' => q[1], + 'cpan_home' => q[\Q$tempdir\E], + 'ftp_passive' => q[1], + 'ftp_proxy' => q[], + 'getcwd' => q[cwd], + 'gpg' => q[/usr/bin/gpg], + 'gzip' => q[/bin/gzip], + 'halt_on_failure' => q[0], + 'histfile' => q[\Q$tempdir\E/histfile], + 'histsize' => q[100], + 'http_proxy' => q[], + 'inactivity_timeout' => q[0], + 'index_expire' => q[1], + 'inhibit_startup_message' => q[0], + 'keep_source_where' => q[\Q$tempdir\E/sources], + 'load_module_verbosity' => q[none], + 'make' => q[/usr/bin/make], + 'make_arg' => q[], + 'make_install_arg' => q[], + 'make_install_make_command' => q[/usr/bin/make], + 'makepl_arg' => q[], + 'mbuild_arg' => q[], + 'mbuild_install_arg' => q[], + 'mbuild_install_build_command' => q[./Build], + 'mbuildpl_arg' => q[], + 'no_proxy' => q[], + 'pager' => q[/usr/bin/less], + 'patch' => q[/usr/bin/patch], + 'perl5lib_verbosity' => q[none], + 'prefer_external_tar' => q[1], + 'prefer_installer' => q[MB], + 'prefs_dir' => q[\Q$tempdir\E/prefs], + 'prerequisites_policy' => q[follow], + 'scan_cache' => q[atstart], + 'shell' => q[/bin/bash], + 'show_unparsable_versions' => q[0], + 'show_upload_date' => q[0], + 'show_zero_versions' => q[0], + 'tar' => q[/bin/tar], + 'tar_verbosity' => q[none], + 'term_is_latin' => q[1], + 'term_ornaments' => q[1], + 'test_report' => q[0], + 'trust_test_report_history' => q[0], + 'unzip' => q[/usr/bin/unzip], + 'urllist' => [q[http://cpan.kinghost.net/], q[http://cpan.dcc.uchile.cl/], q[http://www.laqee.unal.edu.co/CPAN/]], + 'use_sqlite' => q[0], + 'version_timeout' => q[15], + 'wget' => q[/usr/bin/wget], + 'yaml_load_code' => q[0], + 'yaml_module' => q[YAML], + }; +EOF +} + # test from a clean state $ENV{PERL_EXTUTILS_AUTOINSTALL} = ''; require ExtUtils::AutoInstall; -- 2.14.2