[GHC] #8725: make DESTDIR=... install broken

#8725: make DESTDIR=... install broken ----------------------------------+---------------------------------------- Reporter: nomeata | Owner: Type: bug | Status: new Priority: high | Milestone: Component: Build System | Version: 7.6.3 Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: Building GHC failed Unknown/Multiple | Test Case: Difficulty: Unknown | Blocking: Blocked By: | Related Tickets: | ----------------------------------+---------------------------------------- Hi, when the building the Debian package of GHC HEAD, I get this error: {{{ $ /usr/bin/make DESTDIR=/home/nomeata/dailies/2014-01-31/ghc-7.9.20140130/debian/tmp install [...] /home/nomeata/dailies/2014-01-31/ghc-7.9.20140130/debian/tmp/usr/lib/ghc /old-time-1.1.0.2 "inplace/bin/ghc-cabal" copy libraries/haskell98 dist-install "strip" '/home/nomeata/dailies/2014-01-31/ghc-7.9.20140130/debian/tmp' '/usr' '/usr/lib/ghc' '/usr/share/doc/ghc-doc/html/libraries' 'v p dyn' Installing library in /home/nomeata/dailies/2014-01-31/ghc-7.9.20140130/debian/tmp/usr/lib/ghc/haskell98-2.0.0.3 "inplace/bin/ghc-cabal" copy libraries/haskell2010 dist-install "strip" '/home/nomeata/dailies/2014-01-31/ghc-7.9.20140130/debian/tmp' '/usr' '/usr/lib/ghc' '/usr/share/doc/ghc-doc/html/libraries' 'v p dyn' Installing library in /home/nomeata/dailies/2014-01-31/ghc-7.9.20140130/debian/tmp/usr/lib/ghc/haskell2010-1.1.1.1 "/home/nomeata/dailies/2014-01-31/ghc-7.9.20140130/debian/tmp/usr/lib/ghc/lib/bin /ghc-pkg" --force --global-package-db "/home/nomeata/dailies/2014-01-31/ghc-7.9.20140130/debian/tmp/usr/lib/ghc/package.conf.d" update rts/dist/package.conf.install /home/nomeata/dailies/2014-01-31/ghc-7.9.20140130/debian/tmp/usr/lib/ghc/lib/bin /ghc-pkg: error while loading shared libraries: libHSterminfo-0.4.0.0-ghc7.9.20140130.so: cannot open shared object file: No such file or directory make[1]: *** [install_packages] Fehler 127 make: *** [install] Fehler 2 }}} The problem is that it is calling ghc-pkg at the installed position, where it cannot find its libraries. `/home/nomeata/dailies/2014-01-31/ghc-7.9.20140130/debian/tmp/usr/lib/ghc/bin /ghc-pkg` would also not work, as that refers to absolute paths which are not there yet. I guess it should continue using the binaries in `inplace/bin` just like for `ghc-cabal`. But that alone does not help: {{{ "inplace/bin/ghc-pkg" --force --global-package-db "/home/nomeata/dailies/2014-01-31/ghc-7.9.20140130/debian/tmp/usr/lib/ghc/package.conf.d" update rts/dist/package.conf.install Reading package info from "rts/dist/package.conf.install" ... done. rts-1.0: Warning: library-dirs: /usr/lib/ghc/rts-1.0 doesn't exist or isn't a directory rts-1.0: cannot find any of ["libHSrts.a","libHSrts.p_a","libHSrts- ghc7.9.20140130.so","libHSrts-ghc7.9.20140130.dylib","HSrts- ghc7.9.20140130.dll"] on library path (ignoring) "inplace/bin/ghc-cabal" register libraries/ghc-prim dist-install "/home/nomeata/dailies/2014-01-31/ghc-7.9.20140130/debian/tmp/usr/lib/ghc/lib/bin/ghc" "/home/nomeata/dailies/2014-01-31/ghc-7.9.20140130/debian/tmp/usr/lib/ghc/lib/bin /ghc-pkg" "/home/nomeata/dailies/2014-01-31/ghc-7.9.20140130/debian/tmp/usr/lib/ghc" '/home/nomeata/dailies/2014-01-31/ghc-7.9.20140130/debian/tmp' '/usr' '/usr/lib/ghc' '/usr/share/doc/ghc-doc/html/libraries' NO Warning: cannot determine version of /home/nomeata/dailies/2014-01-31/ghc-7.9.20140130/debian/tmp/usr/lib/ghc/lib/bin/ghc : "" Warning: cannot determine version of /home/nomeata/dailies/2014-01-31/ghc-7.9.20140130/debian/tmp/usr/lib/ghc/lib/bin /ghc-pkg : "" ghc-cabal: /home/nomeata/dailies/2014-01-31/ghc-7.9.20140130/debian/tmp/usr/lib/ghc/lib/bin /ghc-pkg: error while loading shared libraries: libHSterminfo-0.4.0.0-ghc7.9.20140130.so: cannot open shared object file: No such file or directory }}} It would be nice if this can be fixed before 7.8.1, packagers rely on `DESTDIR`. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8725 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8725: make DESTDIR=... install broken ----------------------------------------+---------------------------------- Reporter: nomeata | Owner: Type: bug | Status: new Priority: high | Milestone: Component: Build System | Version: 7.6.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Building GHC failed | Unknown/Multiple Test Case: | Difficulty: Unknown Blocking: | Blocked By: | Related Tickets: ----------------------------------------+---------------------------------- Comment (by nomeata): Candidate that might have broken that is 898cb090c8812704448ec4cb1c10d50df4b7d664/ghc by Ian, and most other changes to `ghc.mk` are by Ian. Ian, since you seem to be the expert on the build system, do you think you can fix this easily? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8725#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8725: make DESTDIR=... install broken ----------------------------------------+---------------------------------- Reporter: nomeata | Owner: Type: bug | Status: new Priority: high | Milestone: Component: Build System | Version: 7.6.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Building GHC failed | Unknown/Multiple Test Case: | Difficulty: Unknown Blocking: | Blocked By: | Related Tickets: ----------------------------------------+---------------------------------- Comment (by nomeata): After being told that others have not problem with `DESTDIR`, I narrowed it down a bit. I believe that `DESTDIR` can only work if `$ghclibexecdir` = `$ghclibdir`. Then, executing `$ghclibexecdir/bin/ghc` works because of the rpath of the binaries: {{{ 0x000000000000000f (RPATH) Library rpath: [$ORIGIN/../terminfo-0.4.0.0:$ORIGIN/../bin-package- db-0.0.0.0:$ORIGIN/../binary-0.7.1.0:$ORIGIN/../Cabal-1.18.1.3:$ORIGIN/../process-1.2.0.0:$ORIGIN/../pretty-1.1.1.1:$ORIGIN/../directory-1.2.0.2:$ORIGIN/../unix-2.7.0.0:$ORIGIN/../time-1.4.1:$ORIGIN /../old- locale-1.0.0.6:$ORIGIN/../filepath-1.3.0.2:$ORIGIN/../containers-0.5.4.0:$ORIGIN/../bytestring-0.10.4.0:$ORIGIN/../deepseq-1.3.0.2:$ORIGIN/../array-0.5.0.0:$ORIGIN/../base-4.7.0.0:$ORIGIN /../integer-gmp-0.5.1.0:$ORIGIN/../ghc-prim-0.3.1.0:$ORIGIN/../rts-1.0] }}} Debian has `$ghclibexecdir = $ghclibdir/lib`, so this breaks. The relative path here (`$ORIGIN/../$d`) is hard-coded in source:rules /build-package-way.mk and this issue was last addressed by [7dd7008f], in response to #3072. To fix this properly, instead of `..` one would have to calculate the relative path from `$ghclibexecdir/bin` to `$ghclibdir`. Or simply, and officially stop supporting such directory layouts. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8725#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8725: make DESTDIR=... install broken ----------------------------------------+---------------------------------- Reporter: nomeata | Owner: Type: bug | Status: new Priority: high | Milestone: Component: Build System | Version: 7.6.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Building GHC failed | Unknown/Multiple Test Case: | Difficulty: Unknown Blocking: | Blocked By: | Related Tickets: ----------------------------------------+---------------------------------- Changes (by PHO): * cc: pho@… (added) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8725#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8725: make DESTDIR=... install broken ----------------------------------------+---------------------------------- Reporter: nomeata | Owner: Type: bug | Status: closed Priority: high | Milestone: Component: Build System | Version: 7.6.3 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Building GHC failed | Unknown/Multiple Test Case: | Difficulty: Unknown Blocking: | Blocked By: | Related Tickets: ----------------------------------------+---------------------------------- Changes (by nomeata): * status: new => closed * resolution: => fixed Comment: I think the right solution is to ignore this and expect people not to mess with `ghclibexecdir`. Thus closing this. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8725#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8725: make DESTDIR=... install broken
----------------------------------------+----------------------------------
Reporter: nomeata | Owner:
Type: bug | Status: closed
Priority: high | Milestone:
Component: Build System | Version: 7.6.3
Resolution: fixed | Keywords:
Operating System: Unknown/Multiple | Architecture:
Type of failure: Building GHC failed | Unknown/Multiple
Test Case: | Difficulty: Unknown
Blocking: | Blocked By:
| Related Tickets:
----------------------------------------+----------------------------------
Comment (by Richard Eisenberg

#8725: make DESTDIR=... install broken ----------------------------------------+---------------------------------- Reporter: nomeata | Owner: Type: bug | Status: closed Priority: high | Milestone: Component: Build System | Version: 7.6.3 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Building GHC failed | Unknown/Multiple Test Case: | Difficulty: Unknown Blocking: | Blocked By: | Related Tickets: ----------------------------------------+---------------------------------- Comment (by goldfire): Oops -- meant to reference #8745 in the commit above. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8725#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC