On Wed, Jul 02, 2008 at 11:26:21PM -0400, David Golden wrote:
> On Wed, Jul 2, 2008 at 8:59 PM, Tony Cook <[EMAIL PROTECTED]> wrote:
> > Going by that logic I'd need to look in $Config{installsitebin},
> > $Config{installvendorbin} etc, since $^X could be in installvendorbin,
> > while most CPAN installed binaries are likely to be in installsitebin.
> > Unfortunately this doesn't help in a test environment, since testers
> > don't install the binaries in any of those locations.
> But testers could -- perhaps arguably should.

Certainly should, given that people will declare a dependency on
Foo::Bar::Baz to get the frobnitz script that they can then system().
That's why each of my testing runs goes like ...

$ tar xzf perl-5.x.x.tar.gz
$ perl-5.x.x/bin/perl -MCPAN -e 'install qw(...)' # <-- INSTALL
$ rm -rf perl-5.x.x

So scripts packaged with modules really do get installed to wherever
they would get installed by an ordinary user running perl from his home
dir or similar.

Note that this means scripts are installed outside the $PATH - but
that's the same as when I install a module at work somewhere under
/opt/perl.  And anything that tries to force something to install into
/usr will fail at install time, just like for any other non-root user
trying to install the software.  Both are, IMO, legitimate use cases.

Note, however, that declaring a dependency on Foo::Bar::Baz to get the
frobnitz script is wrong.  It will break if, eg, Foo::Bar::Baz gets
moved to its own distribution but frobnitz stays in the old one.
Unlikely, but might happen.  And I don't see an easy way around it so I
guess we'll just have to continue doing the wrong thing on the grounds
that it works almost all the time :-)

>                IMHO, testers should be trying to provoke reasonable
> failures caused by faulty assumptions. (As, distinct from provoking
> failures on intentionally broken systems.)

Indeed.  A system that only test()s is not, IMO, a reasonable testing
system because real users just don't do that.

> Given the possibilities, it seems like the sort of thing that should
> be wrapped up in a module.  (If it isn't already.)
> 
> Hey, David Cantrell -- how about Devel::CheckBin to go along in the
> series with Devel::CheckLib and Devel::CheckOS?  :-)

Stoppit!  I've got too many projects as it is :-)

What should it do?  Look for a named binary in the $PATH and
$Config{whateverbin}?  What about checking that the frobnitz command it
finds is the frobnitz command that you want?  If you don't think that
the latter matters, consider the case of specifically needing GNU make
or GNU tar.

-- 
David Cantrell | Nth greatest programmer in the world

Cum catapultae proscriptae erunt tum soli proscript catapultas habebunt

Reply via email to