OSX link libs into git-core directory
authorJoey Hess <joeyh@joeyh.name>
Thu, 14 Nov 2019 22:31:58 +0000 (18:31 -0400)
committerJoey Hess <joeyh@joeyh.name>
Thu, 14 Nov 2019 22:31:58 +0000 (18:31 -0400)
So that binaries in that directory can find the library next to them,
where they get modified to look.

This is a hack; it would be better for OSXMkLibs to build a list of what
libraries are needed where.

Unsure if this is needed due to a recent reversion, or is an older
problem, so updated changelog accordingly.

Build/OSXMkLibs.hs
CHANGELOG
doc/bugs/OSX_dmg_git-core_binaries_do_not_link.mdwn [new file with mode: 0644]

index 17af6592b46c7a8bf95452f3884eb9a742327152..8a11c88ee59fda19e1229c4810fabfaebccc6b58 100644 (file)
@@ -50,8 +50,12 @@ installLibs appbase replacement_libs libmap = do
                let symdest = appbase </> shortlib
                -- This is a hack; libraries need to be in the same
                -- directory as the program, so also link them into the
-               -- extra directory.
-               let symdestextra = appbase </> "extra" </> shortlib
+               -- extra and git-core directories so programs in those will
+               -- find them.
+               let symdestextra = 
+                       [ appbase </> "extra" </> shortlib
+                       , appbase </> "git-core" </> shortlib
+                       ]
                ifM (doesFileExist dest)
                        ( return Nothing
                        , do
@@ -59,9 +63,11 @@ installLibs appbase replacement_libs libmap = do
                                putStrLn $ "installing " ++ pathlib ++ " as " ++ shortlib
                                unlessM (boolSystem "cp" [File pathlib, File dest]
                                        <&&> boolSystem "chmod" [Param "644", File dest]
-                                       <&&> boolSystem "ln" [Param "-s", File fulllib, File symdest]
-                                       <&&> boolSystem "ln" [Param "-s", File (".." </> fulllib), File symdestextra]) $
+                                       <&&> boolSystem "ln" [Param "-s", File fulllib, File symdest]) $
                                        error "library install failed"
+                               forM_ symdestextra $ \d ->
+                                       unlessM (boolSystem "ln" [Param "-s", File (".." </> fulllib), File d]) $
+                                               error "library linking failed"
                                return $ Just appbase
                        )
        return (catMaybes libs, replacement_libs', libmap')
index e775f6737307ab4dba0f8b4479a1b10d1636aec5..716bcb983ee6f887eafcc9d4ce2fd1915d9e49c6 100644 (file)
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -6,8 +6,8 @@ git-annex (7.20191107) UNRELEASED; urgency=medium
   * Fix a crash (STM deadlock) when -J is used with multiple files
     that point to the same key.
   * linuxstandalone: Fix a regression that broke git-remote-https.
-  * OSX git-annex.app: Fix a regression that broke git-remote-https,
-    git-remote-http, and git-shell.
+  * OSX git-annex.app: Fix a problem that prevented using the bundled
+    git-remote-https, git-remote-http, and git-shell.
 
  -- Joey Hess <id@joeyh.name>  Mon, 11 Nov 2019 15:59:47 -0400
 
diff --git a/doc/bugs/OSX_dmg_git-core_binaries_do_not_link.mdwn b/doc/bugs/OSX_dmg_git-core_binaries_do_not_link.mdwn
new file mode 100644 (file)
index 0000000..d976be1
--- /dev/null
@@ -0,0 +1,12 @@
+The OSX .dmg contains a few binaries in git-core like git-remote-http.
+They have been adjusted by otool to link to libraries in the same directory
+as the binary. However, the libraries are not located in the git-core
+directory, but in its parent directory, and so the git-core binaries don't
+link.
+
+I don't think this is a new regression, but not entirely sure.
+
+Seems that OSXMkLibs could symlink ../lib into git-core.
+--[[Joey]] 
+
+> [[fixed|done]] --[[Joey]]