From e479cb3f2b78fea4a187c10240cbb6d4fc0fa4eb Mon Sep 17 00:00:00 2001 From: Ionen Wolkens Date: Thu, 3 Sep 2026 10:47:23 -0400 Subject: [PATCH] distutils-r1.eclass: fix sip on musl with gpep517 --verify-tags "manylinux" is rightfullly not in supported sys_tags() on a musl system and `gpep517 --verify-tags` rejects it causing an install failure. This changes e.g. pyqt6-6.11.0-cp310-abi3-manylinux_2_34_x86_64.whl to pyqt6-6.11.0-cp310-abi3-linux_x86_64.whl which is accepted for both musl and glibc, so we can do this unconditionally and may be useful for other exotic configurations beside musl. Actual new code is just the sip_args=() and replacing DISTUTILS_ARGS, the rest is just indenting changes given we don't need to check if DISTUTILS_ARGS is empty anymore. Using a separate sip_args (like maturin_args) to keep DISTUTILS_ARGS as-is and prevent incrementing if called multiple times. fwiw not using sip_args for the argument sanity check loop so it doesn't check static eclass arguments for nothing, not that it matters much. Signed-off-by: Ionen Wolkens --- eclass/distutils-r1.eclass | 48 +++++++++++++++++++++----------------- 1 file changed, 27 insertions(+), 21 deletions(-) diff --git a/eclass/distutils-r1.eclass b/eclass/distutils-r1.eclass index 004c042935850..e53499cb4b110 100644 --- a/eclass/distutils-r1.eclass +++ b/eclass/distutils-r1.eclass @@ -1120,30 +1120,36 @@ distutils_pep517_install() { fi ;; sip) - if [[ -n ${DISTUTILS_ARGS[@]} ]]; then - # NB: for practical reasons, we support only --foo=bar, - # not --foo bar - local arg - for arg in "${DISTUTILS_ARGS[@]}"; do - [[ ${arg} != -* ]] && - die "Bare arguments in DISTUTILS_ARGS unsupported: ${arg}" - done + # NB: for practical reasons, we support only --foo=bar, + # not --foo bar + local arg + for arg in "${DISTUTILS_ARGS[@]}"; do + [[ ${arg} != -* ]] && + die "Bare arguments in DISTUTILS_ARGS unsupported: ${arg}" + done - config_settings=$( - "${EPYTHON}" - "${DISTUTILS_ARGS[@]}" <<-EOF || die - import collections - import json - import sys + local sip_args=( + # sip adds manylinux to tags by default which is wrong + # without a curated environment and causes problems on + # musl with gpep517's --verify-tags + --no-manylinux + "${DISTUTILS_ARGS[@]}" + ) - args = collections.defaultdict(list) - for arg in (x.split("=", 1) for x in sys.argv[1:]): \ - args[arg[0]].extend( - [arg[1]] if len(arg) > 1 else []) + config_settings=$( + "${EPYTHON}" - "${sip_args[@]}" <<-EOF || die + import collections + import json + import sys - print(json.dumps(args)) - EOF - ) - fi + args = collections.defaultdict(list) + for arg in (x.split("=", 1) for x in sys.argv[1:]): \ + args[arg[0]].extend( + [arg[1]] if len(arg) > 1 else []) + + print(json.dumps(args)) + EOF + ) ;; *) [[ -n ${DISTUTILS_ARGS[@]} ]] &&