Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 892982

Summary: dev-python/pbr-5.11.1: fails to build (configure phase) with dev-python/packaging-23.0
Product: Gentoo Linux Reporter: Rémi Cardona <remi2402>
Component: Current packagesAssignee: Matthew Thode ( prometheanfire ) <prometheanfire>
Status: RESOLVED INVALID    
Severity: normal CC: mgorny, openstack, python
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 891359    

Description Rémi Cardona 2023-02-03 06:45:59 UTC
# cat /var/tmp/portage/dev-python/pbr-5.11.1/temp/build.log
 * Package:    dev-python/pbr-5.11.1:0
 * Repository: gentoo
 * Maintainer: prometheanfire@gentoo.org openstack@gentoo.org,python@gentoo.org
 * USE:        abi_x86_64 amd64 elibc_glibc kernel_linux python_targets_python3_10 python_targets_python3_11 python_targets_python3_9 userland_GNU
 * FEATURES:   network-sandbox preserve-libs sandbox splitdebug userpriv usersandbox
>>> Unpacking source...
>>> Unpacking pbr-5.11.1.tar.gz to /var/tmp/portage/dev-python/pbr-5.11.1/work
>>> Source unpacked in /var/tmp/portage/dev-python/pbr-5.11.1/work
>>> Preparing source in /var/tmp/portage/dev-python/pbr-5.11.1/work/pbr-5.11.1 ...
 * Build system packages:
 *   dev-python/gpep517            : 13
 *   dev-python/installer          : 0.6.0
 *   dev-python/setuptools         : 65.6.3
 *   dev-python/setuptools_scm     : 7.1.0
 *   dev-python/wheel              : 0.38.4
>>> Source prepared.
>>> Configuring source in /var/tmp/portage/dev-python/pbr-5.11.1/work/pbr-5.11.1 ...
>>> Source configured.
>>> Compiling source in /var/tmp/portage/dev-python/pbr-5.11.1/work/pbr-5.11.1 ...
 * python3_9: running distutils-r1_run_phase distutils-r1_python_compile
 *   Building the wheel for pbr-5.11.1 via setuptools.build_meta:__legacy__
gpep517 build-wheel --backend setuptools.build_meta:__legacy__ --output-fd 3 --wheel-dir /var/tmp/portage/dev-python/pbr-5.11.1/work/pbr-5.11.1-python3_9/wheel
Traceback (most recent call last):
  File "/usr/lib/python-exec/python3.9/gpep517", line 4, in <module>
    sys.exit(main())
  File "/usr/lib/python3.9/site-packages/gpep517/__main__.py", line 406, in main
    return func(args)
  File "/usr/lib/python3.9/site-packages/gpep517/__main__.py", line 202, in build_wheel
    print(build_wheel_impl(args, args.wheel_dir), file=out)
  File "/usr/lib/python3.9/site-packages/gpep517/__main__.py", line 185, in build_wheel_impl
    backend = importlib.import_module(package)
  File "/usr/lib/python3.9/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 972, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 850, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "/usr/lib/python3.9/site-packages/setuptools/__init__.py", line 247, in <module>
    monkey.patch_all()
  File "/usr/lib/python3.9/site-packages/setuptools/monkey.py", line 97, in patch_all
    patch_for_msvc_specialized_compiler()
  File "/usr/lib/python3.9/site-packages/setuptools/monkey.py", line 134, in patch_for_msvc_specialized_compiler
    msvc = import_module('setuptools.msvc')
  File "/usr/lib/python3.9/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 850, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "/usr/lib/python3.9/site-packages/setuptools/msvc.py", line 24, in <module>
    from packaging.version import LegacyVersion
ImportError: cannot import name 'LegacyVersion' from 'packaging.version' (/usr/lib/python3.9/site-packages/packaging/version.py)
 * ERROR: dev-python/pbr-5.11.1::gentoo failed (compile phase):
 *   Wheel build failed
 *
 * Call stack:
 *     ebuild.sh, line  136:  Called src_compile
 *   environment, line 3294:  Called distutils-r1_src_compile
 *   environment, line 1491:  Called _distutils-r1_run_foreach_impl 'distutils-r1_python_compile'
 *   environment, line  672:  Called python_foreach_impl 'distutils-r1_run_phase' 'distutils-r1_python_compile'
 *   environment, line 2984:  Called multibuild_foreach_variant '_python_multibuild_wrapper' 'distutils-r1_run_phase' 'distutils-r1_python_compile' 
 *   environment, line 2548:  Called _multibuild_run '_python_multibuild_wrapper' 'distutils-r1_run_phase' 'distutils-r1_python_compile'
 *   environment, line 2546:  Called _python_multibuild_wrapper 'distutils-r1_run_phase' 'distutils-r1_python_compile'
 *   environment, line  980:  Called distutils-r1_run_phase 'distutils-r1_python_compile'
 *   environment, line 1473:  Called distutils-r1_python_compile
 *   environment, line 1294:  Called distutils_pep517_install '/var/tmp/portage/dev-python/pbr-5.11.1/work/pbr-5.11.1-python3_9/install'
 *   environment, line 1808:  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 '=dev-python/pbr-5.11.1::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=dev-python/pbr-5.11.1::gentoo'`.
 * The complete build log is located at '/var/tmp/portage/dev-python/pbr-5.11.1/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/dev-python/pbr-5.11.1/temp/environment'.
 * Working directory: '/var/tmp/portage/dev-python/pbr-5.11.1/work/pbr-5.11.1'
 * S: '/var/tmp/portage/dev-python/pbr-5.11.1/work/pbr-5.11.1'



Downgrading packaging to 22.O (which portage then further downgraded to 21.3) fixes the issue.

Reproducible: Always
Comment 1 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-02-03 06:48:18 UTC
Wondering if this is actually pbr or another package that gets imported.
Comment 2 Rémi Cardona 2023-02-03 07:15:32 UTC
Hard to say, as apparently pbr's main purpose is to monkey patch setuptools and provide extensions for it... So this might be quite the rabbit hole.

No bug on the upstream bug tracker (launchpad... so I may have missed something) that I could find.
Comment 3 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2023-02-03 09:17:40 UTC
> *   dev-python/setuptools         : 65.6.3

Here's your culprit.  <67 requires <packaging-22, and 65.7.0 (which is the oldest version in ::gentoo) has a correct dep.
Comment 4 Rémi Cardona 2023-02-03 14:52:41 UTC
I was simply doing:

# emerge -DuN @world --changed-deps -av --keep-going

like I always do and hit this. So there's a missing/bad dep somewhere?
Comment 5 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-02-03 14:59:41 UTC
Yes, Portage doesn't aggressively update deps-of-deps *in order* unless there's a constraint somewhere that forces it (which is correct, really).

So we need to find somewhere to jam one in, I guess. Simply not having bad versions in tree anymore isn't sufficient.