Thread: [Module-build-general] require thread-multi
Status: Beta
Brought to you by:
kwilliams
|
From: Jim C. <jc...@di...> - 2003-07-01 00:39:15
|
Folks,
while trying to install Hook::Scope on a non-threaded perl, I discovered
that it is unsupported on on-threaded builds.
now, Hook::Scope uses an old-style Makefile.PL, but Id much rather
rewrite it into a Build.PL than try to shoehorn a custom dependency check
into its Makefile.PL (tho if its obvious to you, please let me, or
ABERGMAN know)
Anyway, such a dependency is on perl itself, which in my case is already
used
requires => {
perl => '5.8.0',
B::Generate => 0,
optimizer => 0,
},
Is it possible/reasonable to add 2 dependencies on perl, something like
requires => {
perl => [ '5.8.0', qr/thread-multi/ ],
B::Generate => 0,
optimizer => 0,
},
I tried this, it bombs currently:
Invalid prerequisite condition 'ARRAY(0x8111eb4)' for perl at
/usr/local/lib/perl5/site_perl/5.8.0/Module/Build/Base.pm line 436.
This expression of a dependency on a threaded install is somewhat
problematic,
as its not depending upon a particular package, but on a component in @INC.
But a dependency on threads is no good, cuz threads is specifically
available
as a no-op under non-threaded builds.
ARRAY is also not kosher, so I tried following - also failed:
requires => {
perl => '5.8.0, thread-multi',
B::Generate => 0,
optimizer => 0,
}
This still has problem of implied check on @INC, but it fails before
that, on 5.8.0
Invalid prerequisite condition '5.8.0' for perl at
/usr/local/lib/perl5/site_perl/5.8.0/Module/Build/Base.pm line 436.
Lastly, I tried this - but it fails with same error as above
requires => {
perl => 'grep {/thread-multi/} @INC',
B::Generate => 0,
optimizer => 0,
},
So - what would be a good approach ?
what could evolve into an acceptable patch ?
please cc me, as im not currently on the mailing list.
tia,
-jimc
|
|
From: Ken W. <ke...@ma...> - 2003-07-03 16:24:10
|
Hi Jim,
Thanks for this report. I hadn't considered dependencies like this
before, but you have a very valid point. Unfortunately I'm not yet
sure how to solve it well!
It may be that we could add a 'perl-config' item, which could check
certain values in Config.pm. Then you could check 'usethreads' (or
more likely, 'useithreads'), 'usemultiplicity', or whatever.
I think this is going to have to wait until after 0.19 is released
though, because it's way overdue and there are way too many feature
changes in it already. I'll be happy to revisit it then, especially if
you remind me.
Until then, the best way to express this dependency might be to
override the check_prereq() method like so:
sub check_prereq {
my $self = shift;
die "Perl must be built with 'useithreads' defined in order to
install this module"
unless $self->{config}{useithreads};
return $self->SUPER::check_prereq();
}
-Ken
(Aside: why won't Hook::Scope install on non-threaded perls?)
On Monday, June 30, 2003, at 03:37 PM, Jim Cromie wrote:
>
> Folks,
>
> while trying to install Hook::Scope on a non-threaded perl, I
> discovered
> that it is unsupported on on-threaded builds.
>
> now, Hook::Scope uses an old-style Makefile.PL, but Id much rather
> rewrite it into a Build.PL than try to shoehorn a custom dependency
> check
> into its Makefile.PL (tho if its obvious to you, please let me, or
> ABERGMAN know)
>
> Anyway, such a dependency is on perl itself, which in my case is
> already used
>
> requires => {
> perl => '5.8.0',
> B::Generate => 0,
> optimizer => 0,
> },
>
> Is it possible/reasonable to add 2 dependencies on perl, something like
>
> requires => {
> perl => [ '5.8.0', qr/thread-multi/ ],
> B::Generate => 0,
> optimizer => 0,
> },
>
>
> I tried this, it bombs currently:
> Invalid prerequisite condition 'ARRAY(0x8111eb4)' for perl at
> /usr/local/lib/perl5/site_perl/5.8.0/Module/Build/Base.pm line 436.
>
> This expression of a dependency on a threaded install is somewhat
> problematic,
> as its not depending upon a particular package, but on a component in
> @INC.
> But a dependency on threads is no good, cuz threads is specifically
> available
> as a no-op under non-threaded builds.
>
> ARRAY is also not kosher, so I tried following - also failed:
>
> requires => {
> perl => '5.8.0, thread-multi',
> B::Generate => 0,
> optimizer => 0,
> }
>
> This still has problem of implied check on @INC, but it fails before
> that, on 5.8.0
>
> Invalid prerequisite condition '5.8.0' for perl at
> /usr/local/lib/perl5/site_perl/5.8.0/Module/Build/Base.pm line 436.
>
>
> Lastly, I tried this - but it fails with same error as above
>
> requires => {
> perl => 'grep {/thread-multi/} @INC',
> B::Generate => 0,
> optimizer => 0,
> },
>
>
> So - what would be a good approach ?
> what could evolve into an acceptable patch ?
>
> please cc me, as im not currently on the mailing list.
>
> tia,
> -jimc
>
>
>
> -------------------------------------------------------
> This SF.Net email sponsored by: Free pre-built ASP.NET sites including
> Data Reports, E-commerce, Portals, and Forums are available now.
> Download today and enter to win an XBOX or Visual Studio .NET.
> http://aspnet.click-url.com/go/psa00100006ave/direct;at.asp_061203_01/
> 01
> _______________________________________________
> Module-build-general mailing list
> Mod...@li...
> https://lists.sourceforge.net/lists/listinfo/module-build-general
>
-Ken
|