Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 608496

Summary: dev-python/gmpy-2.0.8 fails tests on mips
Product: Gentoo Linux Reporter: Mart Raudsepp <leio>
Component: Current packagesAssignee: Python Gentoo Team <python>
Status: RESOLVED FIXED    
Severity: normal CC: mips
Priority: Normal Keywords: PATCH
Version: unspecified   
Hardware: MIPS   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: build.log for gmpy on mips
patch

Description Mart Raudsepp gentoo-dev 2017-02-06 23:29:19 UTC
Created attachment 462718 [details]
build.log for gmpy on mips

>>> Test phase: dev-python/gmpy-2.0.8
 * python2_7: running distutils-r1_run_phase python_test
Traceback (most recent call last):
  File "runtests.py", line 5, in <module>
    import gmpy2
SystemError: Size of mp_limb_t and mpir_si not compatible
 * ERROR: dev-python/gmpy-2.0.8::gentoo failed (test phase):


(built with USE=-mpir)

Attempted to keyword due to bug 605122
Comment 1 Mart Raudsepp gentoo-dev 2017-02-06 23:33:54 UTC
Portage 2.3.3 (python 2.7.12-final-0, default/linux/mips/13.0/mipsel/n32, gcc-5.4.0, glibc-2.23-r3, 3.12.22 mips64)
=================================================================
System uname: Linux-3.12.22-mips64-ICT_Loongson-2_V0.3_FPU_V0.1-with-gentoo-2.3
KiB Mem:     1031168 total,    180624 free
KiB Swap:    2859520 total,   2858352 free
sh bash 4.4_p11
ld GNU ld (Gentoo 2.27 p1.0) 2.27
app-shells/bash:          4.4_p11::gentoo
dev-lang/perl:            5.24.1_rc4::gentoo
dev-lang/python:          2.7.12::gentoo, 3.5.2::gentoo
dev-util/pkgconfig:       0.29.1::gentoo
sys-apps/baselayout:      2.3::gentoo
sys-apps/openrc:          0.23.2::gentoo
sys-apps/sandbox:         2.10-r3::gentoo
sys-devel/autoconf:       2.69-r2::gentoo
sys-devel/automake:       1.11.6::gentoo, 1.13.4::gentoo, 1.14.1-r1::gentoo, 1.15-r2::gentoo
sys-devel/binutils:       2.25.1-r1::gentoo, 2.27::gentoo
sys-devel/gcc:            5.3.0::gentoo, 5.4.0-r2::gentoo
sys-devel/gcc-config:     1.8-r1::gentoo
sys-devel/libtool:        2.4.6-r2::gentoo
sys-devel/make:           4.2.1::gentoo
sys-kernel/linux-headers: 4.5::gentoo (virtual/os-headers)
sys-libs/glibc:           2.23-r3::gentoo
Repositories:

gentoo
    location: /home/leio/gentoo/gentoo-x86
    sync-type: rsync
    sync-uri: rsync://rsync.gentoo.org/gentoo-portage
    priority: -1000

loongson
    location: /home/leio/gentoo/loongson
    masters: gentoo
    priority: 0

leio-yeeloong
    location: /home/leio/gentoo/local
    masters: gentoo
    priority: 50

ACCEPT_KEYWORDS="mips ~mips"
ACCEPT_LICENSE="* -@EULA"
CBUILD="mips64el-unknown-linux-gnu"
CFLAGS="-O2 -march=loongson2f -mabi=n32 -pipe -mplt -Wa,-mfix-loongson2f-nop"
CHOST="mips64el-unknown-linux-gnu"
CONFIG_PROTECT="/etc"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O2 -march=loongson2f -mabi=n32 -pipe -mplt -Wa,-mfix-loongson2f-nop"
DISTDIR="/usr/portage/distfiles"
FCFLAGS=""
FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch preserve-libs protect-owned sandbox sfperms strict test unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS=""
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="en_US.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j1"
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 --exclude=/.git"
PORTAGE_TMPDIR="/var/tmp"
USE="X acl berkdb bzip2 cairo cli cracklib crypt cxx gdbm iconv ipv6 jpeg loongson2f mips modules n32 ncurses nls nptl pam pcre png readline seccomp session ssl tcpd tiff unicode xattr zlib" ABI_MIPS="n32" ALSA_CARDS="au1x00" 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" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="en et et_EE" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-6" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_5" RUBY_TARGETS="ruby21" USERLAND="GNU" VIDEO_CARDS="siliconmotion fbdev" 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:  CC, CPPFLAGS, CTARGET, CXX, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON
Comment 2 Brian Dolbec gentoo-dev 2017-03-22 02:55:57 UTC
Removing block for twisted keywording as suggested by Mart.

This should only block mips keywording as it is only a mips specific failure.
Comment 3 Matt Turner gentoo-dev 2018-04-04 05:55:50 UTC
The failing assertion is in src/gmpy2.c:

    /* Validate the sizes of the various typedef'ed integer types. */
    if (sizeof(mp_limb_t) != sizeof(mpir_si)) {
        SYSTEM_ERROR("Size of mp_limb_t and mpir_si not compatible");
        INITERROR;
    }

mp_limb_t is a type provided by dev-libs/gmp's gmp.h:

#ifdef __GMP_SHORT_LIMB
typedef unsigned int            mp_limb_t;
typedef int                     mp_limb_signed_t;
#else
#ifdef _LONG_LONG_LIMB
typedef unsigned long long int  mp_limb_t;
typedef long long int           mp_limb_signed_t;
#else
typedef unsigned long int       mp_limb_t;
typedef long int                mp_limb_signed_t;
#endif
#endif

long is 32-bits on n32 and long long is 64-bits. The gmp configure script picks the underlying type for mp_limb_t and for n32 chooses long long.

mpir_si is defined by gmpy's src/gmpy.h:

typedef unsigned long       mpir_ui;
typedef long                mpir_si;

That's the problem.

Upstream gmpy has removed both the assertion and all uses of mpir_si, so this will not be a problem going forward.

I'll attach a patch that fixes it, but can we also get 2.1.0_alpha1 in the tree as well?
Comment 4 Matt Turner gentoo-dev 2018-04-04 05:56:19 UTC
Created attachment 526508 [details, diff]
patch
Comment 5 Larry the Git Cow gentoo-dev 2018-04-06 05:23:02 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0d16531e438828335a8e7616c0ee33b9a32bc1cf

commit 0d16531e438828335a8e7616c0ee33b9a32bc1cf
Author:     Matt Turner <mattst88@gentoo.org>
AuthorDate: 2018-04-06 05:13:50 +0000
Commit:     Matt Turner <mattst88@gentoo.org>
CommitDate: 2018-04-06 05:22:48 +0000

    dev-python/gmpy: Add patch to fix mpir types on mips/n32
    
    Committed with floppym's blessing.
    
    Closes: https://bugs.gentoo.org/608496

 dev-python/gmpy/files/gmpy-2.0.8-fix-mpir-types.patch | 17 +++++++++++++++++
 dev-python/gmpy/gmpy-2.0.8.ebuild                     |  4 ++++
 2 files changed, 21 insertions(+)