Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 907476 - dev-python/platformdirs-3.5.1: Unable to obtain build-backend from pyproject.toml (segmentation fault when calling gpep517)
Summary: dev-python/platformdirs-3.5.1: Unable to obtain build-backend from pyproject....
Status: RESOLVED WORKSFORME
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: x86 Linux
: Normal normal
Assignee: Python Gentoo Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-05-31 07:52 UTC by Andrej Kacian
Modified: 2023-06-04 08:14 UTC (History)
2 users (show)

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


Attachments
Portage build log (build.log,3.53 KB, text/plain)
2023-05-31 07:52 UTC, Andrej Kacian
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Andrej Kacian 2023-05-31 07:52:01 UTC
Failed to emerge dev-python/platformdirs-3.5.1

Reproducible: Always

Steps to Reproduce:
1. Try to emerge =dev-python/platformdirs-3.5.1, either directly or as part of @world update

Actual Results:  
vala ~ # emerge -v1 platformdirs  

These are the packages that would be merged, in order:

Calculating dependencies... done!
Dependency resolution took 5.73 s.

[ebuild     U  ] dev-python/platformdirs-3.5.1::gentoo [3.2.0::gentoo] USE="-test" PYTHON_TARGETS="python3_10 python3_11 (-pypy3) (-python3_12)" 0 KiB

Total: 1 package (1 upgrade), Size of downloads: 0 KiB


>>> Verifying ebuild manifests

>>> Emerging (1 of 1) dev-python/platformdirs-3.5.1::gentoo
 * platformdirs-3.5.1.tar.gz BLAKE2B SHA512 size ;-) ...                                                                                                                                                                                [ ok ]
>>> Unpacking source...
>>> Unpacking platformdirs-3.5.1.tar.gz to /var/tmp/portage/dev-python/platformdirs-3.5.1/work
>>> Source unpacked in /var/tmp/portage/dev-python/platformdirs-3.5.1/work
>>> Preparing source in /var/tmp/portage/dev-python/platformdirs-3.5.1/work/platformdirs-3.5.1 ...
 * Build system packages:
 *   dev-python/gpep517            : 13
 *   dev-python/installer          : 0.7.0
 *   dev-python/flit-core          : 3.8.0
>>> Source prepared.
>>> Configuring source in /var/tmp/portage/dev-python/platformdirs-3.5.1/work/platformdirs-3.5.1 ...
>>> Source configured.
>>> Compiling source in /var/tmp/portage/dev-python/platformdirs-3.5.1/work/platformdirs-3.5.1 ...
 * python3_10: running distutils-r1_run_phase distutils-r1_python_compile
 * ERROR: dev-python/platformdirs-3.5.1::gentoo failed (compile phase):
 *   Unable to obtain build-backend from pyproject.toml
 * 
 * Call stack:
 *     ebuild.sh, line  136:  Called src_compile
 *   environment, line 3443:  Called distutils-r1_src_compile
 *   environment, line 1554:  Called _distutils-r1_run_foreach_impl 'distutils-r1_python_compile'
 *   environment, line  706:  Called python_foreach_impl 'distutils-r1_run_phase' 'distutils-r1_python_compile'
 *   environment, line 3143:  Called multibuild_foreach_variant '_python_multibuild_wrapper' 'distutils-r1_run_phase' 'distutils-r1_python_compile'
 *   environment, line 2640:  Called _multibuild_run '_python_multibuild_wrapper' 'distutils-r1_run_phase' 'distutils-r1_python_compile'
 *   environment, line 2638:  Called _python_multibuild_wrapper 'distutils-r1_run_phase' 'distutils-r1_python_compile'
 *   environment, line 1038:  Called distutils-r1_run_phase 'distutils-r1_python_compile'
 *   environment, line 1536:  Called distutils-r1_python_compile
 *   environment, line 1357:  Called distutils_pep517_install '/var/tmp/portage/dev-python/platformdirs-3.5.1/work/platformdirs-3.5.1-python3_10/install'
 *   environment, line 1904:  Called _distutils-r1_get_backend
 *   environment, line  502:  Called die
 * The specific snippet of code:
 *           die "Unable to obtain build-backend from pyproject.toml";
 * 
 * If you need support, post the output of `emerge --info '=dev-python/platformdirs-3.5.1::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=dev-python/platformdirs-3.5.1::gentoo'`.
 * The complete build log is located at '/var/log/portage/dev-python:platformdirs-3.5.1:20230531-074830.log'.
 * For convenience, a symlink to the build log is located at '/var/tmp/portage/dev-python/platformdirs-3.5.1/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/dev-python/platformdirs-3.5.1/temp/environment'.
 * Working directory: '/var/tmp/portage/dev-python/platformdirs-3.5.1/work/platformdirs-3.5.1'
 * S: '/var/tmp/portage/dev-python/platformdirs-3.5.1/work/platformdirs-3.5.1'

