From: Stanislav Fomichev <sdf@fomichev.me>
To: Daniel Borkmann <daniel@iogearbox.net>
Cc: Luca Boccassi <bluca@debian.org>, netdev@vger.kernel.org
Subject: Re: [PATCH bpf-next v2] tools/bpf: generate pkg-config file for libbpf
Date: Wed, 20 Mar 2019 14:13:49 -0700 [thread overview]
Message-ID: <20190320211349.GP7431@mini-arch.hsd1.ca.comcast.net> (raw)
In-Reply-To: <a34fde7a-ad46-60fd-ff62-d67405980e2d@iogearbox.net>
On 03/20, Daniel Borkmann wrote:
> On 03/20/2019 09:44 PM, Stanislav Fomichev wrote:
> > On 03/20, Luca Boccassi wrote:
> >> On Wed, 2019-03-20 at 10:21 -0700, Stanislav Fomichev wrote:
> >>> On 03/20, Luca Boccassi wrote:
> >>>> On Wed, 2019-03-20 at 13:22 +0000, Luca Boccassi wrote:
> >>>>> On Tue, 2019-03-19 at 16:17 -0700, Stanislav Fomichev wrote:
> >>>>>> On 03/19, Luca Boccassi wrote:
> >>>>>>> Generate a libbpf.pc file at build time so that users can
> >>>>>>> rely
> >>>>>>> on pkg-config to find the library, its CFLAGS and LDFLAGS.
> >>>>>>>
> >>>>>>> Signed-off-by: Luca Boccassi <bluca@debian.org>
> >>>>>>> ---
> >>>>>>> v2: use QUIET_GEN instead of QUIET_LINK to generate pc file,
> >>>>>>> save kernel version in its own variable instead of
> >>>>>>> calling
> >>>>>>> make inline
> >>>>>>>
> >>>>>>> tools/lib/bpf/.gitignore | 1 +
> >>>>>>> tools/lib/bpf/Makefile | 19 ++++++++++++++++---
> >>>>>>> tools/lib/bpf/libbpf.pc.template | 11 +++++++++++
> >>>>>>> 3 files changed, 28 insertions(+), 3 deletions(-)
> >>>>>>> create mode 100644 tools/lib/bpf/libbpf.pc.template
> >>>>>>>
> >>>>>>> diff --git a/tools/lib/bpf/.gitignore
> >>>>>>> b/tools/lib/bpf/.gitignore
> >>>>>>> index 4db74758c674..7d9e182a1f51 100644
> >>>>>>> --- a/tools/lib/bpf/.gitignore
> >>>>>>> +++ b/tools/lib/bpf/.gitignore
> >>>>>>> @@ -1,3 +1,4 @@
> >>>>>>> libbpf_version.h
> >>>>>>> +libbpf.pc
> >>>>>>> FEATURE-DUMP.libbpf
> >>>>>>> test_libbpf
> >>>>>>> diff --git a/tools/lib/bpf/Makefile b/tools/lib/bpf/Makefile
> >>>>>>> index a05c43468bd0..1df3ebfb3118 100644
> >>>>>>> --- a/tools/lib/bpf/Makefile
> >>>>>>> +++ b/tools/lib/bpf/Makefile
> >>>>>>> @@ -80,6 +80,7 @@ libdir_SQ = $(subst ','\'',$(libdir))
> >>>>>>> libdir_relative_SQ = $(subst ','\'',$(libdir_relative))
> >>>>>>>
> >>>>>>> LIB_FILE = libbpf.a libbpf.so
> >>>>>>> +PC_FILE = libbpf.pc
> >>>>>>>
> >>>>>>> VERSION = $(BPF_VERSION)
> >>>>>>> PATCHLEVEL = $(BPF_PATCHLEVEL)
> >>>>>>> @@ -89,6 +90,7 @@ OBJ = $@
> >>>>>>> N =
> >>>>>>>
> >>>>>>> LIBBPF_VERSION =
> >>>>>>> $(BPF_VERSION).$(BPF_PATCHLEVEL).$(BPF_EXTRAVERSION)
> >>>>>>> +KERNEL_VERSION = $(shell make --no-print-directory -sC
> >>>>>>> ../../..
> >>>>>>> kernelversion)
> >>>>>> Oh, we do already have LIBBPF_VERSION, why not use that? This
> >>>>>> way
> >>>>>> you don't need to do anything for out-of-tree libbpf from
> >>>>>> github.
> >>>>>>
> >>>>>> I don't remember what was the strategy regarding libbpf
> >>>>>> versioning,
> >>>>>> but
> >>>>>> that 0.0.1 should be changed to something sensible (be set to
> >>>>>> the
> >>>>>> kernel
> >>>>>> version upon release?)
> >>>>>
> >>>>> [re-sending as reply via phone added html and the list daemon
> >>>>> said
> >>>>> no-
> >>>>> no]
> >>>>>
> >>>>> That looks like the ABI version though, rather than the source
> >>>>> version?
> >>>>> The source version is more appropriate for the PC file
> >>>>
> >>>> That said, the versioning looks looks like it could use some love
> >>>> and
> >>>> it's not really a factor that should gate a pkg-config file and
> >>>> could
> >>>> be done separately if required, so in v3 I've removed
> >>>> KERNEL_VERSION
> >>>> and used LIBBPF_VERSION as you suggested.
> >>> Agree :-) There was some conversation recently about incrementing it
> >>> per
> >>> kernel release vs real api change. I don't remember what the outcome
> >>> was exactly.
> >>
> >> I see, thanks. Anything else you'd like me to change?
> > No, everything looks good to me, wait for the reply from the bpf
> > maintainers.
>
> Current workflow regarding libbpf versioning is that version number
> increase is synced with kernel release. Meaning, new development cycle
> we bump the version when we e.g. add entries into libbpf.map file for
> new api functions.
So it will have its own version, not matching the kernel? I thought we
would keep it 0.0.X until we figure things out and then just follow the
kernel. (I'm fine either way, just wondering).
It's still 0.0.1 in Linus's tree, bpf and in bpf-next btw, even though we
already have LIBBPF_0.0.2 in the libbpf.map file :-)
next prev parent reply other threads:[~2019-03-20 21:13 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-19 21:06 [PATCH bpf-next] tools/bpf: generate pkg-config file for libbpf Luca Boccassi
2019-03-19 21:23 ` Stanislav Fomichev
2019-03-19 23:02 ` Luca Boccassi
2019-03-19 23:12 ` Stanislav Fomichev
2019-03-19 23:00 ` [PATCH bpf-next v2] " Luca Boccassi
2019-03-19 23:17 ` Stanislav Fomichev
2019-03-20 13:22 ` Luca Boccassi
2019-03-20 13:30 ` Luca Boccassi
2019-03-20 17:21 ` Stanislav Fomichev
2019-03-20 20:39 ` Luca Boccassi
2019-03-20 20:44 ` Stanislav Fomichev
2019-03-20 20:54 ` Daniel Borkmann
2019-03-20 21:13 ` Stanislav Fomichev [this message]
2019-03-20 13:28 ` [PATCH bpf-next v3] " luca.boccassi
2019-03-20 23:58 ` Andrey Ignatov
2019-03-21 10:29 ` Luca Boccassi
2019-03-21 10:25 ` [PATCH bpf-next v4] " luca.boccassi
2019-03-21 16:00 ` Andrey Ignatov
2019-03-21 22:01 ` Alexei Starovoitov
2019-03-21 22:19 ` Daniel Borkmann
2019-03-21 22:34 ` Luca Boccassi
2019-03-21 22:23 ` Luca Boccassi
2019-03-21 22:27 ` [PATCH bpf-next v5] " luca.boccassi
2019-03-21 22:33 ` [PATCH bpf-next v6] " luca.boccassi
2019-03-21 22:43 ` Alexei Starovoitov
2019-03-21 23:10 ` Luca Boccassi
2019-03-21 23:09 ` [PATCH bpf-next v7] " luca.boccassi
2019-03-26 20:12 ` Alexei Starovoitov
2019-03-26 20:17 ` Luca Boccassi
2019-03-28 11:33 ` [PATCH bpf-next v8] " luca.boccassi
2019-03-28 16:09 ` Daniel Borkmann
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=20190320211349.GP7431@mini-arch.hsd1.ca.comcast.net \
--to=sdf@fomichev.me \
--cc=bluca@debian.org \
--cc=daniel@iogearbox.net \
--cc=netdev@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.