-
Notifications
You must be signed in to change notification settings - Fork 697
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"malformed mach-o: load commands size" with a multi-package cabal.project #5220
Comments
Lovely... so that's the boundary where the library-name munging hits its limits. So |
@angerman Maybe if you pull all deps of |
Just learned so myself. Alright, I’ll try yesod. I vaguely remember having the everything in the same lib idea implemented somewhere. But it would break package relocatability. I’m however more inclined to see if we can just link direct dependencies only in ghc and circumvent the limit that way; might still need to symlink(?) all libs into a common folder in cabal. I’ll give |
so the new-build version of the linker sadness of OSX has finally happened? |
what about having a lib symlinks directory in the new-dist folder for new builds, then we can get really short relative paths, but they should be safe in the face of relocations lets ignore the issue with lack of symlinks on window for this :)))) |
Alright, i got a reproduction case:
now
will create the And now...
will likely error out with:
|
Reproduction repo: https://github.com/angerman/macos-ghc-dylib-blowup |
So I see the #4656 fixed the libraries in |
At work, we have worked around the mach-o "load commands size" issue by following in the Nix folks' footsteps and using a wrapper script around The script, an example, and more info about this issue is available here: |
@jship's suggestion is probably the best way forward. PRs welcome. |
Note that this is fixed in ghc8.6+ (https://phabricator.haskell.org/D4714) and backported in nixpkgs for at least 8.4 and 8.2. This can also be fixed in the tooling I believe, as mafia did here: haskell-mafia/mafia#226 |
Also note that once you start hitting the dylib issues you will soon hit the realgcc.exe: CreateProcess: No such file or directory when building on windows. Which is technically a gcc bug. See https://phabricator.haskell.org/D4762 for a rather crude hack around it. Notably once you hit that on windows, you might hit it eventually on macOS and likely quite a bit later on Linux as well as your projects transitive dependency closure grows. |
Mafia's fix looks quite simple, anyone willing to implement it in Cabal to fix the issue for GHC < 8.6? |
We have run into this issue using Cabal 3.4.0.0, GHC 8.10.4 I saw this comment in this PR: #7094 (comment) We are wondering if this issue is still being tracked or planned to be worked on in GHC 9 and above. |
Which issue? #7339 is definitely being worked on. |
Wondering if #5220 (this one in the current release of Cabal/GHC) is known about or being worked on. I'm not familiar enough with rpath to know if it would help, but it seems like path length is a factor in this bug, so that's why I asked. |
I'm not familiar with the story, but reading the comments I see that #5220 is already closed for GHC >= 8.6. I don't think it's being worked on any more and I actually think we should close it. Am I misreading the comments? |
We have a project with over 50 packages we run into infamous OSX linker problem.
In
otool -l
dump of some dylib there arefor each dependency, which is fine.
Local libraries names aren't mungled
local package names aren't mungled: we have "long" names
futurice-this
andfuturice-that
,servant-algebraic-graphs
...Each local library's dylib is in own dir
While there is one
LC_RPATH
for store:There are one per local dependency:
I'd say that fixing the second part, having single libdir in
dist-newstyle
(on OSX?) would save this problem too. For now it prevents splitting big "industrial size" repository into smaller packages (we want to have separate packages, as it's easier to manage).We could use internal libraries to workaround this, but the problem would still persist for cases like https://github.com/phadej/acme-kmett (I didn't tried to compile it on OSX).
otool-hyperloglog.txt
The above dump is for
hyperloglog
.dylib
from acme-kmett, it has 111 commands, small-dep app in our repo has 332, biggest (which overflows 32k limit) has 420.cc @christiaanb
The text was updated successfully, but these errors were encountered: