You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Mac OS X RPATH-related issue when using cabal new-repl #4263
cabal-install HEAD used, started from scratch after purging ~/.ghc and ~/.cabal. cabal new-build builds the binary as expected, but new-repl fails, saying:
$ cabal new-repl app-server
In order, the following will be built (use -v for more details):
- app-0.0.1 (exe:app-server) (ephemeral targets)
Preprocessing executable 'app-server' for app-0.0.1...
GHCi, version 8.0.2: http://www.haskell.org/ghc/ :? for help
<command line>: can't load .so/.DLL for: /Users/fcar/.cabal/store/ghc-8.0.2/servant-auth-server-0.2.1.0-efe758625dac2edc974329c8463fa768f38aba7638472ecdb2325ccd5b848f62/lib/libHSservant-auth-server-0.2.1.0-efe758625dac2edc974329c8463fa768f38aba7638472ecdb2325ccd5b848f62-ghc8.0.2.dylib (dlopen(/Users/fcar/.cabal/store/ghc-8.0.2/servant-auth-server-0.2.1.0-efe758625dac2edc974329c8463fa768f38aba7638472ecdb2325ccd5b848f62/lib/libHSservant-auth-server-0.2.1.0-efe758625dac2edc974329c8463fa768f38aba7638472ecdb2325ccd5b848f62-ghc8.0.2.dylib, 5): no suitable image found. Did find:
/Users/fcar/.cabal/store/ghc-8.0.2/servant-auth-server-0.2.1.0-efe758625dac2edc974329c8463fa768f38aba7638472ecdb2325ccd5b848f62/lib/libHSservant-auth-server-0.2.1.0-efe758625dac2edc974329c8463fa768f38aba7638472ecdb2325ccd5b848f62-ghc8.0.2.dylib: malformed mach-o: load commands size (35832) > 32768)
cabal: repl failed for exe:app-server from app-0.0.1.
No surprise there... sadly.... the whole range of cabal new-<command> will run into this bug. We solved this problem for "old-style" builds, by putting all .dylib files all into one directory, so that only one RPATH per package datebase is needed (so two in most cases: global and user).
With "new-style" builds, all the .dylib files still each go into their own directory. I have no idea how the hashing works for new-style, but I guess it should be possible to put the dylibs can go into the shared build-store lib directory without conflicts. @dcoutts probably knows.
That dynlibdir shouldn't be equal to libdir, which in turn is equal to prefix/lib, where prefix is the $STORE/package-hash. It should be equal to $STORE or $STORE/dynlib. Whethe the dylibs already get the correctly hashed names I have no idea.
I think it should be OK to dump all of the dynamic libraries for .cabal/store in a single directory. @christiaanb do you want to submit a patch? dylibs are hashed correctly; they will look like libHSp-0.1.0.0-hash-ghcx.y.z.dylib
Activity
23Skidoo commentedon Jan 25, 2017
/cc @christiaanb
bugthunk commentedon Jan 25, 2017
Furthermore, maybe it's related to GHC ticket https://ghc.haskell.org/trac/ghc/ticket/12479, but
cabal replwith a cabal sandbox works as expected.Minimal example repo: https://github.com/bugthunk/cabalbug-new-repl-minimal
christiaanb commentedon Jan 25, 2017
No surprise there... sadly.... the whole range of
cabal new-<command>will run into this bug. We solved this problem for "old-style" builds, by putting all.dylibfiles all into one directory, so that only oneRPATHper package datebase is needed (so two in most cases:globalanduser).With "new-style" builds, all the
.dylibfiles still each go into their own directory. I have no idea how the hashing works for new-style, but I guess it should be possible to put thedylibs can go into the shared build-store lib directory without conflicts. @dcoutts probably knows.23Skidoo commentedon Jan 25, 2017
@christiaanb Thanks! That's what I suspected.
This shouldn't be very hard to fix, so I think we should try to get the fix into 2.0.
christiaanb commentedon Jan 25, 2017
So the line that needs "fixing" is:
cabal/cabal-install/Distribution/Client/ProjectPlanning.hs
Line 2594 in 8d2229a
That
dynlibdirshouldn't be equal tolibdir, which in turn is equal toprefix/lib, whereprefixis the$STORE/package-hash. It should be equal to$STOREor$STORE/dynlib. Whethe thedylibs already get the correctly hashed names I have no idea.ezyang commentedon Jan 27, 2017
I think it should be OK to dump all of the dynamic libraries for
.cabal/storein a single directory. @christiaanb do you want to submit a patch?dylibs are hashed correctly; they will look likelibHSp-0.1.0.0-hash-ghcx.y.z.dylibAdd single directory in store for .dynlib:s
ulysses4ever commentedon Apr 18, 2023
Appears to have been fixed in
Please, reopen if not.