_i dZddlZddlZddlZddlZddlmZmZmZddl m Z GddeZ de d ee fd Z ejd e d ee fd Zd e d ee fdZedk(rddlZej&Zej+dsJdedeedeej.eddeej0ddej3dddD] Zeedyy)zPEP 656 support. This module implements logic to detect if the currently running Python is linked against musl, and what musl version is used. N)Iterator NamedTupleOptional)ELFFilec"eZdZUeed<eed<y) _MuslVersionmajorminorN)__name__ __module__ __qualname__int__annotations__/builddir/build/BUILDROOT/alt-python312-setuptools-69.0.2-3.el8.x86_64/opt/alt/python312/lib/python3.12/site-packages/setuptools/_vendor/packaging/_musllinux.pyr r s J Jrr outputreturnc@d|jDDcgc]}|s| }}t|dks |ddddk7rytjd|d}|syt t |j dt |j dScc}w) Nc3<K|]}|jyw)N)strip).0ns r z&_parse_musl_version..s@,?q,?srmuslzVersion (\d+)\.(\d+)r)r r ) splitlineslenrematchr rgroup)rrlinesms r_parse_musl_versionr&s@F,=,=,?@ F@1AQ@E F 5zA~q"1/ (%(3A  c!''!*oS_ EE Gs BB executablec* t|d5}t|j}dddd|vryt j|gt jd}t|jS#1swYLxYw#ttt f$rYywxYw)a`Detect currently-running musl runtime version. This is done by checking the specified executable's dynamic linking information, and invoking the loader to parse its output for a version string. If the loader is musl, the output would be something like:: musl libc (x86_64) Version 1.2.2 Dynamic Program Loader rbNrT)stderruniversal_newlines) openr interpreterOSError TypeError ValueError subprocessrunPIPEr&r*)r'fldprocs r_get_musl_versionr7s *d #q''B$ zV2% >>2$z4 PD t{{ ++$ # Y +s' A;A/A;/A84A;;BBarchc#Kttj}|yt|jddD]}d|j d|d|yw)aTGenerate musllinux tags compatible to the current platform. :param arch: Should be the part of platform tag after the ``linux_`` prefix, e.g. ``x86_64``. The ``linux_`` prefix is assumed as a prerequisite for the current platform to be musllinux-compatible. :returns: An iterator of compatible musllinux tags. N musllinux__)r7sysr'ranger r )r8sys_muslr s r platform_tagsr@6sT!0Hx~~r2.8>>*!E7!D6::/sAA__main__zlinux-z not linuxzplat:zmusl:ztags: )endz[.-]r<-r:z )__doc__ functoolsr!r1r=typingrrr_elffilerr strr& lru_cacher7r@r sysconfig get_platformplat startswithprintr'subsplittrrrrSs+   11: FF(>F,#,(<*@,,, ; ; ;  z !9 ! ! #D ??8 $1k1 $ '4 '$S^^45 's 6266'3 30B20FG H aZ Ir