Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Usrmerge in bookwork images causes issues with dpkg-query -S #199

Open
ederuiter opened this issue Jun 29, 2023 · 2 comments
Open

Usrmerge in bookwork images causes issues with dpkg-query -S #199

ederuiter opened this issue Jun 29, 2023 · 2 comments

Comments

@ederuiter
Copy link

Not sure where this issue belongs as it there are a couple of issues that all compound to this issue.

I came across this issue when debugging an issue with the latest phpmyadmin docker image.

This image installs some dev packages and compiles a couple of php extensions and then uses ldd on the resulting extensions .so files together with dpkg-query -S to find the packages that need to be kept after the build.

Note: this pattern does seem to be used by more php based containers.

The issue is that the ldd output points to /lib/x86_64-linux-gnu but most packages don't install files to /lib, but to /usr/lib .. and dpkg-query does not detect that these are effectively the same files (see https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=858331 and https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=848622)

The reason the ldd output point to /lib/x86_64-linux-gnu instead of /usr/lib/x86_64-linux-gnu because both of the paths are in /etc/ld.so.conf.d/x86_64-linux-gnu.conf and it appears the first one take precedence

Removing the /lib/x86_64-linux-gnu line from the ld.so.conf fixes the ldd output; but does not fix the problem.

This is because some packages (for example libbz2-1.0) are still installing to /lib/ instead of /usr/lib so dpkg-query -S does not find these .. and worse even if we would lookup the realpath before calling dpkg-query -S it still does not find them as /usr/lib is the realpath

So in my opinion there are 3 issues:

  1. dpkg-query does not handle soft links (ideally both the install path + given path should be normalized before comparing)
  2. packages still install to /lib instead of /usr/lib
  3. ld.so.conf should only list /usr/lib and not /lib (can only be done after issue 2 is fixed for all packages)

Imho fixing 1 would be the easiest as that would workaround issues 2 & 3.

@tianon
Copy link
Contributor

tianon commented Jul 3, 2023

Sorry for the delay here, I've been meaning to get back to this for days. 🙇

There's not really anything we can do here in the Docker image itself -- we're faithfully following what the Debian project at large has decided, and the two bugs you've linked are unfortunately the appropriate place to track this bug/misfeature.

@ederuiter
Copy link
Author

👌 Let's see what upstream says about this proposal: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=848622#27

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants