On Thursday, October 17, 2002, at 09:11 AM, Puneet Kishor wrote:

 Anyway, I also found the following right at the top of the Makefile

	warn "NOTICE: This module requires libgd 2.0.1 or higher.\n";
	warn "        For earlier versions of libgd, use GD version 1.43.\n";

huh! so, cpan is not that idiot-proof.
Nor is it a mind reader. CPAN simply acts on dependencies that have been listed by module authors, no more, no less.

 Would have been nice if it had figured out that I had libgd 1.8.4
Yeah, that would be nice. But, that's not how CPAN works. It doesn't deduce or "figure out" anything at all - it reads the list of dependencies provided by the module author, and acts upon them. That works pretty well, when only Perl modules are involved - but it breaks down when external libraries are involved.

A major problem with external library dependencies is that each library has its own way of reporting its version. Some, such as libgnome, provide a config script - "gnome-config --version". Others, such as libxml, use different names to distinguish incompatible libraries - libxml vs. libxml2. Others provide a function in the library itself, that reports the version. Because the methods used to detect library versions aren't consistent, it cannot be done by the CPAN module - it has to be managed by individual module authors and built into module Makefiles.

(the latest stable version) and gotten the appropriate GD for me. Interestingly, libgd 2.0.1 is still beta, and yet, cpan insists on installing a beta-dependent software.
CPAN didn't "insist" on anything. It did exactly what you asked it to do - it attempted to install the latest version. Had you read the readme - something that CPAN makes very easy, by the way, all you need to do is enter "readme ModuleName" - you could have seen that the latest version is not what you wanted, without even having to download the full package.

With all due respect, I feel that your rant about CPAN is misguided. You seem to have a rather unrealistic idea of what CPAN does and how it does it. It's not a comprehensive package manager like Fink or BSD's Ports. It's simply a tool that makes installing most modules more convenient.

On the other hand, even though you've chosen the wrong target for venting your frustration, you do have a legitimate cause for complaint. The question is, why didn't the Makefile for GD.pm look for the version of libgd that it needed, and complain when it failed to detect it? The CPAN module cannot be realistically expected to figure out library dependencies, but it's not unreasonable to expect such a sanity check in the GD.pm Makefile.

Btw, am I the only one who finds the error messages streaming off my terminal at 300 mph while doing the make, build dance useless?
I find it easier to do the build, test, and install steps separately. To do that in the CPAN shell, just use the "build Module", "test Module" commands before issuing the "install Module" command.

sherm--

Reply via email to