>>> Failed to emerge dev-python/platformdirs-3.5.1, Log file:

>>>  '/var/log/portage/dev-python:platformdirs-3.5.1:20230531-074830.log'

 * Messages for package dev-python/platformdirs-3.5.1:
 * Log file: /var/log/portage/dev-python:platformdirs-3.5.1:20230531-074830.log

 * ERROR: dev-python/platformdirs-3.5.1::gentoo failed (compile phase):
 *   Unable to obtain build-backend from pyproject.toml
 * 
 * Call stack:
 *     ebuild.sh, line  136:  Called src_compile
 *   environment, line 3443:  Called distutils-r1_src_compile
 *   environment, line 1554:  Called _distutils-r1_run_foreach_impl 'distutils-r1_python_compile'
 *   environment, line  706:  Called python_foreach_impl 'distutils-r1_run_phase' 'distutils-r1_python_compile'
 *   environment, line 3143:  Called multibuild_foreach_variant '_python_multibuild_wrapper' 'distutils-r1_run_phase' 'distutils-r1_python_compile'
 *   environment, line 2640:  Called _multibuild_run '_python_multibuild_wrapper' 'distutils-r1_run_phase' 'distutils-r1_python_compile'
 *   environment, line 2638:  Called _python_multibuild_wrapper 'distutils-r1_run_phase' 'distutils-r1_python_compile'
 *   environment, line 1038:  Called distutils-r1_run_phase 'distutils-r1_python_compile'
 *   environment, line 1536:  Called distutils-r1_python_compile
 *   environment, line 1357:  Called distutils_pep517_install '/var/tmp/portage/dev-python/platformdirs-3.5.1/work/platformdirs-3.5.1-python3_10/install'
 *   environment, line 1904:  Called _distutils-r1_get_backend
 *   environment, line  502:  Called die
 * The specific snippet of code:
 *           die "Unable to obtain build-backend from pyproject.toml";
 * 
 * If you need support, post the output of `emerge --info '=dev-python/platformdirs-3.5.1::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=dev-python/platformdirs-3.5.1::gentoo'`.
 * The complete build log is located at '/var/log/portage/dev-python:platformdirs-3.5.1:20230531-074830.log'.
 * For convenience, a symlink to the build log is located at '/var/tmp/portage/dev-python/platformdirs-3.5.1/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/dev-python/platformdirs-3.5.1/temp/environment'.
 * Working directory: '/var/tmp/portage/dev-python/platformdirs-3.5.1/work/platformdirs-3.5.1'
 * S: '/var/tmp/portage/dev-python/platformdirs-3.5.1/work/platformdirs-3.5.1'


Expected Results:  
Successful emerge

vala ~ # emerge --info '=dev-python/platformdirs-3.5.1::gentoo'
Portage 3.0.44 (python 3.11.3-final-0, default/linux/x86/17.0/hardened, gcc-12, glibc-2.36-r7, 6.1.19-gentoo i686)
=================================================================
                         System Settings
=================================================================
System uname: Linux-6.1.19-gentoo-i686-Intel_Core_i7_9xx_-Nehalem_Class_Core_i7-with-glibc2.36
KiB Mem:     2053892 total,    233004 free
KiB Swap:    2097148 total,   1700496 free
Timestamp of repository gentoo: Wed, 31 May 2023 00:15:01 +0000
Head commit of repository gentoo: 49f74715b1cda34f8cbf3698f6b1b1394e19a149
sh bash 5.1_p16-r2
ld GNU ld (Gentoo 2.39 p6) 2.39.0
app-misc/pax-utils:        1.3.5::gentoo
app-shells/bash:           5.1_p16-r2::gentoo
dev-lang/perl:             5.36.0-r2::gentoo
dev-lang/python:           3.10.11::gentoo, 3.11.3::gentoo
dev-util/cmake:            3.26.3::gentoo
dev-util/meson:            1.0.1::gentoo
sys-apps/baselayout:       2.13-r1::gentoo
sys-apps/openrc:           0.46::gentoo
sys-apps/sandbox:          2.29::gentoo
sys-devel/autoconf:        2.71-r5::gentoo
sys-devel/automake:        1.16.5::gentoo
sys-devel/binutils:        2.39-r5::gentoo
sys-devel/binutils-config: 5.5::gentoo
sys-devel/gcc:             12.2.1_p20230428-r1::gentoo
sys-devel/gcc-config:      2.10::gentoo
sys-devel/libtool:         2.4.7-r1::gentoo
sys-devel/make:            4.4.1-r1::gentoo
sys-kernel/linux-headers:  6.1::gentoo (virtual/os-headers)
sys-libs/glibc:            2.36-r7::gentoo
Repositories:

gentoo
    location: /usr/gentoo/portage
    sync-type: rsync
    sync-uri: rsync://rsync.europe.gentoo.org/gentoo-portage
    priority: -1000
    volatile: True
    sync-rsync-verify-metamanifest: yes
    sync-rsync-verify-max-age: 24
    sync-rsync-extra-opts: 
    sync-rsync-verify-jobs: 1

ACCEPT_KEYWORDS="x86"
ACCEPT_LICENSE="@FREE"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-march=core2 -mtune=pentium -O2 -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/gconf /etc/gentoo-release /etc/php/apache2-php8.1/ext-active/ /etc/php/cgi-php8.1/ext-active/ /etc/php/cli-php8.1/ext-active/ /etc/php/fpm-php8.1/ext-active/ /etc/php/phpdbg-php8.1/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-march=core2 -mtune=pentium -O2 -pipe"
DISTDIR="/usr/gentoo/distfiles"
ENV_UNSET="CARGO_HOME DBUS_SESSION_BUS_ADDRESS DISPLAY GDK_PIXBUF_MODULE_FILE 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 XDG_STATE_HOME"
FCFLAGS="-O2 -march=i686 -pipe"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs buildpkg-live config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync multilib-strict network-sandbox news parallel-fetch pid-sandbox preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms splitdebug strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -march=i686 -pipe"
GENTOO_MIRRORS="http://gentoo.wheel.sk/ http://tux.rainside.sk/gentoo/ http://gd.tuwien.ac.at/opsys/linux/gentoo/"
LC_ALL="en_US.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LEX="flex"
MAKEOPTS="-j2"
PKGDIR="/usr/gentoo/packages"
PORTAGE_CONFIGROOT="/"
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="/var/tmp"
SHELL="/bin/bash"
USE="acpi bash-completion bzip2 cli crypt curl dri fortran gdbm gmp gnutls hardened icecastflac iconv idn imap ipv6 libtirpc logrotate lvm mp3 ncurses nntp nptl nptlonly ntp oggvorbis open_perms openmp openssl pam pcre peer_perms perl pic pie python readline seccomp sieve smp split-usr ssl sslog ssp test-rust type1 ubac unconfined unicode usb vim-syntax x86 xattr xtpax zlib" ABI_X86="32" ADA_TARGET="gnat_2021" 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" CPU_FLAGS_X86="mmx mmxext sse sse2 sse3 ssse3" CURL_SSL="gnutls" ELIBC="glibc" 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="linux" L10N="en sk" 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-4 php8-0" POSTGRES_TARGETS="postgres12 postgres13" PYTHON_SINGLE_TARGET="python3_11" PYTHON_TARGETS="python3_11 python3_10" RUBY_TARGETS="ruby30 ruby31" VIDEO_CARDS="amdgpu fbdev intel nouveau radeon radeonsi vesa dummy v4l" 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:  ADDR2LINE, AR, ARFLAGS, AS, ASFLAGS, CC, CCLD, CONFIG_SHELL, CPP, CPPFLAGS, CTARGET, CXX, CXXFILT, ELFEDIT, EMERGE_DEFAULT_OPTS, EXTRA_ECONF, F77FLAGS, FC, GCOV, GPROF, INSTALL_MASK, LANG, LD, LFLAGS, LIBTOOL, LINGUAS, MAKE, MAKEFLAGS, NM, OBJCOPY, OBJDUMP, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, RANLIB, READELF, RUSTFLAGS, SIZE, STRINGS, STRIP, YACC, YFLAGS
Comment 1 Andrej Kacian 2023-05-31 07:52:30 UTC
Created attachment 862956 [details]
Portage build log

