dev-lang/python-3.9.3 build failed on my cygwin system Reproducible: Always Steps to Reproduce: emerge -av1 =python-3.9.3 Actual Results: build failed with: /home/e_egorov/gentoo_new/var/tmp/portage/dev-lang/python-3.9.3/work/Python-3.9.3/Modules/_ctypes/_ctypes.c:107:10: fatal error: ffi.h: No such file or directory #include <ffi.h> $ emerge --info Portage 3.0.18-prefix (python 3.9.3-final-0, prefix/windows/cygwin/x64, gcc-8.3.0, cygwin-crypt-1.4, 3.2.0-340.x86_64 x86_64) ================================================================= System uname: CYGWIN_NT-10.0-19043-3.2.0-340.x86_64-x86_64-64bit-WindowsPE Timestamp of repository gentoo_prefix: Mon, 21 Jun 2021 00:57:16 +0000 Head commit of repository gentoo_prefix: a08c8635572f9b5dd90a4a83af02740687731e43 sh bash 5.1_p8 ld GNU ld (Gentoo 2.34 p4) 2.34.0 app-shells/bash: 5.1_p8::gentoo_prefix dev-lang/perl: 5.34.0::gentoo_prefix dev-lang/python: 3.9.3::local_prefix sys-devel/autoconf: 2.69-r5::gentoo_prefix sys-devel/automake: 1.16.3-r1::gentoo_prefix sys-devel/binutils: 2.34-r1::gentoo_prefix sys-devel/gcc: 8.3.0::gentoo_prefix sys-devel/gcc-config: 1.9.1::gentoo_prefix sys-devel/libtool: 2.4.6-r6::gentoo_prefix sys-devel/make: 4.3::gentoo_prefix Repositories: gentoo_prefix location: /home/e_egorov/gentoo_new/var/db/repos/gentoo sync-type: rsync sync-uri: rsync://rsync.prefix.bitzolder.nl/gentoo-portage-prefix priority: -1000 sync-rsync-verify-metamanifest: no sync-rsync-verify-max-age: 24 sync-rsync-verify-jobs: 1 sync-rsync-extra-opts: local_prefix location: /home/e_egorov/gentoo_new/var/db/repos/local masters: gentoo_prefix priority: 0 ACCEPT_KEYWORDS="~x64-cygwin" ACCEPT_LICENSE="@FREE" CBUILD="x86_64-pc-cygwin" CFLAGS=" -O2 -pipe" CHOST="x86_64-pc-cygwin" CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt" CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/terminfo" CXXFLAGS=" -O2 -pipe" DISTDIR="/home/e_egorov/gentoo_new/var/cache/distfiles" ENV_UNSET="CARGO_HOME DBUS_SESSION_BUS_ADDRESS DISPLAY GOBIN GOPATH PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR" FCFLAGS="" FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs binpkg-multi-instance case-insensitive-fs config-protect-if-modified distlocks ebuild-locks fixlafiles force-prefix ipc-sandbox merge-sync multilib-strict network-sandbox news nostrip parallel-fetch pid-sandbox preserve-libs protect-owned qa-unresolved-soname-deps sfperms strict unknown-features-warn unmerge-logs unmerge-orphans unprivileged" FFLAGS="" GENTOO_MIRRORS="http://distfiles.gentoo.org" LC_ALL="ru_RU.UTF-8" LDFLAGS="" MAKEOPTS="-j5" PKGDIR="/home/e_egorov/gentoo_new/var/cache/binpkgs" PORTAGE_CONFIGROOT="/home/e_egorov/gentoo_new/" 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="/home/e_egorov/gentoo_new/var/tmp" USE="libglvnd ncurses nls prefix prefix-guest readline ssl unicode x64-cygwin zlib" ADA_TARGET="gnat_2018" 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="karbon sheets words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="Cygwin" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="libinput" KERNEL="Winnt" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-3 php7-4" POSTGRES_TARGETS="postgres10 postgres11" PYTHON_SINGLE_TARGET="python3_9" PYTHON_TARGETS="python3_9" RUBY_TARGETS="ruby26" USERLAND="GNU" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq proto steal rawnat logmark ipmark dhcpmac delude chaos account" Unset: CC, CPPFLAGS, CTARGET, CXX, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LINGUAS, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, RUSTFLAGS
Created attachment 717267 [details] build.log This log without any my patches
Created attachment 717270 [details, diff] python-3.9_libffi.patch Fix finding of libffi
Created attachment 717273 [details] build.log 2 build log with python-3.9_libffi.patch In file included from ./Include/pytime.h:6, from ./Include/Python.h:85, from /home/e_egorov/gentoo_new/var/tmp/portage/dev-lang/python-3.9.3/work/Python-3.9.3/Modules/_xxsubinterpretersmodule.c:5: /home/e_egorov/gentoo_new/var/tmp/portage/dev-lang/python-3.9.3/work/Python-3.9.3/Modules/_xxsubinterpretersmodule.c:1764:27: error: initializer element is not constant PyVarObject_HEAD_INIT(&PyType_Type, 0) ^
Created attachment 717276 [details, diff] python-3.9_pytype.patch
Created attachment 717279 [details] build.log 3 Traceback (most recent call last): File "/home/e_egorov/gentoo_new/var/tmp/portage/dev-lang/python-3.9.3/work/Python-3.9.3/Lib/runpy.py", line 197, in _run_module_as_main return _run_code(code, main_globals, None, File "/home/e_egorov/gentoo_new/var/tmp/portage/dev-lang/python-3.9.3/work/Python-3.9.3/Lib/runpy.py", line 87, in _run_code exec(code, run_globals) File "/home/e_egorov/gentoo_new/var/tmp/portage/dev-lang/python-3.9.3/work/Python-3.9.3/Lib/compileall.py", line 17, in <module> import struct File "/home/e_egorov/gentoo_new/var/tmp/portage/dev-lang/python-3.9.3/work/Python-3.9.3/Lib/struct.py", line 13, in <module> from _struct import * ModuleNotFoundError: No module named '_struct' Traceback (most recent call last): File "/home/e_egorov/gentoo_new/var/tmp/portage/dev-lang/python-3.9.3/work/Python-3.9.3/Lib/runpy.py", line 197, in _run_module_as_main return _run_code(code, main_globals, None, File "/home/e_egorov/gentoo_new/var/tmp/portage/dev-lang/python-3.9.3/work/Python-3.9.3/Lib/runpy.py", line 87, in _run_code exec(code, run_globals) File "/home/e_egorov/gentoo_new/var/tmp/portage/dev-lang/python-3.9.3/work/Python-3.9.3/Lib/compileall.py", line 17, in <module> import struct File "/home/e_egorov/gentoo_new/var/tmp/portage/dev-lang/python-3.9.3/work/Python-3.9.3/Lib/struct.py", line 13, in <module> from _struct import * ModuleNotFoundError: No module named '_struct'
Created attachment 717282 [details, diff] python-3.9-soabi.patch
Created attachment 717285 [details, diff] python-3.9.3-do_not_remove_dll.patch (for ebuild) This patch allow preserve file libpython3.9.dll.a needed for linking other packages
See also #797262
With this patches python built fine on my system
Created attachment 722026 [details, diff] 03-python-3.9-eprefix.patch Fix search libraries
Created attachment 722029 [details, diff] python-3.9.3-eprefix.patch (for ebuild)
Created attachment 722032 [details, diff] 04-python-3.9-cygwin-dll.a.patch
Patches are also available at https://github.com/eegorov/cygwin-gentoo-etc-portage/tree/main/patches/dev-lang/python-3.9.3 Ebuild available at https://github.com/eegorov/cygwin-local-repo/tree/main/dev-lang/python
support for Cygwin was dropped