#2 fix pkgconfig to show the real version, not the incorrect version from src/libbpf.map
Opened 2 years ago by salimma. Modified 2 years ago
rpms/ salimma/libbpf fix-pkgconfig-ver  into  rawhide

file modified
+7 -4
@@ -5,7 +5,7 @@ 

  

  Name:           %{githubname}

  Version:        %{githubver}

- Release:        2%{?dist}

+ Release:        3%{?dist}

  Summary:        Libbpf library

  

  License:        LGPLv2 or BSD
@@ -51,7 +51,7 @@ 

  %autosetup -n %{githubfull}

  

  %build

- %make_build -C ./src %{make_flags}

+ %make_build -C ./src %{make_flags} LIBBPF_VERSION=%{version}

  

  %install

  %make_install -C ./src %{make_flags}
@@ -69,8 +69,11 @@ 

  %{_libdir}/libbpf.a

  

  %changelog

- * Tue Feb 08 2022 Jiri Olsa <jolsa@redhat.com> - 2:0.6.1-1

- - release 0.6.1-1

+ * Thu Feb 10 2022 Michel Alexandre Salim <salimma@fedoraproject.org> - 2:0.6.1-3

+ - fix pkgconfig to show the real version, not the incorrect version from src/libbpf.map

+ 

+ * Tue Feb 08 2022 Jiri Olsa <jolsa@redhat.com> - 2:0.6.1-2

+ - release 0.6.1-2

  

  * Thu Jan 20 2022 Fedora Release Engineering <releng@fedoraproject.org> - 2:0.5.0-2

  - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild

This upstream commit: https://github.com/libbpf/libbpf/commit/8ade99a6f84d0d7e70965451533b8d76926ee391 stops the libbpf version from being dynamically generated; instead it is sourced from libbpf.map. But libbpf.map only lists 0.x.0 versions - since presumably the ABI is unchanged between patch releases.

Unfortunately this then leaks to the Makefile, which means it leaks to libbpf.pc, which means libbpf-0.6.1 claims to be 0.6.0 and any app depending on 0.6.1 fails to find its dependencies.

Fix by overriding LIBBPF_VERSION when building.

Reported upstream: https://github.com/libbpf/libbpf/issues/455

Also update the changelog, looks like when 0.6.1 was built the release field was not reset back to 1, so the changelog entry was inconsistent.

Signed-off-by: Michel Alexandre Salim salimma@fedoraproject.org

Per Bugzilla, copying here for visibility:

Note: talked to Andrii who did the patch to source the version from libbpf.map
- he's going to start recording PATCH_VERSION and use that in Makefile, so the version will be correct in any newer patch releases
- 0.7.0 is out, so the version sourced from libbpf.map is currently correct if we bump to 0.7.0

Given that, I think updating to 0.7.0 is probably better than overriding the version when calling make

I'll check if we can bump to 0.7.0 already, but usually we have to wait for kernel-headers to pick up the latest changes, like for 0.6.1

thanks

fyi I just built 0.7.0

Metadata