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#44921 - [gdb] Should be built against python 3?

Attached to Project: Arch Linux
Opened by Daniel Noland (daniel.noland) - Saturday, 09 May 2015, 18:49 GMT
Last edited by Anatol Pomozov (anatolik) - Saturday, 01 August 2015, 23:54 GMT
Task Type Feature Request
Category Packages: Extra
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 2
Private No

Details

Description:

extra/gdb (v 7.9) is currently compiled against python 2. My understanding is that unless there is a good reason to stick with 2, Arch policy is to build against python 3.

I was able to build this package against python 3 using a trivial modification to the existing PKGBUILD.

Since then I have put my gdb through a bunch of tests (tho more are likely in order) and everything seems to work fine. Both versions of python are supported upstream.

Is there some problem with upgrading to python 3 in gdb or would it be better to make a gdb-python3 package in the AUR?

Additional info:
* package version(s)
GNU gdb (GDB) 7.9
Copyright (C) 2015 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-unknown-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word".

* config and/or log files etc.

Here is the modified PKGBUILD

# Maintainer: Allan McRae <allan@archlinux.org>
# Contributor: Jan de Groot <jgc@archlinux.org>

pkgname=gdb
pkgver=7.9
pkgrel=2
pkgdesc='The GNU Debugger'
arch=('i686' 'x86_64')
url="http://www.gnu.org/software/gdb/"
license=('GPL3')
depends=('ncurses' 'expat' 'python' 'xz' 'guile')
makedepends=('texinfo')
backup=('etc/gdb/gdbinit')
install=gdb.install
source=(http://ftp.gnu.org/gnu/gdb/${pkgname}-${pkgver}.tar.xz{,.sig})
sha1sums=('1dabff2168bd8fe3cadf9386e47a47c527ea99ba'
'SKIP')
validpgpkeys=('F40ADB902B24264AA42E50BF92EDB04BFF325CF3') # Joel Brobecker

prepare() {
cd gdb-$pkgver

# hack! - libiberty configure tests for header files using "$CPP $CPPFLAGS"
sed -i "/ac_cpp=/s/\$CPPFLAGS/\$CPPFLAGS -O2/" libiberty/configure
}

build() {
cd gdb-$pkgver

# guile support has a severe bug https://sourceware.org/bugzilla/show_bug.cgi?id=17247
./configure --prefix=/usr --disable-nls \
--with-system-readline \
--with-python=/usr/bin/python3 \
--with-system-gdbinit=/etc/gdb/gdbinit
make
}

package() {
cd gdb-$pkgver
make DESTDIR=$pkgdir install

# install "custom" system gdbinit
install -dm755 $pkgdir/etc/gdb
touch $pkgdir/etc/gdb/gdbinit

# 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
}


Steps to reproduce:

Install gdb :)
This task depends upon

Closed by  Anatol Pomozov (anatolik)
Saturday, 01 August 2015, 23:54 GMT
Reason for closing:  Fixed
Additional comments about closing:  Submitted to SVN
Comment by Doug Newgard (Scimmia) - Monday, 11 May 2015, 15:45 GMT
I know this has been discussed before, but I can't find it for anything.
Comment by Anatol Pomozov (anatolik) - Wednesday, 29 July 2015, 16:14 GMT
I just submitted these changes to SVN and the next time gdb is released the package will use python3.

For now please pull the latest changes using ABS and make sure python3 support is correct.
Comment by Levente Polyak (anthraxx) - Saturday, 01 August 2015, 20:50 GMT
i have rebuild gdb with the most current PKGBUILD: all my test cases worked fine, also python3 support is properly available and some gdb scripts using python still work, everything superb
Comment by Daniel Noland (daniel.noland) - Saturday, 01 August 2015, 20:50 GMT
Will do. And thank you. I am now very invested in seeing this happen, as I am developing *many* python 3 features on top of gdb, and I would like to release them to the Arch world without requiring the user to mess with their installed gdb. I will run all my scripts against the new build and report any issues, but I very much doubt that any issue I find will be the build's fault.
Comment by Anatol Pomozov (anatolik) - Saturday, 01 August 2015, 23:53 GMT
Thanks for verifying it. The change will be available with the next gdb release, hopefully in a few months from now.

Loading...