[GHC] #15404: ghc-8.6 uninstallable on macos due to hard coded libgmp directory

#15404: ghc-8.6 uninstallable on macos due to hard coded libgmp directory -------------------------------------+------------------------------------- Reporter: tmcdonell | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: 8.6.1 Component: None | Version: Keywords: | Operating System: MacOS X Architecture: | Type of failure: Installing GHC Unknown/Multiple | failed Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- It is very difficult to install the ghc-8.6.1 release candidates (both RC1 and RC2) on MacOS because several components attempt to link directly to `/usr/local/opt/gmp/lib/libgmp.10.dylib`. This is not a standard path. See the offending `LC_LOAD_DYLIB` command here: {{{ $ jtool -l libraries/base/dist- install/build/libHSbase-4.12.0.0-ghc8.6.0.20180714.dylib LC 00: LC_SEGMENT_64 Mem: 0x000000000-0x4e1000 __TEXT Mem: 0x0000010b0-0x0004d12ba __TEXT.__text (Normal) Mem: 0x0004d12ba-0x0004d1686 __TEXT.__stubs (Symbol Stubs) Mem: 0x0004d1688-0x0004d1cee __TEXT.__stub_helper (Normal) Mem: 0x0004d1cee-0x0004df75b __TEXT.__cstring (C-String Literals) Mem: 0x0004df760-0x0004e0f40 __TEXT.__const Mem: 0x0004e0f40-0x0004e1000 __TEXT.__unwind_info LC 01: LC_SEGMENT_64 Mem: 0x0004e1000-0x5a7000 __DATA Mem: 0x0004e1000-0x0004e30f0 __DATA.__got (Non-Lazy Symbol Ptrs) Mem: 0x0004e30f0-0x0004e3100 __DATA.__nl_symbol_ptr (Non-Lazy Symbol Ptrs) Mem: 0x0004e3100-0x0004e3610 __DATA.__la_symbol_ptr (Lazy Symbol Ptrs) Mem: 0x0004e3610-0x0004e3618 __DATA.__mod_init_func (Module Init Function Ptrs) Mem: 0x0004e3620-0x0004f4bc0 __DATA.__const Mem: 0x0004f4bc0-0x0005a6920 __DATA.__data Mem: 0x0005a6920-0x0005a6928 __DATA.__bss (Zero Fill) LC 02: LC_SEGMENT_64 Mem: 0x0005a7000-0xb8c000 __LINKEDIT LC 03: LC_ID_DYLIB @rpath/libHSbase-4.12.0.0-ghc8.6.0.20180714.dylib LC 04: LC_DYLD_INFO LC 05: LC_SYMTAB Symbol table is at offset 0x6a5348 (6968136), 118090 entries String table is at offset 0x873d78 (8863096), 3241616 bytes LC 06: LC_DYSYMTAB 81438 local symbols at index 0 35948 external symbols at index 81438 704 undefined symbols at index 117386 No TOC No modtab 1380 Indirect symbols at offset 0x8727e8 LC 07: LC_UUID UUID: B4C0C347-131F-317B-BA52-EE23F5C5CABA LC 08: LC_VERSION_MIN_MACOSX Minimum OS X version: 10.12.0 LC 09: LC_SOURCE_VERSION Source Version: 0.0.0.0.0 LC 10: LC_LOAD_DYLIB /usr/lib/libiconv.2.dylib LC 11: LC_LOAD_DYLIB @rpath/libHSinteger- gmp-1.0.2.0-ghc8.6.0.20180714.dylib LC 12: LC_LOAD_DYLIB @rpath/libHSghc- prim-0.5.3-ghc8.6.0.20180714.dylib LC 13: LC_LOAD_DYLIB /usr/local/opt/gmp/lib/libgmp.10.dylib LC 14: LC_LOAD_DYLIB /usr/lib/libSystem.B.dylib LC 15: LC_RPATH @loader_path/../integer-gmp-1.0.2.0 LC 16: LC_RPATH @loader_path/../ghc-prim-0.5.3 LC 17: LC_RPATH @loader_path/../rts LC 18: LC_FUNCTION_STARTS Offset: 6876632, Size: 91504 (0x68edd8-0x6a5348) with 83924 functions LC 19: LC_DATA_IN_CODE Offset: 6968136, Size: 0 (0x6a5348-0x6a5348) }}} The other offenders are `libHSbinary` and `libHSinteger-gmp`. Without changing these load commands, you'll get the following error: {{{ $ ./configure --prefix=... $ make install <snip> dyld: Library not loaded: /usr/local/opt/gmp/lib/libgmp.10.dylib Referenced from: ./libraries/base/dist- install/build/libHSbase-4.12.0.0-ghc8.6.0.20180714.dylib Reason: image not found make[1]: *** [install_packages] Abort trap: 6 make: *** [install] Error 2 }}} I tried passing the `--with-gmp-libraries` option to `configure`, but that did not help. I guess this is just a packaging problem, but figured you should be aware before the official release... -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15404 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15404: ghc-8.6 uninstallable on macos due to hard coded libgmp directory -------------------------------------+------------------------------------- Reporter: tmcdonell | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: 8.8.1 Component: None | Version: Resolution: | Keywords: Operating System: MacOS X | Architecture: Type of failure: Installing GHC | Unknown/Multiple failed | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by wereHamster): Is there documentation how to install /usr/local/opt/gmp/lib/libgmp.10.dylib? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15404#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15404: ghc-8.6 uninstallable on macos due to hard coded libgmp directory -------------------------------------+------------------------------------- Reporter: tmcdonell | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: 8.8.1 Component: None | Version: Resolution: | Keywords: Operating System: MacOS X | Architecture: Type of failure: Installing GHC | Unknown/Multiple failed | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by borsboom): On my system, where I was able to install ghc-8.6.1, the file seems to have been installed by Homebrew's [https://formulae.brew.sh/formula/gmp gmp formula]. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15404#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15404: ghc-8.6 uninstallable on macos due to hard coded libgmp directory -------------------------------------+------------------------------------- Reporter: tmcdonell | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: 8.6.1 Component: None | Version: Resolution: | Keywords: Operating System: MacOS X | Architecture: Type of failure: Installing GHC | Unknown/Multiple failed | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * milestone: 8.8.1 => 8.6.1 Comment: Hmm, oh dear. It looks like I overlooked this while bumping tickets to 8.8. This should indeed be fixed. It is likely fall-out from the recent switch to CI-based binary distribution builds. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15404#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15404: ghc-8.6 uninstallable on macos due to hard coded libgmp directory -------------------------------------+------------------------------------- Reporter: tmcdonell | Owner: (none) Type: bug | Status: new Priority: highest | Milestone: 8.6.2 Component: None | Version: Resolution: | Keywords: Operating System: MacOS X | Architecture: Type of failure: Installing GHC | Unknown/Multiple failed | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * priority: normal => highest * milestone: 8.6.1 => 8.6.2 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15404#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15404: ghc-8.6 uninstallable on macos due to hard coded libgmp directory -------------------------------------+------------------------------------- Reporter: tmcdonell | Owner: (none) Type: bug | Status: new Priority: highest | Milestone: 8.6.2 Component: None | Version: Resolution: | Keywords: Operating System: MacOS X | Architecture: Type of failure: Installing GHC | Unknown/Multiple failed | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by bgamari): I see what happened here: we used to build for Darwin using the in-tree GMP but this logic was never ported to CircleCI. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15404#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15404: ghc-8.6 uninstallable on macos due to hard coded libgmp directory
-------------------------------------+-------------------------------------
Reporter: tmcdonell | Owner: (none)
Type: bug | Status: new
Priority: highest | Milestone: 8.6.2
Component: None | Version:
Resolution: | Keywords:
Operating System: MacOS X | Architecture:
Type of failure: Installing GHC | Unknown/Multiple
failed | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s):
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by Ben Gamari

