[Hackage] #791: Large libraries not installable on OS X

#791: Large libraries not installable on OS X -----------------------------+---------------------------------------------- Reporter: batterseapower | Owner: Type: defect | Status: new Priority: high | Milestone: Component: Cabal library | Version: 1.8.0.6 Severity: normal | Keywords: Difficulty: unknown | Ghcversion: Platform: Mac OS | -----------------------------+---------------------------------------------- For example: {{{ cabal unpack highlighting-kate-0.2.8.1 cd highlighting-kate-0.2.8.1 ghc --make Setup.hs ./Setup configure ./Setup build }}} This fails: {{{ ld: scattered reloc r_address too large for inferred architecture i386 }}} The underlying reason is that Cabal is trying to create an object file for use with GHCi, but that is not possible (see http://hackage.haskell.org/trac/ghc/ticket/3260). Cabal's GHC.hs should not use combineObjectFiles on with GHC >= 7 and OS X. -- Ticket URL: http://hackage.haskell.org/trac/hackage/ticket/791 Hackage http://haskell.org/cabal/ Hackage: Cabal and related projects

#791: Large libraries not installable on OS X -----------------------------+---------------------------------------------- Reporter: batterseapower | Owner: Type: defect | Status: new Priority: high | Milestone: Component: Cabal library | Version: 1.8.0.6 Severity: normal | Keywords: Difficulty: unknown | Ghcversion: Platform: Mac OS | -----------------------------+---------------------------------------------- Comment(by batterseapower): OK, now I'm not sure if this is in fact a GHC bug as well, because I tried to work around with: {{{ ./Setup build touch dist/build/HShighlighting-kate-0.2.8.1.o sudo ./Setup install }}} But if I try and use GHCi it dies: {{{ *Main> :m Text.Highlighting.Kate.Syntax Prelude Text.Highlighting.Kate.Syntax> languages Loading package array-0.3.0.2 ... linking ... done. Loading package containers-0.4.0.0 ... linking ... done. Loading package filepath-1.2.0.0 ... linking ... done. Loading package parsec-2.1.0.1 ... linking ... done. Loading package bytestring-0.9.1.8 ... linking ... done. Loading package transformers-0.2.2.0 ... linking ... done. Loading package mtl-2.0.1.0 ... linking ... done. Loading package regex-base-0.93.2 ... linking ... done. Loading package regex-pcre-builtin-0.94.2.1.7.7 ... linking ... done. Loading package xhtml-3000.2.0.1 ... linking ... done. Loading package highlighting-kate-0.2.8.1 ... <interactive>: mmap 0 bytes at 0x0: Invalid argument <interactive>: Try specifying an address with +RTS -xm<addr> -RTS }}} (This is with GHC 7.0.1.20101215) Is this expected behaviour? -- Ticket URL: http://hackage.haskell.org/trac/hackage/ticket/791#comment:1 Hackage http://haskell.org/cabal/ Hackage: Cabal and related projects

#791: Large libraries not installable on OS X -----------------------------+---------------------------------------------- Reporter: batterseapower | Owner: Type: defect | Status: new Priority: high | Milestone: Component: Cabal library | Version: 1.8.0.6 Severity: normal | Keywords: Difficulty: unknown | Ghcversion: Platform: Mac OS | -----------------------------+---------------------------------------------- Comment(by duncan): Ah, you mean it is OK to omit the .o files on OSX with ghc-7 because ghci now will look at the .a files instead. Does that apply on all platforms or just OSX? If we can avoid making ghci .o libs on all arches then that's even better. -- Ticket URL: http://hackage.haskell.org/trac/hackage/ticket/791#comment:2 Hackage http://haskell.org/cabal/ Hackage: Cabal and related projects

