Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Cyclic dependency between setuptools and setuptools-scm
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
CodAv
Apprentice
Apprentice


Joined: 09 May 2004
Posts: 170
Location: Essen, Germany

PostPosted: Sun May 05, 2024 6:01 pm    Post subject: Cyclic dependency between setuptools and setuptools-scm Reply with quote

With a fresh Gentoo installation, I ran into the issue that dev-python/setuptools-scm depends on dev-python/setuptools, but also vice versa:

Code:
[nomerge       ] dev-python/setuptools-69.5.1-r1::gentoo  USE="-test" PYTHON_TARGETS="python3_11 python3_12 -pypy3 -python3_10"
[ebuild  N     ]  dev-python/setuptools-scm-8.0.4::gentoo  USE="-test" PYTHON_TARGETS="python3_11 python3_12 -pypy3 -python3_10" 0 KiB
[ebuild  N     ]   dev-python/setuptools-69.5.1-r1::gentoo  USE="-test" PYTHON_TARGETS="python3_11 python3_12 -pypy3 -python3_10" 0 KiB


I can't merge any of them, because setuptools fails with:
Code:
>>> Compiling source in /var/tmp/portage/dev-python/setuptools-69.5.1-r1/work/setuptools-69.5.1 ...
 * python3_11: running distutils-r1_run_phase distutils-r1_python_compile
 *   Building the wheel for setuptools-69.5.1 via setuptools.build_meta
python3.11 -m gpep517 build-wheel --prefix=/usr --backend setuptools.build_meta --output-fd 3 --wheel-dir /var/tmp/portage/dev-python/setuptools-69.5.1-r1/work/setuptools-69.5.1-python3_11/wheel
2024-05-05 17:58:07,138 gpep517 INFO Building wheel via backend setuptools.build_meta
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 "/var/tmp/portage/dev-python/setuptools-69.5.1-r1/work/setuptools-69.5.1/setuptools/build_meta.py", line 410, in build_wheel
    return self._build_with_temp_dir(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/var/tmp/portage/dev-python/setuptools-69.5.1-r1/work/setuptools-69.5.1/setuptools/build_meta.py", line 395, in _build_with_temp_dir
    self.run_setup()
  File "/var/tmp/portage/dev-python/setuptools-69.5.1-r1/work/setuptools-69.5.1/setuptools/build_meta.py", line 311, in run_setup
    exec(code, locals())
  File "<string>", line 93, in <module>
  File "/var/tmp/portage/dev-python/setuptools-69.5.1-r1/work/setuptools-69.5.1/setuptools/__init__.py", line 104, in setup
    return distutils.core.setup(**attrs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/var/tmp/portage/dev-python/setuptools-69.5.1-r1/work/setuptools-69.5.1/setuptools/_distutils/core.py", line 146, in setup
    _setup_distribution = dist = klass(attrs)
                                 ^^^^^^^^^^^^
  File "/var/tmp/portage/dev-python/setuptools-69.5.1-r1/work/setuptools-69.5.1/setuptools/dist.py", line 307, in __init__
    _Distribution.__init__(self, dist_attrs)
  File "/var/tmp/portage/dev-python/setuptools-69.5.1-r1/work/setuptools-69.5.1/setuptools/_distutils/dist.py", line 284, in __init__
    self.finalize_options()
  File "/var/tmp/portage/dev-python/setuptools-69.5.1-r1/work/setuptools-69.5.1/setuptools/dist.py", line 657, in finalize_options
    for ep in sorted(loaded, key=by_order):
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/var/tmp/portage/dev-python/setuptools-69.5.1-r1/work/setuptools-69.5.1/setuptools/dist.py", line 656, in <lambda>
    loaded = map(lambda e: e.load(), filtered)
                           ^^^^^^^^
  File "/usr/lib/python3.11/importlib/metadata/__init__.py", line 202, in load
    module = import_module(match.group('module'))
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1140, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'setuptools_scm.integration'
 * ERROR: dev-python/setuptools-69.5.1-r1::gentoo failed (compile phase):


And setuptools-scm similarly, requesting a module from setuptools:

Code:
 *   Building the wheel for setuptools-scm-8.0.4 via _own_version_helper:build_meta
python3.11 -m gpep517 build-wheel --prefix=/usr --backend _own_version_helper:build_meta --output-fd 3 --wheel-dir /var/tmp/portage/dev-python/setuptools-scm-8.0.4/work/setuptools-scm-8.0.4-python3_11/wheel
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 198, in build_wheel_impl
    backend = importlib.import_module(package)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 940, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/var/tmp/portage/dev-python/setuptools-scm-8.0.4/work/setuptools-scm-8.0.4/_own_version_helper.py", line 13, in <module>
    from setuptools import build_meta as build_meta  # noqa
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ImportError: cannot import name 'build_meta' from 'setuptools' (unknown location)


To reproduce, just use a fresh stage3 archive, enable a newer python version, e.g. 3.12, then try to install the above packages (or anything that depends on them).

How am I supposed to merge these packages? Or did I overlook something?
_________________
Debian is available in three different versions: rusty, stale and broken.
Back to top
View user's profile Send private message
Josef.95
Advocate
Advocate


Joined: 03 Sep 2007
Posts: 4669
Location: Germany

PostPosted: Sun May 05, 2024 7:23 pm    Post subject: Reply with quote

Hm, not sure, but
Code:
PYTHON_TARGETS="python3_11" emerge -av1 dev-python/setuptools dev-python/setuptools-scm
emerge -avuDU @world
should probably work.
Back to top
View user's profile Send private message
sam_
Developer
Developer


Joined: 14 Aug 2020
Posts: 1970

PostPosted: Sun May 05, 2024 7:34 pm    Post subject: Reply with quote

setuptools' dep on setuptools_scm is a PDEPEND, so this shouldn't happen.

The full emerge output from the command in the initial post may be helpful.

This looks like what happens when you do have setuptools_scm installed (or any setuptools plugin) but its deps or install is otherwise broken, so setuptools tries to load it, but then barfs. This is inconsistent with your initial emerge output showing setuptools_scm isn't installed at all.

The output also doesn't show py3.12 as a *new* impl with e.g. "python3_12*" either?

As such, I have to conclude that...
Quote:

To reproduce, just use a fresh stage3 archive, enable a newer python version, e.g. 3.12, then try to install the above packages (or anything that depends on them).

... is really not sufficient here. Please give far more detail. Do you have PYTHONPATH set? Have you ran 'pip install'? Have you untarred a stage3 over a pre-existing /var/db/pkg or something?
Back to top
View user's profile Send private message
CodAv
Apprentice
Apprentice


Joined: 09 May 2004
Posts: 170
Location: Essen, Germany

PostPosted: Sun May 05, 2024 8:31 pm    Post subject: Reply with quote

I don't have PYTHONPATH set or ran pip. Untarred the stagefile, added my packages to the world file, and changed the Python impls as mentioned at the end of this post. Plus a few USE flags for the world set - I can post a full list if that helps.

Here are the full logs of the above commands, first is a simple "emerge -1 setuptools":

Code:
# emerge -av1 setuptools

 * IMPORTANT: 14 news items need reading for repository 'gentoo'.
 * Use eselect news read to view new items.


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

Calculating dependencies... done!
Dependency resolution took 0.47 s (backtrack: 0/20).

[ebuild  N     ] dev-python/setuptools-69.5.1-r1::gentoo  USE="-test" PYTHON_TARGETS="python3_11 python3_12 -pypy3 -python3_10" 0 KiB
[ebuild  N     ] dev-python/setuptools-scm-8.0.4::gentoo  USE="-test" PYTHON_TARGETS="python3_11 python3_12 -pypy3 -python3_10" 0 KiB

Total: 2 packages (2 new), Size of downloads: 0 KiB

Would you like to merge these packages? [Yes/No]

>>> Verifying ebuild manifests

>>> Emerging (1 of 2) dev-python/setuptools-69.5.1-r1::gentoo
 * Fetching files in the background.
 * To view fetch progress, run in another terminal:
 * tail -f /var/log/emerge-fetch.log
 * setuptools-69.5.1.tar.gz BLAKE2B SHA512 size ;-) ...                                                                                                                                                                                                               [ ok ]
>>> Unpacking source...
>>> Unpacking setuptools-69.5.1.tar.gz to /var/tmp/portage/dev-python/setuptools-69.5.1-r1/work
>>> Source unpacked in /var/tmp/portage/dev-python/setuptools-69.5.1-r1/work
>>> Preparing source in /var/tmp/portage/dev-python/setuptools-69.5.1-r1/work/setuptools-69.5.1 ...
 * Applying setuptools-62.4.0-py-compile.patch ...                                                                                                                                                                                                                    [ ok ]
 * Build system packages:
 *   dev-python/gpep517            : 15
 *   dev-python/installer          : 0.7.0
>>> Source prepared.
>>> Configuring source in /var/tmp/portage/dev-python/setuptools-69.5.1-r1/work/setuptools-69.5.1 ...
>>> Source configured.
>>> Compiling source in /var/tmp/portage/dev-python/setuptools-69.5.1-r1/work/setuptools-69.5.1 ...
 * python3_11: running distutils-r1_run_phase distutils-r1_python_compile
 *   Building the wheel for setuptools-69.5.1 via setuptools.build_meta
python3.11 -m gpep517 build-wheel --prefix=/usr --backend setuptools.build_meta --output-fd 3 --wheel-dir /var/tmp/portage/dev-python/setuptools-69.5.1-r1/work/setuptools-69.5.1-python3_11/wheel
2024-05-05 20:19:18,000 gpep517 INFO Building wheel via backend setuptools.build_meta
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 "/var/tmp/portage/dev-python/setuptools-69.5.1-r1/work/setuptools-69.5.1/setuptools/build_meta.py", line 410, in build_wheel
    return self._build_with_temp_dir(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/var/tmp/portage/dev-python/setuptools-69.5.1-r1/work/setuptools-69.5.1/setuptools/build_meta.py", line 395, in _build_with_temp_dir
    self.run_setup()
  File "/var/tmp/portage/dev-python/setuptools-69.5.1-r1/work/setuptools-69.5.1/setuptools/build_meta.py", line 311, in run_setup
    exec(code, locals())
  File "<string>", line 93, in <module>
  File "/var/tmp/portage/dev-python/setuptools-69.5.1-r1/work/setuptools-69.5.1/setuptools/__init__.py", line 104, in setup
    return distutils.core.setup(**attrs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/var/tmp/portage/dev-python/setuptools-69.5.1-r1/work/setuptools-69.5.1/setuptools/_distutils/core.py", line 146, in setup
    _setup_distribution = dist = klass(attrs)
                                 ^^^^^^^^^^^^
  File "/var/tmp/portage/dev-python/setuptools-69.5.1-r1/work/setuptools-69.5.1/setuptools/dist.py", line 307, in __init__
    _Distribution.__init__(self, dist_attrs)
  File "/var/tmp/portage/dev-python/setuptools-69.5.1-r1/work/setuptools-69.5.1/setuptools/_distutils/dist.py", line 284, in __init__
    self.finalize_options()
  File "/var/tmp/portage/dev-python/setuptools-69.5.1-r1/work/setuptools-69.5.1/setuptools/dist.py", line 657, in finalize_options
    for ep in sorted(loaded, key=by_order):
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/var/tmp/portage/dev-python/setuptools-69.5.1-r1/work/setuptools-69.5.1/setuptools/dist.py", line 656, in <lambda>
    loaded = map(lambda e: e.load(), filtered)
                           ^^^^^^^^
  File "/usr/lib/python3.11/importlib/metadata/__init__.py", line 202, in load
    module = import_module(match.group('module'))
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1140, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'setuptools_scm.integration'
 * ERROR: dev-python/setuptools-69.5.1-r1::gentoo failed (compile phase):
 *   Wheel build failed
 *
 * Call stack:
 *     ebuild.sh, line  136:  Called src_compile
 *   environment, line 3992:  Called distutils-r1_src_compile
 *   environment, line 1894:  Called _distutils-r1_run_foreach_impl 'distutils-r1_python_compile'
 *   environment, line  724:  Called python_foreach_impl 'distutils-r1_run_phase' 'distutils-r1_python_compile'
 *   environment, line 3603:  Called multibuild_foreach_variant '_python_multibuild_wrapper' 'distutils-r1_run_phase' 'distutils-r1_python_compile'
 *   environment, line 3109:  Called _multibuild_run '_python_multibuild_wrapper' 'distutils-r1_run_phase' 'distutils-r1_python_compile'
 *   environment, line 3107:  Called _python_multibuild_wrapper 'distutils-r1_run_phase' 'distutils-r1_python_compile'
 *   environment, line 1210:  Called distutils-r1_run_phase 'distutils-r1_python_compile'
 *   environment, line 1876:  Called distutils-r1_python_compile
 *   environment, line 1692:  Called distutils_pep517_install '/var/tmp/portage/dev-python/setuptools-69.5.1-r1/work/setuptools-69.5.1-python3_11/install'
 *   environment, line 2261:  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/setuptools-69.5.1-r1::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=dev-python/setuptools-69.5.1-r1::gentoo'`.
 * The complete build log is located at '/var/tmp/portage/dev-python/setuptools-69.5.1-r1/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/dev-python/setuptools-69.5.1-r1/temp/environment'.
 * Working directory: '/var/tmp/portage/dev-python/setuptools-69.5.1-r1/work/setuptools-69.5.1'
 * S: '/var/tmp/portage/dev-python/setuptools-69.5.1-r1/work/setuptools-69.5.1'

>>> Failed to emerge dev-python/setuptools-69.5.1-r1, Log file:

>>>  '/var/tmp/portage/dev-python/setuptools-69.5.1-r1/temp/build.log'

 * Messages for package dev-python/setuptools-69.5.1-r1:

 * ERROR: dev-python/setuptools-69.5.1-r1::gentoo failed (compile phase):
 *   Wheel build failed
 *
 * Call stack:
 *     ebuild.sh, line  136:  Called src_compile
 *   environment, line 3992:  Called distutils-r1_src_compile
 *   environment, line 1894:  Called _distutils-r1_run_foreach_impl 'distutils-r1_python_compile'
 *   environment, line  724:  Called python_foreach_impl 'distutils-r1_run_phase' 'distutils-r1_python_compile'
 *   environment, line 3603:  Called multibuild_foreach_variant '_python_multibuild_wrapper' 'distutils-r1_run_phase' 'distutils-r1_python_compile'
 *   environment, line 3109:  Called _multibuild_run '_python_multibuild_wrapper' 'distutils-r1_run_phase' 'distutils-r1_python_compile'
 *   environment, line 3107:  Called _python_multibuild_wrapper 'distutils-r1_run_phase' 'distutils-r1_python_compile'
 *   environment, line 1210:  Called distutils-r1_run_phase 'distutils-r1_python_compile'
 *   environment, line 1876:  Called distutils-r1_python_compile
 *   environment, line 1692:  Called distutils_pep517_install '/var/tmp/portage/dev-python/setuptools-69.5.1-r1/work/setuptools-69.5.1-python3_11/install'
 *   environment, line 2261:  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/setuptools-69.5.1-r1::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=dev-python/setuptools-69.5.1-r1::gentoo'`.
 * The complete build log is located at '/var/tmp/portage/dev-python/setuptools-69.5.1-r1/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/dev-python/setuptools-69.5.1-r1/temp/environment'.
 * Working directory: '/var/tmp/portage/dev-python/setuptools-69.5.1-r1/work/setuptools-69.5.1'
 * S: '/var/tmp/portage/dev-python/setuptools-69.5.1-r1/work/setuptools-69.5.1'


Second one a "emerge -1 --nodeps setuptools-scm" (done just for testing what this one shows):

Code:

# emerge -av1 --nodeps setuptools-scm

 * IMPORTANT: 14 news items need reading for repository 'gentoo'.
 * Use eselect news read to view new items.


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

[ebuild  N     ] dev-python/setuptools-scm-8.0.4::gentoo  USE="-test" PYTHON_TARGETS="python3_11 python3_12 -pypy3 -python3_10" 0 KiB

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

Would you like to merge these packages? [Yes/No]

>>> Verifying ebuild manifests

>>> Emerging (1 of 1) dev-python/setuptools-scm-8.0.4::gentoo
 * setuptools-scm-8.0.4.tar.gz BLAKE2B SHA512 size ;-) ...                                                                                                                                                                                                            [ ok ]
>>> Unpacking source...
>>> Unpacking setuptools-scm-8.0.4.tar.gz to /var/tmp/portage/dev-python/setuptools-scm-8.0.4/work
>>> Source unpacked in /var/tmp/portage/dev-python/setuptools-scm-8.0.4/work
>>> Preparing source in /var/tmp/portage/dev-python/setuptools-scm-8.0.4/work/setuptools-scm-8.0.4 ...
 * Build system packages:
 *   dev-python/gpep517            : 15
 *   dev-python/installer          : 0.7.0
>>> Source prepared.
>>> Configuring source in /var/tmp/portage/dev-python/setuptools-scm-8.0.4/work/setuptools-scm-8.0.4 ...
>>> Source configured.
>>> Compiling source in /var/tmp/portage/dev-python/setuptools-scm-8.0.4/work/setuptools-scm-8.0.4 ...
 * python3_11: running distutils-r1_run_phase distutils-r1_python_compile
 *   Building the wheel for setuptools-scm-8.0.4 via _own_version_helper:build_meta
python3.11 -m gpep517 build-wheel --prefix=/usr --backend _own_version_helper:build_meta --output-fd 3 --wheel-dir /var/tmp/portage/dev-python/setuptools-scm-8.0.4/work/setuptools-scm-8.0.4-python3_11/wheel
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 198, in build_wheel_impl
    backend = importlib.import_module(package)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 940, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/var/tmp/portage/dev-python/setuptools-scm-8.0.4/work/setuptools-scm-8.0.4/_own_version_helper.py", line 13, in <module>
    from setuptools import build_meta as build_meta  # noqa
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ImportError: cannot import name 'build_meta' from 'setuptools' (unknown location)
 * ERROR: dev-python/setuptools-scm-8.0.4::gentoo failed (compile phase):
 *   Wheel build failed
 *
 * Call stack:
 *     ebuild.sh, line  136:  Called src_compile
 *   environment, line 3972:  Called distutils-r1_src_compile
 *   environment, line 1880:  Called _distutils-r1_run_foreach_impl 'distutils-r1_python_compile'
 *   environment, line  725:  Called python_foreach_impl 'distutils-r1_run_phase' 'distutils-r1_python_compile'
 *   environment, line 3589:  Called multibuild_foreach_variant '_python_multibuild_wrapper' 'distutils-r1_run_phase' 'distutils-r1_python_compile'
 *   environment, line 3095:  Called _multibuild_run '_python_multibuild_wrapper' 'distutils-r1_run_phase' 'distutils-r1_python_compile'
 *   environment, line 3093:  Called _python_multibuild_wrapper 'distutils-r1_run_phase' 'distutils-r1_python_compile'
 *   environment, line 1196:  Called distutils-r1_run_phase 'distutils-r1_python_compile'
 *   environment, line 1862:  Called distutils-r1_python_compile
 *   environment, line 1678:  Called distutils_pep517_install '/var/tmp/portage/dev-python/setuptools-scm-8.0.4/work/setuptools-scm-8.0.4-python3_11/install'
 *   environment, line 2247:  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/setuptools-scm-8.0.4::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=dev-python/setuptools-scm-8.0.4::gentoo'`.
 * The complete build log is located at '/var/tmp/portage/dev-python/setuptools-scm-8.0.4/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/dev-python/setuptools-scm-8.0.4/temp/environment'.
 * Working directory: '/var/tmp/portage/dev-python/setuptools-scm-8.0.4/work/setuptools-scm-8.0.4'
 * S: '/var/tmp/portage/dev-python/setuptools-scm-8.0.4/work/setuptools-scm-8.0.4'

>>> Failed to emerge dev-python/setuptools-scm-8.0.4, Log file:

>>>  '/var/tmp/portage/dev-python/setuptools-scm-8.0.4/temp/build.log'

 * Messages for package dev-python/setuptools-scm-8.0.4:

 * ERROR: dev-python/setuptools-scm-8.0.4::gentoo failed (compile phase):
 *   Wheel build failed
 *
 * Call stack:
 *     ebuild.sh, line  136:  Called src_compile
 *   environment, line 3972:  Called distutils-r1_src_compile
 *   environment, line 1880:  Called _distutils-r1_run_foreach_impl 'distutils-r1_python_compile'
 *   environment, line  725:  Called python_foreach_impl 'distutils-r1_run_phase' 'distutils-r1_python_compile'
 *   environment, line 3589:  Called multibuild_foreach_variant '_python_multibuild_wrapper' 'distutils-r1_run_phase' 'distutils-r1_python_compile'
 *   environment, line 3095:  Called _multibuild_run '_python_multibuild_wrapper' 'distutils-r1_run_phase' 'distutils-r1_python_compile'
 *   environment, line 3093:  Called _python_multibuild_wrapper 'distutils-r1_run_phase' 'distutils-r1_python_compile'
 *   environment, line 1196:  Called distutils-r1_run_phase 'distutils-r1_python_compile'
 *   environment, line 1862:  Called distutils-r1_python_compile
 *   environment, line 1678:  Called distutils_pep517_install '/var/tmp/portage/dev-python/setuptools-scm-8.0.4/work/setuptools-scm-8.0.4-python3_11/install'
 *   environment, line 2247:  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/setuptools-scm-8.0.4::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=dev-python/setuptools-scm-8.0.4::gentoo'`.
 * The complete build log is located at '/var/tmp/portage/dev-python/setuptools-scm-8.0.4/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/dev-python/setuptools-scm-8.0.4/temp/environment'.
 * Working directory: '/var/tmp/portage/dev-python/setuptools-scm-8.0.4/work/setuptools-scm-8.0.4'
 * S: '/var/tmp/portage/dev-python/setuptools-scm-8.0.4/work/setuptools-scm-8.0.4'


Python implementations are configured like this:
Code:

PYTHON_TARGETS="python3_11 python3_12"
PYTHON_SINGLE_TARGET="python3_11"


Not sure why it doesn't show the two newer Python versions as new uses, porbably because I've already tried to merge it many times over.

Building it with
Code:

PYTHON_TARGETS="python3_10"
PYTHON_SINGLE_TARGET="python3_10"


doesn't work either, same error.

If I read the output correctly, some plugin that setuptools tries to import has a dependency on setuptools-scm, possibly "wheel", but that's not exactly clear as the code seems to iterate over a list of plugins.

That said, I suspect setuptools itself isn't the real culprit, but some other package used in the build. As a C++ dev, I sadly don't have enough insight into how this stuff works.
_________________
Debian is available in three different versions: rusty, stale and broken.


Last edited by CodAv on Sun May 05, 2024 8:37 pm; edited 1 time in total
Back to top
View user's profile Send private message
sam_
Developer
Developer


Joined: 14 Aug 2020
Posts: 1970

PostPosted: Sun May 05, 2024 8:35 pm    Post subject: Reply with quote

That doesn't make sense - you have the packages missing from the VDB. You need to tell us how that happened.
Back to top
View user's profile Send private message
CodAv
Apprentice
Apprentice


Joined: 09 May 2004
Posts: 170
Location: Essen, Germany

PostPosted: Sun May 05, 2024 8:48 pm    Post subject: Reply with quote

You mean that they're shown as "NEW"?

Well, more often than not it helps to remove the offending packages and reinstall them (or any of their dependencies) if something breaks. After many tries I've removed them, but the exact same error persists. So this really shouldn't make much of a difference. If dev-python/setuptools always need itself (or a package depending on itself) already installed to be built, it's also not a great thing.

Anyways, before I waste too much time, I'll start over again with a fresh stage until it'll go through, trying some different approaches. If I find anything that helps with this particular issue, I'll post an update.

Edit: Only a guess, but to me it looks like some package from my /var/lib/portage/world file pulled in setuptools-scm as a dependency, and doing an "emerge -e @world" then seemingly messed up some dependencies between Python packages. Didn't try to go through the huge dependency tree of all packages to find more clues, so I'll now first fully update the fresh stage with mostly default settings, and then step by step add in more of my previous system's USE flags and packages, then see when or if it breaks.
_________________
Debian is available in three different versions: rusty, stale and broken.
Back to top
View user's profile Send private message
sam_
Developer
Developer


Joined: 14 Aug 2020
Posts: 1970

PostPosted: Sun May 05, 2024 9:56 pm    Post subject: Reply with quote

CodAv wrote:
You mean that they're shown as "NEW"?

Well, more often than not it helps to remove the offending packages and reinstall them (or any of their dependencies) if something breaks. After many tries I've removed them, but the exact same error persists. So this really shouldn't make much of a difference. If dev-python/setuptools always need itself (or a package depending on itself) already installed to be built, it's also not a great thing.


No, you shouldn't do that. You can emerge --oneshot things, you should never unmerge.

Like I suggested earlier, unmerging in particular will break anything where a plugin model is used. setuptools will try to load things from a directory if they exist and assume they work. If you unmerged a dep of one of those said things, it's going to explode.


CodAv wrote:

Anyways, before I waste too much time, I'll start over again with a fresh stage until it'll go through, trying some different approaches. If I find anything that helps with this particular issue, I'll post an update.

Edit: Only a guess, but to me it looks like some package from my /var/lib/portage/world file pulled in setuptools-scm as a dependency, and doing an "emerge -e @world" then seemingly messed up some dependencies between Python packages. Didn't try to go through the huge dependency tree of all packages to find more clues, so I'll now first fully update the fresh stage with mostly default settings, and then step by step add in more of my previous system's USE flags and packages, then see when or if it breaks.


Yes, please show us what goes wrong in a clean stage3. We tried and couldn't reproduce it. As noted above, setuptools' dependency on setuptools_scm is only via a PDEPEND and it's kind of a workaround for something else - setuptools doesn't actually need it, it's just that if it's there, it'll try to use it.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum