Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 850151 - dev-lang/python-3.11.0_beta3 fails to build on N32-based mips (stage1), ffi.h not found
Summary: dev-lang/python-3.11.0_beta3 fails to build on N32-based mips (stage1), ffi.h...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Python Gentoo Team
URL: https://github.com/python/cpython/iss...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-06-06 23:13 UTC by Andreas K. Hüttel
Modified: 2022-07-08 13:10 UTC (History)
2 users (show)

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


Attachments
build log from a chroot (build.log,206.81 KB, text/plain)
2022-06-07 08:29 UTC, Andreas K. Hüttel
Details
emerge --info (emerge-info.txt,5.15 KB, text/plain)
2022-06-07 08:29 UTC, Andreas K. Hüttel
Details
config.log (compressed) (config.log.xz,30.30 KB, application/x-xz)
2022-06-07 20:07 UTC, Andreas K. Hüttel
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Andreas K. Hüttel archtester gentoo-dev 2022-06-06 23:13:00 UTC
This seems to affect only mips3-n32, mips3-multilib, mips64-n32, mips64-multilib (note that the primary ABI for the multilib stages is n32).

Here's what I got from catalyst:

building '_ctypes' extension
mips64-unknown-linux-gnu-gcc -fPIC -Wsign-compare -DNDEBUG -O2 -march=mips64 -mabi=n32 -mplt -pipe -fwrapv -std=c11 -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wstrict-prototypes -Werror=implicit-function-declaration -fvisibility=hidden -I./Include/internal -I./Include -I. -I/usr/include/ncursesw -I/var/tmp/portage/dev-lang/python-3.11.0_beta3/work/Python-3.11.0b3/Include -I/var/tmp/portage/dev-lang/python-3.11.0_beta3/work/Python-3.11.0b3 -c /var/tmp/portage/dev-lang/python-3.11.0_beta3/work/Python-3.11.0b3/Modules/_ctypes/_ctypes.c -o build/temp.linux-mips64-3.11/var/tmp/portage/dev-lang/python-3.11.0_beta3/work/Python-3.11.0b3/Modules/_ctypes/_ctypes.o
/var/tmp/portage/dev-lang/python-3.11.0_beta3/work/Python-3.11.0b3/Modules/_ctypes/_ctypes.c:118:10: fatal error: ffi.h: No such file or directory
  118 | #include <ffi.h>
      |          ^~~~~~~
compilation terminated.
*** WARNING: renaming "readline" since importing it failed: /var/tmp/portage/dev-lang/python-3.11.0_beta3/work/Python-3.11.0b3/build/lib.linux-mips64-3.11/readline.cpython-311-mips64-linux-gnuabin32.so: undefined symbol: rl_resize_terminal
*** WARNING: renaming "_curses" since importing it failed: /var/tmp/portage/dev-lang/python-3.11.0_beta3/work/Python-3.11.0b3/build/lib.linux-mips64-3.11/_curses.cpython-311-mips64-linux-gnuabin32.so: undefined symbol: tigetstr
*** WARNING: renaming "_curses_panel" since importing it failed: /var/tmp/portage/dev-lang/python-3.11.0_beta3/work/Python-3.11.0b3/build/lib.linux-mips64-3.11/_curses_panel.cpython-311-mips64-linux-gnuabin32.so: undefined symbol: set_panel_userptr

The following modules found by detect_modules() in setup.py have not
been built, they are *disabled* by configure:
_tkinter              nis                                      


Failed to build these modules:
_ctypes                                                        


Following modules built successfully but were removed because they could not be imported:
_curses               _curses_panel         readline           

Traceback (most recent call last):
  File "/var/tmp/portage/dev-lang/python-3.11.0_beta3/work/Python-3.11.0b3/./setup.py", line 1626, in <module>
    main()
    ^^^^^^
  File "/var/tmp/portage/dev-lang/python-3.11.0_beta3/work/Python-3.11.0b3/./setup.py", line 1596, in main
    setup(# PyPI Metadata (PEP 301)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/var/tmp/portage/dev-lang/python-3.11.0_beta3/work/Python-3.11.0b3/Lib/distutils/core.py", line 148, in setup
    dist.run_commands()
    ^^^^^^^^^^^^^^^^^^^
  File "/var/tmp/portage/dev-lang/python-3.11.0_beta3/work/Python-3.11.0b3/Lib/distutils/dist.py", line 966, in run_commands
    self.run_command(cmd)
    ^^^^^^^^^^^^^^^^^^^^^
  File "/var/tmp/portage/dev-lang/python-3.11.0_beta3/work/Python-3.11.0b3/Lib/distutils/dist.py", line 985, in run_command
    cmd_obj.run()
    ^^^^^^^^^^^^^
  File "/var/tmp/portage/dev-lang/python-3.11.0_beta3/work/Python-3.11.0b3/Lib/distutils/command/build.py", line 135, in run
    self.run_command(cmd_name)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/var/tmp/portage/dev-lang/python-3.11.0_beta3/work/Python-3.11.0b3/Lib/distutils/cmd.py", line 313, in run_command
    self.distribution.run_command(command)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/var/tmp/portage/dev-lang/python-3.11.0_beta3/work/Python-3.11.0b3/Lib/distutils/dist.py", line 985, in run_command
    cmd_obj.run()
    ^^^^^^^^^^^^^
  File "/var/tmp/portage/dev-lang/python-3.11.0_beta3/work/Python-3.11.0b3/Lib/distutils/command/build_ext.py", line 340, in run
    self.build_extensions()
    ^^^^^^^^^^^^^^^^^^^^^^^
  File "/var/tmp/portage/dev-lang/python-3.11.0_beta3/work/Python-3.11.0b3/./setup.py", line 522, in build_extensions
    self.summary(mods_built, mods_disabled)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/var/tmp/portage/dev-lang/python-3.11.0_beta3/work/Python-3.11.0b3/./setup.py", line 601, in summary
    raise RuntimeError("Failed to build some stdlib modules")
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
RuntimeError: Failed to build some stdlib modules
make: *** [Makefile:867: sharedmods] Error 1
 * ERROR: dev-lang/python-3.11.0_beta3::gentoo failed (compile phase):
 *   emake failed
 * 
 * If you need support, post the output of `emerge --info '=dev-lang/python-3.11.0_beta3::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=dev-lang/python-3.11.0_beta3::gentoo'`.
 * The complete build log is located at '/var/tmp/catalyst/logs/dev-lang:python-3.11.0_beta3:20220605-213407.log'.
 * For convenience, a symlink to the build log is located at '/var/tmp/portage/dev-lang/python-3.11.0_beta3/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/dev-lang/python-3.11.0_beta3/temp/environment'.
 * Working directory: '/var/tmp/portage/dev-lang/python-3.11.0_beta3/work/Python-3.11.0b3'
 * S: '/var/tmp/portage/dev-lang/python-3.11.0_beta3/work/Python-3.11.0b3'
 * Messages for package dev-lang/python-3.11.0_beta3:
 * Log file: /var/tmp/catalyst/logs/dev-lang:python-3.11.0_beta3:20220605-213407.log
 * ERROR: dev-lang/python-3.11.0_beta3::gentoo failed (compile phase):
 *   emake failed
 * 
 * If you need support, post the output of `emerge --info '=dev-lang/python-3.11.0_beta3::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=dev-lang/python-3.11.0_beta3::gentoo'`.
 * The complete build log is located at '/var/tmp/catalyst/logs/dev-lang:python-3.11.0_beta3:20220605-213407.log'.
 * For convenience, a symlink to the build log is located at '/var/tmp/portage/dev-lang/python-3.11.0_beta3/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/dev-lang/python-3.11.0_beta3/temp/environment'.
 * Working directory: '/var/tmp/portage/dev-lang/python-3.11.0_beta3/work/Python-3.11.0b3'
 * S: '/var/tmp/portage/dev-lang/python-3.11.0_beta3/work/Python-3.11.0b3'
Comment 1 Andreas K. Hüttel archtester gentoo-dev 2022-06-07 08:29:41 UTC
Created attachment 783293 [details]
build log from a chroot
Comment 2 Andreas K. Hüttel archtester gentoo-dev 2022-06-07 08:29:58 UTC
Created attachment 783296 [details]
emerge --info
Comment 3 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-06-07 08:35:25 UTC
Could you:
1. get config.log and share it
2. run pkg-config libffi --cflags-only-I
3. run pkg-config libffi --cflags-only-I 2>/dev/null | sed -e 's/^-I//;s/ *$//'
Comment 4 Andreas K. Hüttel archtester gentoo-dev 2022-06-07 20:00:15 UTC
(In reply to Sam James from comment #3)


> 2. run pkg-config libffi --cflags-only-I

dilfridge-mips64-multilib ~ # pkg-config libffi --cflags-only-I
-I/usr/lib32/libffi/include 

> 3. run pkg-config libffi --cflags-only-I 2>/dev/null | sed -e 's/^-I//;s/
> *$//'

dilfridge-mips64-multilib ~ # pkg-config libffi --cflags-only-I 2>/dev/null | sed -e 's/^-I//;s/ *$//'
/usr/lib32/libffi/include


dilfridge-mips64-multilib ~ # ls -l /usr/lib32/libffi/include
total 24
-rw-r--r-- 1 root root 14253 Apr 18 14:51 ffi.h
-rw-r--r-- 1 root root  6578 Apr 18 14:51 ffitarget.h
Comment 5 Andreas K. Hüttel archtester gentoo-dev 2022-06-07 20:07:48 UTC
Created attachment 783500 [details]
config.log (compressed)

From a quick glance, maybe python gets the main abi wrong?
Comment 6 Andreas K. Hüttel archtester gentoo-dev 2022-06-27 23:36:54 UTC
@python: could someone of you please report this upstream and link to the report here?
Comment 7 Larry the Git Cow gentoo-dev 2022-06-27 23:45:45 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3f90c33b4082f6bb908d2ae1b9ce4cf66a0b7428

commit 3f90c33b4082f6bb908d2ae1b9ce4cf66a0b7428
Author:     Andreas K. Hüttel <dilfridge@gentoo.org>
AuthorDate: 2022-06-27 23:44:19 +0000
Commit:     Andreas K. Hüttel <dilfridge@gentoo.org>
CommitDate: 2022-06-27 23:45:30 +0000

    profiles: mask python:3.11 on mips n32 profiles
    
    Bug: https://bugs.gentoo.org/850151
    Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>

 profiles/arch/mips/mips64/n32/package.mask          | 5 +++++
 profiles/arch/mips/mips64/n32/use.mask              | 5 ++++-
 profiles/arch/mips/mipsel/mips64el/n32/package.mask | 5 +++++
 profiles/arch/mips/mipsel/mips64el/n32/use.mask     | 5 ++++-
 4 files changed, 18 insertions(+), 2 deletions(-)
Comment 8 Andreas K. Hüttel archtester gentoo-dev 2022-07-07 11:40:44 UTC
Submitted upstream
Comment 9 Mike Gilbert gentoo-dev 2022-07-07 18:37:33 UTC
As I mentioned on the upstream issue, I think this patch got dropped for our Python 3.11 ebuilds, maybe by accident?

https://github.com/gentoo/cpython/commit/69fccd4a801cb0e2f303f765e1bee8d7589d803f
Comment 10 Larry the Git Cow gentoo-dev 2022-07-08 13:10:35 UTC
The bug has been closed via the following commit(s):

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

commit a3a07918714b4e45902be8f43cb3d5bd649bf8a8
Author:     Mike Gilbert <floppym@gentoo.org>
AuthorDate: 2022-07-08 13:09:59 +0000
Commit:     Mike Gilbert <floppym@gentoo.org>
CommitDate: 2022-07-08 13:10:19 +0000

    dev-lang/python: add 3.11.0_beta3_p2
    
    Closes: https://bugs.gentoo.org/850151
    Signed-off-by: Mike Gilbert <floppym@gentoo.org>

 dev-lang/python/Manifest                      |   1 +
 dev-lang/python/python-3.11.0_beta3_p2.ebuild | 472 ++++++++++++++++++++++++++
 2 files changed, 473 insertions(+)