Skip Menu |

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

Report information
The Basics
Id: 25578
Status: resolved
Priority: 0/
Queue: Module-Build

People
Owner: Nobody in particular
Requestors: sam [...] mitre.org
Cc:
AdminCc:

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



Subject: Can't build Module::Build from a separate uninstalled Perl tree
Date: Tue, 20 Mar 2007 17:25:03 -0400
To: bug-Module-Build [...] rt.cpan.org
From: "Samuel L. Bayer" <sam [...] mitre.org>
I'm trying to build a Perl distribution somewhere other than where it's going to be deployed, and populate it with modules BEFORE I deploy it. In this configuration, it appears to be impossible to build Module::Build, because the _perl_is_same function in Base.pm does not add a local library path to the config check unless PERL_CORE is set, and in this case, as far as I can tell, if I set it, the build barfs with this error PERL_CORE is set but I can't find your perl source! which leads me to believe that PERL_CORE is supposed to be set only if you're actually building the Perl source tree, which I'm not. So I'm kind of hosed. Running version 2806, Solaris 10, Perl 5.8.7. Cheers, Sam Bayer sam@mitre.org
That's correct, PERL_CORE is only for when M::B is being built as part of building perl itself. I'm not quite clear on exactly what you're trying to do, though - could you provide a little more detail? Maybe some judicious use of the PERL5LIB environment variable would help? -Ken
Subject: Re: [rt.cpan.org #25578] Can't build Module::Build from a separate uninstalled Perl tree
Date: Tue, 27 Mar 2007 10:06:52 -0400
To: bug-Module-Build [...] rt.cpan.org
From: "Samuel L. Bayer" <sam [...] mitre.org>
Ken_Williams via RT wrote: Show quoted text
> I'm not quite clear on exactly what you're trying to do, though - could you provide a little more > detail? Maybe some judicious use of the PERL5LIB environment variable would help?
Oh, dear. I hope I can explain this clearly. I'm building a Perl tree for distribution to another site. I don't want to build it on-site; I want to deploy it with all the appropriate modules already installed. But I also can't build it in the location that it's going to be deployed; e.g., I'm deploying it as /app/bin/perl (well, /app/packages/perl-5.8.7/bin/perl, plus stow for linking), but I can't build it in /app, because I'm building it on a machine which already has a test installation of the remote site's code. So it gets built in /project/staging/app/etc. The problem arises when Module::Build tries to find the Perl executable that's currently being used. find_perl_interpreter in Base.pm collects the executable path correctly, but this executable requires a bunch of -I directives in order to work (because it's being built in a location other than the one where it'll be deployed). When we get down to _perl_is_same, the config check fails to pass along the -I directives, and so I get the config for the INSTALLED /app/bin/perl, rather than the one I'm building. Here's the torture I inflicted on _perl_is_same to get it to work: sub _perl_is_same { my ($self, $perl) = @_; my @cmd = ($perl); # When run from the perl core, @INC will include the directories # where perl is yet to be installed. We need to reference the # absolute path within the source distribution where it can find # it's Config.pm This also prevents us from picking up a Config.pm # from a different configuration that happens to be already # installed in @INC. # SAM 3/20/07: Not good enough. I need all the -I from the command line. # Can't use $self->_added_to_inc, because that pretty much # gives you infinite recursion. if ($ENV{PERL_CORE}) { push @cmd, '-I' . File::Spec->catdir(File::Basename::dirname($perl), 'lib'); } if ($ENV{PERL_MB_CONFIG_LIB}) { # This is really gross. But we can't use _added_to_inc. my $sep = $self->config('path_sep'); my @incs = split(/$sep/, $ENV{PERL_MB_CONFIG_LIB}); for my $inc ( @incs ) { push @cmd, '-I' . $inc; } } push @cmd, qw(-MConfig=myconfig -e print -e myconfig); return $self->_backticks(@cmd) eq Config->myconfig; } You see that I added a whole new environment variable, PERL_MB_CONFIG_LIB, because there's no way to get the -I directives from the command line at this point that I could see. I'm not proud of this :-). Hope this helps - Sam
RT-Send-CC: scratchcomputing [...] gmail.com
On Tue Mar 27 10:12:59 2007, sam@mitre.org wrote: Show quoted text
> You see that I added a whole new environment variable, > PERL_MB_CONFIG_LIB, because there's no way to get the -I directives > from the command line at this point that I could see.
Is it possible that setting PERL5OPT would do it?
Subject: Re: [rt.cpan.org #25578] Can't build Module::Build from a separate uninstalled Perl tree
Date: Mon, 01 Oct 2007 15:03:29 -0400
To: bug-Module-Build [...] rt.cpan.org
From: Samuel Bayer <sam [...] mitre.org>
via RT wrote: Show quoted text
> <URL: http://rt.cpan.org/Ticket/Display.html?id=25578 > > > On Tue Mar 27 10:12:59 2007, sam@mitre.org wrote:
>> You see that I added a whole new environment variable, >> PERL_MB_CONFIG_LIB, because there's no way to get the -I directives >> from the command line at this point that I could see.
> > Is it possible that setting PERL5OPT would do it?
For what it's worth, I'm pretty sure I tried that and its effects were too broad. I'm no longer working on the project under which I encountered this problem, so I doubt I'll be much help moving forward.
I'm considering this request withdrawn.