A pleasant surprise in CPAN.pm

bart on 2006-12-05T22:09:17

Yesterday, I was trying out a perl of shady origin on my work PC, and while I was dabbling in the CPAN shell, suddenly, to my suprise, when I tried installing a module, it me showed the following message:

The required 'nmake' executable not found, fetching it...
Fetching 'Nmake15.exe' from download.microsoft.com... done!

I was baffled. I never had expected that. This is so cool!

It made me start dreaming again of a completely autonomously selfconfiguring installation system. Searching for a proper list of CPAN mirrors, without any help from the user, for example.

I know there have been a few attempts on creating an automated tool, but I don't think any ever came out of the beta stage.

There are basically two ways to achieve this goal:

  1. Figuring out where in the world you are. But that requires either use of a not-really-free database, like the one from Geo::IP, or the cooperation of a website that can tell your system where you are. I thought perl.com used to do this a long time ago, on the URL , which still does something, though I have no idea what. It'd be nice if perl.org or cpan.org would do that.
  2. Alternatively, try using ping, tracert/traceroute and related tools, to find a few nearby and responsive CPAN mirrors.
Neither of these look like the complete solution to me.

I do think that it would be helpful if the list of mirrors that CPAN.pm retrieves from CPAN, was to contain a rating for the mirrors, based on responsiveness, speed, available bandwidth, and last but not least: up-to-date-ness.

Update: Half of my time on CPAN, I'm on search.cpan.org. That always made me wonder: does search.cpan.org make use worldwide mirroring, too?


You use a different search.cpan.org....

speters on 2006-12-06T01:52:21

..than I do in the U.S. There are multiple search.cpan.org sites, and the one you use depends on the the country that your IP address suggests you are in.

Glad you like it. :-)

audreyt on 2006-12-06T04:41:35

I'm happy that you like my little nmake-fetching trick -- the magic is in Module::Install, not in CPAN.pm. :-)

Re:Glad you like it. :-)

bart on 2006-12-06T21:35:31

Yes do I like it... I love it.

But, Module::Install? Wasn't that module supposed to bypass the need for make?

Re:Glad you like it. :-)

audreyt on 2006-12-06T23:14:04

No, that was Module::Build. :-)

There are two search sites

essuu on 2006-12-06T10:00:47

Half of my time on CPAN, I'm on search.cpan.org. That always made me wonder: does search.cpan.org make use worldwide mirroring, too?

search.cpan uses Ask's geoDNS to route traffic to one of two sites, the main perl.org racks in the US or to our mirror in London. It would work with more if anyone wanted to host one in, say, Asia or Australia.

Re:There are two search sites

bart on 2006-12-06T21:38:55

So there are two search.cpan.org sites. Urm... for half of everything everybody does in CPAN in the world? While there are 280 CPAN mirrors?

Something looks to be very much out of proportion.

Re:There are two search sites

essuu on 2006-12-07T09:47:59

Yep, there are probably far more CPAN mirrors than are actually required !

Seriously, search.cpan.org is well down our list of busy sites so it doesn't really need many more mirrors. I understand an Asian/Pacific mirror would be welcomed but the existing servers seem to be coping just fine with the load.

S.

Meh

djberg96 on 2006-12-06T15:19:27

Of course, one can only wonder why Perl has insisted on an external make program for pure Perl modules for the last 15 years, but nevermind that.

Where's pmake?!

Make Meh

DAxelrod on 2006-12-06T17:08:52

Of course, one can only wonder why Perl has insisted on an external make program for pure Perl modules for the last 15 years

Bad interface design. Seriously.

The canonical way to install a CPAN module is
perl Makefile.pl
make
make test
make install
and the problem is all those invocations of make.

In most cases, those make targets end up running perl one-liners anyway; there's been a lot of heroic effort to take out dependencies on other programs and design other build systems.

(I'm not saying the bad interface design is anybody's fault. Lots of things sort of happen by convention and aren't really designed, or at least are designed with certain assumptions that turn out to not hold true.)