Bug#849499: llvmlite: ERROR: test_get_host_cpu_features (llvmlite.tests.test_binding.TestMisc)
Daniel Stender
debian at danielstender.com
Tue Dec 27 21:59:00 UTC 2016
Source: llvmlite
Version: 0.14.0-2
Severity: serious
File: llvmlite
Justification: fails to build from source
llvmlite [1] (currently in experimental) has a test failure on some archs (mips, ppc64el, s390x etc.) [2]:
<cut>
======================================================================
ERROR: test_get_host_cpu_features (llvmlite.tests.test_binding.TestMisc)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/«PKGBUILDDIR»/llvmlite/tests/test_binding.py", line 237, in test_get_host_cpu_features
features = llvm.get_host_cpu_features()
File "/«PKGBUILDDIR»/llvmlite/binding/targets.py", line 61, in get_host_cpu_features
outdict[feat[1:]] = flag_map[feat[0]]
IndexError: string index out of range
</cut>
get_host_cpu_features() is defined in llvmlite/binding/targets.py:
<cut>
def get_host_cpu_features():
"""
Returns a dictionary-like object indicating the CPU features for current
architecture and whether they are enabled for this CPU. The key-value pairs
are the feature name as string and a boolean indicating whether the feature
is available. The returned value is an instance of ``FeatureMap`` class,
which adds a new method ``.flatten()`` for returning a string suitable for
use as the "features" argument to ``Target.create_target_machine()``.
"""
with ffi.OutputString() as out:
ffi.lib.LLVMPY_GetHostCPUFeatures(out)
outdict = FeatureMap()
flag_map = {'+': True, '-': False}
for feat in str(out).split(','):
outdict[feat[1:]] = flag_map[feat[0]]
return outdict
</cut>
It appears ffi.lib.LLVMPY_GetHostCPUFeatures() doesn't return anything (e.g. on s390x):
<cut>
Python 2.7.13 (default, Dec 18 2016, 20:19:42)
[GCC 6.2.1 20161215] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from llvmlite.binding import ffi
>>> with ffi.OutputString() as out:
... ffi.lib.LLVMPY_GetHostCPUFeatures(out)
... print(out)
...
0
</cut>
Could this be a regression from LLVM?
DS
[1] https://packages.qa.debian.org/l/llvmlite.html
[2] https://buildd.debian.org/status/package.php?p=llvmlite&suite=experimental
-- System Information:
Debian Release: stretch/sid
APT prefers testing
APT policy: (500, 'testing'), (1, 'experimental')
Architecture: amd64 (x86_64)
Kernel: Linux 4.8.0-2-amd64 (SMP w/4 CPU cores)
Locale: LANG=de_DE.utf8, LC_CTYPE=de_DE.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
Versions of packages python-llvmlite depends on:
ii libc6 2.24-8
ii libgcc1 1:6.2.1-5
ii libtinfo5 6.0+20161126-1
ii llvm-3.8 1:3.8.1-16
ii python 2.7.11-2
ii python-enum34 1.1.6-1
ii python-six 1.10.0-3
pn python:any <none>
ii zlib1g 1:1.2.8.dfsg-4
Versions of packages python-llvmlite recommends:
ii llvmlite-doc 0.14.0-2
python-llvmlite suggests no packages.
-- no debconf information
More information about the Pkg-llvm-team
mailing list