Re: Autobundling the installer

2007-08-20 Thread Sendu Bala

Eric Wilhelm wrote:

# from Ken Williams
# on Friday 17 August 2007 07:28 pm:


If I understand correctly, the problem being solved is old cpan
client (and somewhat standalone tarball usage)  Right?
I think the other big one is that authors are often hesitant to take  
advantage of new M::B features, or to make an M::B-only distribution,

because it can add extra burdens to their users.


True, though configure_requires should solve that once the cpan client 
is upgraded, right?


Some users (eg. non-root newbies) have difficulty doing that. When a 
user only cares about using your particular module (which basically just 
needs to be put somewhere in PERL5LIB), requiring them to upgrade CPAN/ 
install M::B is a serious pain for them.


For one real-world example:
http://bioperl.org/pipermail/bioperl-l/2007-August/026230.html


Re: Command-line options available during actions?

2007-06-15 Thread Sendu Bala

Salve J Nilsen wrote:

Sendu Bala wrote:
 
Can anyone suggest a solution that could be implemented in an M::B 
subclass to make --something visible in a test script when running the 
test action? I've tried looking through the M::B code but the 
command-line arg handling is just way too obfuscated for me to figure 
out where to 'patch into' the system, so to speak.


My might want to look at the get_options(), notes() and current() 
methods documented in Module::Build::API.


Specifically, how do those help me? I'm already using those to store 
--something if --something is supplied to Build.PL:


perl Build.PL --something

...

./Build test --test_files t/test.t

test.t knows about --something via notes().

I want to pass --something directly during test, however, to specify or 
negate what ever the current notes value may be.





Re: Bad interaction between custom build module and new CPAN.pm

2007-01-22 Thread Sendu Bala

Andreas J. Koenig wrote:

CPAN.pm still has an open issue with Module::Build with regard to
finding out the prerequisites of a distribution. I append the email
below where I asked the encompassing question: can I rely on the
contents of _build/prereqs?

Since then I have changed CPAN.pm in 1.88_63 to actually read
_build/prereqs. All CPAN seems to be conquered with this trick. All of
CPAN? Actually, one developer complained about it: Sendu Bala (CC'd)
who released SENDU/bioperl-1.5.2_100.tar.gz in December. He used some
heavy Module::Build subclassing wizardry, I did not try to understand
it.


Specifically the issue was that my _build/prereqs 'requires' wasn't the 
normal dumped hash-ref, but an array of hash-refs (such that CPAN/my 
M::B subclass would install things in a certain order).


But after discussion with Andreas I find that order can be achieved a 
better way, so I could do an updated release that behaves normally wrt 
_build/prereqs. Andreas, when were you thinking of releasing 1.89? I'd 
like just a little time to update bioperl before hand.




Would it be possible to make an interface decision for the prereqs?


All that said, I still have to point out my issues with this approach. 
The '_build' directory is supposed to be configurable. The prereqs file 
is a dump of the internal data structure of a module. It seems extremely 
wrong to me for CPAN to have to hard-code the location of this file and 
assume the format of its contents. This is no suitable 'interface'! 
There ought to be some defined M::B method that generates a file that 
CPAN will read, thus allowing the format and location of the file to be 
documented in the API, and allowing M::B sub-classers to massage their 
data correctly in their over-ridden version of that method.


(I'm still not really clear on the problem with CPAN using $req  = 
Module::Build-current-requires();. Seems 'correct' and ideal to me.)


Module::Build install doesn't use its own Build.PL

2007-01-19 Thread Sendu Bala
During Module::Build installation, it fails to use its own Build.PL if 
another is in perl5lib, resulting in test failures.


With Mac OS X I downloaded perl-5.8.8 and did a clean install:

 cd ~/Desktop/
 tar -xzf perl-5.8.8.tgz
 cd perl-5.8.8
 sh Configure -Dprefix=/test/perl -Dcc=gcc -des
 make
 make test

 sudo rm -rf /test
 sudo mkdir /test
 sudo make install
 sudo rm -rf ~/.cpan
 setenv PATH /test/perl/bin:$PATH

Now I check my perl5lib:

 perl -V
Summary of my perl5 (revision 5 version 8 subversion 8) configuration:
  Platform:
osname=darwin, osvers=8.8.1, archname=darwin-2level
uname='darwin dhn02982.mrc-dunn.cam.ac.uk 8.8.1 darwin kernel 
version 8.8.1: mon sep 25 19:42:00 pdt 2006; 
root:xnu-792.13.8.obj~1release_i386 i386 i386 '

config_args='-Dprefix=/test/perl -Dcc=gcc -des'
[...]
%ENV:
PERL5LIB=/sw/lib/perl5:/sw/lib/perl5/darwin:/Users/sb/Work/scripts:/Volumes/biodav/core:/Volumes/biodav/run
@INC:
/sw/lib/perl5
/sw/lib/perl5/darwin
/Users/sb/Work/scripts
/Volumes/biodav/core
/Volumes/biodav/run
/test/perl/lib/5.8.8/darwin-2level
/test/perl/lib/5.8.8
/test/perl/lib/site_perl/5.8.8/darwin-2level
/test/perl/lib/site_perl/5.8.8
/test/perl/lib/site_perl
.

I check my PATH:

 echo $PATH
/test/perl/bin:/sw/bin:/sw/sbin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin/:/Users/sb/Programs/:/Users/sb/Programs/hmmer/binaries/:/Users/sb/Work/scripts/:/Volumes/data/Home/ajr/sw/powerpc/phylip-3.6/bin/:/Volumes/data/Home/ajr/sw/powerpc/t_coffee-2.66/bin/:/Volumes/data/Home/ajr/sw/powerpc/bin/:/Volumes/data/Home/ajr/sw/powerpc/emboss-2.10.0/bin/:/usr/X11R6/bin

Nothing in PATH contains a Build.PL script.
The PERL5LIB directory '/Volumes/biodav/core' contains a Build.PL script 
that needs /Volumes/biodav/core/Bio/Root/Version.pm for its version number.


Now I try updating cpan (same problem if I just install Module::Build 
directly):


 sudo cpan

/test/perl/lib/5.8.8/CPAN/Config.pm initialized.

[...]

 cpan install Bundle::CPAN

[...]
  There's a new CPAN.pm version (v1.8802) available!
  [Current version is v1.7602]

[...]
Running install for module Module::Build
Running make for K/KW/KWILLIAMS/Module-Build-0.2806.tar.gz
LWP not available
Fetching with Net::FTP:

ftp://ftp.mirror.ac.uk/sites/ftp.funet.fi/pub/languages/perl/CPAN/authors/id/K/KW/KWILLIAMS/Module-Build-0.2806.tar.gz
Checksum for 
/Users/sb/.cpan/sources/authors/id/K/KW/KWILLIAMS/Module-Build-0.2806.tar.gz 
ok

Module-Build-0.2806/
Module-Build-0.2806/Build.PL
[...]
Module-Build-0.2806/t/xs.t

  CPAN.pm: Going to build K/KW/KWILLIAMS/Module-Build-0.2806.tar.gz

# running Build.PL
/test/perl/bin/perl Build.PL
Checking whether your kit is complete...
Looks good

Checking prerequisites...
 * Optional prerequisite Module::Signature is not installed
 * Optional prerequisite ExtUtils::ParseXS is not installed
 * Optional prerequisite version is not installed
 * Optional prerequisite Archive::Tar is not installed
 * Optional prerequisite Pod::Readme is not installed

ERRORS/WARNINGS FOUND IN PREREQUISITES.  You may wish to install the 
versions

of the modules indicated above before proceeding with this installation

Checking features:
  manpage_supportenabled
  YAML_support...disabled
- YAML is not installed
  C_support..enabled
* Optional prerequisite ExtUtils::ParseXS is not installed
  HTML_support...enabled

Creating new 'Build' script for 'Module-Build' version '0.2806'
/test/perl/bin/perl Build --makefile_env_macros 1
Copying lib/Module/Build/Version.pm - blib/lib/Module/Build/Version.pm
[...]
Manifying blib/lib/Module/Build/Compat.pm - 
blib/libdoc/Module::Build::Compat.3

  /usr/bin/make  -- OK
Running make test
/test/perl/bin/perl Build --makefile_env_macros 1 test
t/basic...ok 

t/compat..ok 1/60Can't find file Bio/Root/Version.pm to 
determine version at 
/Users/sb/.cpan/build/Module-Build-0.2806/blib/lib/Module/Build/Base.pm 
line 949.

# Looks like you planned 60 tests but only ran 1.
t/compat..dubious 


Test returned status 255 (wstat 65280, 0xff00)
DIED. FAILED tests 2-60
Failed 59/60 tests, 1.67% okay
t/destinationsWarning: Removing existing directory 
'/Users/sb/.cpan/build/Module-Build-0.2806/t/_tmp/Simple'
Can't find file Bio/Root/Version.pm to determine version at 
/Users/sb/.cpan/build/Module-Build-0.2806/blib/lib/Module/Build/Base.pm 
line 949.

# No tests run!
t/destinationsdubious 


Test returned status 255 (wstat 65280, 0xff00)
DIED. FAILED tests 1-113
Failed 113/113 tests, 0.00% okay
t/ext.ok 

t/extend..Warning: Removing existing directory 
'/Users/sb/.cpan/build/Module-Build-0.2806/t/_tmp/Simple'
t/extend..ok 

t/files...Can't find file Bio/Root/Version.pm to determine 
version at 
/Users/sb/.cpan/build/Module-Build-0.2806/blib/lib/Module/Build/Base.pm 
line 949.

# No tests run!
t/files...dubious 


Test returned status 255 

optional_features possible?

2006-11-10 Thread Sendu Bala

I currently have a setup like:

my $build = Module::Build-new(
  #...
  recommends = {'Module' = 0}
)

I can then use ./Build distmeta to generate a META.yml file with content 
like:


requires:
Module: 0

Is it possible to get Module::Build to generate the optional_features 
syntax instead? So I want:


optional_features:
  - foo:
  description: Provides the ability to blah.
  requires:
Module: 0

Also, where can I find full documentation for all of the methods 
available? Eg. I couldn't find anything that even told me all the 
possible options you can supply to Module::Build-new(), having looked 
in these places:


http://search.cpan.org/~kwilliams/Module-Build-0.2805/lib/Module/Build.pm
http://search.cpan.org/~kwilliams/Module-Build-0.2805/lib/Module/Build/Authoring.pod
http://search.cpan.org/~kwilliams/Module-Build-0.2805/lib/Module/Build/Cookbook.pm
http://search.cpan.org/~kwilliams/Module-Build-0.2805/lib/Module/Build/Compat.pm

So far I've just looked through the code of Module/Build/Base.pm to 
guess what I should be able to do, which isn't ideal.