Adding build log.
Comment 2 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2023-05-31 08:22:25 UTC
Could you run:

cd /var/tmp/portage/dev-python/platformdirs-3.5.1/work/platformdirs-3.5.1
cat pyproject.toml
gpep517 get-backend

?
Comment 3 Andrej Kacian 2023-05-31 08:55:19 UTC
vala ~ # cd /var/tmp/portage/dev-python/platformdirs-3.5.1/work/platformdirs-3.5.1
vala /var/tmp/portage/dev-python/platformdirs-3.5.1/work/platformdirs-3.5.1 # cat pyproject.toml 
[build-system]
requires = ["flit_core >=3.2,<4"]
build-backend = "flit_core.buildapi"

[project]
name = "platformdirs"
version = "3.5.1"
description = 'A small Python package for determining appropriate platform-specific dirs, e.g. a "user data dir".'
vala /var/tmp/portage/dev-python/platformdirs-3.5.1/work/platformdirs-3.5.1 # gpep517 get-backend
Segmentation fault
Comment 4 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-05-31 19:53:21 UTC
vala /var/tmp/portage/dev-python/platformdirs-3.5.1/work/platformdirs-3.5.1 # gpep517 get-backend
Segmentation fault

That's not good.

Could you build glibc and python with debugging symbols, and then run:
gdb --args /usr/bin/python3.11 /usr/bin/gpep517 get-backend
then 'r', then 'bt', and share the output?

Thanks.
Comment 5 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2023-06-01 03:44:49 UTC
If you have multiple Python versions installed, you could also test:

  pythonX.Y -m gpep517 get-backend

(substituting X.Y appropriately) to see if all of them are affected or only a subset.
Comment 6 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-06-04 06:38:34 UTC
Ping
Comment 7 Andrej Kacian 2023-06-04 08:12:29 UTC
I'm sorry, I've had a rather busy week. Anyway, I rebuilt python with debug symbols, but glibc build failed on a python script error:

make[2]: *** [../Makerules:251: /var/tmp/portage/sys-libs/glibc-2.36-r7/work/build-x86-i686-pc-linux-gnu-nptl/nptl/nptl_lock_constants.py] Error 139
make[2]: Leaving directory '/var/tmp/portage/sys-libs/glibc-2.36-r7/work/glibc-2.36/nptl'
make[1]: *** [Makefile:485: nptl/others] Error 2
make[1]: Leaving directory '/var/tmp/portage/sys-libs/glibc-2.36-r7/work/glibc-2.36'
make: *** [Makefile:9: all] Error 2
make: Leaving directory '/var/tmp/portage/sys-libs/glibc-2.36-r7/work/build-x86-i686-pc-linux-gnu-nptl'


Now, after a reboot, most non-trivial python scripts segfault as well, including things like emerge or quickpkg.

Frankly, I think I'll just give up and replace this with a Debian VM, as in past few years, every python upgrade has caused some sort of problem, and for me this is the last straw. Feel free to close this bug.
Comment 8 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-06-04 08:14:18 UTC
That sounds a lot like a hardware issue then. That's abnormal (and indeed I've never seen it before). But I understand you're frustrated and I can't cure that.

Please let us know if you want to resume debugging.