#791: Large libraries not installable on OS X -----------------------------+---------------------------------------------- Reporter: batterseapower | Owner: Type: defect | Status: new Priority: high | Milestone: Component: Cabal library | Version: 1.8.0.6 Severity: normal | Keywords: Difficulty: unknown | Ghcversion: Platform: Mac OS | -----------------------------+---------------------------------------------- Comment(by batterseapower): It was my understanding that GHCi will use the .a on all platforms - so you could disable it unconditionally for GHC >= 7. See the patch at http://darcs.haskell.org/cgi- bin/darcsweb.cgi?r=ghc-7.0/ghc;a=darcs_commitdiff;h=20101127173000-3fd76-04f98172935bf6b1a3f4154d57c06f620b6b9427.gz for details. However, I'm having some problems making it actually work (as you can see above). I've filed GHC #4901 (http://hackage.haskell.org/trac/ghc/ticket/4901) to get feedback on whether my understanding at fault or GHCi is. -- Ticket URL: http://hackage.haskell.org/trac/hackage/ticket/791#comment:3 Hackage http://haskell.org/cabal/ Hackage: Cabal and related projects

#791: Large libraries not installable on OS X -----------------------------+---------------------------------------------- Reporter: batterseapower | Owner: Type: defect | Status: new Priority: high | Milestone: Component: Cabal library | Version: 1.8.0.6 Severity: normal | Keywords: Difficulty: unknown | Ghcversion: Platform: Mac OS | -----------------------------+---------------------------------------------- Changes (by PHO): * cc: pho@… (added) -- Ticket URL: http://hackage.haskell.org/trac/hackage/ticket/791#comment:4 Hackage http://haskell.org/cabal/ Hackage: Cabal and related projects

#791: Large libraries not installable on OS X -----------------------------+---------------------------------------------- Reporter: batterseapower | Owner: Type: defect | Status: new Priority: high | Milestone: Component: Cabal library | Version: 1.8.0.6 Severity: normal | Keywords: Difficulty: unknown | Ghcversion: Platform: Mac OS | -----------------------------+---------------------------------------------- Comment(by duncan): Current decision of ghc devs is not to disable GHCi .o libs yet because of possible bugs in loading the .a archives. http://hackage.haskell.org/trac/ghc/ticket/4901 When we do change it, we can use this patch: {{{ hunk ./Distribution/Simple/GHC.hs 542 - ifGHCiLib = when (withGHCiLib lbi && withVanillaLib lbi) + ifGHCiLib = when (withGHCiLib lbi && withVanillaLib lbi + -- As of GHC 7, GHCi can load .a libs, so the .o + -- libs are not necessary. However this only works + -- correctly in later releases of the ghc-7.x + && compilerVersion comp < Version [7,0,unknown] []) }}} Obviously, we'll have to wait to know just which ghc-7.x version it does work in. In the meantime, the workaround for affected packages is to use the flag `--disable-library-for-ghci`. -- Ticket URL: http://hackage.haskell.org/trac/hackage/ticket/791#comment:5 Hackage http://haskell.org/cabal/ Hackage: Cabal and related projects

#791: Large libraries not installable on OS X -----------------------------+---------------------------------------------- Reporter: batterseapower | Owner: Type: defect | Status: new Priority: high | Milestone: Component: Cabal library | Version: 1.8.0.6 Severity: normal | Keywords: Difficulty: unknown | Ghcversion: Platform: Mac OS | -----------------------------+---------------------------------------------- Comment(by igloo): I don't think you should override `withGHCiLib`, just change the default. -- Ticket URL: http://hackage.haskell.org/trac/hackage/ticket/791#comment:6 Hackage http://haskell.org/cabal/ Hackage: Cabal and related projects

