]> dgit.raspbian.org Git - git-annex.git/commitdiff
skip OSX libraries that do not exist in disk due to new cache
authorJoey Hess <joeyh@joeyh.name>
Mon, 3 Jan 2022 17:19:33 +0000 (13:19 -0400)
committerJoey Hess <joeyh@joeyh.name>
Mon, 3 Jan 2022 17:19:33 +0000 (13:19 -0400)
Addresses the build problem discussed here:
https://github.com/datalad/git-annex/issues/95

Sponsored-by: Dartmouth College's Datalad project
Build/OSXMkLibs.hs

index fed88de88cceb5ab0215261d42670370af20b06b..2adf3c61a2db3695d30f51a4f2b391b20a42e737 100644 (file)
@@ -1,6 +1,6 @@
 {- OSX library copier
  -
- - Copyright 2012 Joey Hess <id@joeyh.name>
+ - Copyright 2012-2022 Joey Hess <id@joeyh.name>
  -
  - Licensed under the GNU AGPL version 3 or higher.
  -}
@@ -14,6 +14,7 @@ import Control.Monad
 import Control.Monad.IfElse
 import Data.List
 import Control.Applicative
+import System.Posix.Files
 import Prelude
 
 import Utility.PartialPrelude
@@ -105,10 +106,17 @@ otool appbase installedbins replacement_libs libmap = do
                -- _inflateValidate symbol. So, avoid bundling libz unless
                -- this incompatability is resolved.
                && not ("libz." `isInfixOf` s)
+       lib_present s = ifM (isJust <$> catchMaybeIO (getSymbolicLinkStatus s))
+               ( return True
+               , do
+                       hPutStrLn stderr $ "note: skipping library that is not present on disk: " ++ s
+                       return False
+               )
        process c [] rls m = return (nub $ concat c, rls, m)
        process c (file:rest) rls m = do
                _ <- boolSystem "chmod" [Param "755", File file]
-               libs <- filter want . parseOtool
+               libs <- filterM lib_present
+                       =<< filter want . parseOtool
                        <$> readProcess "otool" ["-L", file]
                expanded_libs <- expand_rpath installedbins libs replacement_libs file
                let rls' = nub $ rls ++ (zip libs expanded_libs)