Hi. Apparently, I was not properly subscribed to the list when I sent this,
trying again:
-------- Forwarded Message --------
Subject: How to see why distutils-powered tests failed?
Date: Mon, 13 May 2024 12:10:20 +0200
From: Miro Hrončok <mhron...@redhat.com>
To: cython-devel@python.org
Hello,
I've recently encountered the following test failure when I wanted to run the
upstream Cython testusite on Fedora CI.
======================================================================
ERROR: runTest (__main__.CythonRunTestCase.runTest)
[-1] compiling (cpp/cy2/pythran) and running numpy_pythran
----------------------------------------------------------------------
Traceback (most recent call last):
File
"/usr/lib/python3.12/site-packages/setuptools/_distutils/unixccompiler.py",
line 266, in link
self.spawn(linker + ld_args)
File "/usr/lib/python3.12/site-packages/setuptools/_distutils/ccompiler.py",
line 1041, in spawn
spawn(cmd, dry_run=self.dry_run, **kwargs)
File "/usr/lib/python3.12/site-packages/setuptools/_distutils/spawn.py",
line 70, in spawn
raise DistutilsExecError(
distutils.errors.DistutilsExecError: command '/usr/bin/g++' failed with exit
code 1
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File
"/var/ARTIFACTS/work-planwuditg_4/plan/discover/default-0/source/cython-3.0.9/runtests.py",
line 1550, in run
ext_so_path = self.runCompileTest()
^^^^^^^^^^^^^^^^^^^^^
File
"/var/ARTIFACTS/work-planwuditg_4/plan/discover/default-0/source/cython-3.0.9/runtests.py",
line 1163, in runCompileTest
return self.compile(
^^^^^^^^^^^^^
File
"/var/ARTIFACTS/work-planwuditg_4/plan/discover/default-0/source/cython-3.0.9/runtests.py",
line 1482, in compile
so_path = self.run_distutils(test_directory, module, workdir, incdir)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File
"/var/ARTIFACTS/work-planwuditg_4/plan/discover/default-0/source/cython-3.0.9/runtests.py",
line 1378, in run_distutils
build_extension.run()
File
"/usr/lib/python3.12/site-packages/setuptools/_distutils/command/build_ext.py",
line 345, in run
self.build_extensions()
File
"/usr/lib/python3.12/site-packages/setuptools/_distutils/command/build_ext.py",
line 467, in build_extensions
self._build_extensions_serial()
File
"/usr/lib/python3.12/site-packages/setuptools/_distutils/command/build_ext.py",
line 493, in _build_extensions_serial
self.build_extension(ext)
File
"/var/ARTIFACTS/work-planwuditg_4/plan/discover/default-0/source/cython-3.0.9/runtests.py",
line 637, in build_extension
_build_ext.build_extension(self, ext)
File
"/usr/lib/python3.12/site-packages/setuptools/_distutils/command/build_ext.py",
line 572, in build_extension
self.compiler.link_shared_object(
File "/usr/lib/python3.12/site-packages/setuptools/_distutils/ccompiler.py",
line 752, in link_shared_object
self.link(
File
"/usr/lib/python3.12/site-packages/setuptools/_distutils/unixccompiler.py",
line 268, in link
raise LinkError(msg)
distutils.errors.LinkError: command '/usr/bin/g++' failed with exit code 1
There were 4 failures like this (all pythran_numpy related).
I was clueless as to why is this failing. I was trying to make the tests tell
me more.
After long digging I ended up modifying
/usr/lib/python3.12/site-packages/setuptools/_distutils/spawn.py in a test
container directly to always make this conditional False:
https://github.com/pypa/setuptools/blob/v69.1.0/setuptools/_distutils/spawn.py#L61
This turned:
distutils.errors.DistutilsExecError: command '/usr/bin/g++' failed with exit
code 1
Into:
distutils.errors.DistutilsExecError: command ['/usr/bin/g++', ...] failed
with exit code 1
Then, I was able to rerun the failed g++ command manually to see the actual
linker error (missing flexiblas).
However, the experience was far from ideal.
Would it be possible (and desired) to modify the tests to actually print out
the compiler/linker errors when they happen?
Or perhaps this already is possible, but I am not doing it correctly? (I tried
--no-capture, but no dice.)
Thanks,
--
Miro Hrončok
--
Phone: +420777974800
IRC: mhroncok
_______________________________________________
cython-devel mailing list
cython-devel@python.org
https://mail.python.org/mailman/listinfo/cython-devel