#791: Large libraries not installable on OS X -----------------------------+---------------------------------------------- Reporter: batterseapower | Owner: Type: defect | Status: new Priority: high | Milestone: Component: Cabal library | Version: 1.8.0.6 Severity: normal | Keywords: Difficulty: unknown | Ghcversion: Platform: Mac OS | -----------------------------+---------------------------------------------- Changes (by conal): * cc: conal (added) Comment: I just ran into this same issue while 'cabal install'ing highlighting- kate-0.2.9 with 32-bit ghc 7.0.2 on Mac OS 10.6.6. Is there an up-to-date recommendation for this problem? {{{ bash-3.2$ pwd /Users/conal/cabal/highlighting-kate-0.2.9 bash-3.2$ cabal install Resolving dependencies... Configuring highlighting-kate-0.2.9... Preprocessing library highlighting-kate-0.2.9... Preprocessing executables for highlighting-kate-0.2.9... Building highlighting-kate-0.2.9... [ 1 of 111] Compiling Paths_highlighting_kate ( dist/build/autogen/Paths_highlighting_kate.hs, dist/build/Paths_highlighting_kate.o ) ... [111 of 111] Compiling Text.Highlighting.Kate ( Text/Highlighting/Kate.hs, dist/build/Text/Highlighting/Kate.o ) ld: scattered reloc r_address too large cabal: Error: some packages failed to install: highlighting-kate-0.2.9 failed during the building phase. The exception was: ExitFailure 1 bash-3.2$ ghc --version The Glorious Glasgow Haskell Compilation System, version 7.0.2 bash-3.2$ uname -a Darwin Conals-Mac.local 10.6.0 Darwin Kernel Version 10.6.0: Wed Nov 10 18:13:17 PST 2010; root:xnu-1504.9.26~3/RELEASE_I386 i386 }}} -- Ticket URL: http://hackage.haskell.org/trac/hackage/ticket/791#comment:7 Hackage http://haskell.org/cabal/ Hackage: Cabal and related projects

I see that this this trac item has no milestone and an "unknown" duration.
Has this problem (incompatibility of large libraries and ghci on the Mac)
slipped through the cracks? Is it thought to be unimportant? For me, not
being able to count on ghci is a huge detriment. Thanks,
- Conal
On Sun, Mar 20, 2011 at 9:18 PM, Hackage
#791: Large libraries not installable on OS X
-----------------------------+---------------------------------------------- Reporter: batterseapower | Owner: Type: defect | Status: new Priority: high | Milestone: Component: Cabal library | Version: 1.8.0.6 Severity: normal | Keywords: Difficulty: unknown | Ghcversion: Platform: Mac OS |
-----------------------------+---------------------------------------------- Changes (by conal):
* cc: conal (added)
Comment:
I just ran into this same issue while 'cabal install'ing highlighting- kate-0.2.9 with 32-bit ghc 7.0.2 on Mac OS 10.6.6. Is there an up-to-date recommendation for this problem? {{{ bash-3.2$ pwd /Users/conal/cabal/highlighting-kate-0.2.9 bash-3.2$ cabal install Resolving dependencies... Configuring highlighting-kate-0.2.9... Preprocessing library highlighting-kate-0.2.9... Preprocessing executables for highlighting-kate-0.2.9... Building highlighting-kate-0.2.9... [ 1 of 111] Compiling Paths_highlighting_kate ( dist/build/autogen/Paths_highlighting_kate.hs, dist/build/Paths_highlighting_kate.o ) ... [111 of 111] Compiling Text.Highlighting.Kate ( Text/Highlighting/Kate.hs, dist/build/Text/Highlighting/Kate.o ) ld: scattered reloc r_address too large cabal: Error: some packages failed to install: highlighting-kate-0.2.9 failed during the building phase. The exception was: ExitFailure 1 bash-3.2$ ghc --version The Glorious Glasgow Haskell Compilation System, version 7.0.2 bash-3.2$ uname -a Darwin Conals-Mac.local 10.6.0 Darwin Kernel Version 10.6.0: Wed Nov 10 18:13:17 PST 2010; root:xnu-1504.9.26~3/RELEASE_I386 i386 }}}
-- Ticket URL: http://hackage.haskell.org/trac/hackage/ticket/791#comment:7 Hackage http://haskell.org/cabal/ Hackage: Cabal and related projects
_______________________________________________ cabal-devel mailing list cabal-devel@haskell.org http://www.haskell.org/mailman/listinfo/cabal-devel

Hi Conal, The Hackage bug you quoted is related to this GHC ticket: http://hackage.haskell.org/trac/ghc/ticket/4326 the root cause is a size limitation in the OS X linker triggered when libraries get particularly large. We worked around it (actually Ian did) in GHC by adding support to the GHCi linker to load .a files. What's still missing (I presume) is something in Cabal to treat this error as non-fatal, and back off to using .a files instead. Or perhaps using .a files should be the default. Cheers, Simon On 26/03/2011 16:59, Conal Elliott wrote:
I see that this this trac item has no milestone and an "unknown" duration. Has this problem (incompatibility of large libraries and ghci on the Mac) slipped through the cracks? Is it thought to be unimportant? For me, not being able to count on ghci is a huge detriment. Thanks,
- Conal
On Sun, Mar 20, 2011 at 9:18 PM, Hackage
mailto:cvs-ghc@haskell.org> wrote: #791: Large libraries not installable on OS X -----------------------------+---------------------------------------------- Reporter: batterseapower | Owner: Type: defect | Status: new Priority: high | Milestone: Component: Cabal library | Version: 1.8.0.6 Severity: normal | Keywords: Difficulty: unknown | Ghcversion: Platform: Mac OS | -----------------------------+---------------------------------------------- Changes (by conal):
* cc: conal (added)
Comment:
I just ran into this same issue while 'cabal install'ing highlighting- kate-0.2.9 with 32-bit ghc 7.0.2 on Mac OS 10.6.6. Is there an up-to-date recommendation for this problem? {{{ bash-3.2$ pwd /Users/conal/cabal/highlighting-kate-0.2.9 bash-3.2$ cabal install Resolving dependencies... Configuring highlighting-kate-0.2.9... Preprocessing library highlighting-kate-0.2.9... Preprocessing executables for highlighting-kate-0.2.9... Building highlighting-kate-0.2.9... [ 1 of 111] Compiling Paths_highlighting_kate ( dist/build/autogen/Paths_highlighting_kate.hs, dist/build/Paths_highlighting_kate.o ) ... [111 of 111] Compiling Text.Highlighting.Kate ( Text/Highlighting/Kate.hs, dist/build/Text/Highlighting/Kate.o ) ld: scattered reloc r_address too large cabal: Error: some packages failed to install: highlighting-kate-0.2.9 failed during the building phase. The exception was: ExitFailure 1 bash-3.2$ ghc --version The Glorious Glasgow Haskell Compilation System, version 7.0.2 bash-3.2$ uname -a Darwin Conals-Mac.local 10.6.0 Darwin Kernel Version 10.6.0: Wed Nov 10 18:13:17 PST 2010; root:xnu-1504.9.26~3/RELEASE_I386 i386 }}}
-- Ticket URL: http://hackage.haskell.org/trac/hackage/ticket/791#comment:7 Hackage http://haskell.org/cabal/ Hackage: Cabal and related projects
_______________________________________________ cabal-devel mailing list cabal-devel@haskell.org mailto:cabal-devel@haskell.org http://www.haskell.org/mailman/listinfo/cabal-devel
_______________________________________________ Cvs-ghc mailing list Cvs-ghc@haskell.org http://www.haskell.org/mailman/listinfo/cvs-ghc

On 28 March 2011 09:36, Simon Marlow
the root cause is a size limitation in the OS X linker triggered when libraries get particularly large. We worked around it (actually Ian did) in GHC by adding support to the GHCi linker to load .a files.
What's still missing (I presume) is something in Cabal to treat this error as non-fatal, and back off to using .a files instead. Or perhaps using .a files should be the default.
Except that I can't actually get the archive loading stuff to work: http://hackage.haskell.org/trac/ghc/ticket/4901 Cheers, Max

#791: Large libraries not installable on OS X -----------------------------+---------------------------------------------- Reporter: batterseapower | Owner: Type: defect | Status: new Priority: high | Milestone: Component: Cabal library | Version: 1.8.0.6 Severity: normal | Keywords: Difficulty: unknown | Ghcversion: Platform: Mac OS | -----------------------------+---------------------------------------------- Comment(by batterseapower): The archive-loading bug is fixed upstream. For now you have to work around the issue by installing the library with --disable-library-for-ghci, so GHCi won't work with such a library. When the new GHC comes out you will get GHCi support, but you will still to use --disable-library-for-ghci in order to install the package in the first place. When Cabal stops generating the GHCi object file by default we will stop trying to link large objects and hence this error will be a non-issue. -- Ticket URL: http://hackage.haskell.org/trac/hackage/ticket/791#comment:8 Hackage http://haskell.org/cabal/ Hackage: Cabal and related projects

#791: Large libraries not installable on OS X -----------------------------+---------------------------------------------- Reporter: batterseapower | Owner: Type: defect | Status: new Priority: high | Milestone: Component: Cabal library | Version: 1.8.0.6 Severity: normal | Keywords: Difficulty: unknown | Ghcversion: Platform: Mac OS | -----------------------------+---------------------------------------------- Comment(by duncan): If the GHC devs think it's really fixed then I'm happy to have Cabal stop generating GHCi .o files at all, either on all arches, or just on OSX, for GHC version > whatever. I don't want to do something dubious like making failure to generate .o files non-fatal and just warn. -- Ticket URL: http://hackage.haskell.org/trac/hackage/ticket/791#comment:9 Hackage http://haskell.org/cabal/ Hackage: Cabal and related projects

#791: Large libraries not installable on OS X -----------------------------+---------------------------------------------- Reporter: batterseapower | Owner: Type: defect | Status: new Priority: high | Milestone: Component: Cabal library | Version: 1.8.0.6 Severity: normal | Keywords: Difficulty: unknown | Ghcversion: Platform: Mac OS | -----------------------------+---------------------------------------------- Changes (by qerub): * cc: christoffer.sawicki@… (added) -- Ticket URL: http://hackage.haskell.org/trac/hackage/ticket/791#comment:10 Hackage http://haskell.org/cabal/ Hackage: Cabal and related projects

#791: Large libraries not installable on OS X -----------------------------+---------------------------------------------- Reporter: batterseapower | Owner: Type: defect | Status: new Priority: high | Milestone: Component: Cabal library | Version: 1.8.0.6 Severity: normal | Keywords: Difficulty: unknown | Ghcversion: Platform: Mac OS | -----------------------------+---------------------------------------------- Comment(by elga): * [http://www.releve-identite-operateur.fr/rio-bouygues.html rio bouygues] -- Ticket URL: http://hackage.haskell.org/trac/hackage/ticket/791#comment:11 Hackage http://haskell.org/cabal/ Hackage: Cabal and related projects

#791: Large libraries not installable on OS X -----------------------------+---------------------------------------------- Reporter: batterseapower | Owner: Type: defect | Status: new Priority: high | Milestone: Component: Cabal library | Version: 1.8.0.6 Severity: normal | Keywords: Difficulty: unknown | Ghcversion: Platform: Mac OS | -----------------------------+---------------------------------------------- Comment(by edouard): A l'image du RIB bancaire, le code RIO est un identifiant unique attribue a une ligne et a un contrat client permettant d'identifier son demande de portabilite vers un autre operateur. [http://www.releve-identite- operateur.fr/numbero-de-virgin-mobile.html virgin mobile] -- Ticket URL: http://hackage.haskell.org/trac/hackage/ticket/791#comment:12 Hackage http://haskell.org/cabal/ Hackage: Cabal and related projects
participants (4)
-
Conal Elliott
-
Hackage
-
Max Bolingbroke
-
Simon Marlow