Our use of Module::install is proving to be VERY VERY fragile.

I tried to test out a patch to EFS::Perl::Depends, and had a hell of a
time getting past "perl Makefile.PL".  The pod file I included below
has the notes I took while trying to debug this.  I'll cut to the
chase.  if you want to create a distribution out of any of our git
repos, and you are doing so using the perl5 environment in /efs/dist,
this is what you have to do:

PERL5LIB=/efs/dist/perl5/Module-Install/1.04/exec/5.14/lib/perl5 perl
Makefile.PL

This will FAIL, and generate a lot of errors, however it at least
succeeds in bootstrapping the contents of inc/.  Then you can run
"perl Makefile.PL", and make, and everything Just Works.  This is
obscene, and I can NOT figure out what the hell is happening in the
guts of M::I.  I know that if you install M::I directly into one of
the perl5/core @INC dirs, then you don't have this problem (at least,
I didn't when I was bootstrapping).  I mistakenly thought this was an
issue with objects in @INC, but the patch to allow them changed
nothing (and upon further analysis, was pointless anyway).

This is REALLY ugly, but this is the only way I can get my inc/ dirs
bootstrapped so that I can then run:

perl Makefile.PL && make manifest dist

If someone else has any insight into this, please share it.

BTW, the fact that noone but me has seen this says a lot about how
often other people are really working with this source code.

=====



=head1 Getting inc/ bootstrapped when Module::Install is in EFS

Starting with a clean, empty repo, it has no inc/ subdir:

    [efsops@shou18lesx4vm83 trunk]$ perl Makefile.PL
    Can't locate inc/Module/Install.pm in @INC (@INC contains:
build-lib /efs/dist/perl5/core/5.14.2-build002/.exec/x86-64.\
    rhel.5/lib/perl5 .) at Makefile.PL line 8.
    BEGIN failed--compilation aborted at Makefile.PL line 8.

OK, fair enough.   Let's try this:

    [efsops@shou18lesx4vm83 trunk]$
EFS_PERL_DEPENDS_RUNTIME=perl5/Module-Install/1.04 perl Makefile.PL
    include /home/efsops/dev/efs/deploy-test/trunk/inc/Module/Install.pm
    syntax error at Makefile.PL line 10, near "name         q{EFS-Deploy}"
    Bareword "tests_recursive" not allowed while "strict subs" in use
at Makefile.PL line 74.
    Bareword "WriteAll" not allowed while "strict subs" in use at
Makefile.PL line 76.
    Execution of Makefile.PL aborted due to compilation errors.

This does copy Module/Install.pm into inc/ though.   If you re-run
perl Makefile.PL again, you get:

    [efsops@shou18lesx4vm83 trunk]$ perl Makefile.PL
    Can't call method "load_all_extensions" on an undefined value at
inc/Module/Install.pm line 206.
    BEGIN failed--compilation aborted at Makefile.PL line 8.

Remove inc/, and try this:

    [efsops@shou18lesx4vm83 trunk]$
PERL5LIB=/efs/dist/perl5/Module-Install/1.04/exec/5.14/lib/perl5 perl
Makefile.PL
    include /home/efsops/dev/efs/deploy-test/trunk/inc/Module/Install.pm
    Can't locate LWP/UserAgent.pm in @INC (@INC contains: inc
build-lib /efs/dist/perl5/Module-Install/1.04/exec/5.14/lib/p\
    erl5 /efs/dist/perl5/core/5.14.2-build002/.exec/x86-64.rhel.5/lib/perl5
.) at /efs/dist/perl5/Module-Install/1.04/exec/\
    5.14/lib/perl5/Module/Install/Admin/Bundle.pm line 6.
    BEGIN failed--compilation aborted at
/efs/dist/perl5/Module-Install/1.04/exec/5.14/lib/perl5/Module/Install/Admin/Bundl\
    e.pm line 6.
    Compilation failed in require at inc/Module/Install.pm line 307.
    Can't locate File/Remove.pm in @INC (@INC contains: inc build-lib
/efs/dist/perl5/Module-Install/1.04/exec/5.14/lib/per\
    l5 /efs/dist/perl5/core/5.14.2-build002/.exec/x86-64.rhel.5/lib/perl5
.) at /efs/dist/perl5/Module-Install/1.04/exec/5.\
    14/lib/perl5/Module/Install/Admin/Compiler.pm line 5.
    BEGIN failed--compilation aborted at
/efs/dist/perl5/Module-Install/1.04/exec/5.14/lib/perl5/Module/Install/Admin/Compi\
    ler.pm line 5.
    Compilation failed in require at inc/Module/Install.pm line 307.
    Can't locate YAML/Tiny.pm in @INC (@INC contains: inc build-lib
/efs/dist/perl5/Module-Install/1.04/exec/5.14/lib/perl5\
     /efs/dist/perl5/core/5.14.2-build002/.exec/x86-64.rhel.5/lib/perl5
.) at /efs/dist/perl5/Module-Install/1.04/exec/5.14\
    /lib/perl5/Module/Install/Admin/Metadata.pm line 4.
    BEGIN failed--compilation aborted at
/efs/dist/perl5/Module-Install/1.04/exec/5.14/lib/perl5/Module/Install/Admin/Metad\
    ata.pm line 4.
    Compilation failed in require at inc/Module/Install.pm line 307.
    include inc/Module/Install/Metadata.pm
    include inc/Module/Install/Base.pm
    include inc/Module/Install/Makefile.pm
    include inc/Module/Install/External.pm
    include inc/Module/Install/Can.pm
    Locating bin:rsync... found at /usr/bin/rsync.
    Locating bin:ssh... found at /usr/bin/ssh.
    Locating bin:tar... found at /bin/tar.
    Locating bin:sha1sum... found at /usr/bin/sha1sum.
    Locating bin:md5sum... found at /usr/bin/md5sum.
    include inc/Module/Install/Scripts.pm
    include inc/Module/Install/Share.pm
    include inc/Module/Install/PRIVATE.pm
    Checking if your kit is complete...
    Warning: the following files are missing in your kit:
            inc/Module/Install/Fetch.pm
            inc/Module/Install/Win32.pm
            inc/Module/Install/WriteAll.pm
    Please inform the author.
    include inc/Module/Install/WriteAll.pm
    include inc/Module/Install/Win32.pm
    include inc/Module/Install/Fetch.pm
    Checking if your kit is complete...
    Looks good
    Warning: prerequisite Config::Tiny 0 not found.
    Warning: prerequisite Date::Format 0 not found.
    Warning: prerequisite File::LibMagic 0 not found.
    Warning: prerequisite File::ShareDir 0 not found.
    Warning: prerequisite File::Slurp 0 not found.
    Warning: prerequisite FreezeThaw 0 not found.
    Warning: prerequisite HTTP::Request 0 not found.
    Warning: prerequisite LWP::Protocol::https 0 not found.
    Warning: prerequisite LWP::UserAgent 0 not found.
    Warning: prerequisite Moose 0 not found.
    Warning: prerequisite Moose::Util::TypeConstraints 0 not found.
    Warning: prerequisite MooseX::Singleton 0 not found.
    Warning: prerequisite Parallel::ForkManager 0 not found.
    Warning: prerequisite Params::Validate 0 not found.
    Warning: prerequisite Readonly 0 not found.
    Warning: prerequisite Regexp::Common 0 not found.
    Warning: prerequisite Sort::Versions 0 not found.
    Warning: prerequisite Sys::Hostname::FQDN 0 not found.
    Warning: prerequisite Test::Exception 0 not found.
    Warning: prerequisite Test::Perl::Critic 0 not found.
    Warning: prerequisite Test::Pod 0 not found.
    Warning: prerequisite Test::Pod::Coverage 0 not found.
    Warning: prerequisite Text::FormatTable 0 not found.
    Warning: prerequisite Tie::IxHash 0 not found.
    Warning: prerequisite Try::Tiny 0 not found.
    Writing Makefile for EFS::Deploy
    Writing MYMETA.yml
    Cannot find an extension with method 'write_meta' at
/efs/dist/perl5/Module-Install/1.04/exec/5.14/lib/perl5/Module/Ins\
    tall/Admin.pm line 186.

OK, no surprise, since just setting PERL5LIB won't pick up the M::I
dependencies.

In an existing, working git repo, I have a older version of M::I
copied into inc/ (1.01) and it works fine.  Copy that inc dir over,
and then "perl Makefile.PL" works fine.

Therefore, something in tne 1.04 version is breaking.  Let's keep digging....

Whoa...  OK, I just tried swapping the 1.04 inc back, and now the damn
thing worked.  SO, how did it getinto that state?

Let's start over...  Wipe out @INC, and do this:

    [efsops@shou18lesx4vm83 trunk]$
EFS_PERL_DEPENDS_RUNTIME=perl5/Module-Install/1.04 perl Makefile.PL
    include /home/efsops/dev/efs/deploy-test/trunk/inc/Module/Install.pm
    syntax error at Makefile.PL line 10, near "name         q{EFS-Deploy}"
    Bareword "tests_recursive" not allowed while "strict subs" in use
at Makefile.PL line 74.
    Bareword "WriteAll" not allowed while "strict subs" in use at
Makefile.PL line 76.
    Execution of Makefile.PL aborted due to compilation errors.
    [efsops@shou18lesx4vm83 trunk]$ tree inc
    inc
    `-- Module
        `-- Install.pm

    1 directory, 1 file
    [efsops@shou18lesx4vm83 trunk]$ perl Makefile.PL
    Can't call method "load_all_extensions" on an undefined value at
inc/Module/Install.pm line 206.
    BEGIN failed--compilation aborted at Makefile.PL line 8.

The PERL5LIB approach produces:

    [efsops@shou18lesx4vm83 trunk]$
PERL5LIB=/efs/dist/perl5/Module-Install/1.04/exec/5.14/lib/perl5 perl
Makefile.PL
    include /home/efsops/dev/efs/deploy-test/trunk/inc/Module/Install.pm
    Can't locate LWP/UserAgent.pm in @INC (@INC contains: inc
build-lib /efs/dist/perl5/Module-Install/1.04/exec/5.14/lib/p\
    erl5 /efs/dist/perl5/core/5.14.2-build002/.exec/x86-64.rhel.5/lib/perl5
.) at /efs/dist/perl5/Module-Install/1.04/exec/\
    5.14/lib/perl5/Module/Install/Admin/Bundle.pm line 6.
    ...
    ...
    ...
    Writing Makefile for EFS::Deploy
    Writing MYMETA.yml
    Cannot find an extension with method 'write_meta' at
/efs/dist/perl5/Module-Install/1.04/exec/5.14/lib/perl5/Module/Ins\
    tall/Admin.pm line 186.
    [efsops@shou18lesx4vm83 trunk]$ tree inc
    inc
    `-- Module
        |-- Install
        |   |-- Base.pm
        |   |-- Can.pm
        |   |-- External.pm
        |   |-- Fetch.pm
        |   |-- Makefile.pm
        |   |-- Metadata.pm
        |   |-- PRIVATE.pm
        |   |-- Scripts.pm
        |   |-- Share.pm
        |   |-- Win32.pm
        |   `-- WriteAll.pm
        `-- Install.pm

    2 directories, 12 files

But NOW...  "perl Makefile.PL" works (!!!)

    [efsops@shou18lesx4vm83 trunk]$ perl Makefile.PL
    Locating bin:rsync... found at /usr/bin/rsync.
    Locating bin:ssh... found at /usr/bin/ssh.
    Locating bin:tar... found at /bin/tar.
    Locating bin:sha1sum... found at /usr/bin/sha1sum.
    Locating bin:md5sum... found at /usr/bin/md5sum.
    Warning: prerequisite Config::Tiny 0 not found.
    Warning: prerequisite Date::Format 0 not found.
    Warning: prerequisite File::LibMagic 0 not found.
    Warning: prerequisite File::ShareDir 0 not found.
    Warning: prerequisite File::Slurp 0 not found.
    Warning: prerequisite FreezeThaw 0 not found.
    Warning: prerequisite HTTP::Request 0 not found.
    Warning: prerequisite LWP::Protocol::https 0 not found.
    Warning: prerequisite LWP::UserAgent 0 not found.
    Warning: prerequisite Moose 0 not found.
    Warning: prerequisite Moose::Util::TypeConstraints 0 not found.
    Warning: prerequisite MooseX::Singleton 0 not found.
    Warning: prerequisite Parallel::ForkManager 0 not found.
    Warning: prerequisite Params::Validate 0 not found.
    Warning: prerequisite Readonly 0 not found.
    Warning: prerequisite Regexp::Common 0 not found.
    Warning: prerequisite Sort::Versions 0 not found.
    Warning: prerequisite Sys::Hostname::FQDN 0 not found.
    Warning: prerequisite Test::Exception 0 not found.
    Warning: prerequisite Test::Perl::Critic 0 not found.
    Warning: prerequisite Test::Pod 0 not found.
    Warning: prerequisite Test::Pod::Coverage 0 not found.
    Warning: prerequisite Text::FormatTable 0 not found.
    Warning: prerequisite Tie::IxHash 0 not found.
    Warning: prerequisite Try::Tiny 0 not found.
    Writing Makefile for EFS::Deploy
    Writing MYMETA.yml

The lack of dependencies is fine.  We get a Makefile that works, and
can be used to produce the distro for installation.

So that means the workaround to get a working inc dir is to use
PERL5LIB, JUST the first time, let is fail, and then go back to just
using "perl Makefile.PL".

You only have to do this the FIRST time you get your git repo setup.

=cut
_______________________________________________
EFS-dev mailing list
[email protected]
http://mailman.openefs.org/mailman/listinfo/efs-dev

Reply via email to