Dependencies from pkg-config files
Hi all, I implemented a new rule for namcap [1] to check if dependencies from pkg-config .pc files are satisfied. These are used by the 'pkg-config - -cflags --libs <library name>' command to set the appropriate CFLAGS and LDFAGS when building any dependent (direct and indirect) packages. If any of dependencies specified in 'Requires' or 'Requires.private' fields are missing, pkg-config throws an error. These dependencies are mostly covered by link-level dependencies, but there are some exceptions. Some packages already aware about this (e.g. glib2 -> libsysprof-capture; libx11 -> xorgproto), so we only need to fix a few others. I checked 590 core packages, and I found 13 packages with missing dependencies. [2] I propose the following solutions: - Some missing dependencies (gobject-introspection, systemd, util- linux) are caused because the pkg-config files are packaged separately from the libraries. This shouldn't happen in our distribution, because we don't split development packages. pkg-config files and the related header files should be in the same package where the library is found. - Some packages depend on specific header or data files (xorgproto, wayland-protocols) without linked library in it. Sometimes just a struct is needed from a header file in another package (libxi -> libxfixes). [3] Sometimes a library is used by dlopen() instead of linking (libepoxy -> libglvnd). [4] These should be added as dependencies if defined in a pkg-config file. - If you are sure that the dependency is unnecessarily, then contact with upstream. If no objections, I'll open tasks in Flyspray for these issues. [1] https://gitlab.archlinux.org/pacman/namcap/-/merge_requests/28 [2] https://md.archlinux.org/s/iXr206Xb1 [3] https://gitlab.freedesktop.org/xorg/lib/libxi/-/blob/08431d0684f9a1edf199f6c... [4] https://github.com/anholt/libepoxy/blob/8db879f810e2dbc63824c43c17eeea0d3dbc... #L547-L559 -- Balló György Package Maintainer / Trusted User
On Thu, Mar 02, 2023 at 08:27:50PM +0100, Balló György wrote:
If no objections, I'll open tasks in Flyspray for these issues.
Is there any reason why todo-lists are not suitable for this? -- Morten Linderud PGP: 9C02FF419FECBE16
2023. 03. 2, csütörtök keltezéssel 20.37-kor Morten Linderud ezt írta:
On Thu, Mar 02, 2023 at 08:27:50PM +0100, Balló György wrote:
If no objections, I'll open tasks in Flyspray for these issues.
Is there any reason why todo-lists are not suitable for this?
Because I didn't scan all packages (it would be hard to do that with namcap, because it works only on installed packages), and there are two different tasks with a few packages: Move pkg-config and header files: - gobject-introspection -> gobject-introspection-runtime - systemd -> systemd-libs - util-linux -> util-linux-libs Add missing dependencies (move from makedepends to depends): - gst-plugins-bad-libs: wayland-protocols - libepoxy: libglvnd - libice: xorgproto - libxau: xorgproto - libxdmcp: xorgproto - libxfont2: xorgproto - libxi: libxfixes -- Balló György Package Maintainer / Trusted User
Balló György <bgyorgy@archlinux.org> on Thu, 2023/03/02 20:27:
- Some missing dependencies (gobject-introspection, systemd, util- linux) are caused because the pkg-config files are packaged separately from the libraries. This shouldn't happen in our distribution, because we don't split development packages. pkg-config files and the related header files should be in the same package where the library is found.
For me splitting development packages (to not ship header files) and splitting library packages (to allow lighter dependencies for linked libraries) is something different... Anyway, do we have any guide lines what a library package should contain? I have some of them. :-p -- main(a){char*c=/* Schoene Gruesse */"B?IJj;MEH" "CX:;",b;for(a/* Best regards my address: */=0;b=c[a++];) putchar(b-1/(/* Chris cc -ox -xc - && ./x */b/42*2-3)*42);}
2023. 03. 3, péntek keltezéssel 12.29-kor Christian Hesse ezt írta:
Balló György <bgyorgy@archlinux.org> on Thu, 2023/03/02 20:27:
- Some missing dependencies (gobject-introspection, systemd, util- linux) are caused because the pkg-config files are packaged separately from the libraries. This shouldn't happen in our distribution, because we don't split development packages. pkg-config files and the related header files should be in the same package where the library is found.
For me splitting development packages (to not ship header files) and splitting library packages (to allow lighter dependencies for linked libraries) is something different...
Anyway, do we have any guide lines what a library package should contain? I have some of them. :-p
Basically, anything related to the library itself should be included in a library package. A typical package should contain the followings: - usr/lib/*.so* - the library itself with symlinks - usr/include/* - any header files associated with the library - usr/lib/girepository-1.0/*.typelib - the associated GObject Introspection data in binary format - usr/lib/pkgconfig/*.pc - the associated pkg-config file - usr/lib/python3.10/site-packages/* - any associated Python bindings (can be in a separated python-* package) - usr/share/gir-1.0/*.gir - the associated GObject Introspection data in XML format - usr/share/gtk-doc/ - the associated API documentation (can be in a separated *-docs package if it's large) - usr/share/man/man3/* - the related man pages describing the library functions - usr/share/vala/vapi/* - the associated Vala API file Executables, configuration files, data files, translations are usually not needed in a library package, except if the library itself using any of them directly. So, let's talk about your packages. :) It would be enough to move the following additional stuff to the associated library packages: - systemd -> systemd-libs: usr/include/* usr/lib/pkgconfig/* usr/share/man/man3/* - util-linux -> util-linux-libs: usr/include/* usr/lib/pkgconfig/* usr/lib/python3.10/site-packages/* usr/share/man/man3/* -- Balló György Package Maintainer / Trusted User
Balló György <bgyorgy@archlinux.org> on Fri, 2023/03/03 13:46:
So, let's talk about your packages. :) It would be enough to move the following additional stuff to the associated library packages:
- systemd -> systemd-libs: usr/include/* usr/lib/pkgconfig/* usr/share/man/man3/*
Committed to svn, will be in 253.1-1...
- util-linux -> util-linux-libs: usr/include/* usr/lib/pkgconfig/* usr/lib/python3.10/site-packages/* usr/share/man/man3/*
Pushed in (2.38.1-2 and) 2.38.1-3... Will have to check lvm2, mariadb and probably more. -- main(a){char*c=/* Schoene Gruesse */"B?IJj;MEH" "CX:;",b;for(a/* Best regards my address: */=0;b=c[a++];) putchar(b-1/(/* Chris cc -ox -xc - && ./x */b/42*2-3)*42);}
2023. 03. 3, péntek keltezéssel 15.25-kor Christian Hesse ezt írta:
Balló György <bgyorgy@archlinux.org> on Fri, 2023/03/03 13:46:
So, let's talk about your packages. :) It would be enough to move the following additional stuff to the associated library packages:
- systemd -> systemd-libs: usr/include/* usr/lib/pkgconfig/* usr/share/man/man3/*
Committed to svn, will be in 253.1-1...
- util-linux -> util-linux-libs: usr/include/* usr/lib/pkgconfig/* usr/lib/python3.10/site-packages/* usr/share/man/man3/*
Pushed in (2.38.1-2 and) 2.38.1-3...
Will have to check lvm2, mariadb and probably more.
Looks good. Thanks! :) One more thing: the python optdepend needs to be moved from util-linux to util-linux-libs. -- Balló György Package Maintainer / Trusted User
2023. 03. 3, péntek keltezéssel 15.35-kor Balló György ezt írta:
2023. 03. 3, péntek keltezéssel 15.25-kor Christian Hesse ezt írta:
Balló György <bgyorgy@archlinux.org> on Fri, 2023/03/03 13:46:
So, let's talk about your packages. :) It would be enough to move the following additional stuff to the associated library packages:
- systemd -> systemd-libs: usr/include/* usr/lib/pkgconfig/* usr/share/man/man3/*
Committed to svn, will be in 253.1-1...
- util-linux -> util-linux-libs: usr/include/* usr/lib/pkgconfig/* usr/lib/python3.10/site-packages/* usr/share/man/man3/*
Pushed in (2.38.1-2 and) 2.38.1-3...
Will have to check lvm2, mariadb and probably more.
Looks good. Thanks! :) One more thing: the python optdepend needs to be moved from util-linux to util-linux-libs.
Oh, and an empty /usr/lib/python3.10 directory left in the util-linux package. -- Balló György Package Maintainer / Trusted User
2023. 03. 3, péntek keltezéssel 15.25-kor Christian Hesse ezt írta:
Balló György <bgyorgy@archlinux.org> on Fri, 2023/03/03 13:46:
So, let's talk about your packages. :) It would be enough to move the following additional stuff to the associated library packages:
- systemd -> systemd-libs: usr/include/* usr/lib/pkgconfig/* usr/share/man/man3/*
Committed to svn, will be in 253.1-1...
Oh, you moved wrong .pc files to the systemd-libs package. Files describing the libraries should be moved to systemd-libs: usr/lib/pkgconfig/libsystemd.pc usr/lib/pkgconfig/libudev.pc Files describing the services should be kept in systemd: usr/share/pkgconfig/systemd.pc usr/share/pkgconfig/udev.pc -- Balló György Package Maintainer / Trusted User
Balló György <bgyorgy@archlinux.org> on Mon, 2023/03/06 13:23:
2023. 03. 3, péntek keltezéssel 15.25-kor Christian Hesse ezt írta:
Balló György <bgyorgy@archlinux.org> on Fri, 2023/03/03 13:46:
So, let's talk about your packages. :) It would be enough to move the following additional stuff to the associated library packages:
- systemd -> systemd-libs: usr/include/* usr/lib/pkgconfig/* usr/share/man/man3/*
Committed to svn, will be in 253.1-1...
Oh, you moved wrong .pc files to the systemd-libs package.
Files describing the libraries should be moved to systemd-libs: usr/lib/pkgconfig/libsystemd.pc usr/lib/pkgconfig/libudev.pc
Files describing the services should be kept in systemd: usr/share/pkgconfig/systemd.pc usr/share/pkgconfig/udev.pc
Oh, one path is /usr/lib, the other /usr/share... I think that confused me. About to fix, stay tuned... -- main(a){char*c=/* Schoene Gruesse */"B?IJj;MEH" "CX:;",b;for(a/* Best regards my address: */=0;b=c[a++];) putchar(b-1/(/* Chris cc -ox -xc - && ./x */b/42*2-3)*42);}
On 03.03.23 at 13:46 (UTC+0100), Balló György wrote:
Basically, anything related to the library itself should be included in a library package. A typical package should contain the followings:
- usr/lib/*.so* - the library itself with symlinks
- usr/include/* - any header files associated with the library
- usr/lib/girepository-1.0/*.typelib - the associated GObject Introspection data in binary format
- usr/lib/pkgconfig/*.pc - the associated pkg-config file
- usr/lib/python3.10/site-packages/* - any associated Python bindings (can be in a separated python-* package)
- usr/share/gir-1.0/*.gir - the associated GObject Introspection data in XML format
- usr/share/gtk-doc/ - the associated API documentation (can be in a separated *-docs package if it's large)
- usr/share/man/man3/* - the related man pages describing the library functions
- usr/share/vala/vapi/* - the associated Vala API file
Executables, configuration files, data files, translations are usually not needed in a library package, except if the library itself using any of them directly.
I would like to point out that the split between boost and boost-libs is very weird with respect to the list above...
participants (4)
-
Balló György
-
Christian Hesse
-
Jakub Klinkovský
-
Morten Linderud