+
    UBi                       R t ^ RIHt ^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt	^ RI
t^ RIHt ^RIHtHt ^RIHt ^RIHt ^RIHtHtHtHtHt ^RIHtHtHtHt ^R	IHtH t  ^R
I!H"t" ]PF                  '       d-   ^RIH$t$ ^RIH%t% ^RIH&t&H't' ^RI(H)t) ^RI*H+t+ ^RI,H-t- ^ RI.H/t/ R,R R llt0R R lt1R-R R llt2R R lt3R R lt4]Pj                   ! R R4      4       t6]Pj                   ! R R4      4       t7]Pj                  ! R R!7       ! R" R#4      4       t8]Pj                   ! R$ R%4      4       t9 ! R& R'4      t:R.R( R) llt;R* R+ lt<R# )/aA  Interpreter for converting Cargo Toml definitions to Meson AST

There are some notable limits here. We don't even try to convert something with
a build.rs: there's so few limits on what Cargo allows a build.rs (basically
none), and no good way for us to convert them. In that case, an actual meson
port will be required.
)annotationsN)PurePath)builderversion)eval_cfg)	load_toml)Manifest	CargoLockCargoLockPackage	Workspacefixup_meson_varname)is_parent_pathMesonExceptionMachineChoiceversion_compare)coredatamlog)PackageDefinition)raw)mparser)
DependencySystemDependency)Environment)
SubProject)RustCompiler)Literalc               (    V ^8  d   QhRRRRRRRR/# )   package_namestrapisuffixreturn )formats   "A/usr/lib/python3.14/site-packages/mesonbuild/cargo/interpreter.py__annotate__r&   (   s(     ' '3 'S '# '# '    c                t    V'       d'   V P                  V4      '       d   V R \        V4      )  MT pV RV V 2# )N-)endswithlen)r   r    r!   basenames   &&& r%   _dependency_namer-   (   s>    .49N9Nv9V9V|Mc&k\*\hHZqfX&&r'   c                    V ^8  d   QhRRRR/# )r   depr   r"   r   r#   )r$   s   "r%   r&   r&   -   s     S SZ SC Sr'   c                l    \        V P                  4       R V P                  P                  RR 4       R2# )_._dep)r   packager    replace)r/   s   &r%   _dependency_varnamer6   -   s/    !#++./q#''//#s2K0MTRRr'   c               (    V ^8  d   QhRRRRRRRR/# )r   namer   r    lib_type"Literal['rust', 'c', 'proc-macro']r"   r#   )r$   s   "r%   r&   r&   1   s*     - - -# -1S -ad -r'   c                B    VR 8X  d   V # V  RVP                  RR4       2# )c+r2   r1   )r5   )r8   r    r9   s   &&&r%   _library_namer>   1   s-     3V1S[[c*+,,r'   c                   V ^8  d   QhRR/# r   r"   r   r#   )r$   s   "r%   r&   r&   :         S r'   c                     R # )
extra_argsr#   r#   r'   r%   _extra_args_varnamerD   :       r'   c                   V ^8  d   QhRR/# r@   r#   )r$   s   "r%   r&   r&   >   rA   r'   c                     R # )
extra_depsr#   r#   r'   r%   _extra_deps_varnamerI   >   rE   r'   c                      ] tR t^Bt$ Rt]P                  ! ]R7      tR]	R&   ]P                  ! ]R7      t
R]	R&   ]P                  ! R R7      tR]	R&   ]P                  ! ]R7      tR	]	R
&   R R ltR R ltRtR# )PackageConfigurationz9Configuration for a package during dependency resolution.default_factoryz
T.Set[str]featuresrequired_depsc                 	6    \         P                  ! \        4      # N)collectionsdefaultdictsetr#   r'   r%   <lambda>PackageConfiguration.<lambda>G   s    `k`w`wx{`|r'   zT.Dict[str, T.Set[str]]optional_deps_featuresz T.Dict[PackageKey, PackageState]dep_packagesc                   V ^8  d   QhRR/# r   r"   T.List[str]r#   )r$   s   "r%   r&   !PackageConfiguration.__annotate__K   s      ; r'   c                ^    . pV P                    F  pVP                  RRV R2.4       K  	  V# )z$Get feature configuration arguments.--cfgz	feature="")rN   extend)selfargsfeatures   &  r%   get_features_args&PackageConfiguration.get_features_argsK   s4    }}GKKIgYa"89: %r'   c                    V ^8  d   QhRRRR/# )r   manifestr   r"   T.Dict[str, str]r#   )r$   s   "r%   r&   r\   R   s     
 
8 
8H 
r'   c                   / pV P                    F  pVP                  V,          p\        VP                  VP                  4      pV P
                  V,          p\        VP                  P                  P                  VP                  P                  P                  4      pW4P                  8w  d   TMVP                  P                  P                  pWV&   K  	  V# )z?Get the rust dependency mapping for this package configuration.)
rO   dependencies
PackageKeyr4   r    rX   r>   rg   libr8   )	ra   rg   dependency_mapr8   r/   dep_keydep_pkgdep_lib_namedep_crate_names	   &&       r%   get_dependency_map'PackageConfiguration.get_dependency_mapR   s    +-&&D''-C cgg6G''0G()9)9)=)=)B)BGDTDTD\D\D`D`aL%)[[%8Tg>N>N>R>R>W>WN+9<( ' r'   r#   N)__name__
__module____qualname____firstlineno____doc__dataclassesfieldrT   rN   __annotations__rO   rW   dictrX   rd   rr   __static_attributes__r#   r'   r%   rK   rK   B   sm    C&,,SAHjA + 1 1# FM:F6A6G6GX|6}3}5@5F5FW[5\L2\
 
r'   rK   c                      ] tR t^_t$ R]R&   RtR]R&   RtR]R&   RtR]R	&   RtR
]R&   R R lt	R R lt
R R ltR R ltRtR# )PackageStater   rg   Fbool
downloadedNT.Optional[str]	ws_subdir	ws_memberz T.Optional[PackageConfiguration]cfgc               $    V ^8  d   QhRRRRRR/# )r   environmentr   subdirr   r"   rh   r#   )r$   s   "r%   r&   PackageState.__annotate__i   s"     
 
 
S 
EU 
r'   c                l   \         P                  P                  VP                  VR4      p\         P                  ! VRR7       V P
                  P                  P                  P                  R4      pVR.^\        V4      ,
          ,          ,          p/ RVbR\         P                  P                  VP                  V4      bR\         P                  P                  VP                  VR	4      bR
