Arch Linux

Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#59948 - [gdb]8.2-1 cannot be installed. Conflicts with a file in binutils.

Attached to Project: Arch Linux
Opened by Frederic Bezies (fredbezies) - Wednesday, 05 September 2018, 17:30 GMT
Last edited by Eli Schwartz (eschwartz) - Wednesday, 05 September 2018, 22:31 GMT
Task Type Bug Report
Category Packages: Testing
Status Closed
Assigned To Anatol Pomozov (anatolik)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 3
Private No

Details

Description: Simple bug to reproduce. On an Archlinux testing installation, try to upgrade to gdb 8.2-1...

:: Starting full system upgrade...
resolving dependencies...
looking for conflicting packages...

Packages (6) gdb-8.2-1 gdb-common-8.2-1 linux-4.18.6.arch1-1
linux-headers-4.18.6.arch1-1 picard-2.0.4-1
virtualbox-host-modules-arch-5.2.18-8

Total Installed Size: 176.57 MiB
Net Upgrade Size: -0.18 MiB

:: Proceed with installation? [Y/n]
(6/6) checking keys in keyring [----------------------] 100%
(6/6) checking package integrity [----------------------] 100%
(6/6) loading package files [----------------------] 100%
(6/6) checking for file conflicts [----------------------] 100%
error: failed to commit transaction (conflicting files)
gdb: /usr/include/diagnostics.h exists in filesystem (owned by binutils)
Errors occurred, no packages were upgraded.

This task depends upon

Closed by  Eli Schwartz (eschwartz)
Wednesday, 05 September 2018, 22:31 GMT
Reason for closing:  Fixed
Additional comments about closing:  gdb 8.2-2
Comment by Eli Schwartz (eschwartz) - Wednesday, 05 September 2018, 17:51 GMT
(By the way, attempting to build the package with devtools will fail, during the namcap stage, to install the package.)
Comment by Eli Schwartz (eschwartz) - Wednesday, 05 September 2018, 18:08 GMT
In order to be more future-proof to things like this, I suggest using the builtin Makefile target for preventing conflicting files.

replace:

# resolve conflicts with binutils
rm $pkgdir/usr/include/{ansidecl,bfd,bfdlink,dis-asm,plugin-api,symcat}.h
rm $pkgdir/usr/share/info/bfd.info
rm $pkgdir/usr/lib/{libbfd,libopcodes}.a

with:

make -C bfd DESTDIR="$pkgdir" uninstall
Comment by Eli Schwartz (eschwartz) - Wednesday, 05 September 2018, 19:03 GMT
Thanks for the fix.

I messed around with it a bit more, and it could be simplified further (no need for another pkgrel bump this time):

replace:
make DESTDIR=$pkgdir install
make -C bfd DESTDIR=$pkgdir uninstall

with:

make -C gdb DESTDIR="$pkgdir" install

also gdb-common can replace its whole rm -r lots-of-stuff, by using the make target:

make -C gdb/data-directory DESTDIR="$pkgdir" install

(Obviously again you no longer need to uninstall bfd)

I tried to see if you could *just* configure, make, make install inside the gdb/ subdirectory, but then it errors with:
make: *** No rule to make target '../bfd/libbfd.a', needed by 'gdb'. Stop.

:(

Unfortunately the build system seems to be very very specific about wanting the internal copy only. Which is ever so slightly awkward when building gdb and binutils separately... but eh, it is just extra build time AFAICT.

OTOH make install, can at least be confined to gdb/ I think, since it should not be depending on anything outside that subdirectory except as static libraries used for internal compilation.
Comment by Anatol Pomozov (anatolik) - Wednesday, 05 September 2018, 21:42 GMT
The fix has been pushed to the testing repos. Please verify that it works as expected.

Thanks Eli for providing better install command for `gdb` package.

Loading...