11__author__ = "desultory"
2- __version__ = "4.5.1 "
2+ __version__ = "4.6.0 "
33
44from os import environ , makedev , mknod , uname
55from pathlib import Path
@@ -303,6 +303,7 @@ def deploy_nodes(self) -> None:
303303 raise e
304304
305305
306+ @unset ("musl_libc" , "Skipping libgcc_s dependency resolution, musl_libc is enabled." , log_level = 20 )
306307@contains ("find_libgcc" , "Skipping libgcc_s dependency resolution" , log_level = 20 )
307308def autodetect_libgcc (self ) -> None :
308309 """Finds libgcc.so, adds a 'dependencies' item for it.
@@ -318,7 +319,9 @@ def autodetect_libgcc(self) -> None:
318319 musl_warning = True
319320
320321 if musl_warning :
321- self .logger .warning ("This check can be disabled by setting `find_libgcc = false` in the configuration." )
322+ self .logger .warning (
323+ "This check can be disabled by setting `musl_libc = true` or `find_libgcc = false` in the configuration."
324+ )
322325 return self .logger .warning ("Unable to run ldconfig -p, if glibc is being used, this is fatal!" )
323326
324327 if cmd .returncode != 0 :
@@ -343,6 +346,17 @@ def autodetect_musl(self) -> None:
343346 if musl_path .exists ():
344347 self .logger .info ("Detected musl search path: %s" % c_ (musl_path , "cyan" ))
345348 self ["dependencies" ] = musl_path
349+ elif self ["musl_libc" ]:
350+ raise AutodetectError ("Musl libc is enabled, but the musl search path was not found: %s" % musl_path )
351+
352+
353+ @unset ("musl_libc" , "Skipping ld.so.cache regeneration, musl_libc is enabled." , log_level = 30 )
354+ def regen_ld_so_cache (self ) -> None :
355+ """Regenerates the ld.so.cache file in the build dir"""
356+ self .logger .info ("Regenerating ld.so.cache" )
357+ build_path = self ._get_build_path ("/" )
358+ self ._run (["ldconfig" , "-r" , str (build_path )])
359+ self ["check_included_or_mounted" ] = "etc/ld.so.cache"
346360
347361
348362def _process_out_file (self , out_file : str ) -> None :
0 commit comments