Skip to content

=sci-mathematics/sagemath-standard-10.3 fails as: AttributeError: Can't pickle local object '_prepare_extension_detection.<locals>.<lambda>' #783

@trofi

Description

@trofi

Tried to build sagemath-standard to reproduce a possible tool chain failure. Got the build failure as:

# emerge -av1 sagemath-standard
# emerge -av1 sagemath-standard
...
[ebuild  N     ] sci-mathematics/sagemath-standard-10.3::sage-on-gentoo  USE="X doc jmol -debug -latex -test" PYTHON_TARGETS="python3_11 -python3_10 -python3_12" 0 KiB
[ebuild  N     ] sci-mathematics/sage-doc-10.3::sage-on-gentoo  USE="-doc-pdf" L10N="-ca -de -es -fr -hu -it -ja -pt -ru -tr" 0 KiB
...
************************************************************************
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/usr/lib/python3.11/site-packages/gpep517/__main__.py", line 429, in <module>
    sys.exit(main())
             ^^^^^^
  File "/usr/lib/python3.11/site-packages/gpep517/__main__.py", line 425, in main
    return func(args)
           ^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/gpep517/__main__.py", line 215, in build_wheel
    print(build_wheel_impl(args, args.wheel_dir), file=out)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/gpep517/__main__.py", line 207, in build_wheel_impl
    wheel_name = backend.build_wheel(str(wheel_dir), args.config_json)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/setuptools/build_meta.py", line 410, in build_wheel
    return self._build_with_temp_dir(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/setuptools/build_meta.py", line 395, in _build_with_temp_dir
    self.run_setup()
  File "/usr/lib/python3.11/site-packages/setuptools/build_meta.py", line 311, in run_setup
    exec(code, locals())
  File "<string>", line 105, in <module>
  File "/usr/lib/python3.11/site-packages/setuptools/__init__.py", line 104, in setup
    return distutils.core.setup(**attrs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/setuptools/_distutils/core.py", line 184, in setup
    return run_commands(dist)
           ^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/setuptools/_distutils/core.py", line 200, in run_commands
    dist.run_commands()
  File "/usr/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 969, in run_commands
    self.run_command(cmd)
  File "/usr/lib/python3.11/site-packages/setuptools/dist.py", line 967, in run_command
    super().run_command(command)
  File "/usr/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
    cmd_obj.run()
  File "/usr/lib/python3.11/site-packages/wheel/bdist_wheel.py", line 368, in run
    self.run_command("build")
  File "/usr/lib/python3.11/site-packages/setuptools/_distutils/cmd.py", line 316, in run_command
    self.distribution.run_command(command)
  File "/usr/lib/python3.11/site-packages/setuptools/dist.py", line 967, in run_command
    super().run_command(command)
  File "/usr/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
    cmd_obj.run()
  File "/usr/lib/python3.11/site-packages/setuptools/_distutils/command/build.py", line 132, in run
    self.run_command(cmd_name)
  File "/usr/lib/python3.11/site-packages/setuptools/_distutils/cmd.py", line 316, in run_command
    self.distribution.run_command(command)
  File "/usr/lib/python3.11/site-packages/setuptools/dist.py", line 967, in run_command
    super().run_command(command)
  File "/usr/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
    cmd_obj.run()
  File "/usr/lib/python3.11/site-packages/sage_setup/command/sage_build_ext.py", line 25, in run
    self.run_command('build_cython')
  File "/usr/lib/python3.11/site-packages/setuptools/_distutils/cmd.py", line 316, in run_command
    self.distribution.run_command(command)
  File "/usr/lib/python3.11/site-packages/setuptools/dist.py", line 967, in run_command
    super().run_command(command)
  File "/usr/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
    cmd_obj.run()
  File "/usr/lib/python3.11/site-packages/sage_setup/command/sage_build_cython.py", line 220, in run
    extensions = cythonize(
                 ^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/Cython/Build/Dependencies.py", line 1150, in cythonize
    result.get(99999)  # seconds
    ^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/multiprocessing/pool.py", line 774, in get
    raise self._value
  File "/usr/lib/python3.11/multiprocessing/pool.py", line 540, in _handle_tasks
    put(task)
  File "/usr/lib/python3.11/multiprocessing/connection.py", line 206, in send
    self._send_bytes(_ForkingPickler.dumps(obj))
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/multiprocessing/reduction.py", line 51, in dumps
    cls(buf, protocol).dump(obj)
AttributeError: Can't pickle local object '_prepare_extension_detection.<locals>.<lambda>'
************************************************************************
Error building the Sage library
************************************************************************
 * ERROR: sci-mathematics/sagemath-standard-10.3::sage-on-gentoo failed (compile phase):
 *   Wheel build failed
 *
 * Call stack:
 *     ebuild.sh, line  136:  Called src_compile
 *   environment, line 4476:  Called distutils-r1_src_compile
 *   environment, line 1978:  Called _distutils-r1_run_foreach_impl 'distutils-r1_python_compile'
 *   environment, line  731:  Called python_foreach_impl 'distutils-r1_run_phase' 'distutils-r1_python_compile'
 *   environment, line 4053:  Called multibuild_foreach_variant '_python_multibuild_wrapper' 'distutils-r1_run_phase' 'distutils-r1_python_compile'
 *   environment, line 3491:  Called _multibuild_run '_python_multibuild_wrapper' 'distutils-r1_run_phase' 'distutils-r1_python_compile'
 *   environment, line 3489:  Called _python_multibuild_wrapper 'distutils-r1_run_phase' 'distutils-r1_python_compile'
 *   environment, line 1294:  Called distutils-r1_run_phase 'distutils-r1_python_compile'
 *   environment, line 1960:  Called distutils-r1_python_compile
 *   environment, line 1776:  Called distutils_pep517_install '/dev/shm/portage/sci-mathematics/sagemath-standard-10.3/work/sagemath-standard-10.3-python3_11/install'
 *   environment, line 2345:  Called die
 * The specific snippet of code:
 *       local wheel=$("${cmd[@]}" 3>&1 1>&2 || die "Wheel build failed");
 *
 * If you need support, post the output of `emerge --info '=sci-mathematics/sagemath-standard-10.3::sage-on-gentoo'`,
 * the complete build log and the output of `emerge -pqv '=sci-mathematics/sagemath-standard-10.3::sage-on-gentoo'`.
 * The complete build log is located at '/dev/shm/portage/sci-mathematics/sagemath-standard-10.3/temp/build.log'.
 * The ebuild environment file is located at '/dev/shm/portage/sci-mathematics/sagemath-standard-10.3/temp/environment'.
 * Working directory: '/dev/shm/portage/sci-mathematics/sagemath-standard-10.3/work/sagemath-standard-10.3'
 * S: '/dev/shm/portage/sci-mathematics/sagemath-standard-10.3/work/sagemath-standard-10.3'

>>> Failed to emerge sci-mathematics/sagemath-standard-10.3

 * Messages for package sci-mathematics/sagemath-standard-10.3:

 * ERROR: sci-mathematics/sagemath-standard-10.3::sage-on-gentoo failed (compile phase):
 *   Wheel build failed
 *
 * Call stack:
 *     ebuild.sh, line  136:  Called src_compile
 *   environment, line 4476:  Called distutils-r1_src_compile
 *   environment, line 1978:  Called _distutils-r1_run_foreach_impl 'distutils-r1_python_compile'
 *   environment, line  731:  Called python_foreach_impl 'distutils-r1_run_phase' 'distutils-r1_python_compile'
 *   environment, line 4053:  Called multibuild_foreach_variant '_python_multibuild_wrapper' 'distutils-r1_run_phase' 'distutils-r1_python_compile'
 *   environment, line 3491:  Called _multibuild_run '_python_multibuild_wrapper' 'distutils-r1_run_phase' 'distutils-r1_python_compile'
 *   environment, line 3489:  Called _python_multibuild_wrapper 'distutils-r1_run_phase' 'distutils-r1_python_compile'
 *   environment, line 1294:  Called distutils-r1_run_phase 'distutils-r1_python_compile'
 *   environment, line 1960:  Called distutils-r1_python_compile
 *   environment, line 1776:  Called distutils_pep517_install '/dev/shm/portage/sci-mathematics/sagemath-standard-10.3/work/sagemath-standard-10.3-python3_11/install'
 *   environment, line 2345:  Called die
 * The specific snippet of code:
 *       local wheel=$("${cmd[@]}" 3>&1 1>&2 || die "Wheel build failed");
 *
 * If you need support, post the output of `emerge --info '=sci-mathematics/sagemath-standard-10.3::sage-on-gentoo'`,
 * the complete build log and the output of `emerge -pqv '=sci-mathematics/sagemath-standard-10.3::sage-on-gentoo'`.
 * The complete build log is located at '/dev/shm/portage/sci-mathematics/sagemath-standard-10.3/temp/build.log'.
 * The ebuild environment file is located at '/dev/shm/portage/sci-mathematics/sagemath-standard-10.3/temp/environment'.
 * Working directory: '/dev/shm/portage/sci-mathematics/sagemath-standard-10.3/work/sagemath-standard-10.3'
# emerge --info
# emerge --info
Portage 3.0.64 (python 3.11.9-final-0, default/linux/amd64/17.1, gcc-13, glibc-2.39-r4, 6.9.0-rc5 x86_64)
=================================================================
System uname: Linux-6.9.0-rc5-x86_64-AMD_Ryzen_9_5950X_16-Core_Processor-with-glibc2.39
KiB Mem:   131848004 total,  17565464 free
KiB Swap:  197770748 total, 195366652 free
Head commit of repository gentoo: f653248b062439bfc6fafabae43cb1b94952ab1d

Head commit of repository nix-guix: c91980e8812b78b0221642f5edaf697d479961ab

Head commit of repository sage-on-gentoo: 1669f0e889ca9951f26aafdd33558d9590cc6618

sh bash 5.2_p26-r3
ld GNU ld (Gentoo 2.41 p5) 2.41.0
ccache version 4.9.1 [disabled]
app-misc/pax-utils:        1.3.7::gentoo
app-shells/bash:           5.2_p26-r3::gentoo
dev-build/autoconf:        2.72-r1::gentoo
dev-build/automake:        1.16.5-r2::gentoo
dev-build/cmake:           3.29.2::gentoo
dev-build/libtool:         2.4.7-r4::gentoo
dev-build/make:            4.4.1-r1::gentoo
dev-build/meson:           1.4.0-r1::gentoo
dev-java/java-config:      2.3.3-r1::gentoo
dev-lang/perl:             5.38.2-r2::gentoo
dev-lang/python:           3.11.9::gentoo, 3.12.3::gentoo
dev-lang/rust:             1.77.1::gentoo
dev-util/ccache:           4.9.1-r1::gentoo
sys-apps/baselayout:       2.15::gentoo
sys-apps/sandbox:          2.38::gentoo
sys-apps/systemd:          254.11::gentoo
sys-devel/binutils:        2.41-r5::gentoo, 2.42-r1::gentoo
sys-devel/binutils-config: 5.5::gentoo
sys-devel/gcc:             12.3.1_p20240209::gentoo, 13.2.1_p20240503::gentoo
sys-devel/gcc-config:      2.11::gentoo
sys-devel/llvm:            17.0.6::gentoo, 18.1.5::gentoo
sys-kernel/linux-headers:  6.8-r1::gentoo (virtual/os-headers)
sys-libs/glibc:            2.39-r4::gentoo
Repositories:

gentoo
    location: /var/db/repos/gentoo
    sync-type: git
    sync-uri: https://github.com/gentoo/gentoo.git
    priority: -1000
    volatile: False

crossdev
    location: /co
    masters: gentoo
    volatile: True

nix-guix
    location: /var/db/repos/nix-guix
    sync-type: git
    sync-uri: https://github.com/trofi/nix-guix-gentoo.git
    masters: gentoo
    volatile: False

sage-on-gentoo
    location: /var/db/repos/sage-on-gentoo
    sync-type: git
    sync-uri: https://github.com/cschwan/sage-on-gentoo
    masters: gentoo
    volatile: False

ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="@FREE"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe -fdiagnostics-show-option -frecord-gcc-switches"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-O2 -pipe"
DISTDIR="/bound/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 -pipe"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs buildpkg-live config-protect-if-modified distlocks ebuild-locks fail-clean fixlafiles ipc-sandbox merge-sync merge-wait multilib-strict network-sandbox news parallel-fetch pid-sandbox pkgdir-index-trusted preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="C.UTF8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,--hash-style=gnu"
LEX="flex"
MAKEOPTS="-j17 -l17"
PKGDIR="/var/cache/binpkgs"
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="/dev/shm"
SHELL="/bin/bash"
USE="X acl amd64 bzip2 cli crypt dri fortran gdbm harfbuzz iconv ipv6 libtirpc minizip multilib ncurses nls opengl openmp pam pcre readline seccomp split-usr ssl systemd test-rust text unicode xattr zlib" ABI_X86="64" ADA_TARGET="gcc_12" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_anon authn_dbm authn_file authz_dbm authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir env expires ext_filter file_cache filter headers include info log_config logio 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" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax mtk3301 ntrip navcom oceanserver oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 tsip tripmate tnt ublox" INPUT_DEVICES="libinput" KERNEL="linux" LCD_DEVICES="bayrad cfontz glk hd44780 lb216 lcdm001 mtxorb text" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php8-1" POSTGRES_TARGETS="postgres15" PYTHON_SINGLE_TARGET="python3_11" PYTHON_TARGETS="python3_11" RUBY_TARGETS="ruby31" VIDEO_CARDS="amdgpu fbdev intel nouveau radeon radeonsi vesa dummy" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipp2p iface geoip fuzzy condition tarpit sysrq proto 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, LC_ALL, LD, LFLAGS, LIBTOOL, LINGUAS, MAKE, MAKEFLAGS, NM, OBJCOPY, OBJDUMP, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, PYTHONPATH, RANLIB, READELF, RUSTFLAGS, SIZE, STRINGS, STRIP, YACC, YFLAGS

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions