
    wBf                    x    d dl mZ d dlZd dlmZ d dlmZ d dlmZ ddl	m
Z
  ee      Z ed      d
d	       Zy)    )annotationsN)	lru_cache)	getLogger)exists   )on_linux)maxsizec                    t         sydD ]>  } 	 t        j                  |       x}r$|j                         j	                  d      \  }} n@ d\  }}t        j                  d||       |dk(  rd t        j                  d      D        D ]O  }t        j                  |      }t        |      s$|j                  d	      s6|j                  d
      rd}nd} ||fS  d}t        j                  d||       ||fS # t
        $ r Y w xY w)zDIf on linux, returns (libc_family, version), otherwise (None, None).)NN)CS_GNU_LIBC_VERSIONCS_GNU_LIBPTHREAD_VERSION )glibcz2.5z8Failed to detect libc family and version, assuming %s/%sNPTLc              3  Z   K   | ]#  }|j                   d d dk(  s|j                   % y w)N   zlibc.so)namepath).0entrys     6lib/python3.12/site-packages/conda/common/_os/linux.py	<genexpr>z)linux_get_libc_version.<locals>.<genexpr>+   s*      
 %**Ra.I:UEJJ
s   ++z/lib	libuClibcz0.uClibcz	uClibc-ngz1Failed to detect non-glibc family, assuming %s/%s)r   osconfstrstripsplit
ValueErrorlogwarningscandirreadlinkr   
startswith)r   valuefamilyversionclibs        r   linux_get_libc_versionr(      s)    D 
	

4((u("'++-"5"5c": )
 )F	
 
$&JJv$6
 	D ;;t$Dd|??;/))$/!)!, 7?)	 FKKC 7?I  	 	s   9C77	DD)returnz#tuple[str, str] | tuple[None, None])
__future__r   r   	functoolsr   loggingr   os.pathr   compatr   __name__r   r(        r   <module>r2      s<    # 	     4/ /r1   