Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 485490 - dev-libs/botan-1.10.5 - src_configure(): ERROR: 'map' object is not subscriptable
Summary: dev-libs/botan-1.10.5 - src_configure(): ERROR: 'map' object is not subscript...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Library (show other bugs)
Hardware: AMD64 Linux
: Normal normal (vote)
Assignee: Jack Lloyd
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-09-20 14:38 UTC by Nikolaos Chatzidakis
Modified: 2013-09-21 20:41 UTC (History)
6 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Convert map to list (gentoo485490a.patch,943 bytes, patch)
2013-09-21 17:27 UTC, Martin von Gagern
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Nikolaos Chatzidakis 2013-09-20 14:38:27 UTC
Updated my system as usual (emerge -avDuN world) and botan-1.10.5 fails to emerge. The log follows:

* Package:    dev-libs/botan-1.10.5
 * Repository: gentoo
 * Maintainer: lloyd@randombit.net crypto@gentoo.org,proxy-maint@gentoo.org
 * USE:        amd64 bzip2 elibc_glibc kernel_linux python_targets_python2_7 python_targets_python3_2 ssl threads userland_GNU zlib
 * FEATURES:   ccache preserve-libs sandbox userpriv usersandbox
>>> Unpacking source...
>>> Unpacking Botan-1.10.5.tbz to /var/tmp/portage/dev-libs/botan-1.10.5/work
>>> Source unpacked in /var/tmp/portage/dev-libs/botan-1.10.5/work
>>> Preparing source in /var/tmp/portage/dev-libs/botan-1.10.5/work/Botan-1.10.5 ...
>>> Source prepared.
>>> Configuring source in /var/tmp/portage/dev-libs/botan-1.10.5/work/Botan-1.10.5 ...
 * Disabling modules: proc_walk,unix_procs
   INFO: Canonicalizized --cpu=x86_64 to x86_64/x86_64
   INFO: Target is gcc-linux-x86_64-x86_64
   INFO: Detected gcc version 4.7.3
  ERROR: 'map' object is not subscriptable
 * ERROR: dev-libs/botan-1.10.5::gentoo failed (configure phase):
 *   configure.py failed
 * 
 * Call stack:
 *     ebuild.sh, line  93:  Called src_configure
 *   environment, line 3292:  Called die
 * The specific snippet of code:
 *       ./configure.py --prefix="${EPREFIX}/usr" --libdir=$(get_libdir) --docdir=share/doc --cc=gcc --os=${myos} --cpu=${CHOSTARCH} --with-endian="$(tc-endian)" --without-sphinx --with-tr1=system $(use_with bzip2) $(use_with gmp gnump) $(use_with python boost-python) $(use_with ssl openssl) $(use_with zlib) --disable-modules=${disable_modules} || die "configure.py failed"
 * 
 * If you need support, post the output of `emerge --info '=dev-libs/botan-1.10.5::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=dev-libs/botan-1.10.5::gentoo'`.
 * The complete build log is located at '/var/tmp/portage/dev-libs/botan-1.10.5/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/dev-libs/botan-1.10.5/temp/environment'.
 * Working directory: '/var/tmp/portage/dev-libs/botan-1.10.5/work/Botan-1.10.5'
 * S: '/var/tmp/portage/dev-libs/botan-1.10.5/work/Botan-1.10.5'
----------------
My emerge --info:

Portage 2.2.6 (default/linux/amd64/13.0/desktop/kde, gcc-4.7.3, glibc-2.17, 3.11.0-gentoo x86_64)
=================================================================
System uname: Linux-3.11.0-gentoo-x86_64-Intel-R-_Core-TM-_i7-3820_CPU_@_3.60GHz-with-gentoo-2.2
KiB Mem:    16351672 total,  13502500 free
KiB Swap:    4166652 total,   4166652 free
Timestamp of tree: Fri, 20 Sep 2013 14:15:01 +0000
ld GNU ld (GNU Binutils) 2.23.2
distcc 3.1 x86_64-pc-linux-gnu [disabled]
ccache version 3.1.9 [enabled]
app-shells/bash:          4.2_p45
dev-java/java-config:     2.2.0
dev-lang/python:          2.7.5-r2, 3.2.5-r2, 3.3.2-r2
dev-util/ccache:          3.1.9-r1
dev-util/cmake:           2.8.11.2
dev-util/pkgconfig:       0.28
sys-apps/baselayout:      2.2
sys-apps/openrc:          0.12
sys-apps/sandbox:         2.6-r1
sys-devel/autoconf:       2.13, 2.69
sys-devel/automake:       1.12.6, 1.13.4, 1.14
sys-devel/binutils:       2.23.2
sys-devel/gcc:            4.7.3
sys-devel/gcc-config:     1.8
sys-devel/libtool:        2.4.2
sys-devel/make:           3.82-r4
sys-kernel/linux-headers: 3.11 (virtual/os-headers)
sys-libs/glibc:           2.17
Repositories: gentoo
ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=corei7 -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/config /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5.5/ext-active/ /etc/php/cgi-php5.5/ext-active/ /etc/php/cli-php5.5/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-march=corei7 -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="--quiet-build=y --jobs=5 --keep-going"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs ccache config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="ftp://ftp.cc.uoc.gr/mirrors/linux/gentoo/"
LANG="el_GR.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j9"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY=""
SYNC="rsync://rsync.gr.gentoo.org/gentoo-portage"
USE="X a52 aac accessibility acl acpi alsa amd64 apache2 apng berkdb branding bzip2 cairo cdda cdr consolekit cracklib crypt cups curl cxx dbus declarative device-mapper dirac dri dts dvd dvdr emboss encode exif extras fam ffmpeg firefox flac fontconfig fortran gd gdbm gif gnome gnutls gpm gtk hddtemp iconv ipv6 java jpeg kde kipi lcms libnotify lm_sensors mad matroska melt mikmod mmx mng modules mp3 mp4 mpeg mpi msn mudflap multilib multiuser mysql ncurses nls nptl nsplugin nvidia objc ogg opengl openmp pam pango pcre pdf plasma png policykit ppds private-headers pulseaudio qt3support qt4 readline romio rtmp sdl secure-delete semantic-desktop session skins snmp source spell sql sse sse2 sse4_1 ssl ssse3 startup-notification svg tcpd theora threads tiff truetype udev udisks unicode upower usb v4l v4l2 vaapi vdpau vorbis webkit wlm wma wxwidgets x264 xcb xcomposite xinerama xml xscreensaver xv xvid xvmc yahoo zlib" ABI_X86="64" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" INPUT_DEVICES="evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_2" RUBY_TARGETS="ruby19 ruby18 ruby20" USERLAND="GNU" VIDEO_CARDS="nvidia" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CPPFLAGS, CTARGET, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON
Comment 1 Dale Lukas Peterson 2013-09-20 17:52:49 UTC
I am hitting the same bug.
Comment 2 Chiitoo gentoo-dev 2013-09-20 18:28:19 UTC
Python 3 incompatibility?

The package builds fine with 2.7 here (but not with 3.2 nor 3.3).  I'm certainly not knowledgeable enough to say for sure, but from what I gathered, it looked like there is certain things the Python 2 and 3 do differently regarding the particular object, and thus, this indeed would (should) not work with Python 3.


I do hope this helps even though I may be completely off the mark.  ^^;
Comment 3 Ivan Iraci 2013-09-21 09:14:49 UTC
Same problem here.
Comment 4 Martin von Gagern 2013-09-21 17:24:09 UTC
Activating the traceback code atthe end of the configure script:

Traceback (most recent call last):
  File "./configure.py", line 1880, in <module>
    main()
  File "./configure.py", line 1812, in main
    gcc_version_matches({ 4 : [0], 3 : [0,1,2,3,4], 2 : [95] }):
  File "./configure.py", line 1797, in gcc_version_matches
    if gcc_version[0] != match[0]:
TypeError: 'map' object is not subscriptable
Comment 5 Martin von Gagern 2013-09-21 17:27:06 UTC
Created attachment 359190 [details, diff]
Convert map to list

The problem is the return type of get_gcc_version: in Python 3, map returns an iterable but in Python 2 it returns a list. So one possible fix would be always casting that to list, as this patch does.

With it, configure succeeded for me, and build looks fine so far.

Another possible solution would be always using python2 to run configure.py. That would ward against subtile changes in semantics, but would also mean a fixed python 2 dependency.
Comment 6 Alon Bar-Lev (RETIRED) gentoo-dev 2013-09-21 19:27:09 UTC
(In reply to Martin von Gagern from comment #5)
> Created attachment 359190 [details, diff] [details, diff]
> Convert map to list
> 
> The problem is the return type of get_gcc_version: in Python 3, map returns
> an iterable but in Python 2 it returns a list. So one possible fix would be
> always casting that to list, as this patch does.
> 
> With it, configure succeeded for me, and build looks fine so far.
> 
> Another possible solution would be always using python2 to run configure.py.
> That would ward against subtile changes in semantics, but would also mean a
> fixed python 2 dependency.

Thanks, fixed in similar manner.
Comment 7 Martin von Gagern 2013-09-21 20:37:09 UTC
It looks like upstream has already addressed this as well:
https://github.com/randombit/botan/commit/d909d4a4555a8761da2eaebf008993d9734c
The fix there is slightly different, but should work pretty much the same.
I'll leave it to you whether you want to change the patch the ebuild uses.
In any case, there should be no need to report this upstream.
Comment 8 Alon Bar-Lev (RETIRED) gentoo-dev 2013-09-21 20:41:55 UTC
(In reply to Martin von Gagern from comment #7)
> It looks like upstream has already addressed this as well:
> https://github.com/randombit/botan/commit/
> d909d4a4555a8761da2eaebf008993d9734c
> The fix there is slightly different, but should work pretty much the same.
> I'll leave it to you whether you want to change the patch the ebuild uses.
> In any case, there should be no need to report this upstream.

I used:
return [int(c) for c in gcc_version.split('.')[0:2]]

Upstream:
return [int(v) for v in gcc_version.split('.')]

Not sure why they removed the 0:2... I will leave this as-is for now, will update at next fix release.