public inbox for elfutils@sourceware.org
 help / color / mirror / Atom feed
From: Mark Wielaard <mark@klomp.org>
To: "Frank Ch. Eigler" <fche@redhat.com>, elfutils-devel@sourceware.org
Cc: amerey@redhat.com
Subject: Re: patch 1/2 debuginfod client
Date: Tue, 12 Nov 2019 11:12:00 -0000	[thread overview]
Message-ID: <0bdee1935e9cce5e7ae6804d6d6335cf8ab97b7b.camel@klomp.org> (raw)
In-Reply-To: <20191028190602.GD14349@redhat.com>

Hi,

On Mon, 2019-10-28 at 15:06 -0400, Frank Ch. Eigler wrote:
> From 3e1f8d93569004d06902459d84baceb636e139d5 Mon Sep 17 00:00:00 2001
> From: Aaron Merey <amerey@redhat.com>
> Date: Mon, 28 Oct 2019 13:29:26 -0400
> Subject: [PATCH 1/2] debuginfod 1/2: client side
> 
> Introduce the debuginfod/ subdirectory, containing the client for a
> new debuginfo-over-http service, in shared-library and command-line
> forms.  Two functions in libdwfl make calls into the client library to
> fetch elf/dwarf files by buildid, as a fallback.  Instead of normal
> dynamic linking (thus pulling in a variety of curl dependencies),
> the libdwfl hooks use dlopen/dlsym.  Server & tests coming in patch 2.
> 
> Signed-off-by: Aaron Merey <amerey@redhat.com>
> Signed-off-by: Frank Ch. Eigler <fche@redhat.com>

A few comments on the first (top-level) part, just to make progress.

> diff --git a/ChangeLog b/ChangeLog
> index 911cf35432c9..4f33657df976 100644
> --- a/ChangeLog
> +++ b/ChangeLog
> @@ -1,3 +1,9 @@
> +2019-10-28  Aaron Merey  <amerey@redhat.com>
> +
> +	* debuginfod/: New directory for debuginfod code.
> +	* Makefile.am (SUBDIRS): Recurse there.
> +	* configure.ac (--enable-debuginfod): New flag & checks.
> +
>  2019-07-05  Omar Sandoval  <osandov@fb.com>
>  
>  	* configure.ac: Get rid of --enable-libebl-subdir.
> diff --git a/Makefile.am b/Makefile.am
> index 52f64fc904f4..bd8926b52344 100644
> --- a/Makefile.am
> +++ b/Makefile.am
> @@ -29,6 +29,10 @@ pkginclude_HEADERS = version.h
>  SUBDIRS = config m4 lib libelf libcpu backends libebl libdwelf libdwfl libdw \
>  	  libasm src po doc tests
>  
> +if DEBUGINFOD
> +SUBDIRS += debuginfod
> +endif
> +
>  EXTRA_DIST = elfutils.spec GPG-KEY NOTES CONTRIBUTING \
>  	     COPYING COPYING-GPLV2 COPYING-LGPLV3

I was afraid this wouldn't play nice with make dist, but ...

"If SUBDIRS is defined conditionally using Automake
conditionals, Automake will define DIST_SUBDIRS automatically
from the possible values of SUBDIRS in all conditions."
https://www.gnu.org/software/automake/manual/html_node/SUBDIRS-vs-DIST_005fSUBDIRS.html

So this is fine.

> diff --git a/config/Makefile.am b/config/Makefile.am
> index 9d292cee66c8..6425718efc54 100644
> --- a/config/Makefile.am
> +++ b/config/Makefile.am
> @@ -32,7 +32,7 @@ EXTRA_DIST = elfutils.spec.in known-dwarf.awk 10-default-yama-scope.conf
>  	     libelf.pc.in libdw.pc.in
>  
>  pkgconfigdir = $(libdir)/pkgconfig
> -pkgconfig_DATA = libelf.pc libdw.pc
> +pkgconfig_DATA = libelf.pc libdw.pc libdebuginfod.pc
>  
>  if MAINTAINER_MODE
>  $(srcdir)/elfutils.spec.in: $(top_srcdir)/NEWS

Nice to have a separate libdebuginfod.pc

> diff --git a/config/libdebuginfod.pc.in b/config/libdebuginfod.pc.in
> new file mode 100644
> index 000000000000..46722a76b593
> --- /dev/null
> +++ b/config/libdebuginfod.pc.in
> @@ -0,0 +1,12 @@
> +prefix=@prefix@
> +exec_prefix=@exec_prefix@
> +libdir=@libdir@
> +includedir=@includedir@
> +
> +Name: debuginfod
> +Description: elfutils library to query debuginfo files from debuginfod servers
> +Version: @VERSION@
> +URL: http://elfutils.org/
> +
> +Libs: -L${libdir} -ldebuginfod
> +Cflags: -I${includedir}

