Konstantin Ryabitsev <konstan...@linuxfoundation.org> wrote:
> Hello:
> 
> I can't seem to get a clean "make test" in the Debian container. It's possible
> that I'm missing some of the packages, as the official Debian container image
> is very minimal.

Not sure, it's taking forever to update one of my VMs...

> The dockerfile is here: 
> https://gist.github.com/mricon/046ba7c8b03bd92176dbe83e04f2466c
> 
> The pertinent section is:
>     RUN apt-get -y install git liburi-perl libemail-mime-perl libplack-perl 
> libtimedate-perl \
>                            libdbd-sqlite3-perl libsearch-xapian-perl 
> libnet-server-perl \
>                            libinline-c-perl libemail-address-xs-perl 
> libparse-recdescent-perl \
>                            xapian-tools libencode-perl libdbi-perl 
> liblinux-inotify2-perl \
>                            libio-compress-perl curl libmail-imapclient-perl 
> sqlite3 \
>                            libgit2-dev make eatmydata

Oops, pkg-config is needed for libgit2-dev.  I thought most
*-dev packages would pull it in...

------------8<------------
Subject: [PATCH] gcf2: die if pkg-config is missing

We can't link properly to libgit2 without pkg-config telling
us which libraries and headers to use.
---
 lib/PublicInbox/Gcf2.pm | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lib/PublicInbox/Gcf2.pm b/lib/PublicInbox/Gcf2.pm
index 99f4ae04..0f967579 100644
--- a/lib/PublicInbox/Gcf2.pm
+++ b/lib/PublicInbox/Gcf2.pm
@@ -17,7 +17,8 @@ BEGIN {
                die 'PERL_INLINE_DIRECTORY not defined';
        my $f = "$inline_dir/.public-inbox.lock";
        open $lockfh, '>', $f or die "failed to open $f: $!\n";
-       my $pc = which($ENV{PKG_CONFIG} // 'pkg-config');
+       my $pc = which($ENV{PKG_CONFIG} // 'pkg-config') //
+               die "pkg-config missing for libgit2";
        my ($dir) = (__FILE__ =~ m!\A(.+?)/[^/]+\z!);
        my $rdr = {};
        open $rdr->{2}, '>', '/dev/null' or die "open /dev/null: $!";


> When I run "make test", I get the following failures:
> 
>     ...
>     t/gcf2.t ..................... Use of uninitialized value $file in index 
> at /home/user/work/temp/pi/blib/lib/PublicInbox/Spawn.pm line 348.
>     Use of uninitialized value $file in concatenation (.) or string at 
> /home/user/work/temp/pi/blib/lib/PublicInbox/Spawn.pm line 350.
>     Use of uninitialized value in subroutine entry at 
> /home/user/work/temp/pi/blib/lib/PublicInbox/Spawn.pm line 388.
>     Use of uninitialized value in join or string at 
> /home/user/work/temp/pi/blib/lib/PublicInbox/Spawn.pm line 389.

Otherwise, maybe printing a stacktrace can shine a light on the problem:

diff --git a/lib/PublicInbox/Spawn.pm b/lib/PublicInbox/Spawn.pm
index fe7aa0a8..473d0716 100644
--- a/lib/PublicInbox/Spawn.pm
+++ b/lib/PublicInbox/Spawn.pm
@@ -343,8 +343,10 @@ unless ($set_nodatacow) {
 undef $set_nodatacow;
 undef $all_libc;
 
+use Carp;
 sub which ($) {
        my ($file) = @_;
+       warn "file undefined ",Carp::longmess() unless defined($file);
        return $file if index($file, '/') >= 0;
        for my $p (split(/:/, $ENV{PATH})) {
                $p .= "/$file";
--
unsubscribe: one-click, see List-Unsubscribe header
archive: https://public-inbox.org/meta/

Reply via email to