Subject: | Cannot debug what is happening with this error |
This is regarding the following error in an upstream module using Devel::CheckLib:
https://github.com/benkasminbullock/gzip-faster/issues/5
The problem I have is that it's nearly impossible to work out what happened here. Even if I switch on the debugging option in Devel::CheckLib, I don't get good information:
----------
# /home/njh/perl5/perlbrew/bin/ gcc-5 -D_REENTRANT -D_GNU_SOURCE -O2 -mtune=native -march=native -Wall -pipe -ftree-vectorize -fdiagnostics-color=auto -fsanitize=bounds -g -fwrapv -fno-strict-aliasing -fstack-protector-strong -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -fsanitize=bounds -g -fstack-protector-strong -L/usr/local/lib assertlibcH_VHpDx.c -o assertlibcw2uEzQX
# /home/njh/perl5/perlbrew/bin/ gcc-5 -D_REENTRANT -D_GNU_SOURCE -O2 -mtune=native -march=native -Wall -pipe -ftree-vectorize -fdiagnostics-color=auto -fsanitize=bounds -g -fwrapv -fno-strict-aliasing -fstack-protector-strong -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -fsanitize=bounds -g -fstack-protector-strong -L/usr/local/lib assertlibOxHlFv_g.c -o assertlibNroAiJbs -lz
------------
The above output is an error on the part of Devel::CheckLib, because the user in this case was able to install the module once I had removed Devel::CheckLib. I would strongly prefer to have extremely detailed and explicit debugging information, including file and line number of Devel::CheckLib, for example I would prefer to know exactly what it thinks the compiler is. In the following code:
------------
my @ccflags = grep { length } quotewords('\s+', 1, $Config_ccflags||'');
my @ldflags = grep { length } quotewords('\s+', 1, @Config_ldflags);
my @paths = split(/$Config{path_sep}/, $ENV{PATH});
my @cc = split(/\s+/, $Config{cc});
return ( [ @cc, @ccflags ], \@ldflags ) if -x $cc[0];
foreach my $path (@paths) {
my $compiler = File::Spec->catfile($path, $cc[0]) . ($^O eq 'cygwin' ? '' : $Config{_exe});
return ([ $compiler, @cc[1 .. $#cc], @ccflags ], \@ldflags)
if -x $compiler;
next if ! length $Config{_exe};
$compiler = File::Spec->catfile($path, $cc[0]);
return ([ $compiler, @cc[1 .. $#cc], @ccflags ], \@ldflags)
if -x $compiler;
}
--------
there should be a "debug" option where it tells me exactly what it thinks the compiler is before it returns a value, and preferably with a line number, something like this:
https://github.com/benkasminbullock/p5-Devel-CheckLib/commit/5b0d4a54dbc42958db157ac9151820d205791ef0