V P
                  P                  P                  bRV^ ,          bRV^,          bRV^,          bRV^,          bRRP                  V P
                  P                  P                  4      bRV P
                  P                  P                  bRV P
                  P                  P                  ;'       g    RbRV P
                  P                  P                  ;'       g    RbRV P
                  P                  P                  ;'       g    RbRV P
                  P                  P                   ;'       g    RbRV P
                  P                  P"                  ;'       g    RbRV P
                  P                  P$                  ;'       g    RbR\'        V P
                  P                  P                  4      b# )z+Get environment variables for this package.mesonT)exist_okr2    OUT_DIRCARGO_MANIFEST_DIRCARGO_MANIFEST_PATH
Cargo.tomlCARGO_PKG_VERSIONCARGO_PKG_VERSION_MAJORCARGO_PKG_VERSION_MINORCARGO_PKG_VERSION_PATCHCARGO_PKG_VERSION_PRECARGO_PKG_AUTHORS,CARGO_PKG_NAMECARGO_PKG_HOMEPAGECARGO_PKG_REPOSITORYCARGO_PKG_LICENSECARGO_PKG_LICENSE_FILECARGO_PKG_RUST_VERSIONCARGO_PKG_READMECARGO_CRATE_NAME)ospathjoin	build_dirmakedirsrg   r4   r   splitr+   
source_dirauthorsr8   homepage
repositorylicenselicense_filerust_versionreadmer   )ra   r   r   out_dirversion_arrs   &&&  r%   get_env_dictPackageState.get_env_dicti   sW    '',,{44fgF
Gd+mm++3399#>tq3{#3344
w
 "'',,{/E/Ev"N
 "277<<0F0FP\#]
  !6!6!>!>	

 &{1~
 &{1~
 &{1~
 $[^
  $--*?*?*G*G!H
 dmm3388
 !$--"7"7"@"@"F"FB
 #DMM$9$9$D$D$J$J
  !6!6!>!>!D!D"
  %dmm&;&;&H&H&N&NB!
" %dmm&;&;&H&H&N&NB#
$  5 5 < < B B%
&  3DMM4I4I4N4N O'
 	
r'   c                    V ^8  d   QhRRRR/# )r   rustcr   r"   r[   r#   )r$   s   "r%   r&   r      s      < K r'   c                   . pVP                   pV P                  P                   F#  pVP                  VP	                  V4      4       K%  	  V'       d   V P                  P
                   F2  pVR8w  g   K  VP                  R4       VP                  RV R24       K4  	  V P                  P                   F2  pVP                  R4       VP                  R\        V4       R24       K4  	  V# )z$Get lint arguments for this package.defaultz--check-cfgzcfg(feature,values("z"))zcfg(system_deps_have_))	has_check_cfgrg   lintsr`   to_argumentsrN   appendsystem_dependenciesr   )ra   r   rb   r   lintrc   r8   s   &&     r%   get_lint_argsPackageState.get_lint_args   s    ++MM''DKK))-89 ( ==11i'KK.KK"6wis CD 2 99M*34G4M3NaPQ : r'   c               (    V ^8  d   QhRRRRRRRR/# )	r   r   r   r   r   r   r   r"   r[   r#   )r$   s   "r%   r&   r      s*     
 
, 
[ 
RU 
Ze 
r'   c                    VP                  4       pVf   . # V P                  W#4      p\        V4      pVP                  4        F  w  rxVP	                  RV RV 2.4       K  	  V# )z-Get environment variable arguments for rustc.z	--env-set=)enable_env_set_argsr   listitemsr`   )	ra   r   r   r   r   env_dictenv_argskvs	   &&&&     r%   get_env_argsPackageState.get_env_args   sj    #779&I$$[9+,NN$DAOO[QCq*56 %r'   c               (    V ^8  d   QhRRRRRRRR/# )	r   r   r   r   r   machiner   r"   r[   r#   )r$   s   "r%   r&   r      s)      + s ] _j r'   c                   VP                  4       '       g   \        P                  p\        P                  ! RVP
                  P                  V,          R,          4      pV P                  p. pVP                  V P                  V4      4       VP                  VP                  4       4       VP                  V P                  WAV4      4       V# )z%Get rustc arguments for this package.r   rust)is_cross_buildr   HOSTTcastr   	compilersr   r`   r   rd   r   )ra   r   r   r   r   r   rb   s   &&&&   r%   get_rustc_argsPackageState.get_rustc_args   s    ))++#((G~{';';'E'Eg'Nv'VWhhD&&u-.C))+,D%%e&ABr'   r#   )rt   ru   rv   rw   r{   r   r   r   r   r   r   r   r   r}   r#   r'   r%   r   r   _   sK    J!%I%!%I%,0C	)0
B&
 r'   r   T)frozenc                  ,    ] tR t^t$ R]R&   R]R&   RtR# )rk   r   r   r    r#   N)rt   ru   rv   rw   r{   r}   r#   r'   r%   rk   rk      s    	Hr'   rk   c                      ] tR t^t$ R]R&   R]R&   RtR]R&   ]P                  ! ]R7      t	R	]R
&   ]P                  ! ]R7      t
R]R&   ]P                  ! ]R7      tR]R&   RtR# )WorkspaceStater   	workspacer   r   Fr   r   rL   zT.Dict[str, PackageState]packagesrh   packages_to_memberr[   required_membersr#   N)rt   ru   rv   rw   r{   r   ry   rz   r|   r   r   r   r   r}   r#   r'   r%   r   r      sZ    KJ*5*;*;D*QH'Q+6+<+<T+R(R$/$5$5d$KkKr'   r   c                     ] tR t^tR R ltR R ltR R ltR>R R	 lltR
 R ltR R lt	R R lt
R R ltR R ltR R ltR R ltR R ltR R ltR R ltR R ltR  R! ltR" R# ltR?R$ R% lltR& R' ltR( R) ltR* R+ lt]P4                  ! RR,7      R- R. l4       t]R/ R0 l4       tR1 R2 ltR3 R4 ltR5 R6 lt R7 R8 lt!R9 R: lt"R@R; R< llt#R=t$R# )AInterpreterc               (    V ^8  d   QhRRRRRRRR/# )r   envr   r   r   subprojects_dirr"   Noner#   )r$   s   "r%   r&   Interpreter.__annotate__   s(     2 2K 2 2s 2t 2r'   c                	(   Wn         W0n        / V n        / V n        / V n        . V n        \        P                  P                  V P                   P                  4       VR 4      p\        P                  P                  V P                   P                  4       V4      p\        WC4      V n        V P                  '       dW   V P                   P                  P                  V P                  P                  4       V P
                  P                  V4       R# R# )z
Cargo.lockN)r   r   	manifestsr   
workspacesbuild_def_filesr   r   r   get_source_dirload_cargo_lock	cargolockwrap_resolvermerge_wrapswrapsr   )ra   r   r   r   filenames   &&&& r%   __init__Interpreter.__init__   s    .DF:<79,.77<< 0 0 ? ? A6<X'',,t'7'7'F'F'H/Z(C>>>**66t~~7K7KL  ''1 r'   c                   V ^8  d   QhRR/# rZ   r#   )r$   s   "r%   r&   r      s     $ $[ $r'   c                	    V P                   # rQ   )r   )ra   s   &r%   get_build_def_filesInterpreter.get_build_def_files   s    ###r'   c                    V ^8  d   QhRRRR/# )r   wsr   r"   r   r#   )r$   s   "r%   r&   r      s     1 1~ 1$ 1r'   c                	    VP                   P                   Uu. uF  q P                  W4      NK  	  ppV F&  pV P                  V4       V P	                  VR 4       K(  	  R# u upi )r   N)r   default_members_require_workspace_member_prepare_package_enable_feature)ra   r   mpkgspkgs   &&   r%   _prepare_entry_point Interpreter._prepare_entry_point   sY    ?A||?[?[\?[!..r5?[\C!!#&  i0  ]s   A"Nc               $    V ^8  d   QhRRRRRR/# )r   r   r   project_rootr   r"   mparser.CodeBlockNoder#   )r$   s   "r%   r&   r      s"     ; ; ;? ;Nc ;r'   c                	   V P                  V4      w  r4\        P                  P                  V P                  P
                  VR 4      p\        P                  ! V4      pV'       d+   \        V\        4      '       g   Q hV P                  W6W4      # V P                  W1RR7      pV'       g   V P                  V4       V P                  WvV4      # )r   Fr   )_load_manifestr   r   r   r   r   r   Builder
isinstancer   interpret_package_get_workspacer  interpret_workspace)ra   r   r  rg   cachedr   buildr   s   &&&     r%   	interpretInterpreter.interpret   s    ..v677<< 0 0 ; ;V\R)h1111))(6PP  e D%%b)''6::r'   c          
     ,    V ^8  d   QhRRRRRRRRRR	/# )
r   rg   r   r  builder.Builderr   r   r  r"   r  r#   )r$   s   "r%   r&   r      s6        (  ?  TW  gj    pE  r'   c                	    V P                   V,          pVP                  VP                  P                  ,          pVP                  V,          pV P                  WrV4      pVP                  V4      # rQ   )r   r   r4   r8   r   _create_packageblock)	ra   rg   r  r   r  r   memberr   asts	   &&&&&    r%   r  Interpreter.interpret_package   s[    __\*&&x'7'7'<'<=kk&!""3v6{{3r'   c               (    V ^8  d   QhRRRRRRRR/# )	r   r   r   r  r  r   r   r"   T.List[mparser.BaseNode]r#   )r$   s   "r%   r&   r      s*      <  QT Yq r'   c                	D  a VP                   pTP                  TP                  VP                   Uu. uF  qRP	                  V4      NK  	  up4      R 4      VP                  RVP	                  R4      VP                  R 4      .4      .pW`P                  W4      ,          pW`P                  V4      ,          pVP                  P                  '       EdH   VP                  P                  P                  oRS9   d   RS9   d   \        R4      hRS9   d%   VP                  V P                  WVRRR7      4       \        ;QJ d    V3R	 lR 4       F  '       g   K   RM	  RM! V3R	 lR 4       4      '       d9   TP                  T P                  YTRR
S9   ;'       g    RS9   RS9   R7      4       \        ;QJ d    V3R lR 4       F  '       g   K   RM	  RM! V3R lR 4       4      '       d,   VP                  V P                  WVRRS9   RS9   R7      4       V# u upi )rN   messagezEnabled features:dylibcdylibz<Cannot build both dylib and cdylib due to file name conflict
proc-macroT)sharedc              3  ,   <"   T F	  qS9   x  K  	  R # 5irQ   r#   .0x
crate_types   & r%   	<genexpr>.Interpreter._create_package.<locals>.<genexpr>  s     E,Dq
?,D   rl   rlibFr   )staticr!  c              3  ,   <"   T F	  qS9   x  K  	  R # 5irQ   r#   r#  s   & r%   r'  r(    s     D,Cq
?,Cr)  	staticlibr<   )rl   r*  r  )r-  r  )r   assignarrayrN   stringfunction
identifier_create_dependencies_create_meson_subdirrg   rl   r&  r   r`   _create_libany)ra   r   r  r   r   fr  r&  s   &&&&   @r%   r  Interpreter._create_package   s   ggLLs||%L|!ll1o|%LMzZNN901  ,' )
 	((44((//<<))44J*$Z)?$%cddz)

4++CUY+Z[sE,DEsssE,DEEE

4++C49Z4G4_4_6U_K_3:j3H , J K sD,CDsssD,CDDD

4++C3>*3L3;z3I , K L 
1 &Ms   Hc               (    V ^8  d   QhRRRRRRRR/# )	r   r   r   r  r  r   r   r"   r  r#   )r$   s   "r%   r&   r     s*     "  " n " _ " VY " ^s " r'   c           
     	V  a aaaaaa	 \         P                  P                  S4      p\         P                  P                  SR 4      pS P                  P
                  P                  V\        P                  ! RV4      4       . o/ o	R VVVV	V VV3R lloSP                  SP                  SP                  RSP                  R4      .4      R4      4       SP                   F  pS! V4       K  	  S P                  VS	P                  R4      S4      S,           oSP!                  S4      # )subprojectsr   c                    V ^8  d   QhRRRR/# )r   r  r   r"   r   r#   )r$   s   "r%   r&   5Interpreter.interpret_workspace.<locals>.__annotate__'  s     	, 	,C 	,D 	,r'   c                ~  < V S	9   d   R # SP                   V ,          pVP                  pVP                   F  pVP                  P                  V,          pVP
                  '       g   K4  \        P
                  P                  \        P
                  P                  VP                  VP
                  4      4      pS! V4       K  	  V R8X  d$   SP                  S
P                  VSS4      4       M\        S
P                  V 4      '       d{   \        VP                  P                  P                   VP                  P                  P"                  4      pSP%                  SP'                  RSP)                  V4      .4      4       M1SP%                  SP'                  RSP)                  V 4      .4      4       VS	V &   R # )Nr2   
subprojectr   )r   r   rO   rg   rj   r   r   normpathr   r   r`   r  r   r   r-   r4   r8   r    r   r1  r0  )r  r   r   depnamer/   
dep_member_process_memberr  r  processed_membersra   r   r   s   &     r%   rC  8Interpreter.interpret_workspace.<locals>._process_member'  s:   **++f%C''C,,ll//8888!#!1!1"'',,s}}chh2W!XJ#J/	 -
 }

4//UFCD 4 4f==*3<<+?+?+D+DcllFZFZF^F^_

5>>,g9N8OPQ

5>>(U\\&5I4JKL(+f%r'   importr   r2   )r   r   dirnamer   r   r   load_and_merger   r   r   r.  r1  r0  r   _create_projectgetr  )
ra   r   r  r   r8   r   r  rC  r  rD  s
   ffff   @@@r%   r  Interpreter.interpret_workspace  s    wwv&'',,v}=&&55oqvvl\`Gab(*
 8:	, 	,& 	

5<<x%,,v:N9O PRXYZ))FF# *""4):)>)>s)CUKcQ{{3r'   c               $    V ^8  d   QhRRRRRR/# )r   r   r   r   r   r"   r   r#   )r$   s   "r%   r&   r   @  s!     5 5 5C 5D 5r'   c                	L   \         P                  P                  V4      pW!P                  9   d   R # \         P                  P	                  VP
                  V4      pV P                  W1P                  V4      w  rE\        V\        4      '       g   Q hV P                  WAV4       R # rQ   )r   r   r@  r   r   r   r  r   r
  r   _add_workspace_member)ra   r   r   m_subdir	manifest_r1   s   &&&   r%   _load_workspace_member"Interpreter._load_workspace_member@  sv    GGQ77<<		1-**8\\1E	)X....""9!4r'   c               (    V ^8  d   QhRRRRRRRR/# )	r   rP  r   r   r   r   r   r"   r   r#   )r$   s   "r%   r&   r   J  s0     q qx q^ qPS qX\ qr'   c                	   \        VP                  P                  VP                  P                  4      pW2P                  VP                  P                  &   W@P
                  9   d4   V P
                  V,          VP
                  V&   V P                  W#4       R# \        WP                  W2P                  R 7      VP
                  V&   R# ))r   r   r   N)
rk   r4   r8   r    r   r   r   r   r   r   )ra   rP  r   r   keys   &&&& r%   rN  !Interpreter._add_workspace_memberJ  s    **//1B1B1F1FG89i//445--!]]3/BKKN**21))yyTUbobopBKKNr'   c               (    V ^8  d   QhRRRRRRRR/# )	r   rg   zT.Union[Workspace, Manifest]r   r   r   r   r"   r   r#   )r$   s   "r%   r&   r   S  s+      'C S ^b gu r'   c                	|   V P                   P                  V4      pV'       d   V# \        V\        4      '       d   TM\        VR .R .R7      p\	        WRVR7      pVP
                  '       d   V P                  VP
                  VR 4       VP                   F  pV P                  WF4       K  	  W@P                   V&   V# )r2   )root_packagemembersr   r  )	r   rJ  r
  r   r   rY  rN  rZ  rQ  )ra   rg   r   r   r   r   r   s   &&&&   r%   r  Interpreter._get_workspaceS  s    __  (I *8Y ? ?H8cUSER 	I*E!!!&&y'='=r3G""A''. #"$	r'   c                    V ^8  d   QhRRRR/# r   r   r   r"   r   r#   )r$   s   "r%   r&   r   a  s     % %< %D %r'   c                	    \        VP                  P                  P                  VP                  P                  P                  4      pW P
                  9  d   WP
                  V&   R # R # rQ   )rk   rg   r4   r8   r    r   )ra   r   rU  s   && r%   _record_packageInterpreter._record_packagea  sI    --22CLL4H4H4L4LMmm#!$MM# $r'   c               $    V ^8  d   QhRRRRRR/# )r   r   r   r  r   r"   r   r#   )r$   s   "r%   r&   r   f  s!      N C L r'   c                	    \         P                  P                  V4      pVP                  V,          pW!P                  9  d-   V P                  V4       VP                  P                  V4       V# rQ   )r   r   r@  r   r   r_  r   )ra   r   r  r   s   &&& r%   r   %Interpreter._require_workspace_memberf  sW    !!&)kk&!,,,  %&&v.
r'   c               $    V ^8  d   QhRRRRRR/# )r   r   r   r    r"   r   r#   )r$   s   "r%   r&   r   n  s&     P P3 PS P\ Pr'   c                	    \        W4      pV P                  P                  V4      pV'       d   V# \        W4      pV P	                  W4      # rQ   )rk   r   rJ  r-   _fetch_package_from_subproject)ra   r   r    rU  r   meson_depnames   &&&   r%   _fetch_packageInterpreter._fetch_packagen  sC    +mm$J(;22<OOr'   c               $    V ^8  d   QhRRRRRR/# )r   r   r   version_constraintsr[   r"   zT.Optional[CargoLockPackage]r#   )r$   s   "r%   r&   r   v  s"      S { Ws r'   c                .  a V P                   '       d   V P                   P                  V4      pM. pV FG  o\        ;QJ d    V3R lV 4       F  '       d   K   RM	  RM! V3R lV 4       4      '       g   KE  Su # 	  V'       g   \        RV 24      hR# )zkFrom all available versions from Cargo.lock, pick the most recent
satisfying the constraints and return it.c              3  P   <"   T F  p\        SP                  V4      x  K  	  R # 5irQ   )r   r   )r$  r   	cargo_pkgs   & r%   r'  /Interpreter._resolve_package.<locals>.<genexpr>~  s#     VBUQ?9#4#4a88BUs   #&FTz*Cannot determine version of cargo package N)r   namedallr   )ra   r   rk  cargo_lock_pkgsrn  s   &&& @r%   _resolve_packageInterpreter._resolve_packagev  su     >>>"nn22<@O O(IsVBUVsssVBUVVV   ) # #Ml^!\]]r'   c               $    V ^8  d   QhRRRRRR/# )r   r   r   rg  r"   r   r#   )r$   s   "r%   r&   r     s"      3 s Wc r'   c                	   V P                   P                  P                  V4      w  r4Vf   V P                  f   \	        RV: R24      hV P                  P                  V4       Uu. uF  pVP                  NK  	  ppV'       d   RRP                  V4       R2pMRp\	        RV: RV R24      hV P                   P                  P                  V4      w  r\        P                  P                  VR	4      p	V P                   P                  P                  V	\        P                  ! R
V4      4       V P                  V4      w  rW0P                   P                  P                  9   ;'       d4    V P                   P                  P                  V,          P                   R JpV P#                  WVR7      pVP$                  V,          pV P'                  W4      pV# u upi )NzDependency z not found in any wrap files.zCargo.lock provides: z, r2   z,Cargo.lock does not contain this crate name.z, not found in any wrap files or Cargo.lock; z- This could be a Meson bug, please report it.r;  r   r  )r   r   find_dep_providerr   r   rp  r?  r   resolver   r   rH  r   r   r  r   typer  r   r   )ra   r   rg  	subp_namer1   r   similar_depssimilar_msgr   r   rg   r   r   r  s   &&&           r%   rf  *Interpreter._fetch_package_from_subproject  s   ''55GGV	~~%${=2CC`%abb (,~~';';L'IK'I  NN'I  K 5dii6M5NaPL ;}.??klwkx  yf  "g  h  h$$22::9E	'',,v}=&&55oqvvl\iGjk))&1))77=== M M**00;@@L 	   j I&&|4,,R8
'Ks   'Gc                    V ^8  d   QhRRRR/# r]  r#   )r$   s   "r%   r&   r     s     3 3L 3T 3r'   c                	   \        VP                  P                  P                  VP                  P                  P                  4      pW P
                  9   g   Q hVP                  '       d   R # \        4       Vn        V P                  \        P                  4      pVP                  P                  P                  4        F=  w  rE\        WC4      '       g   K  VP                  P                  P                  V4       K?  	  VP                  P                  P                  4        F*  w  rgVP                   '       d   K  V P#                  W4       K,  	  R # rQ   )rk   rg   r4   r8   r    r   r   rK   	_get_cfgsr   r   targetr   r   rj   updateoptional_add_dependency)ra   r   rU  cfgs	conditionrj   rA  r/   s   &&      r%   r   Interpreter._prepare_package  s    --22CLL4H4H4L4LMmm###777&(~~m001'*||':':'@'@'B#I	(())00> (C  LL55;;=LG<<<$$S2 >r'   c               $    V ^8  d   QhRRRRRR/# )r   r   r   r/   r   r"   r#   )r$   s   "r%   r&   r     s!       : , r'   c                	   VP                   '       d   V P                  VP                  ,          p\        P                   P	                  \        P                   P                  VP                  VP                   4      4      p\        V P                  V4      '       d:   \        \        P                  ! V4      P                  4      ^8w  d   \        R4      hV P                  W44       V P                  W44      pMVP                   '       dA   \#        VP                   VP$                  4      w   rgV P'                  VP(                  V4      pMrV P+                  VP(                  VP,                  4      pV'       d   VP/                  RVP0                   24       V P3                  VP(                  VP4                  4      pVP0                  '       g3   VP/                  RVP6                  P(                  P0                   24       \9        VP(                  VP4                  4      p	VP:                  P<                  P?                  W4       VP:                  P<                  V	,          V8X  g   Q hV# )r   zLfound "{self.subprojects_dir}" in path but it is not a valid subproject pathr   ) r   r   r   r   r@  r   r   r   r   r+   pathlibr   partsr   rQ  r   git_parse_git_urlbranchrf  r4   rs  meson_versionupdate_versionr   rh  r    rg   rk   r   rX   
setdefault)
ra   r   r/   r   rB  ro   r1   	directoryrn  rn   s
   &&&       r%   _dep_packageInterpreter._dep_package  s   888/B))"'',,s}}chh*OPJd22J??w''
399:a?()wxx''744RDGWWW,SWWcjjAOAq99#++yQG--ckk3;L;LMI""Qy'8'8&9#:;))#++sww?G{{{7#3#3#;#;#C#C"DEFS[[#''2''9ww##G,777r'   c               (    V ^8  d   QhRRRRRRRR/# )r   r   r   r   zT.Optional[Workspace]member_pathr"   z+T.Tuple[T.Union[Manifest, Workspace], bool]r#   )r$   s   "r%   r&   r     s/        S  5J  `c    nY  r'   c                	(   V P                   P                  V4      pV'       d   VR 3# \        P                  P	                  V P
                  P                  V4      p\        P                  P	                  VR4      pV P                  P                  V4       \        P                  ! R\        V4      4      pRV9   d   \        P                  ! Wu4      pM-RV9   d   \        P                  ! WuW#4      pM\        V R24      hW@P                   V&   VR3# )Tr   zraw.Manifestr   r4   z:/Cargo.toml does not have [package] or [workspace] sectionF)r   rJ  r   r   r   r   r   r   r   r   r   r   r   from_rawr   r   )ra   r   r   r  rP  r   r   raw_manifests   &&&&    r%   r  Interpreter._load_manifest  s    NN&&v.	d?"ww||D,,77@77<<l3##H-vvni.AB,&!**<>I,& )),iUI F8+e!fgg!*v%r'   c               $    V ^8  d   QhRRRRRR/# )r   r   r   rA  r   r"   r   r#   )r$   s   "r%   r&   r     s!     - -< -# -$ -r'   c                	    VP                   pW#P                  9   d   R # VP                  P                  P	                  V4      pV'       g   R # VP                  P                  V4       V P                  W4      pV P                  V4       VP                  '       d   V P                  VR4       VP                   F  pV P                  WV4       K  	  VP                  V,           F  pV P                  WV4       K  	  R # )Nr   )r   rO   rg   rj   rJ  addr  r   default_featuresr   rN   rW   )ra   r   rA  r   r/   ro   r7  s   &&&    r%   r  Interpreter._add_dependency  s    gg'''ll''++G4g&##C-g&  )4A  , ++G44A  , 5r'   c               $    V ^8  d   QhRRRRRR/# )r   r   r   rc   r   r"   r   r#   )r$   s   "r%   r&   r     s!     - -< -# -$ -r'   c                	   VP                   pW#P                  9   d   R # VP                  P                  V4       W!P                  P                  9   d   V P                  W4       VP                  P                  P                  V. 4       F  pRV9   d   VP                  R^4      w  rVVR,          R8X  d   VR R pMV P                  W4       WSP                  9   dB   VP                  P                  V,          pV P                  W4      pV P                  W4       K  VP                  V,          P                  V4       K  VP                  R4      '       d   V P                  WR,          4       K  V P                  W4       K  	  R # )N/?zdep:   NN)r   rN   r  rg   rj   r  rJ  r   rO   r  r   rW   
startswith)	ra   r   rc   r   r7  rA  dep_fr/   ro   s	   &&&      r%   r   Interpreter._enable_feature  s0   ggll"!ll///  . &&**7B7Aax!"a2;#%%crlG((6///,,33G<C"//9G((8 ..w7;;EBf%%$$SB%0$$S,% 8r'   c                    V ^8  d   QhRRRR/# )r   r   r   r"   r   r#   )r$   s   "r%   r&   r     s     # #] #t #r'   c                	    V P                   P                  4       '       g   \        P                  p\        P
                  ! R V P                   P                  P                  V,          R,          4      pVP                  # )r   r   )	r   r   r   r   r   r   r   r   r   )ra   r   r   s   && r%   r   Interpreter.has_check_cfg  s[    ..00#((G~t'7'7'@'@'J'J7'STZ'[\"""r'   )maxsizec                    V ^8  d   QhRRRR/# )r   r   r   r"   rh   r#   )r$   s   "r%   r&   r     s     
6 
6 
63C 
6r'   c                	
  a  S P                   P                  4       '       g   \        P                  p\        P
                  ! R S P                   P                  P                  V,          R,          4      pVP                  4       P                  4       pS P                   P                  P                  VR4      p\        V4      pV F&  pVR8X  g   K  VP                  \        V4      4       K(  	  \        V 3R lV 4       4      # )r   r   r^   c              3  F   <"   T F  pSP                  V4      x  K  	  R # 5irQ   )
_split_cfg)r$  ira   s   & r%   r'  (Interpreter._get_cfgs.<locals>.<genexpr>  s     51DOOA&&s   !)r   r   r   r   r   r   r   r   get_cfgscopyget_external_argsiterr   nextr|   )ra   r   r   r  	rustflagsrustflags_ir  s   f&     r%   r  Interpreter._get_cfgs  s    ..00#((G~t'7'7'@'@'J'J7'STZ'[\~~$$&$$--??P	9oAG|D-.  5555r'   c                    V ^8  d   QhRRRR/# )r   r   r   r"   zT.Tuple[str, str]r#   )r$   s   "r%   r&   r   !  s        1 r'   c                	    V P                  R ^R7      p\        V4      ^8  d
   V^,          MRpV'       d   V^ ,          R8X  d   V^R pV^ ,          V3# )r   )maxsplitr   r_   r  )r   r+   )r   pairvalues   &  r%   r  Interpreter._split_cfg   sO    yyqy)t9q=QbU1X_!BKEAw~r'   c               (    V ^8  d   QhRRRRRRRR/# )	r   r8   r   r   zT.Optional[PackageState]r  r  r"   r  r#   )r$   s   "r%   r&   r   (  s*     #9 #9C #9.F #9 #9c{ #9r'   c                   VP                  V4      VP                  R4      .pRVP                  R\        P                   24      /pV'       g   VP                  RWE4      .# / pVP                  '       d   VP                  R4      VR&   TP                  RVP                  VP                  P                  P                  4      RTP                  VP                  4        UUu/ uF  w  rxVP                  V4      VbK  	  upp4      /4       VP                  P                  P                  '       d4   VP                  VP                  P                  P                  4      VR	&   MXVP                  P                  P                  '       d3   VP                  VP                  P                  P                  4      VR
&   VP                  RWE4      .# u uppi )zCreate the project() function call

:param pkg: The package to generate from
:param build: The AST builder
:return: a list nodes
r   r  z>= project0warning_levelr   default_optionsr   license_files)r0  r   stable_versionr1  r   r  rg   r4   r   r|   r   r   r   )	ra   r8   r   r  rb   kwargsr  r   r   s	   &&&&     r%   rI  Interpreter._create_project(  s|    LLLL *
 U\\C0G0G/H*IJ	1
 y$7  :<>>>/4||C/@OO,u||CLL$8$8$@$@Auzz/J_J_Ja*bJa$!5<<?A+=Ja*bc
 	 <<''' %S\\-A-A-I-I JF9\\!!...&+ll3<<3G3G3T3T&UF?#y$788 +cs   #Gc               $    V ^8  d   QhRRRRRR/# )r   r   r   r  r  r"   r  r#   )r$   s   "r%   r&   r   M  s"       _ Qi r'   c                	@   VP                   p. pVP                   Fg  pVP                  P                  V,          pV P	                  W4      pVP                  P
                  '       g   KO  W@P                  WvV4      ,          pKi  	  VP                  VP                  VP                  . 4      R 4      4       VP                  P                  P                  4        F@  w  rV	P                  VP                  4      '       g   K(  W@P                  WV4      ,          pKB  	  V# )system_deps_args)r   rO   rg   rj   r  rl   _create_dependencyr   r.  r/  r   r   enabledrN   _create_system_dependency)
ra   r   r  r   r  rA  r/   ro   r8   sys_deps
   &&&       r%   r3   Interpreter._create_dependenciesM  s    gg(*((G,,++G4C''1G###..wUCC	 )
 	

5<<B1CDE \\==CCEMDs||,,55dUKK F 
r'   c               (    V ^8  d   QhRRRRRRRR/# )	r   r8   r   r/   r   r  r  r"   r  r#   )r$   s   "r%   r&   r   [  s+     
 
c 
8H 
Q` 
e} 
r'   c                	t   R TP                  VP                   Uu. uF  qCP                  V4      NK  	  up4      RVP                  VP                  '       * 4      /p\        V4       R2pR\        V4       2pVP                  VP                  RVP                  VP                  4      .V4      V4      VP                  VP                  RVP                  V4      4      VP                  VP                  VP                  VP                  R4      VP                  V4      .4      R4      .4      4      .# u upi )r   required_system_depsystem_deps_have_
dependencyfoundr^   r  )r/  r  r0  r   r  r   r.  r1  r8   if_methodr2  r  
plusassign)ra   r8   r/   r  skwvarnamer   s   &&&&    r%   r  %Interpreter._create_system_dependency[  s%    u{{S=N=N#O=NLLO=N#OP

s||#34
 )./{;!"5d";!<=LL \\#((+,
  IIWe&6&6w&?@%++$$U\\'%:ELL<M$NO*O C
 	
 $Ps   D5
c               (    V ^8  d   QhRRRRRRRR/# )	r   r   r   r/   r   r  r  r"   r  r#   )r$   s   "r%   r&   r   v  s)     <
 <
l <
 <
O <
`x <
r'   c                	V   VP                   pVP                  ;'       g"    VP                  P                  P                  .pR TP                  V Uu. uF  qcP                  V4      NK  	  up4      /pVP                  VP                  RVP                  \        VP                  VP                  4      4      .V4      \        V4      4      VP                  VP                  RVP                  RVP                  \        V4      4      VP                  R4      .RVP                  R4      /4      VP                  R4      .4      R4      TP                  TP                  VP                   Uu. uF  qP                  V4      NK  	  up4      R	4      VP                  R
.VP                  R	4      VP!                  VP#                  VP%                  VP                  R
4      VP                  R4      4      VP!                  VP                  RVP                  R4      VP                  \        VP                  VP                  4      4      VP                  R4      VP                  R4      VP                  R4      VP                  R	4      .4      .4      4      .4      4      .# u upi u upi )r   r  r   get_variablerN   default_valuer   r   actual_featuresneeded_featuresr7  errorr   z#previously configured with featureszbut need)r   r  rg   r4   r   r/  r0  r.  r1  r-   r    r6   r  r2  rN   foreachr  r  not_in)	ra   r   r/   r  r   version_r  r  r7  s	   &&&&     r%   r  Interpreter._create_dependencyv  sK   gg$$FF)=)=)E)E(Fu{{X#FXLLOX#FG
  LL \\"23;;"HIJ
 $C( LLLL&(()<S)ABj12(%,,r*:;	 \\#&'	 "& LLs||%L|!ll1o|%LMO`aMM3%!1!12C!Dekk		%,,u'7'7'<e>N>NO`>abdidodoNN7\2%5ckk377%KL%JK(():;Z0(():;- 	q 	e 	S G ?+
 +	
 $GV &Ms   J!
-J&c                    V ^8  d   QhRRRR/# )r   r  r  r"   r  r#   )r$   s   "r%   r&   r     s     
 
/ 
>V 
r'   c                	   VP                  VP                  . 4      \        4       4      VP                  VP                  . 4      \        4       4      VP                  VP	                  R VP                  R4      .4      R4      VP                  VP                  RVP                  R4      VP                  R4      .4      VP                  VP	                  RVP                  R4      .4      .4      4      .# )rF  fsis_dirr   r   )
r.  r/  rD   rI   r1  r0  r  r  r2  r  )ra   r  s   &&r%   r4   Interpreter._create_meson_subdir  s     LLR*=*?@LLR*=*?@LL5<<3E2FGNIIell8U-=-=d-CellSZF[E\]kk5>>(U\\'=R<S#T"UVX	
 	
r'   c               4    V ^8  d   QhRRRRRRRRR	R
RR
RR/# )r   r   r   r  r  r   r   r9   r:   r+  r   r!  r"   r  r#   )r$   s   "r%   r&   r     sJ     R
 R
| R
O R
S R
@R
 R
26R
C[R
r'   c                		   VP                   p. pVP                   FI  p	VP                  P                  V	,          p
VP	                  VP                  \        V
4      4      4       KK  	  VP                  VP                  4      P                  4        UUu/ uF&  w  rVP                  V4      VP                  V4      bK(  	  pppVP                  P                  P                  4        FT  w  rVP                  VP                  4      '       g   K(  VP	                  VP                  \        V	4       R 24      4       KV  	  VP                  V P                  V\         P"                  4      pVP                  \%        4       4      pVP                  R4      pV Uu. uF  pVP                  V4      NK  	  ppVP	                  V4       VP	                  V4       VP	                  VP                  \'        4       4      4       VP                  R4      VP                  VP                  P(                  P*                  4      /pVP                  \-        VP                  P.                  P0                  VP                  P(                  P2                  V4      4      VP                  VP                  P.                  P4                  4      .pRVP7                  V4      RVP9                  V4      RVP7                  V4      RVP9                  V4      /pVR8X  d   RMR	p\;        VP                  P(                  P0                  VP                  P(                  P2                  V4      pVR
8X  d%   VP=                  RVP                  R4      VV4      pMFV'       d   V'       d   RpMV'       d   RMRpVP                  V4      VR&   VP?                  VVV4      pVPA                  VR4      VPA                  VP?                  RRVP                  R4      RVP9                  VP                  R4      VP                  RPC                  VP                  4      4      /4      RVP                  VP                  P(                  PD                  4      /R7      R4      VP=                  RVP                  R4      VP                  V4      VP                  R4      .4      .# u uppi u upi )r  r  rust_stdrj   rust_dependency_map	rust_argsoverride_optionsr<   r   -rsr   
proc_macror   both_librariesshared_librarystatic_libraryrust_abirl   declare_dependency	link_with	variablesrN   r   r   )r  r/   override_dependencyr   )#r   rO   rg   rj   r   r2  r6   rr   r   r0  r   r  rN   r   r   r   r   r   rD   rI   r4   editionr>   rl   r8   r    r   r/  r|   r-   r  r1  r.  r   r   )ra   r   r  r   r9   r+  r!  r   rj   r8   r/   r   r   rm   r  rustc_args_listextra_args_refsystem_deps_args_refar  r  posargsr  depname_suffixrA  rl   target_types   &&&&&&&                    r%   r5  Interpreter._create_lib  s    gg13%%D,,++D1C 0 01DS1I JK &
 :=9O9OPSP\P\9]9c9c9eFg9eELLOU\\!_,9e 	 Fg !\\==CCEMDs||,,##E$4$48KD8Q7RR]5^$_` F ,,T-=-=v}GYGYZ))*=*?@$//0BCHW.X1u||A	.X(-.E,,-@-BCD LL$ell3<<3G3G3O3O&PH

 LLs||'7'7'<'<cll>R>R>V>VX`abLL))../-
 EKK5!5::n#=Y/

+; <	1
  (3E"3<<#7#7#<#<cll>R>R>V>VXfg |#,,|U-=-=f-EwPVWC&.28.>N!&h!7F:..gv>C LLe$LL(#U%5%5e%<#UZZ!LL4ell388CLLCY6Z1 & "5<<0D0D0L0L#M  	  LL%  )LL)$$U+
 	
eFg /Ys   ,SS)r   r   r   r   r   r   r   rQ   )Nr   )FF)%rt   ru   rv   rw   r   r   r  r  r  r  r  rQ  rN  r  r_  r   rh  rs  rf  r   r  r  r  r   r   	functools	lru_cacher  staticmethodr  rI  r3  r  r  r4  r5  r}   r#   r'   r%   r   r      s    2&$1; :" H5q%
P83"4 "-$-<# &
6 '
6  #9J
6<
|
$R
 R
r'   r   c               $    V ^8  d   QhRRRRRR/# )r   urlr   r  r   r"   zT.Tuple[str, str, str]r#   )r$   s   "r%   r&   r&     s"     $ $ $_ $@V $r'   c                P   V P                  R 4      '       d
   V R,          p \        P                  P                  V 4      p\        P                  P	                  VP
                  4      pRV9   d   VR,          ^ ,          MRpT;'       g    TpVP                  ;'       g    Tp\        VP                  4      P                  pVP                  R4      '       d   VRR pV'       d   VRV 2,          p\        P                  P                  VP                  RRRR7      4      p WV3# )	git+r  r  r   z.gitNr)   )paramsqueryfragment)r  urllibparseurlparseparse_qsr  r  r   r   r8   r*   
urlunparse_replace)r  r  r  r  query_branchrevisionr  s   &&     r%   r  r    s    
~~f"gLL!!#&ELL!!%++.E)1U):5?1%L##|F~~''H$))I&!!crN	q\!	
,,
!
!%.."r."R
SC)##r'   c               $    V ^8  d   QhRRRRRR/# )r   r   r   subproject_dirr"   zT.Optional[CargoLock]r#   )r$   s   "r%   r&   r&   ,  s"     , ,c ,3 ,;P ,r'   c                   \         P                  P                  V 4      '       Ed?   \        V 4      p\        P
                  ! RV4      p\        P                  ! V4      p/ pVP                   EF  p\        VP                  \        P                  ! VP                  4      4      pVP                  f   KH  VP                  R8X  d   VP                  pVf<   VP                  RVP                   RVP                   RVP                   R2,          pRVP                   R	VP                   R
2p	VP                   RVP                   2p
W9  d(   \         P"                  ! WqRRV
RV	RV
 R2RVRR/4      WZ&   WZ,          P%                  V4       EK#  VP                  P'                  R4      '       dY   \)        VP                  4      w  rp
W9  d!   \         P"                  ! WRRV	RVRR/4      WZ&   WZ,          P%                  V4       EK  \*        P,                  ! RV  RVP                   24       EK  	  VP/                  4        Uu/ uF  qP                  VbK  	  upVn        V# R# u upi )z(Convert Cargo.lock into a list of wraps zraw.CargoLockNz5registry+https://github.com/rust-lang/crates.io-indexz	checksum  z (r   z https://crates.io/api/v1/crates/r  z	/downloadr)   filer  
source_urlsource_filenamez.tar.gzsource_hashr  cargor  r  r  r  zUnsupported source URL in z: )r   r   existsr   r   r   r	   r  r4   r-   r8   r   r    sourcechecksummetadatar   from_valuesadd_provided_depr  r  r   warningvaluesr   )r   r  tomlraw_cargolockr   r   r4   rg  r)  r  r  r  ws   &&           r%   r   r   ,  s#    
ww~~h"5&&}5	02 ((G,W\\7;;w;WXM~~%#ZZ"++#(11Igll^1W__L]]_`g`n`n_oop2qrH8aGXXab&||nAgoo->?	)'8'D'D]dj#Y$c)i[+@%x 'm (E$  11-@**622+9'..+I(y)'8'D'DY`es"H 'h (E$
  11-@9(2gnnEUVW= )> /4lln=n6619n=	 >s   I')r  )r   rQ   )=rx   
__future__r   ry   r  r   r  rR   urllib.parser  typingr   r   r   r   r   r   r   r/  r   rg   r   r	   r
   r   r   mesonlibr   r   r   r   r   r   	wrap.wrapr   TYPE_CHECKINGr   r   r   r   r   r   interpreterbaser   compilers.rustr   typing_extensionsr   r-   r6   r>   rD   rI   	dataclassrK   r   rk   r   r   r  r   r#   r'   r%   <module>r<     s   #   	         [ [ U U  )???6),-)'
S-   8 V V Vr d#  $
 	L 	L 	LL	
 L	
^$",r'   