#15404: ghc-8.6 uninstallable on macos due to hard coded libgmp directory -------------------------------------+------------------------------------- Reporter: tmcdonell | Owner: (none) Type: bug | Status: closed Priority: highest | Milestone: 8.6.2 Component: None | Version: Resolution: fixed | Keywords: Operating System: MacOS X | Architecture: Type of failure: Installing GHC | Unknown/Multiple failed | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: new => closed * resolution: => fixed Comment: Fixed with 78fb31077e58d949ea644c9d51abe53de9a9d2cb. Merged to `ghc-8.6` with 578012be13eb1548050d51c0a23bd1a98423f03e. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15404#comment:8 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15404: ghc-8.6 uninstallable on macos due to hard coded libgmp directory -------------------------------------+------------------------------------- Reporter: tmcdonell | Owner: (none) Type: bug | Status: closed Priority: highest | Milestone: 8.6.2 Component: None | Version: Resolution: fixed | Keywords: Operating System: MacOS X | Architecture: Type of failure: Installing GHC | Unknown/Multiple failed | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by berdario): Has this really been fixed? https://gist.github.com/berdario/e1160b6fb2d353f446a0ecd9c8caa6d1 I get the same error: dyld: Library not loaded: /usr/local/opt/gmp/lib/libgmp.10.dylib Referenced from: /private/tmp/ghc-8.6.2/libraries/base/dist- install/build/libHSbase-4.12.0.0-ghc8.6.2.dylib Reason: image not found -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15404#comment:9 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15404: ghc-8.6 uninstallable on macos due to hard coded libgmp directory -------------------------------------+------------------------------------- Reporter: tmcdonell | Owner: (none) Type: bug | Status: closed Priority: highest | Milestone: 8.6.2 Component: None | Version: Resolution: fixed | Keywords: Operating System: MacOS X | Architecture: Type of failure: Installing GHC | Unknown/Multiple failed | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by berdario): I see that here: https://circleci.com/gh/ghc/ghc/11020 This message is logged: configure: WARNING: unrecognized options: --with-intree-gmp maybe the configuration hasn't been picked up by autoconf? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15404#comment:10 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15404: ghc-8.6 uninstallable on macos due to hard coded libgmp directory -------------------------------------+------------------------------------- Reporter: tmcdonell | Owner: (none) Type: bug | Status: new Priority: highest | Milestone: 8.6.3 Component: None | Version: Resolution: | Keywords: Operating System: MacOS X | Architecture: Type of failure: Installing GHC | Unknown/Multiple failed | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: closed => new * resolution: fixed => * milestone: 8.6.2 => 8.6.3 Comment: Indeed, very good catch! Looks like another 8.6 release is in order. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15404#comment:11 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15404: ghc-8.6 uninstallable on macos due to hard coded libgmp directory -------------------------------------+------------------------------------- Reporter: tmcdonell | Owner: (none) Type: bug | Status: new Priority: highest | Milestone: 8.6.2 Component: None | Version: Resolution: | Keywords: Operating System: MacOS X | Architecture: Type of failure: Installing GHC | Unknown/Multiple failed | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by berdario): * milestone: 8.6.3 => 8.6.2 Comment: Thanks to dminuoso, he pointed out that the flag is actually defined for the inner library, and in fact should be toggled differently in the build.mk While running tests with this fix in https://github.com/ghc/ghc/pull/222/files this surfaced test failures due to https://ghc.haskell.org/trac/ghc/ticket/15105 This turned out to be the same behavior in GHC 8.4, unclear why the failures weren't seen before. The .o code for the HSinteger-gmp-1.0.2.0.o had the same symbol table. The bug turned out to be in GHC static linker. We added a bunch more logging statements to the code that reads MachO symbols. It turned out that it was counting the number of external symbols (let's say M), and then going through the first M such symbols in the table (thus ignoring the last N-M symbols). -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15404#comment:12 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15404: ghc-8.6 uninstallable on macos due to hard coded libgmp directory -------------------------------------+------------------------------------- Reporter: tmcdonell | Owner: (none) Type: bug | Status: patch Priority: highest | Milestone: 8.6.3 Component: None | Version: Resolution: | Keywords: Operating System: MacOS X | Architecture: Type of failure: Installing GHC | Unknown/Multiple failed | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by berdario): * status: new => patch * milestone: 8.6.2 => 8.6.3 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15404#comment:13 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15404: ghc-8.6 uninstallable on macos due to hard coded libgmp directory
-------------------------------------+-------------------------------------
Reporter: tmcdonell | Owner: (none)
Type: bug | Status: patch
Priority: highest | Milestone: 8.6.3
Component: None | Version:
Resolution: | Keywords:
Operating System: MacOS X | Architecture:
Type of failure: Installing GHC | Unknown/Multiple
failed | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s):
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by Ben Gamari

#15404: ghc-8.6 uninstallable on macos due to hard coded libgmp directory -------------------------------------+------------------------------------- Reporter: tmcdonell | Owner: (none) Type: bug | Status: closed Priority: highest | Milestone: 8.6.3 Component: None | Version: 8.6.1 Resolution: fixed | Keywords: Operating System: MacOS X | Architecture: Type of failure: Installing GHC | Unknown/Multiple failed | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: patch => closed * version: => 8.6.1 * resolution: => fixed Comment: Merged with b6d2d8375e4c1425690e26d1f6bc1578f7ed1043. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15404#comment:15 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC