I believe that what we have stumbled on here is a case where we have
been bitten on the butt by our dependence on Perl 5's Config.pm and the
global, read-only variable it supplies, %Config.  If the Perl you use
for building Parrot was not build with gdbm, then no reference to gdbm
will be located in those cases where Parrot compilation consults
%Config.  That does not mean, however, that your system does not have
gdbm; it simply means you didn't build your Perl 5 with it.

Here is data from the two systems on which I test:

Linux:

System *has* gdbm, as evidenced by fact that 'man gdbm' DWIMs.

During Configure.pl, I get this message:
  Determining if your platform supports
gdbm.............................yes.

Once Parrot builds, Parrot::Config::Generated has these values:
             'has_gdbm' => 1,
             ...
             'i_gdbm' => undef,
             
Perl -V output does not contain any string 'gdbm'.  This perl, however,
is that in /usr/local/bin/.  It's a manually compiled Perl 5.8.8 and no
gdbm-related option was selected at build time.
    [li11-226:parrot] 509 $ perl -MConfig -le 'print $Config{libs}'
    -lnsl -ldl -lm -lcrypt -lutil -lc
I don't use the older vendor Perl in /usr/bin/perl/.


Darwin:

System *has* gdbm, as evidenced by fact that 'man gdbm' DWIMs.

During Configure.pl, I get this message:
  Determining if your platform supports
gdbm.............................yes.

Once Parrot builds, Parrot::Config::Generated has these values:
             'has_gdbm' => 1,
             ...
             'i_gdbm' => undef,
             
Perl -V output does not contain any string 'gdbm'.  This perl, however,
is that in /usr/local/bin/.  It's a manually compiled Perl 5.8.8 and no
gdbm-related option was selected at build time.  
    [parrot] 524 $ perl -MConfig -le 'print $Config{libs}'
    -ldbm -ldl -lm -lc
I don't use the older vendor Perl in /usr/bin/perl/.

We first consult %Config in the second configuration step,
init::defaults.  We then go on to say 'use Config;' in a total of 18 of
our 60 configuration step classes.  So that's 18 places where there is a
possible discrepancy between the information about the OS that was
gathered by Perl 5 at the time it was built/installed and that gathered
by Parrot's Configure.pl via the probes of the OS it conducts, mostly in
the 'inter::*' and 'auto::*' steps. 

[li11-226:parrot] 514 $ fnsa config '*.pm' | xargs grep -n 'use Config'
config/init/hints/openbsd.pm:8:use Config;
config/init/hints/linux.pm:9:use Config;
config/init/defaults.pm:21:use Config;
config/init/optimize.pm:22:use Config;
config/auto/gdbm.pm:22:use Config;
config/auto/headers.pm:23:use Config;
config/auto/socklen_t.pm:22:use Config;
config/auto/jit.pm:25:use Config;
config/auto/signal.pm:87:    use Config;
config/auto/pack.pm:22:use Config;
config/auto/m4.pm:22:use Config;
config/auto/gmp.pm:21:use Config;
config/auto/readline.pm:21:use Config;
config/auto/gcc.pm:365:                use Config;
config/auto/alignptrs.pm:22:use Config;
config/auto/ctags.pm:25:use Config;
config/gen/icu.pm:21:use Config;
config/gen/platform.pm:22:use Config;

This will require discussion to see what changes we should make.  In the
meantime, we can mitigate the problem slightly by removing the 'use
Config' statements from 3 configuration step classes where %Config is
not actually consulted.  The patch attached does that.  It does not
cause any test failures, so I have applied it in r22679.

kid51


Index: config/auto/jit.pm
===================================================================
--- config/auto/jit.pm  (revision 22676)
+++ config/auto/jit.pm  (working copy)
@@ -22,7 +22,6 @@
 
 use base qw(Parrot::Configure::Step::Base);
 
-use Config;
 use Parrot::Configure::Step qw(copy_if_diff cc_gen cc_clean cc_build cc_run);
 
 sub _init {
Index: config/auto/ctags.pm
===================================================================
--- config/auto/ctags.pm        (revision 22676)
+++ config/auto/ctags.pm        (working copy)
@@ -22,7 +22,6 @@
 
 use base qw(Parrot::Configure::Step::Base);
 
-use Config;
 use Parrot::Configure::Step ':auto', 'capture_output';
 
 sub _init {
Index: config/gen/icu.pm
===================================================================
--- config/gen/icu.pm   (revision 22676)
+++ config/gen/icu.pm   (working copy)
@@ -18,7 +18,6 @@
 
 use base qw(Parrot::Configure::Step::Base);
 
-use Config;
 use Cwd qw(cwd);
 use File::Basename;
 use Parrot::Configure::Step qw(capture_output cc_gen cc_clean);

Reply via email to