From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.5 required=3.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_PASS,USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7ED9AC43381 for ; Wed, 20 Mar 2019 21:13:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4E974218AE for ; Wed, 20 Mar 2019 21:13:53 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=fomichev-me.20150623.gappssmtp.com header.i=@fomichev-me.20150623.gappssmtp.com header.b="wU6qSVKQ" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727572AbfCTVNv (ORCPT ); Wed, 20 Mar 2019 17:13:51 -0400 Received: from mail-pf1-f194.google.com ([209.85.210.194]:45751 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727116AbfCTVNv (ORCPT ); Wed, 20 Mar 2019 17:13:51 -0400 Received: by mail-pf1-f194.google.com with SMTP id v21so2786670pfm.12 for ; Wed, 20 Mar 2019 14:13:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fomichev-me.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=0EPLp8rAvSxwL2jeOuXFzLpXetyUtse7jfu8jzncvTw=; b=wU6qSVKQCwBUlnNIpdM6L/f4dRiw2m5HAsypc8BvsKrYjKKod5zPh0PgKff4Lo0xYU LYHUUSdkQTQwWFPku4uXv7qohZbMCIe863YcKFyXiioxC1A0M45JUBTdUn+Y0gVEZXAp dvyXdnNqAiF93EfV9UT012tNVt0lG8I985CjH3o7aozij8Qjwb8jKBn6PHuglUUXz7Bt hpiQpxl1ezQXSiVc+HwAPb3N5LQZM+F/ADPD9j+hVHkWdY+ivGFi6cEPou0fZIoUuUbd ciGBVXSfoTTT3oVBzGBQAyFynMfumdWmAMUy+dnwokxNhFlTA1vvaZukwR8b+CzRIisb +odQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=0EPLp8rAvSxwL2jeOuXFzLpXetyUtse7jfu8jzncvTw=; b=LHP+AQLCVMMvL1iXKlP/ZCC9cVFeOBzHZMXyvx4FKsGft/TnupVkjCjTzb5v89qax6 Une/jvira6i0twrqFWrySu0h/cxUcB7lqQ8Nd2/QJxWfzqpKYIZ2qoIj7Svjob1Oswjy jIN/PbWwLrPCxXGkmryiA1ux3KJx4rWZrUkJmtJToF4YMCZPhWrhq8mM0qBq8kgxfXR4 cOruIezpa0DVJv2Htx4s4z0xRSd13t9HwWK7HCiSEWrUN11FTVaOyTXkvxSsPAuo+waG 8BO9RAQjC7hA1rJ+aezI8oQusVZ4HSzKHk1CvfOTGUQo6N7VdJ+UX59cCVZ13SeWBV+M BV4A== X-Gm-Message-State: APjAAAVUCzc/SBPv48e33jF0/f2IVFlPygLNpVvIOzAcZkYMMlEwYATb 2uT+k7IYAfpXtNzbgaRErHUdmDw7EtQ= X-Google-Smtp-Source: APXvYqzE25ilDrO9Ny4nmWBxVxQ5MbrO4WY0DfeEd73csw8P++Mhzul4wRfDxUjEpovBlCjmqK8KdA== X-Received: by 2002:a17:902:7590:: with SMTP id j16mr10158667pll.304.1553116430678; Wed, 20 Mar 2019 14:13:50 -0700 (PDT) Received: from localhost ([2601:646:8f00:18d9:d0fa:7a4b:764f:de48]) by smtp.gmail.com with ESMTPSA id r10sm3517801pfn.188.2019.03.20.14.13.49 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 20 Mar 2019 14:13:49 -0700 (PDT) Date: Wed, 20 Mar 2019 14:13:49 -0700 From: Stanislav Fomichev To: Daniel Borkmann Cc: Luca Boccassi , netdev@vger.kernel.org Subject: Re: [PATCH bpf-next v2] tools/bpf: generate pkg-config file for libbpf Message-ID: <20190320211349.GP7431@mini-arch.hsd1.ca.comcast.net> References: <20190319210639.6282-1-bluca@debian.org> <20190319230042.32087-1-bluca@debian.org> <20190319231713.GG7431@mini-arch.hsd1.ca.comcast.net> <20190320172114.GK7431@mini-arch.hsd1.ca.comcast.net> <20190320204438.GO7431@mini-arch.hsd1.ca.comcast.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.11.3 (2019-02-01) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org 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 > >>>>>>> --- > >>>>>>> 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 :-)