No Requires on libelf or libdw?

> diff --git a/configure.ac b/configure.ac
> index 9be34d124387..738a96f18bf5 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -60,6 +60,8 @@ AC_CONFIG_FILES([m4/Makefile])
>  dnl The RPM spec file.  We substitute a few values in the file.
>  AC_CONFIG_FILES([elfutils.spec:config/elfutils.spec.in])
>  
> +dnl debuginfo-server client & server parts.
> +AC_CONFIG_FILES([debuginfod/Makefile])
>  
>  AC_CANONICAL_HOST
>  
> @@ -86,6 +88,8 @@ AS_IF([test "$use_locks" = yes],
>  AH_TEMPLATE([USE_LOCKS], [Defined if libraries should be thread-safe.])
>  
>  AC_PROG_CC
> +AC_PROG_CXX
> +AX_CXX_COMPILE_STDCXX(11, noext, optional)
>  AC_PROG_RANLIB
>  AC_PROG_YACC
>  AM_PROG_LEX
> @@ -538,7 +542,7 @@ AM_CONDITIONAL(STANDALONE, false)dnl Used in tests/Makefile.am, which see.
>  AC_CONFIG_FILES([tests/Makefile])
>  
>  dnl pkgconfig files
> -AC_CONFIG_FILES([config/libelf.pc config/libdw.pc])
> +AC_CONFIG_FILES([config/libelf.pc config/libdw.pc config/libdebuginfod.pc])

My only concern is that these might slow down configure when debuginfod
isn't enabled? Can/Should they be moved later after the enable test?

>  # Get the definitions necessary to create the Makefiles in the po
>  # subdirectories.  This is a small subset of the gettext rules.
> @@ -641,6 +645,22 @@ if test "$HAVE_BUNZIP2" = "no"; then
>    AC_MSG_WARN([No bunzip2, needed to run make check])
>  fi
>  
> +# Look for libmicrohttpd, libcurl, libarchive, sqlite for debuginfo server
> +# minimum versions as per rhel7.  Single --enable-* option arranges to build
> +# both client libs and server process.
> +
> +PKG_PROG_PKG_CONFIG
> +AC_ARG_ENABLE([debuginfod], AC_HELP_STRING([--enable-debuginfod], [Build debuginfo server and client solib]))
> +AS_IF([test "x$enable_debuginfod" = "xyes"], [
> +    AC_DEFINE([ENABLE_DEBUGINFOD],[1],[Build debuginfo-server])
> +    PKG_CHECK_MODULES([libmicrohttpd],[libmicrohttpd >= 0.9.33])
> +    PKG_CHECK_MODULES([libcurl],[libcurl >= 7.29.0])
> +    PKG_CHECK_MODULES([sqlite3],[sqlite3 >= 3.7.17])
> +    PKG_CHECK_MODULES([libarchive],[libarchive >= 3.1.2])
> +], [enable_debuginfod="no"])
> +AM_CONDITIONAL([DEBUGINFOD],[test "x$enable_debuginfod" = "xyes"])

Would it be better to enable by default with an error to disable if any
dependencies (and CXX compiler?) aren't found?

If not, then I think you should add it explicitly to the
AM_DISTCHECK_CONFIGURE_FLAGS in Makefile.am.

>  AC_OUTPUT
>  
>  AC_MSG_NOTICE([
> @@ -669,6 +689,7 @@ AC_MSG_NOTICE([
>    OTHER FEATURES
>      Deterministic archives by default  : ${default_ar_deterministic}
>      Native language support            : ${USE_NLS}
> +    Debuginfo server support           : ${enable_debuginfod}

client and server support?

Cheers,

Mark

  parent reply	other threads:[~2019-11-12 11:12 UTC|newest]

Thread overview: 78+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-28 19:04 patch 0/2 debuginfod submission Frank Ch. Eigler
2019-10-28 19:06 ` patch 1/2 debuginfod client Frank Ch. Eigler
2019-10-28 19:09   ` patch 2/2 debuginfod server etc Frank Ch. Eigler
2019-11-04 21:48     ` patch 3/3 debuginfod client interruptability Frank Ch. Eigler
2019-11-07  9:07       ` patch 4 debuginfod: symlink following mode Frank Ch. Eigler
2019-11-07  9:08         ` patch 5 debuginfod: prometheus metrics Frank Ch. Eigler
2019-11-15 17:26           ` Mark Wielaard
2019-11-15 17:58             ` Frank Ch. Eigler
2019-11-18 16:20               ` Mark Wielaard
2019-11-18 16:48                 ` Frank Ch. Eigler
2019-11-19 16:13                   ` Mark Wielaard
2019-11-15 16:49         ` patch 4 debuginfod: symlink following mode Mark Wielaard
2019-11-15 18:31           ` Frank Ch. Eigler
2019-11-18 16:27             ` Mark Wielaard
2019-11-15 16:16       ` patch 3/3 debuginfod client interruptability Mark Wielaard
2019-11-15 17:03         ` Aaron Merey
2019-11-15 17:35           ` Mark Wielaard
2019-11-15 18:14             ` Pedro Alves
2019-11-17 23:44               ` Mark Wielaard
2019-11-18  2:50                 ` Frank Ch. Eigler
2019-11-18  9:24                   ` Pedro Alves
2019-11-19 12:58                   ` Mark Wielaard
2019-11-13 17:22     ` patch 2/2 debuginfod server etc Mark Wielaard
2019-11-14 11:54       ` Frank Ch. Eigler
2019-11-16  1:31         ` Mark Wielaard
2019-11-13 23:19     ` Mark Wielaard
2019-11-14 12:30       ` Frank Ch. Eigler
2019-11-18 14:17         ` Mark Wielaard
2019-11-18 18:41           ` Frank Ch. Eigler
2019-11-19 15:41             ` Mark Wielaard
2019-11-19 16:13               ` Frank Ch. Eigler
2019-11-19 20:11                 ` Mark Wielaard
2019-11-19 21:15                   ` Frank Ch. Eigler
2019-11-20 11:53                     ` Mark Wielaard
2019-11-20 12:29                       ` Frank Ch. Eigler
2019-11-21 14:16                       ` Mark Wielaard
2019-11-21 15:40                         ` Mark Wielaard
2019-11-21 16:01                           ` Frank Ch. Eigler
2019-11-21 15:58                         ` Frank Ch. Eigler
2019-11-21 16:37                           ` Mark Wielaard
2019-11-21 17:18                             ` Frank Ch. Eigler
2019-11-21 20:42                               ` Mark Wielaard
2019-11-22 12:08                                 ` Mark Wielaard
2019-11-14 20:45     ` Mark Wielaard
2019-11-15 11:03       ` Mark Wielaard
2019-11-15 21:00       ` Frank Ch. Eigler
2019-11-18 15:01         ` Mark Wielaard
2019-11-15 14:40     ` Mark Wielaard
2019-11-15 19:54       ` Frank Ch. Eigler
2019-11-18 15:31         ` Mark Wielaard
2019-11-18 15:49           ` Frank Ch. Eigler
2019-11-12 11:12   ` Mark Wielaard [this message]
2019-11-12 15:14     ` patch 1/2 debuginfod client Frank Ch. Eigler
2019-11-12 21:59       ` Mark Wielaard
2019-11-14  0:33         ` Frank Ch. Eigler
2019-11-15 21:33       ` Mark Wielaard
2019-11-12 21:25   ` Mark Wielaard
2019-11-13 23:25     ` Frank Ch. Eigler
2019-11-16  0:46       ` Mark Wielaard
2019-11-16 18:53         ` Frank Ch. Eigler
2019-11-18 17:17           ` Mark Wielaard
2019-11-18 20:33             ` Frank Ch. Eigler
2019-11-19 15:57               ` Mark Wielaard
2019-11-19 16:20                 ` Frank Ch. Eigler
2019-11-19 20:16                   ` Mark Wielaard
2019-11-19 21:22                     ` Frank Ch. Eigler
2019-11-20 12:50                       ` Mark Wielaard
2019-11-20 13:30                         ` Frank Ch. Eigler
2019-11-21 14:02                           ` Mark Wielaard
2019-11-13 13:57   ` Mark Wielaard
2019-11-14 11:24     ` Frank Ch. Eigler
2019-11-16  0:52       ` Mark Wielaard
2019-11-16  2:28         ` Frank Ch. Eigler
2019-10-30 11:04 ` patch 0/2 debuginfod submission Mark Wielaard
2019-10-30 13:40   ` Frank Ch. Eigler
2019-10-30 14:12     ` Mark Wielaard
2019-10-30 18:11       ` Frank Ch. Eigler
2019-10-31 11:18         ` Mark Wielaard

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

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

  git send-email \
    --in-reply-to=0bdee1935e9cce5e7ae6804d6d6335cf8ab97b7b.camel@klomp.org \
    --to=mark@klomp.org \
    --cc=amerey@redhat.com \
    --cc=elfutils-devel@sourceware.org \
    --cc=fche@redhat.com \
    /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).