Skip Menu |
 

This queue is for tickets about the Module-Build CPAN distribution.

Report information
The Basics
Id: 18162
Status: open
Priority: 0/
Queue: Module-Build

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

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



Subject: .packlist written to the wrong location
Download (untitled) / with headers
text/plain 1.4k
Greetings, I've found, that when using Module::Build to install certain packages, the .packlist file is written to a top level directory, and not to the proper subdir. For example: [kane@codebase2 /tmp/Feed-Find-0.06]$ perl Build.PL *** ExtUtils::AutoInstall version 0.56 *** Checking for dependencies... [Core Features] - Class::ErrorHandler ...missing. - LWP ...loaded. (5.803) - HTML::Parser ...loaded. (3.48) - URI ...loaded. (1.35) ==> Auto-install the 1 mandatory module(s) from CPAN? [y] n ==> The module(s) are mandatory! Really skip? [n] y *** ExtUtils::AutoInstall configuration finished. Checking whether your kit is complete... Looks good * ERROR: Prerequisite Class::ErrorHandler isn't installed ERRORS/WARNINGS FOUND IN PREREQUISITES. You may wish to install the versions of the modules indicated above before proceeding with this installation. Deleting Build Removed previous script 'Build' Creating new 'Build' script for 'Feed-Find' version '0.06' [kane@codebase2 /tmp/Feed-Find-0.06]$ ./Build fakeinstall Installing /usr/local/share/perl/5.8.7/Feed/Find.pm Installing /usr/local/man/man3/Feed::Find.3pm Writing /usr/local/lib/perl/5.8.7/auto/.packlist [kane@codebase2 /tmp/Feed-Find-0.06]$ Note how it is written to: Writing /usr/local/lib/perl/5.8.7/auto/.packlist According to the changes file, this has not been addressed in any of the development releases either.
Download (untitled) / with headers
text/plain 416b
Hi Kane, Coincidentally (I think) this was just fixed a few days ago on the 9th. The problem in this case is that no 'module_name' parameter was supplied (just 'name' and 'version_from'), so we don't know what directory to install the packlist to. The fix checked in by Randy was to simply not create the packlist in this case. Perhaps it's possible to guess the proper location somehow, I'm not sure. -Ken
Download (untitled) / with headers
text/plain 668b
I did a little checking with the perl debugger here. It looks like Module::Install is figuring out 'NAME' so it can pass it to EU::MakeMaker: ExtUtils::MakeMaker::WriteMakefile('test', ref(HASH), 'NAME', 'Feed::Find', 'DISTNAME', 'Feed- Find', 'AUTHOR', 'Benjamin Trott <ben+cpan@stupidfool.org>', 'DIR', ref(ARRAY), 'NO_META', 1, 'ABSTRACT', 'Syndication Feed Discovery', 'PL_FILES', ref(HASH), 'VERSION', 0.06, 'PREREQ_PM', ref(HASH)) called from file `inc/Module/Install/Makefile.pm - /Library/Perl/5.8.1/Module/ Install/Makefile.pm' line 92 It would solve the issue if it could extend the same courtesy to M::B and pass it a "module_name" parameter. -Ken
CC: KANE [...] cpan.org
Subject: Re: [rt.cpan.org #18162] .packlist written to the wrong location
Date: Wed, 15 Mar 2006 09:45:38 +0100
To: bug-Module-Build [...] rt.cpan.org
From: "Jos I. Boumans" <kane [...] xs4all.net>
Download (untitled) / with headers
text/plain 1.8k
On Mar 14, 2006, at 11:32 PM, Ken_Williams via RT wrote: Show quoted text
Show quoted text
> Hi Kane, > > Coincidentally (I think) this was just fixed a few days ago on the > 9th. The problem in this case > is that no 'module_name' parameter was supplied (just 'name' and > 'version_from'), so we don't > know what directory to install the packlist to.
If i read the M::B documentation correctly, there is no support for a 'name' parameter, just 'module_name' and 'dist_name', correct? Show quoted text
> The fix checked in by Randy was to simply not create the packlist > in this case. Perhaps it's > possible to guess the proper location somehow, I'm not sure.
You could accept 'name' to be shorthand for 'module_name' i suppose, or use the logic that 'Build dist' would use to make the Feed-Find.VERSION.tgz.. but of course, that's heuristics. Show quoted text
> I did a little checking with the perl debugger here. It looks like > Module::Install is figuring out > 'NAME' so it can pass it to EU::MakeMaker: > > ExtUtils::MakeMaker::WriteMakefile('test', ref(HASH), 'NAME', > 'Feed::Find', 'DISTNAME', 'Feed- > Find', 'AUTHOR', 'Benjamin Trott <ben+cpan@stupidfool.org>', 'DIR', > ref(ARRAY), 'NO_META', 1, > 'ABSTRACT', 'Syndication Feed Discovery', 'PL_FILES', ref(HASH), > 'VERSION', 0.06, 'PREREQ_PM', > ref(HASH)) called from file `inc/Module/Install/Makefile.pm - / > Library/Perl/5.8.1/Module/ > Install/Makefile.pm' line 92 > > It would solve the issue if it could extend the same courtesy to > M::B and pass it a > "module_name" parameter.
That sounds quite acceptable -- i've coded a workaround in cpanplus for now at least. Perhaps you can move this bug to the M::I queue and hopefully they can pick up on it. Thanks for the prompt reply, -- Jos Boumans "Whenever you find you are on the side of the majority, it is time to pause and reflect." - Mark Twain CPANPLUS http://cpanplus.sf.net
From: ADAMK [...] cpan.org
Download (untitled) / with headers
text/plain 1.1k
On Tue Mar 14 17:32:48 2006, KWILLIAMS wrote: Show quoted text
> I did a little checking with the perl debugger here. It looks like > Module::Install is figuring out > 'NAME' so it can pass it to EU::MakeMaker: > > ExtUtils::MakeMaker::WriteMakefile('test', ref(HASH), 'NAME', > 'Feed::Find', 'DISTNAME', 'Feed- > Find', 'AUTHOR', 'Benjamin Trott <ben+cpan@stupidfool.org>', 'DIR', > ref(ARRAY), 'NO_META', 1, > 'ABSTRACT', 'Syndication Feed Discovery', 'PL_FILES', ref(HASH), > 'VERSION', 0.06, 'PREREQ_PM', > ref(HASH)) called from file `inc/Module/Install/Makefile.pm - > /Library/Perl/5.8.1/Module/ > Install/Makefile.pm' line 92 > > It would solve the issue if it could extend the same courtesy to M::B > and pass it a > "module_name" parameter. > > -Ken
Indeed. The larger problem is that MB support in MI just plain sucks ass. Specifically, MI doesn't really understand whether or not it's building things for EUMM or MB. While I'm going to start dealing with that larger problem shortly, Ken you might want to consider getting a commit bit for the MI repository so you can deal with these little bits and pieces yourself. Interested? If so ping my in IRC and I'll set it up for you.
RT-Send-CC: module-build [...] perl.org, adamk [...] cpan.org, makemaker [...] perl.org
Download (untitled) / with headers
text/plain 3.7k
On Tue Mar 14 17:22:36 2006, KWILLIAMS wrote: Show quoted text
> The fix checked in by Randy was to simply not create the packlist in > this case. Perhaps it's > possible to guess the proper location somehow, I'm not sure.
Adam and I reviewed this issue today and determined: #1 Module::Install does have this bug wrt using Module::Build #2 ExtUtils::MakeMaker has a bug wrt a missing "NAME" #3 Module::Build should create a .packlist (which means #1 would be moot) Overview: ------------------------ We're using ExtUtils::Installed as the definitive reference here. Unfortunately, ExtUtils::Install::install() does not define a canonical .packlist location (it expects the caller to pass it an explicit filename.) But, given that the modules() method is not named "distros", we have decided that ExtUtils::Installed is expecting to find .packlist files under a directory such as the following (in actuality, it does File::Find on all of @INC -- but it assigns what it finds to module names *as if* it had used this random-access scheme.) ($module_path = $module_name) =~ s#::#/#g; That is, a user expects to get an answer with "my $packlist = $inst->packlist('Foo::Bar')", not 'Foo-Bar'. Essentially, we determined that the following should never yield output: perl -e 'use ExtUtils::Installed; my $i = ExtUtils::Installed->new; print join("\n", $i->modules, ""); ' | grep \- (XML-DOM, Pod-Tests, rpm-build-perl, libintl-perl, libxml-perl, ...) While the foo-perl dists are a bit of a sticking point, the majority of distros stick to the convention of '($dist = $module) =~ s/::/-/g'. The cases where ExtUtils::Installed won't work appear to be those where the author has incorrectly set the name parameter to "Foo-Bar" instead of "Foo::Bar". Aside: While this might best be solved with wrist-slapping, I think we need to normalize the 'NAME' parameter to have no '-' characters. Note that Module::Build will complain "Can't find file lib/Foo-Bar.pm to determine version", which sort-of covers the common "oops" case. Definitions: ------------------------ I'll use the M::B parameter names in the rest of this description. $module_name := Foo::Bar (NAME parameter in EU::MM) $dist_name := Foo-Bar (DISTNAME in EU::MM) Desired Behavior: ------------------------ 1. Given a $module_name, .packlist goes at ($path = $module_name) =~ s#::#/#g; 2. Given only $dist_name, pretend ($module_name = $dist_name) =~ s/-/::/g; goto(1) Current situation: ------------------------ Module::Build currently does nothing in case (2). ExtUtils::MakeMaker currently uses the directory name in absence of $module_name ('NAME'), the directory name ends up being $dist_name in most cases, but it should try $dist_name first (if that value is defined) because of things like: on win32 saying "Warning: Guessing NAME [AUTHEN~1] from current directory name." Module::Install implements the desired behavior when running from Makefile.PL because it passes EU::MM NAME => $module_name (where it determined $module_name from $dist_name as above.) When running from Build.PL, it does *not* pass this M::B this same information -- module_name => $module_name. See Ken's comment about "extend the same courtesy". However, see below. Suggested Implementation: ------------------------ Toolkits are strongly encouraged to prefer case (1) and warn/slap the author accordingly at `build|make dist` time if module_name is improperly formatted or missing. Module::Build should die() at `build dist` time if $module_name =~ m/-/, but at install time should $module_name =~ s/-/::/g for purposes of installing a .packlist. EU::MM should probably do something similar. Module::Install doesn't need to do anything if Module::Build implements the above behavior.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.