From fac5ccb2e2db19320eb2c1b63c047fbdcdf4cdaf Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 14 Dec 2020 15:34:27 -0400 Subject: [PATCH] add USE_SYSTEM_LIBS=1 for osxapp build --- Build/OSXMkLibs.hs | 6 ++++- Makefile | 1 + ..._4f68ed79045c93831cb8b41888057f29._comment | 25 +++++++++++++++++++ 3 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 doc/bugs/Build__47__OSXMkLibs.hs_does_not_resolve___64__loader__95__path/comment_2_4f68ed79045c93831cb8b41888057f29._comment diff --git a/Build/OSXMkLibs.hs b/Build/OSXMkLibs.hs index b79cfa84d0..196650bae1 100644 --- a/Build/OSXMkLibs.hs +++ b/Build/OSXMkLibs.hs @@ -9,6 +9,7 @@ module Build.OSXMkLibs (mklibs) where import Data.Maybe import System.FilePath +import System.IO import Control.Monad import Control.Monad.IfElse import Data.List @@ -33,7 +34,10 @@ type LibMap = M.Map FilePath String mklibs :: FilePath -> M.Map FilePath FilePath -> IO Bool mklibs appbase installedbins = do - mklibs' appbase installedbins [] [] M.empty + usl <- getEnv "USE_SYSTEM_LIBS" + case usl of + Nothing -> mklibs' appbase installedbins [] [] M.empty + Just _ -> hPutStrLn stderr "dmg will use system libraries (USE_SYSTEM_LIBS)" return True {- Recursively find and install libs, until nothing new to install is found. -} diff --git a/Makefile b/Makefile index dce3173a47..5b6754cfae 100644 --- a/Makefile +++ b/Makefile @@ -205,6 +205,7 @@ dpkg-buildpackage%: prep-standalone umask 022; dpkg-buildpackage -rfakeroot $* $(MAKE) undo-standalone +# Run this with USE_SYSTEM_LIBS=1 to build without bundling system libraries. OSXAPP_DEST=tmp/build-dmg/git-annex.app OSXAPP_TOP=$(OSXAPP_DEST)/Contents/MacOS/bundle osxapp: diff --git a/doc/bugs/Build__47__OSXMkLibs.hs_does_not_resolve___64__loader__95__path/comment_2_4f68ed79045c93831cb8b41888057f29._comment b/doc/bugs/Build__47__OSXMkLibs.hs_does_not_resolve___64__loader__95__path/comment_2_4f68ed79045c93831cb8b41888057f29._comment new file mode 100644 index 0000000000..9b5cbf5398 --- /dev/null +++ b/doc/bugs/Build__47__OSXMkLibs.hs_does_not_resolve___64__loader__95__path/comment_2_4f68ed79045c93831cb8b41888057f29._comment @@ -0,0 +1,25 @@ +[[!comment format=mdwn + username="joey" + subject="""comment 2""" + date="2020-12-14T19:08:40Z" + content=""" +install_name_tool: warning: changes being made to the file will invalidate the code signature in: tmp/build-dmg/git-annex.app/Contents/MacOS/bundle/R + +This makes me doubtful that, even if the `@loader_path` problem gets resolved +and it builds, it will actually work. It seems likely that if a library is +signed, modifying it to have an invalid signature would make the OS refuse to +use it. + +The OSX build used for releases is still using an older OSX and does not have +either problem. I do notice there is a similar workaround in Build/OSXMkLibs.h +for `@executable_path`; it skips such libraries. So skipping `@loader_path` +in the same place would probably build, but would it work? + +Since git-annex can be installed from homebrew, I don't know if it's worth +trying to keep the standalone app working in the face of such problems. +Is there a use case for the .dmg file that this failing build is producing? + +One approach would be to stop bundling system libraries, so the .dmg +perhaps is tied to a specific version of OSX. I've added a way to build +the dmg that way, make osxapp USE_SYSTEM_LIBS=1 +"""]] -- 2.30.2