FS#66755 - [makepkg] debug packages may keep source files in their original directories
Attached to Project:
Pacman
Opened by magiblot (magiblot) - Saturday, 23 May 2020, 14:55 GMT
Last edited by Allan McRae (Allan) - Monday, 02 May 2022, 14:00 GMT
Opened by magiblot (magiblot) - Saturday, 23 May 2020, 14:55 GMT
Last edited by Allan McRae (Allan) - Monday, 02 May 2022, 14:00 GMT
|
Details
Summary and Info:
When building certain debug packages, source files are kept in their original directories instead of being moved to `/usr/src/debug`. Steps to Reproduce: 1. `asp checkout qt5-base` 2. Edit PKGBUILD and add the following: - `options+=(debug)`. - `-no-strip` argument to the `configure` script. 3. Build the package with makepkg. 4. The debug package now contains files in their current filesystem path. Pacman may warn about this conflict when installing the debug package. I attach the `tree` output for the `pkg/qt5-base-debug` folder produced by `makepkg`. Note how some files are under the `/tmp` directory. |
This task depends upon
Closed by Allan McRae (Allan)
Monday, 02 May 2022, 14:00 GMT
Reason for closing: Fixed
Additional comments about closing: git commit ae2f506ddfd11d9becda7216033fe1b159536982
Monday, 02 May 2022, 14:00 GMT
Reason for closing: Fixed
Additional comments about closing: git commit ae2f506ddfd11d9becda7216033fe1b159536982
According to man PKGBUILD, the special CFLAGS/CXXFLAGS used with option 'debug' are the ones in makepkg.conf, that is, '-g -fvar-tracking-assignments'. Does this mean the conflicting source files will be moved to '/usr/src/debug/' if I find some way to compile them with these flags?
Anyway, it is undesired behaviour for makepkg to copy source files outside '/usr/src/debug' in debug packages, but again I don't know how this is done. Is there an easy way for makepkg to detect such files and simply not copy them? If not, could it at least print a warning?
Thanks.
If the upstream software doesn't respect CFLAGS/CXXFLAGS, then the -fdebug-prefix-map fails to do what it's supposed to, and paths are left pointing outside of /usr/src/debug. The software therefore doesn't support debug packages.
I see two separate issues here:
1. Files not respecting CFLAGS/CXXFLAGS may be left pointing to an unexisting or newer-than-executable source file. In my case, I was building under '/tmp' so those source files were lost after rebooting. makepkg can do nothing to prevent this, but the user may find some way to make the software respect those variables.
2. Files being installed to unexpected locations. This is uncomfortable and confusing, and may also be dangerous. It looks like makepkg could be changed not to assume all debuginfo paths are properly remapped and filter out those which are not.
So my suggestion is to change makepkg so that files that have not been remapped inside '/usr/src/debug' are excluded from debug packages and, ideally, print a warning so that the user can try to fix this on their own.
Thanks.