unofficial mirror of meta@public-inbox.org
 help / color / mirror / Atom feed
From: Eric Wong <e@80x24.org>
To: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
Cc: meta@public-inbox.org
Subject: [PATCH] gcf2: die if pkg-config is missing
Date: Thu, 9 Sep 2021 20:45:41 +0000	[thread overview]
Message-ID: <20210909204541.GA11866@dcvr> (raw)
In-Reply-To: <20210909182350.yzhdw3znylowb3im@meerkat.local>

Konstantin Ryabitsev <konstantin@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";

  reply	other threads:[~2021-09-09 20:45 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-09 18:23 make test in a debian-11 container Konstantin Ryabitsev
2021-09-09 20:45 ` Eric Wong [this message]
2021-09-09 21:01   ` [PATCH] gcf2: die if pkg-config is missing Konstantin Ryabitsev
2021-09-09 21:14     ` Eric Wong
2021-09-09 21:21       ` Konstantin Ryabitsev
2021-09-09 21:23         ` Eric Wong
2021-09-09 21:29           ` Konstantin Ryabitsev
2021-09-09 21:34             ` Eric Wong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://public-inbox.org/README

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210909204541.GA11866@dcvr \
    --to=e@80x24.org \
    --cc=konstantin@linuxfoundation.org \
    --cc=meta@public-inbox.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).