Build failing
We try to include this application in Mageia. But the build fails:
/usr/bin/python3 -Bs /usr/lib/rpm/redhat/pyproject_buildrequires.py --generate-extras --python3_pkgversion 3 --wheeldir /home/pterjan/rpmbuild/BUILD/canto-curses-0.9.9-build/canto-curses-0.9.9/pyproject-wheeldir --output /home/pterjan/rpmbuild/BUILD/canto-curses-0.9.9-build/canto-curses-0.9.9-7.mga10.x86_64-pyproject-buildrequires
Handling setuptools >= 40.8 from default build backend
Requirement satisfied: setuptools >= 40.8
(installed: setuptools 75.6.0)
/usr/lib/python3.12/site-packages/setuptools/command/sdist.py:122: SetuptoolsDeprecationWarning: `build_py` command does not inherit from setuptools' `build_py`.
!!
********************************************************************************
Custom 'build_py' does not implement 'get_data_files_without_manifest'.
Please extend command classes from setuptools instead of distutils.
See https://peps.python.org/pep-0632/ for details.
********************************************************************************
!!
Building wheels for collected packages: Canto-curses
Building wheel for Canto-curses (pyproject.toml): started
Running command Building wheel for Canto-curses (pyproject.toml)
canto_curses/widecurse.c: In function ‘py_wsize’:
canto_curses/widecurse.c:83:42: error: invalid application of ‘sizeof’ to incomplete type ‘WINDOW’ {aka ‘struct _win_st’}
83 | return Py_BuildValue("i", sizeof(WINDOW));
| ^~~~~~
error: command '/usr/bin/gcc' failed with exit code 1
error: subprocess-exited-with-error
× Building wheel for Canto-curses (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> See above for output.
What is the complete output? The snippet you pasted is only a deprecation warning. This will be a problem in the future, but until now it should still work
Sorry, I didn't copy the correct part. Now corrected. The full log is here: https://pkgsubmit.mageia.org/autobuild/cauldron/x86_64/core/2025-01-03/canto-curses-0.9.9-7.mga10/build.x86_64.0.20250103132901.log
Arch included this patch because of the same issue IIRC. At least I vaguely remember the error message when I tried to rebuild a package from HEAD. And adding that patch made the build succeed.
I didn't look into this issue and assumed it was a python3.13 thing. But maybe not (instead being a ncurses thing) and you may have success with the same patch?
Thanks for the link. However, after applying the patch, I get the same error. The same also after applying the patch about remove pipes import. The problem is probably a question of GCC 14 hardening. We use python 3.12.
Odd...
Although the flags are different from what I can gather looking at the log you provided:
+ CFLAGS='-O2 -g -pipe -Wformat -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -m64 -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection=full'
compared to Arch:
CFLAGS="-march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions \
-Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security \
-fstack-clash-protection -fcf-protection \
-fno-omit-frame-pointer -mno-omit-leaf-frame-pointer"
it seems more like a generic error?
Just to make sure: ncurses/ncursesw is listed as a dependency for the build recipe?
Just as reference:
Build log for me with the patch:
==> Extracting sources...
-> Extracting canto-curses-0.9.9.tar.gz with bsdtar
==> Starting prepare()...
patching file canto_curses/widecurse.c
patching file canto_curses/command.py
==> Starting build()...
* Getting build dependencies for wheel...
/usr/lib/python3.13/site-packages/setuptools/command/sdist.py:121: SetuptoolsDeprecationWarning: `build_py` command does not inherit from setuptools' `build_py`.
!!
********************************************************************************
Custom 'build_py' does not implement 'get_data_files_without_manifest'.
Please extend command classes from setuptools instead of distutils.
See https://peps.python.org/pep-0632/ for details.
********************************************************************************
!!
self._add_data_files(self._safe_data_files(build_py))
* Building wheel...
In file included from canto_curses/widecurse.c:12:
/usr/include/python3.13/py_curses.h:95:15: warning: ‘PyCurses_API’ defined but not used [-Wunused-variable]
95 | static void **PyCurses_API;
| ^~~~~~~~~~~~
[Errno 2] No such file or directory: 'git'
/usr/lib/python3.13/site-packages/setuptools/command/sdist.py:121: SetuptoolsDeprecationWarning: `build_py` command does not inherit from setuptools' `build_py`.
!!
********************************************************************************
Custom 'build_py' does not implement 'get_data_files_without_manifest'.
Please extend command classes from setuptools instead of distutils.
See https://peps.python.org/pep-0632/ for details.
********************************************************************************
!!
self._add_data_files(self._safe_data_files(build_py))
Successfully built Canto_curses-0.9.9-cp313-cp313-linux_x86_64.whl
==> Entering fakeroot environment...
==> Starting package()...
/usr/lib/python3.13/site-packages/canto_curses/guibase.py:56: SyntaxWarning: invalid escape sequence '\ '
/usr/lib/python3.13/site-packages/canto_curses/guibase.py:56: SyntaxWarning: invalid escape sequence '\ '
/usr/lib/python3.13/site-packages/canto_curses/html.py:201: SyntaxWarning: invalid escape sequence '\w'
/usr/lib/python3.13/site-packages/canto_curses/html.py:201: SyntaxWarning: invalid escape sequence '\w'
==> Tidying install...
-> Removing libtool files...
-> Purging unwanted files...
-> Removing static library files...
-> Stripping unneeded symbols from binaries and libraries...
-> Compressing man and info pages...
==> Checking for packaging issues...
==> Creating package "canto-curses"...
-> Generating .PKGINFO file...
-> Generating .BUILDINFO file...
-> Generating .MTREE file...
-> Compressing package...
==> Leaving fakeroot environment.
==> Finished making: canto-curses 0.9.9-8 (Wed Feb 12 22:18:06 2025)
versus without:
==> Starting prepare()...
patching file canto_curses/command.py
==> Starting build()...
* Getting build dependencies for wheel...
/usr/lib/python3.13/site-packages/setuptools/command/sdist.py:121: SetuptoolsDeprecationWarning: `build_py` command does not inherit from setuptools' `build_py`.
!!
********************************************************************************
Custom 'build_py' does not implement 'get_data_files_without_manifest'.
Please extend command classes from setuptools instead of distutils.
See https://peps.python.org/pep-0632/ for details.
********************************************************************************
!!
self._add_data_files(self._safe_data_files(build_py))
* Building wheel...
canto_curses/widecurse.c: In function ‘py_wsize’:
canto_curses/widecurse.c:83:42: error: invalid application of ‘sizeof’ to incomplete type ‘WINDOW’ {aka ‘struct _win_s’}
83 | return Py_BuildValue("i", sizeof(WINDOW));
| ^~~~~~
canto_curses/widecurse.c:84:1: warning: control reaches end of non-void function [-Wreturn-type]
84 | }
| ^
In file included from canto_curses/widecurse.c:10:
/usr/include/python3.13/py_curses.h: At top level:
/usr/include/python3.13/py_curses.h:95:15: warning: ‘PyCurses_API’ defined but not used [-Wunused-variable]
95 | static void **PyCurses_API;
| ^~~~~~~~~~~~
error: command '/usr/bin/gcc' failed with exit code 1
ERROR Backend subprocess exited when trying to invoke build_wheel
==> ERROR: A failure occurred in build().
Aborting...
Great, this is now fixed. Thanks for your patience. Patch was loaded, but not applied. You can close this issue or keep it until the fix is in the repo.
Great.
You can close this issue or keep it until the fix is in the repo.
Not in my hands. I only watch this repo as I like the program since canto 1.x days :D And try to give life support.
But maybe I will take a look on to why the patch is needed with GCC 14.x and provide a PR.
After looking into the issues I noticed that #54 is related, but that happened on a platform with Clang. But alas, GCC caught on...