Bug#1018289: perl: FTBFS on hurd-i386: NDBM not getting linked against libgdbm-compat

Niko Tyni ntyni at debian.org
Tue Aug 30 21:54:23 BST 2022


Control: tag -1 confirmed upstream

On Sun, Aug 28, 2022 at 01:41:48PM +0200, Samuel Thibault wrote:
> Package: perl
> Version: 5.34.0-5
> Severity: important

> perl currently FTBFS on hurd-i386: 

> #     Error:  Can't load '../../lib/auto/NDBM_File/NDBM_File.so' for module NDBM_File: ../../lib/auto/NDBM_File/NDBM_File.so: undefined symbol: dbm_nextkey at ../../lib/XSLoader.pm line 93.
> #   at ../../lib/NDBM_File.pm line 12.

> Notably on hurd there aren't the "harmless" messages about -ldbm ; it's
> supposed to use -lgdbm_compat, as hinted from hints/linux.pl, sourced
> from hints/gnu.pl, but for some reason this isn't working any more?

I think this broke with

  https://github.com/Perl-Toolchain-Gang/ExtUtils-MakeMaker/pull/367

but nobody noticed until now.

All the hints files used to get loaded with 'do', which limits scope so
that local variables ("my $var") aren't visible. The $self hash that the
hints usually modify was a local variable ("our $self") to overcome this.

The commit above changed the normal loading to use 'eval', which removed
the visibility problem, and changed the $self variable to a local
variable, presumably to make things cleaner now that it was possible.

Unfortunately hints/gnu.pl is still loading linux.pl with 'do', so $self
isn't visible anymore and the resulting hints have no effect.

A simple 'grep -w do' indicates there's a dozen affected files with the
same pattern (and a couple of false positives removed manually):

  ext/NDBM_File/hints/gnu.pl
  ext/NDBM_File/hints/gnukfreebsd.pl
  ext/NDBM_File/hints/gnuknetbsd.pl
  ext/ODBM_File/hints/gnu.pl
  ext/ODBM_File/hints/gnukfreebsd.pl
  ext/ODBM_File/hints/gnuknetbsd.pl
  ext/POSIX/hints/gnukfreebsd.pl
  ext/POSIX/hints/gnuknetbsd.pl
  ext/DynaLoader/hints/gnukfreebsd.pl
  ext/DynaLoader/hints/gnuknetbsd.pl
  dist/Storable/hints/gnukfreebsd.pl
  dist/Storable/hints/gnuknetbsd.pl

Something like this works but seems rather wordy and
silly to repeat in all of those:

------------------------------------------------------
  my $hint_file = 'hints/linux.pl';
  open(my $fh, '<', $hint_file)
      or die "Could not open $hint_file for read: $!";
  eval join('', <$fh>);
  die "Failed to load hint file $hint_file: $@" if $@;
------------------------------------------------------

Guess I'll sleep on this and try to come up with something better.
-- 
Niko




More information about the Perl-maintainers mailing list