Skip Menu |

This queue is for tickets about the CPAN CPAN distribution.

Report information
The Basics
Id: 92402
Status: open
Priority: 0/
Queue: CPAN

People
Owner: Nobody in particular
Requestors: pause [...] tlinx.org
Cc: CHORNY [...] cpan.org
AdminCc:

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



Subject: Inline asks interactive question -- but doesn't have keyboard
Example: Checking if your kit is complete... Looks good Inline::C is packaged with Inline.pm because it is the most commonly used Inline Language Support Module (ILSM). See also: Inline::ASM, ::Awk, ::BC, ::Basic, ::Befunge, ::CPP (C++), ::CPR, ::Foo, ::Guile, ::Java, ::Octave, ::PERL, ::Python, ::Ruby, ::TT, ::Tcl and ::WebChat. Config.pm indicates that your version of Perl was built with this C compiler: gcc I have located this compiler on your system. Do you want to install Inline::C? [y] y (/home/perl/perl-5.16.3/bin/perl Makefile.PL exited with 9) CPAN::Reporter: test results were not valid, Command interrupted. No 'Makefile' created SISYPHUS/Inline-0.53.tar.gz /home/perl/perl-5.16.3/bin/perl Makefile.PL -- NOT OK Running make test Make had some problems, won't test Running make install Make had some problems, won't install --------------------- Very frustrating -- I tried to type 'y', bt it was ignored, as STDIN seems to be taken over by CPAN. Running the make manually, however, works fine... (maybe a CPAN deficiency? Though the make of this module was done as a pre-req in a long line of automatic build/installs -- wasn't until I looked back later that I found the cause.
On Wed Jan 22 21:24:28 2014, LAWALSH wrote: Show quoted text
> > Example: > > > Checking if your kit is complete... > Looks good > > Inline::C is packaged with Inline.pm because it is the most commonly > used > Inline Language Support Module (ILSM). > > See also: Inline::ASM, ::Awk, ::BC, ::Basic, ::Befunge, ::CPP (C++), > ::CPR, > : :Foo, ::Guile, ::Java, ::Octave, ::PERL, ::Python, ::Ruby, ::TT, > : :Tcl and ::WebChat. > > Config.pm indicates that your version of Perl was built with this C > compiler: > > gcc > > I have located this compiler on your system. > > Do you want to install Inline::C? [y] y
At this point you're experiencing the Makefile.PL for Inline::C, as the CPAN installer runs all Makefile.PL's within the distribution recursively. The prompting is handled by ExtUtils::MakeMaker's prompt() function. And as you see within the "[y]" square brackets, prompt() is being directed to supply a default. prompt() detects whether Makefile.PL has been invoked interactively, or non-interactively (as is the case when running the 'cpan' installer). When it's invoked non-interactively, the default is used. Inline::C supplies the "y" default, which seems to be what you would have selected anyway, had you been in interactive mode. If Inline::C's Makefile.PL didn't supply a default, prompt() would use the empty string as a default in non-interactive mode, which would cause Inline::C's Makefile.PL to enter an endless loop (you can look at the source to see what I mean). Fortunately, Inline::C's Makefile.PL does the right thing; it supplies a default. So the prompting problem you're describing is actually "how things are done": Makefile.PL is making correct use of prompt(), supplied by ExtUtils::MakeMaker. If you don't like how ExtUtils::MakeMaker::prompt works, and for the most part, prompt() works flawlessly across a broad range of systems and configurations; it has to, being part of EU::MM. The next issue to consider is how the cpan installer works. The basic 'cpan' installer (provided by App::cpan) doesn't (to my knowledge) provide an option for interactive installations. So if you want to install automatically using the 'cpan' installer, you're going to have to accept Inline::C's defaults, which is exactly why defaults are provided. It would be nice to see an "interactive mode" feature implemented for App::cpan / CPAN.pm, but that's someone else's jurisdiction, not Inline's. However, if you would like a degree of automation, but still want to be able to hit the "y" key yourself (without waiting around for someone to implement the feature in App::cpan / CPAN.pm), you may use 'cpanm' (App::cpanm, or cpanminus) to install Inline and Inline::C. 'cpanm' provides an "--interactive" option. If you invoke this command: 'cpanm --interactive Inline' you will get an automated installation of Inline, along with blocking prompting that you can respond to manually before Inline::C gets installed. Show quoted text
> (/home/perl/perl-5.16.3/bin/perl Makefile.PL exited with 9) > > CPAN::Reporter: test results were not valid, Command interrupted. > > No 'Makefile' created SISYPHUS/Inline-0.53.tar.gz > /home/perl/perl-5.16.3/bin/perl Makefile.PL -- NOT OK > Running make test > Make had some problems, won't test > Running make install > Make had some problems, won't install > ---------------------
This problem, I haven't seen before. But it's not related to prompting. The fact that you're able to achieve a successful install manually (make, make test, make install) indicates that your setup is capable of installing Inline and Inline::C. And as indicated earlier, the prompting is working as intended.
Subject: Re: [rt.cpan.org #92402] Inline asks interactive question -- but doesn't have keyboard
Date: Thu, 23 Jan 2014 17:55:06 +1100
To: <bug-Inline [...] rt.cpan.org>, <inline [...] perl.org>
From: <sisyphus1 [...] optusnet.com.au>
Show quoted text
-----Original Message----- From: Linda A Walsh via RT
> Do you want to install Inline::C? [y] y > (/home/perl/perl-5.16.3/bin/perl Makefile.PL exited with 9)
> Very frustrating -- I tried to type 'y', bt it was ignored, as STDIN seems > to be taken over by CPAN.
Yes, I would find that very annoying. I don't use any of the CPAN family of modules very much - I avoid them unless there's a very long dependency chain. Consequently, I don't know much about the options they provide, or about the details of the way in which they're supposed to work. Did David's reply help ? The only thing I can think of adding to what David provided is that, if you're happy to accept the default, then setting the PERL_MM_USE_DEFAULT environment variable to 1 should enable that. (The default will be 'y' if a compiler is found, and 'n' if a compiler is not found.) Cheers, Rob
CC: inline <inline [...] perl.org>
Subject: Re: [rt.cpan.org #92402] Inline asks interactive question -- but doesn't have keyboard
Date: Thu, 23 Jan 2014 21:29:07 +0800
To: bug-Inline [...] rt.cpan.org
From: Xiao Yafeng <xyf.xiao [...] gmail.com>
I've tried reinstall Inline via cpan and seems work fine: xyf@AndyHome:~$ cpan -f -i Inline CPAN: Storable loaded ok (v2.34) Reading '/home/xyf/.cpan/Metadata' Database was generated on Thu, 23 Jan 2014 10:17:02 GMT CPAN: Module::CoreList loaded ok (v2.76) Running install for module 'Inline' Running make for S/SI/SISYPHUS/Inline-0.53.tar.gz CPAN: LWP::UserAgent loaded ok (v6.05) CPAN: Time::HiRes loaded ok (v1.9725) Fetching with LWP: http://mirrors.btte.net/CPAN/authors/id/S/SI/SISYPHUS/Inline-0.53.tar.gz CPAN: YAML loaded ok (v0.88) CPAN: Digest::SHA loaded ok (v5.71) Fetching with LWP: http://mirrors.btte.net/CPAN/authors/id/S/SI/SISYPHUS/CHECKSUMS CPAN: Compress::Zlib loaded ok (v2.048) Checksum for /home/xyf/.cpan/sources/authors/id/S/SI/SISYPHUS/Inline-0.53.tar.gz ok CPAN: File::Temp loaded ok (v0.22) CPAN: CPAN::Meta loaded ok (v2.130880) CPAN.pm: Building S/SI/SISYPHUS/Inline-0.53.tar.gz Checking if your kit is complete... Looks good Inline::C is packaged with Inline.pm because it is the most commonly used Inline Language Support Module (ILSM). See also: Inline::ASM, ::Awk, ::BC, ::Basic, ::Befunge, ::CPP (C++), ::CPR, ::Foo, ::Guile, ::Java, ::Octave, ::PERL, ::Python, ::Ruby, ::TT, ::Tcl and ::WebChat. Config.pm indicates that your version of Perl was built with this C compiler: cc I have located this compiler on your system. Do you want to install Inline::C? [y] y Writing Makefile for Inline::C Writing MYMETA.yml and MYMETA.json Writing Makefile for Inline Writing MYMETA.yml and MYMETA.json cp Inline.pod blib/lib/Inline.pod cp lib/Inline/MakeMaker/Changes blib/lib/Inline/MakeMaker/Changes cp lib/Inline/denter.pm blib/lib/Inline/denter.pm .... .... SISYPHUS/Inline-0.53.tar.gz /usr/bin/make install -- OK uname -a Linux AndyHome 3.2.0-4-686-pae #1 SMP Debian 3.2.51-1 i686 GNU/Linux On Thu, Jan 23, 2014 at 3:00 PM, sisyphus1@optusnet.com.au via RT <bug-Inline@rt.cpan.org> wrote: Show quoted text
> Thu Jan 23 02:00:31 2014: Request 92402 was acted upon. > Transaction: Correspondence added by sisyphus1@optusnet.com.au > Queue: Inline > Subject: Re: [rt.cpan.org #92402] Inline asks interactive question -- but doesn't have keyboard > Broken in: (no value) > Severity: Important > Owner: Nobody > Requestors: pause@tlinx.org > Status: open > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=92402 > > > > > > -----Original Message----- > From: Linda A Walsh via RT >
>> Do you want to install Inline::C? [y] y >> (/home/perl/perl-5.16.3/bin/perl Makefile.PL exited with 9)
>
>> Very frustrating -- I tried to type 'y', bt it was ignored, as STDIN seems >> to be taken over by CPAN.
> > Yes, I would find that very annoying. > I don't use any of the CPAN family of modules very much - I avoid them > unless there's a very long dependency chain. > Consequently, I don't know much about the options they provide, or about the > details of the way in which they're supposed to work. > > Did David's reply help ? > > The only thing I can think of adding to what David provided is that, if > you're happy to accept the default, then setting the PERL_MM_USE_DEFAULT > environment variable to 1 should enable that. (The default will be 'y' if a > compiler is found, and 'n' if a compiler is not found.) > > Cheers, > Rob > >
On Thu Jan 23 01:25:12 2014, DAVIDO wrote: Show quoted text
>
> > Do you want to install Inline::C? [y] y
> > At this point you're experiencing the Makefile.PL for Inline::C, as > the CPAN installer runs all Makefile.PL's within the distribution > recursively. The prompting is handled by ExtUtils::MakeMaker's > prompt() function. And as you see within the "[y]" square brackets, > prompt() is being directed to supply a default.
---- Right -- but then it **waits*** for input. The input never comes, because my input is being redirected "elsewhere" (dunno). Show quoted text
> ExtUtils::MakeMaker. If you don't like how > ExtUtils::MakeMaker::prompt works, and for the most part, prompt() > works flawlessly across a broad range of systems and configurations; > it has to, being part of EU::MM.
---- It's not a matter of "like" -- it's a matter of it stopping at any interactive prompt (most have some default), and waiting for input. Then it "pseudo-dies"-- due to hitting the timeout value in my CPAN config file. (usually set to 15 seconds). Show quoted text
> > The next issue to consider is how the cpan installer works. The basic > 'cpan' installer (provided by App::cpan) doesn't (to my knowledge) > provide an option for interactive installations.
---- The rest of this seems not relevant, as I don't want interactive, but during non-interactive build, 1) CPAN pauses at any such point to wait for input (even w/a default) until it hits the 'inactivity timeout value. 2) Then the exit via signal is detected by CPAN as an error and no default is taken. Show quoted text
> > (/home/perl/perl-5.16.3/bin/perl Makefile.PL exited with 9) > > ---------------------
> > This problem, I haven't seen before. But it's not related to > prompting.
---- It is only Makefile.PL's that prompt that have this problem. To say that it isn't related to prompting isn't supported by the evidence. I don't know if it would help, but maybe the makefile.pl needs to check to see if /dev/stdin is a character device. If it is a pipe (which I'm guessing is the case here, as /dev/stdin isn't being read from the /dev/tty input), then just do the default -- don't prompt. The fact that you're able to achieve a successful install Show quoted text
> manually (make, make test, make install) indicates that your setup is > capable of installing Inline and Inline::C. And as indicated earlier, > the prompting is working as intended.
---- Only when it receives input -- which it does in manual mode. But when run automatically, the prompting waits instead of immediately taking the default, and eventually times out returning an error in the Makefile.PL run to CPAN.
On Thu Jan 23 16:06:00 2014, LAWALSH wrote: Show quoted text
> On Thu Jan 23 01:25:12 2014, DAVIDO wrote:
> >
> > > Do you want to install Inline::C? [y] y
> > > > At this point you're experiencing the Makefile.PL for Inline::C, as > > the CPAN installer runs all Makefile.PL's within the distribution > > recursively. The prompting is handled by ExtUtils::MakeMaker's > > prompt() function. And as you see within the "[y]" square brackets, > > prompt() is being directed to supply a default.
> ---- > Right -- but then it **waits*** for input. > > The input never comes, because my input is being redirected > "elsewhere" (dunno).
I myself have taken a pretty close look at how prompt() works, because I've stolen much of its guts into IO::Prompt::Hooked (one of my modules on CPAN). If you are getting blocking behavior, that's a problem, but not an Inline problem. From the prompt() documentation in EU::MM: "If prompt() detects that it is not running interactively and there is nothing on STDIN or if the PERL_MM_USE_DEFAULT environment variable is set to true, the $default will be used without prompting. This prevents automated processes from blocking on user input." So the question comes down to why is *your* automated process allowing *prompt()* to block for user input? This line from EU::MM::prompt's source makes me wonder.... if ($ENV{PERL_MM_USE_DEFAULT} || (!$isa_tty && eof STDIN)) { Is it possible that you've got something waiting on STDIN, so the "eof STDIN" test fails? Or is there a problem a few lines earlier when prompt() attempts to detect if it's got a tty or not? One way to test this theory would be to set the environment variable PERL_MM_USE_DEFAULT and see if you still get the blocking behavior. Setting it to a true value will short-circuit the test of STDIN being at an eof condition, and I suspect you will no longer block. Either way, this seems to me to be an interaction between your configuration and EU::MM::prompt. I don't see how it could be something relating to Inline::C's Makefile.PL. If you know otherwise, please do point to the code in Inline::C's Makefile.PL that is blocking... but we already know from the dump of your run that prompt() is blocking.... so the finger points back at prompt(), and how it's interacting with your system. Inline::C's makefile doesn't have control over this, unless we decide that there's some more reliable version of prompt that we could be using, which, given EU::MM's ubiquity, is unlikely. Show quoted text
> It's not a matter of "like" -- it's a matter of it stopping at any > interactive prompt (most have some default), and waiting for input. > Then it "pseudo-dies"-- due to hitting the timeout value in my CPAN > config file. (usually set to 15 seconds).
Yes, "like" was the wrong word. It's blocking for you, and that's irritating at best, and definitely not what we have in mind. ...but the question is "why?" And as you dive into the layers of code involved, everything I'm seeing points to how ExtUtils::MakeMaker prompt interacts with your environment. I haven't even looked at the EU::MM bug queue lately to see if others are mentioning such issues... but if they are, that's where I'd expect to see them mentioned. Show quoted text
> > The next issue to consider is how the cpan installer works. The > > basic > > 'cpan' installer (provided by App::cpan) doesn't (to my knowledge) > > provide an option for interactive installations.
> ---- > The rest of this seems not relevant, as I don't want interactive, but > during non-interactive build, > 1) CPAN pauses at any such point to wait for input (even w/a default) > until it hits the 'inactivity timeout value. > 2) Then the exit via signal is detected by CPAN as an error and no > default is taken.
Yes, I agree. If you want non-interactive to progress without blocking, setting cpanminus to interactive mode isnt what you need. When I first read your post you mentioned hitting "y" and not getting response from the keyboard, which is where I derived the relevancy of the --interactive mode in cpanminus. But you just want it to stop blocking. I would too. There are a limited number of places to look for that problem; Makefile.PL, which uses prompt, which comes from EU::MM.
Subject: Re: [rt.cpan.org #92402] Inline asks interactive question -- but doesn't have keyboard
Date: Thu, 23 Jan 2014 20:40:13 -0800
To: bug-Inline [...] rt.cpan.org
From: "L. A. Walsh" <pause [...] tlinx.org>
David J. Oswald via RT wrote: Show quoted text
> if ($ENV{PERL_MM_USE_DEFAULT} || (!$isa_tty && eof STDIN)) {
---- Why is it testing eof on STDIN? That seems wrong. my setup is in regenerating modules that need to be reinstalled/upgraded or whatever... usually something like: cat /tmp/outdatedmodules|(either a while look if I want to do them 1 at a time, or .. lately been trying xargs -- the blockages happen either way). in xarg case: cat /tmp/mods|xargs -n1 -P8 cpan -i would be a sample line... I'm not sure what xargs does...but a similar cat /tmp/mods|while read mod;do cpan -i "$mod" done will create the same type of error (Inline hasn't been the only mod I've seen this on -- wasn't until I looked into it to try to see why. I don't see a CPAN option to "take the default" in the config or in cpan's o config options. Is it documented somewhere? Show quoted text
> Is it possible that you've got something waiting on STDIN, so the "eof STDIN" test fails?
--- Given there is stdin supplying the list of mods to be built, it is not impossible -- but I wouldn't think stdin from the input file would be passed unaltered directly into cpan... Show quoted text
>
FWIW -- I tested this with all 'site' libs removed (trying to only use core mods) and got the same result (I thought it might be due to some module I installed. Also, no vendor files are installed -- (though this same problem happens on the vendor version as well).
Try removing timeout in CPAN config - I had a similar problem with CPAN::Reporter https://rt.cpan.org/Ticket/Display.html?id=62310 -- Alexandr Ciornii, http://chorny.net
On Wed Mar 19 03:22:27 2014, CHORNY wrote: Show quoted text
> Try removing timeout in CPAN config - I had a similar problem with > CPAN::Reporter https://rt.cpan.org/Ticket/Display.html?id=62310
--------------------- Hah. was just going to cross reference that. Problem with that is that some tests DO hang... The timeout is needed -- so that's not a solution -- I've tried it with the default of of 300s having it wait and it still doesn't work. With no timeout, some things would hang 'forever'... That's defeats the purpose of having the timeout feature in the first place. Which would be a better solution -- removing the timeout feature from all build/testings or fixing the few cases that don't work correctly w/a timeout?