Bug 5882 - build-perl-modules.pl can't build Encode-Detect on new linux install
: build-perl-modules.pl can't build Encode-Detect on new linux install
Status: REOPENED
Product: Logitech Media Server
Classification: Unclassified
Component: Platform Support
: 7.0
: PC Linux (other)
: P2 normal (vote)
: Future
Assigned To: Andy Grundman
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2007-10-22 03:06 UTC by Mark Miksis
Modified: 2008-06-04 10:25 UTC (History)
2 users (show)

See Also:
Category: ---


Attachments
Log of the failure (2.84 KB, text/plain)
2007-10-23 11:17 UTC, Mark Miksis
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Miksis 2007-10-22 03:06:20 UTC
On a fresh CentOS 5 install, "build-perl-modules.pl Encode-Detect" gets stuck in an endless loop of "Sorry! since you don't have any existing picks, you must make a geographic selection."  I haven't really investigated this but I assume the problem is this:  The Encode-Detect Makefile uses CPAN to download something.  If CPAN has never been used on the system, it tries to go through it's normal first time setup.  Simply accepting the defaults won't allow it to proceed.

If my assumption is correct, the workaround is to set up CPAN before running build-perl-modules.pl.  I'm not sure what a good long term fix is...
Comment 1 KDF 2007-10-22 14:42:45 UTC
not quite sure how this is major.  
Workaround is to set up CPAN -  (perl -MCPAN -e "install ...")

It has also long been assumed that Linux users should be prepared and capable of dealing with setup issues like this.  build-perl-modules.pl is intended as a helper, not a blind automated solution.
Comment 2 Mark Miksis 2007-10-22 14:49:27 UTC
I agree.  Chris set it to major, not me.  However, I suspect that someone who has never used CPAN will have no clue what the error message means and how to fix it.

FWIW, the reason I found this is because I was toying with the idea of running build-perl-modules.pl unattended as part of the %post scriptlet in the RPM.  But, that's a different topic and I'm still not sure it's a good idea...
Comment 3 Chris Owens 2007-10-23 09:13:42 UTC
Andy to comment.
Comment 4 Erland Isaksson 2007-10-23 09:29:15 UTC
This also happens on a fresh Ubuntu Gutsy 7.10 installation. 
I solved it by installing the libmodule-build-perl package.
Comment 5 Andy Grundman 2007-10-23 10:31:31 UTC
I haven't tried the new Ubuntu yet but it should work OOTB with our included binary modules.  If you run SC on some system that can't run our modules, you'll need to install Encode::Detect as it is now required.

I would not recommend auto-running build-perl-modules for the RPM.  The vast majoriy of systems can use our included modules unless people have built their own Perl that doesn't support threading for example.
Comment 6 Mark Miksis 2007-10-23 10:39:53 UTC
Andy, I agree with your comments but I still think this is a bug.  Specifically, if you run build-perl-modules.pl on a system that has never run CPAN, you will get stuck in an endless loop with an error message that will make no sense to someone unfamiliar with CPAN.  (Actually, I'm not sure why installing libmodule-build-perl package on Ubuntu fixes anything.)  At the very least, I'd suggest either:

- Add a message at the top explaining to the user that if you see this error you need to quit and initialize CPAN
- Disable "$ENV{'PERL_MM_USE_DEFAULT'} = 1;" just for the Encode-Detect build
Comment 7 Andy Grundman 2007-10-23 10:58:47 UTC
Can you post the output of what happens?
Comment 8 Mark Miksis 2007-10-23 11:17:04 UTC
Created attachment 2307 [details]
Log of the failure
Comment 9 Mark Miksis 2007-10-23 11:17:51 UTC
See attachment.  The last message repeats until interrupted with ctrl-C.
Comment 10 Andy Grundman 2007-10-23 11:28:03 UTC
OK yeah that's bad.  What happens if you disable $ENV{'PERL_MM_USE_DEFAULT'}?  I assume you'll get the 'Install Module::Build now from CPAN?' prompt, but then what happens?
Comment 11 Mark Miksis 2007-10-23 11:38:26 UTC
It hangs at:

Downloading Encode-Detect-1.00.tar.gz to: /var/cache/squeezecenter
Can't locate auto/Compress/Zlib/autosplit.ix in @INC (@INC contains: /usr/local/slimserver/CPAN /usr/share/squeezecenter/CPAN CPAN /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.7/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.6/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl/5.8.7 /usr/lib/perl5/site_perl/5.8.6 /usr/lib/perl5/site_perl/5.8.5 /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.7/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.6/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.5/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl/5.8.7 /usr/lib/perl5/vendor_perl/5.8.6 /usr/lib/perl5/vendor_perl/5.8.5 /usr/lib/perl5/vendor_perl /usr/lib/perl5/5.8.8/i386-linux-thread-multi /usr/lib/perl5/5.8.8 .) at /usr/lib/perl5/5.8.8/AutoLoader.pm line 160, <STDIN> line 3.
 at /usr/share/squeezecenter/CPAN/Compress/Zlib.pm line 15
Uncompressing..
Configuring..
 /usr/bin/perl Makefile.PL 

Weird.  Not what I expected...
Comment 12 Paul 2007-12-14 09:11:08 UTC
I've installed the CPAN modules by hand.  However, the build-perl-modules.pl file grabs the modules from the slimdevices trunk line.  This appears to be where the problem is.  The Encode-Detect module can be compiled manually through CPAN.
Comment 13 Paul 2007-12-14 11:36:21 UTC
(In reply to comment #12)
> I've installed the CPAN modules by hand.  However, the build-perl-modules.pl
> file grabs the modules from the slimdevices trunk line.  This appears to be
> where the problem is.  The Encode-Detect module can be compiled manually
> through CPAN.
> 

Forgot to mention I'm using Freelink on a Linkstation, PPC processor.
Comment 14 Stuart Hickinbottom 2007-12-18 14:55:50 UTC
This is also happening on Gentoo (I'm currently trying to create a Portage ebuild (aka package) for SqueezeCenter 7). I've raised this in bug 6389 but have been pointed to this as a duplicate.

The problem was the same for me - those messages repeating in a loop because CPAN was not set up. In a Gentoo ebuild (which effectively compiles the package from source) CPAN can't be relied upon to be set up for the user and there is no specific arch tarball available because the same ebuild has to run on a number of architectures (x86/arm/mips etc etc).

I think it's quite reasonable to be able to use build-perl-modules within the package build in a case like this - indeed, I have it working with some small modifications.

I think the problem comes because Encode::Detect wants Module::Build as a dependency, but can't pull it in. The solution is to simply install Module::Build before installing Encode::Detect and it will no longer need to try to use CPAN.

Even if the CPAN dependency worked I think it might be better to pull in a specific version in build-perl-modules anyway - that way it will at least be the same combination of module versions that everyone else is using, perhaps lessoning the support burden if ever a problem was encountered with a specific Encode::Detect/Module::Build combo.

Note that bug 6143 is also somewhat related in that it covers another missing required dependency for SC7 (GD).
Comment 15 Chris Owens 2008-06-04 10:25:40 UTC
So the theory is, if you're installing on a distro that we don't natively support, that you can install perl modules.

Advice from the linux brains in the community about how to 'fix' this bug is always welcome, but we're just not going to sweat this at the moment.