I hosed my system by doing a @world update and having ~130 packages in-between 'python-exec' and the new python:3.11 slot. I recovered most of it by running the /usr/lib/python-exec/python3.9/emerge script to merge python:3.11, but trying to then single-shot Portage itself to python:3.11 correctly grabbed gemato, but did not grab meson-format-array: >>> Emerging (14 of 15) sys-apps/portage-3.0.51::gentoo * portage-3.0.51.tar.bz2 BLAKE2B SHA512 size ;-) ... [ ok ] * Determining the location of the kernel source code * Found kernel source directory: * /usr/src/linux * Could not find a Makefile in the kernel source directory. * Please ensure that /usr/src/linux points to a complete set of Linux sources * Unable to calculate Linux Kernel version for build, attempting to use running version >>> Unpacking source... >>> Unpacking portage-3.0.51.tar.bz2 to /var/tmp/portage/sys-apps/portage-3.0.51/work >>> Source unpacked in /var/tmp/portage/sys-apps/portage-3.0.51/work >>> Preparing source in /var/tmp/portage/sys-apps/portage-3.0.51/work/portage-3.0.51 ... >>> Source prepared. >>> Configuring source in /var/tmp/portage/sys-apps/portage-3.0.51/work/portage-3.0.51 ... * python3_11: running my_src_configure meson-format-array: no python-exec wrapped executable found in /usr/lib/python-exec. meson-format-array: no python-exec wrapped executable found in /usr/lib/python-exec. meson-format-array: no python-exec wrapped executable found in /usr/lib/python-exec. meson-format-array: no python-exec wrapped executable found in /usr/lib/python-exec. meson-format-array: no python-exec wrapped executable found in /usr/lib/python-exec. meson-format-array: no python-exec wrapped executable found in /usr/lib/python-exec. meson-format-array: no python-exec wrapped executable found in /usr/lib/python-exec. meson-format-array: no python-exec wrapped executable found in /usr/lib/python-exec. meson-format-array: no python-exec wrapped executable found in /usr/lib/python-exec. meson-format-array: no python-exec wrapped executable found in /usr/lib/python-exec. meson-format-array: no python-exec wrapped executable found in /usr/lib/python-exec. meson-format-array: no python-exec wrapped executable found in /usr/lib/python-exec. meson-format-array: no python-exec wrapped executable found in /usr/lib/python-exec. meson-format-array: no python-exec wrapped executable found in /usr/lib/python-exec. meson-format-array: no python-exec wrapped executable found in /usr/lib/python-exec. meson-format-array: no python-exec wrapped executable found in /usr/lib/python-exec. meson-format-array: no python-exec wrapped executable found in /usr/lib/python-exec. meson-format-array: no python-exec wrapped executable found in /usr/lib/python-exec. meson-format-array: no python-exec wrapped executable found in /usr/lib/python-exec. meson-format-array: no python-exec wrapped executable found in /usr/lib/python-exec. meson setup --libdir lib64 --localstatedir /var/lib --prefix /usr --sysconfdir /etc --wrap-mode nodownload --build.pkg-config-path /var/tmp/portage/sys-apps/portage-3.0.51/temp/python3.11/pkgconfig:/usr/share/pkgconfig --pkg-config-path /var/tmp/portage/sys-apps/portage-3.0.51/temp/python3.11/pkgconfig:/usr/share/pkgconfig --native-file /var/tmp/portage/sys-apps/portage-3.0.51/temp/meson.x86_64-pc-linux-gnu.amd64.ini -Db_pch=false -Dwerror=false --buildtype plain -Dcode-only=false -Deprefix= -Dportage-bindir=/usr/lib/portage/python3.11 -Ddocdir=/usr/share/doc/portage-3.0.51 -Ddoc=false -Dapidoc=false -Dgentoo-dev=false -Dipc=true -Dxattr=true -Dnative-extensions=true -Drsync-verify=true /var/tmp/portage/sys-apps/portage-3.0.51/work/portage-3.0.51 /var/tmp/portage/sys-apps/portage-3.0.51/work/portage-3.0.51-python3_11 ERROR: Malformed value in machine file variable 'ar': value cannot be empty. * ERROR: sys-apps/portage-3.0.51::gentoo failed (configure phase): * (no error message) * * Call stack: * ebuild.sh, line 127: Called src_configure * environment, line 3322: Called python_foreach_impl 'my_src_configure' * environment, line 2967: Called multibuild_foreach_variant '_python_multibuild_wrapper' 'my_src_configure' * environment, line 2458: Called _multibuild_run '_python_multibuild_wrapper' 'my_src_configure' * environment, line 2456: Called _python_multibuild_wrapper 'my_src_configure' * environment, line 858: Called my_src_configure * environment, line 2697: Called meson_src_configure * environment, line 2396: Called die * The specific snippet of code: * "${mesonargs[@]}" ) || die * * If you need support, post the output of `emerge --info '=sys-apps/portage-3.0.51::gentoo'`, * the complete build log and the output of `emerge -pqv '=sys-apps/portage-3.0.51::gentoo'`. * The complete build log is located at '/var/tmp/portage/sys-apps/portage-3.0.51/temp/build.log'. * The ebuild environment file is located at '/var/tmp/portage/sys-apps/portage-3.0.51/temp/environment'. * Working directory: '/var/tmp/portage/sys-apps/portage-3.0.51/work/portage-3.0.51' * S: '/var/tmp/portage/sys-apps/portage-3.0.51/work/portage-3.0.51' One-shotting dev-util/meson-format-array before sys-apps/portage made it work. I think the problem is that meson.eclass adds dev-util/meson-format-array but it doesn't do [${PYTHON_USEDEP}] for it. One way to possibly fix this is to hard-code the dep on dev-util/meson-format-array[${PYTHON_USEDEP}] in Portage's ebuild.
Another possible option might be to only install meson-format-array for a single python version and update the shebang to point to the exact versioned python. This would avoid going through python-exec for a script that both doesn't care about its python version and doesn't have any dependencies. It doesn't feel like it gets much value out of being multiversioned.
meson-format-array should work if any of its enabled targets match a target enabled on python-exec. I suspect the issue is that you had meson-format-array installed with only python3_9 enabled, but you rebuilt python-exec with python3_9 disabled. Given that you say you "hosed" your system, I don't think there is much to be done here unless you can provide more exact steps to reproduce the issue.
I think what happened here is what I describe at https://bugs.gentoo.org/916498#c1.