Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 936137 - x11-misc/xkeyboard-config-2.42: Fails to build with python-3.10
Summary: x11-misc/xkeyboard-config-2.42: Fails to build with python-3.10
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo X packagers
URL:
Whiteboard:
Keywords: PullRequest
Depends on:
Blocks:
 
Reported: 2024-07-16 07:07 UTC by Bruno
Modified: 2024-08-12 15:31 UTC (History)
2 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Bruno 2024-07-16 07:07:02 UTC
When updating xkeyboard-config while still having
  PYTHON_TARGETS="python3_10"
  PYTHON_SINGLE_TARGET="python3_10"
compilation fails as follows:


Dependency resolution took 58.80 s (backtrack: 0/20).

[ebuild     U  ] x11-misc/xkeyboard-config-2.42::gentoo [2.41::gentoo] USE="-test" 0 KiB

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

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

>>> Verifying ebuild manifests

>>> Emerging (1 of 1) x11-misc/xkeyboard-config-2.42::gentoo
 * xkeyboard-config-2.42.tar.xz BLAKE2B SHA512 size ;-) ...                                                                                                                                                                                                               [ ok ]
>>> Unpacking source...
>>> Unpacking xkeyboard-config-2.42.tar.xz to /var/tmp/portage/x11-misc/xkeyboard-config-2.42/work
>>> Source unpacked in /var/tmp/portage/x11-misc/xkeyboard-config-2.42/work
>>> Preparing source in /var/tmp/portage/x11-misc/xkeyboard-config-2.42/work/xkeyboard-config-2.42 ...
>>> Source prepared.
>>> Configuring source in /var/tmp/portage/x11-misc/xkeyboard-config-2.42/work/xkeyboard-config-2.42 ...
meson setup -Db_lto=false --libdir lib64 --localstatedir /var/lib --prefix /usr --sysconfdir /etc --wrap-mode nodownload --build.pkg-config-path /usr/share/pkgconfig --pkg-config-path /usr/share/pkgconfig --native-file /var/tmp/portage/x11-misc/xkeyboard-config-2.42/temp/meson.x86_64-pc-linux-gnu.amd64.ini -Db_pch=false -Dwerror=false -Dbuildtype=plain -Dxkb-base=/usr/share/X11/xkb -Dcompat-rules=true /var/tmp/portage/x11-misc/xkeyboard-config-2.42/work/xkeyboard-config-2.42 /var/tmp/portage/x11-misc/xkeyboard-config-2.42/work/xkeyboard-config-2.42-build
The Meson build system
Version: 1.4.1
Source dir: /var/tmp/portage/x11-misc/xkeyboard-config-2.42/work/xkeyboard-config-2.42
Build dir: /var/tmp/portage/x11-misc/xkeyboard-config-2.42/work/xkeyboard-config-2.42-build
Build type: native build
Project name: xkeyboard-config
Project version: 2.42
Host machine cpu family: x86_64
Host machine cpu: x86_64
Found pkg-config: YES (/usr/bin/x86_64-pc-linux-gnu-pkg-config) 2.2.0
Program generate-options-symbols.py found: YES (/var/tmp/portage/x11-misc/xkeyboard-config-2.42/work/xkeyboard-config-2.42/rules/generate-options-symbols.py)
Program compat/map-variants.py found: YES (/var/tmp/portage/x11-misc/xkeyboard-config-2.42/work/xkeyboard-config-2.42/rules/compat/map-variants.py)
Program merge.py found: YES (/var/tmp/portage/x11-misc/xkeyboard-config-2.42/work/xkeyboard-config-2.42/rules/merge.py)
Program xml2lst.pl found: YES (/var/tmp/portage/x11-misc/xkeyboard-config-2.42/work/xkeyboard-config-2.42/rules/xml2lst.pl)
Program xsltproc found: YES (/usr/bin/xsltproc)
Configuring man.xsl using configuration
Program tests/verify-group-names.sh found: YES (/var/tmp/portage/x11-misc/xkeyboard-config-2.42/work/xkeyboard-config-2.42/tests/verify-group-names.sh)
Program python3 (pytest) found: NO
Program pytest-3 pytest found: NO
Program msgfmt found: YES (/usr/bin/msgfmt)
Program msginit found: YES (/usr/bin/msginit)
Program msgmerge found: YES (/usr/bin/msgmerge)
Program xgettext found: YES (/usr/bin/xgettext)
Build targets in project: 66
NOTICE: Future-deprecated features used:
 * 0.64.0: {'copy arg in configure_file'}

xkeyboard-config 2.42

  User defined options
    Native files         : /var/tmp/portage/x11-misc/xkeyboard-config-2.42/temp/meson.x86_64-pc-linux-gnu.amd64.ini
    build.pkg_config_path: /usr/share/pkgconfig
    buildtype            : plain
    libdir               : lib64
    localstatedir        : /var/lib
    pkg_config_path      : /usr/share/pkgconfig
    prefix               : /usr
    sysconfdir           : /etc
    werror               : false
    wrap_mode            : nodownload
    b_lto                : false
    b_pch                : false
    compat-rules         : true
    xkb-base             : /usr/share/X11/xkb

Found ninja-1.11.1 at /usr/bin/ninja
>>> Source configured.
>>> Compiling source in /var/tmp/portage/x11-misc/xkeyboard-config-2.42/work/xkeyboard-config-2.42 ...
ninja -v -j2 -l0
[1/63] /usr/lib/python-exec/python3.10/meson --internal exe --capture rules/0043-option_compat.part -- /var/tmp/portage/x11-misc/xkeyboard-config-2.42/work/xkeyboard-config-2.42/rules/generate-options-symbols.py --rules-section=compatibility --xkb-config-root /var/tmp/portage/x11-misc/xkeyboard-config-2.42/work/xkeyboard-config-2.42 ../xkeyboard-config-2.42/rules/base.xml ../xkeyboard-config-2.42/rules/base.extras.xml
FAILED: rules/0043-option_compat.part 
/usr/lib/python-exec/python3.10/meson --internal exe --capture rules/0043-option_compat.part -- /var/tmp/portage/x11-misc/xkeyboard-config-2.42/work/xkeyboard-config-2.42/rules/generate-options-symbols.py --rules-section=compatibility --xkb-config-root /var/tmp/portage/x11-misc/xkeyboard-config-2.42/work/xkeyboard-config-2.42 ../xkeyboard-config-2.42/rules/base.xml ../xkeyboard-config-2.42/rules/base.extras.xml
--- stderr ---
Traceback (most recent call last):
  File "/var/tmp/portage/x11-misc/xkeyboard-config-2.42/work/xkeyboard-config-2.42/rules/generate-options-symbols.py", line 10, in <module>
    from enum import StrEnum, unique
ImportError: cannot import name 'StrEnum' from 'enum' (/usr/lib/python3.10/enum.py)

[2/63] /usr/lib/python-exec/python3.10/meson --internal exe --capture rules/0042-option_symbols.part -- /var/tmp/portage/x11-misc/xkeyboard-config-2.42/work/xkeyboard-config-2.42/rules/generate-options-symbols.py --rules-section=symbols --xkb-config-root /var/tmp/portage/x11-misc/xkeyboard-config-2.42/work/xkeyboard-config-2.42 ../xkeyboard-config-2.42/rules/base.xml ../xkeyboard-config-2.42/rules/base.extras.xml
FAILED: rules/0042-option_symbols.part 
/usr/lib/python-exec/python3.10/meson --internal exe --capture rules/0042-option_symbols.part -- /var/tmp/portage/x11-misc/xkeyboard-config-2.42/work/xkeyboard-config-2.42/rules/generate-options-symbols.py --rules-section=symbols --xkb-config-root /var/tmp/portage/x11-misc/xkeyboard-config-2.42/work/xkeyboard-config-2.42 ../xkeyboard-config-2.42/rules/base.xml ../xkeyboard-config-2.42/rules/base.extras.xml
--- stderr ---
Traceback (most recent call last):
  File "/var/tmp/portage/x11-misc/xkeyboard-config-2.42/work/xkeyboard-config-2.42/rules/generate-options-symbols.py", line 10, in <module>
    from enum import StrEnum, unique
ImportError: cannot import name 'StrEnum' from 'enum' (/usr/lib/python3.10/enum.py)

ninja: build stopped: subcommand failed.
 * ERROR: x11-misc/xkeyboard-config-2.42::gentoo failed (compile phase):
 *   ninja -v -j2 -l0 failed
 * 
 * Call stack:
 *     ebuild.sh, line  136:  Called src_compile
 *   environment, line 2809:  Called meson_src_compile
 *   environment, line 1988:  Called eninja
 *   environment, line 1412:  Called die
 * The specific snippet of code:
 *       "$@" || die -n "${*} failed"
 * 
 * If you need support, post the output of `emerge --info '=x11-misc/xkeyboard-config-2.42::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=x11-misc/xkeyboard-config-2.42::gentoo'`.
 * The complete build log is located at '/var/tmp/portage/x11-misc/xkeyboard-config-2.42/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/x11-misc/xkeyboard-config-2.42/temp/environment'.
 * Working directory: '/var/tmp/portage/x11-misc/xkeyboard-config-2.42/work/xkeyboard-config-2.42-build'
 * S: '/var/tmp/portage/x11-misc/xkeyboard-config-2.42/work/xkeyboard-config-2.42'

>>> Failed to emerge x11-misc/xkeyboard-config-2.42, Log file:



According to search engines, StrEnum is a python-3.11 feature.

While the ebuild does list
  PYTHON_COMPAT=( python3_{11..12} )
it is still happy attempting install when system only has a python-3.10.
The ebuild gives the impression that python dependency checks only apply for USE=test

Reproducible: Always
Comment 1 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-07-17 03:46:06 UTC
Yeah, the ebuild looks like it needs adjusting in addition to the PYTHON_COMPAT fix.
Comment 2 Larry the Git Cow gentoo-dev 2024-08-12 15:31:17 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=61309a4ab7a675175279172ab0ad4ee2b62881d9

commit 61309a4ab7a675175279172ab0ad4ee2b62881d9
Author:     Maide <github@maide.ca>
AuthorDate: 2024-08-10 22:00:51 +0000
Commit:     Matt Turner <mattst88@gentoo.org>
CommitDate: 2024-08-12 15:31:11 +0000

    x11-misc/xkeyboard-config: Enforce >= python3_11 dependency
    
    Python is now always listed as a dependency, as `xkeyboard-config`
    uses python during the build process whether or not the `test` USE
    flag is set.
    
    Always call `python-any-r1_pkg_setup` during package setup so that
    the `PYTHON_COMPAT` value is used/enforced. This fixes a build error
    if the system's default python is an incompatible version.
    
    Updated trivial homepage url change pkgcheck complained about.
    
    Closes: https://bugs.gentoo.org/936137
    Closes: https://bugs.gentoo.org/933984
    Signed-off-by: Maide <github@maide.ca>
    Closes: https://github.com/gentoo/gentoo/pull/38089
    Signed-off-by: Matt Turner <mattst88@gentoo.org>

 x11-misc/xkeyboard-config/xkeyboard-config-2.42.ebuild | 6 +++---
 x11-misc/xkeyboard-config/xkeyboard-config-9999.ebuild | 6 +++---
 2 files changed, 6 insertions(+), 6 deletions(-)