Opened 8 months ago

Closed 7 months ago

#8194 closed bug (fixed)

make install (at git ef01794) still fails

Reported by: guest Owned by: bos
Priority: highest Milestone: 7.8.1
Component: Build System Version: 7.7
Keywords: Cc:
Operating System: Linux Architecture: x86
Type of failure: Installing GHC failed Difficulty: Unknown
Test Case: Blocked By:
Blocking: Related Tickets:

Description

I think the last time make install worked for me was sometime in
February or March 2013. The build succeeds but make install fails.

mk/build.mk:

BuildFlavour = perf
V = 0

Steps to reproduce:

$ perl boot
$ ./configure --prefix=/tmp/ghc/7.7.20130827
$ make
$ make install
[...]
Installing library in
/tmp/ghc/7.7.20130827/lib/ghc-7.7.20130827/haskell2010-1.1.1.0
"/tmp/ghc/7.7.20130827/lib/ghc-7.7.20130827/bin/ghc-pkg" --force
--global-package-db
"/tmp/ghc/7.7.20130827/lib/ghc-7.7.20130827/package.conf.d" update
rts/dist/package.conf.install
/tmp/ghc/7.7.20130827/lib/ghc-7.7.20130827/bin/ghc-pkg: error while
loading shared libraries:
libHSbin-package-db-0.0.0.0-ghc7.7.20130827.so: cannot open shared
object file: No such file or directory

make[1]: *** [install_packages] Error 127
make: *** [install] Error 2

Related mailing list threads:

Change History (11)

comment:1 Changed 8 months ago by ezyang

  • Priority changed from normal to highest

Probably this is due to dynamic GHC; after the shared libraries are installed ghc-pkg can no longer find them. The proper way to do this is to register the libraries with the system dynamic linker; someone should figure out how to do this in a packager friendly way.

comment:2 Changed 8 months ago by guest

So you think some change in 7.7 caused this, right?

I haven't heard of anyone else hit the same issue, and it would great if someone else could verify the issue with the same i386 toolchain.

Should I modify build.mk to disable shared libs for now, or is that something you would discourage me from doing?

Version 0, edited 8 months ago by guest (next)

comment:3 Changed 8 months ago by rrnewton

I have the same problem. I assume everyone does then and the dynamic-libs switch is just a work-in-progress?

comment:4 Changed 8 months ago by ezyang

Well, I couldn't get GHC to build not dynamic-by-default. IIRC, we're planning on shipping 7.8 with dynamic-by-default GHC, so this is a major blocker on the way there.

comment:5 Changed 7 months ago by bos

This is affecting me, too. I'm trying to use a perf build.

The problem appears to be that we do not install any shared libraries for packages during "make install".

~/git/ghc $ ldd /usr/local/ghc/head/lib/ghc-7.7.20130912/bin/ghc-pkg
	linux-vdso.so.1 =>  (0x00007fff269fe000)
	libHSterminfo-0.3.2.5-ghc7.7.20130912.so => /usr/local/ghc/head/lib/ghc-7.7.20130912/bin/../terminfo-0.3.2.5/libHSterminfo-0.3.2.5-ghc7.7.20130912.so (0x00007f189275f000)
	libHSbin-package-db-0.0.0.0-ghc7.7.20130912.so => not found
	libHSbinary-0.7.1.0-ghc7.7.20130912.so => not found
	libHSCabal-1.18.0-ghc7.7.20130912.so => not found
	libHSprocess-1.2.0.0-ghc7.7.20130912.so => not found
	libHSpretty-1.1.1.0-ghc7.7.20130912.so => not found
	libHSdirectory-1.2.0.1-ghc7.7.20130912.so => not found
	libHSunix-2.7.0.0-ghc7.7.20130912.so => not found
	libHStime-1.4.1-ghc7.7.20130912.so => not found
	libHSold-locale-1.0.0.5-ghc7.7.20130912.so => not found
	libHSfilepath-1.3.0.2-ghc7.7.20130912.so => not found
	libHScontainers-0.5.3.1-ghc7.7.20130912.so => not found
	libHSbytestring-0.10.3.0-ghc7.7.20130912.so => not found
	libHSdeepseq-1.3.0.2-ghc7.7.20130912.so => not found
	libHSarray-0.4.0.2-ghc7.7.20130912.so => not found
	libHSbase-4.7.0.0-ghc7.7.20130912.so => not found
	libHSinteger-gmp-0.5.1.0-ghc7.7.20130912.so => not found
	libHSghc-prim-0.3.1.0-ghc7.7.20130912.so => not found

Sure enough, if I look for libHSbin-package-db-0.0.0.0-ghc7.7.20130912.so in the source tree, it's there, but there is no sign of it in /usr/local/ghc/head/lib/ghc-7.7.20130912/bin-package-db-0.0.0.0 - the static libraries are there, but *not* the shared.

~/git/ghc $ ls /usr/local/ghc/head/lib/ghc-7.7.20130912/bin-package-db-0.0.0.0
Distribution
libHSbin-package-db-0.0.0.0.a
libHSbin-package-db-0.0.0.0_p.a

comment:6 Changed 7 months ago by bos

The problem here is simple: inplace/bin/ghc-cabal does not know about shared libraries.

Here is a simple, and incorrect, patch that makes it unconditionally install shared libraries. With this hack in place, make install succeeds, and the installed code actually works.

--- a/utils/ghc-cabal/Main.hs
+++ b/utils/ghc-cabal/Main.hs
@@ -172,7 +172,8 @@ doCopy directory distDir
             progs' <- configureProgram verbosity stripProgram' progs
             let lbi' = lbi {
                                withPrograms = progs',
-                               installDirTemplates = idts
+                               installDirTemplates = idts,
+                               withSharedLib = True
                            }
             f pd lbi' us flags

The correct fix is probably to pass another parameter to ghc-cabal that tells it if we're building shared libraries, so that it can set withSharedLib appropriately.

Weird followon observation: we copy two versions of many utilities into the install tree. There are statically linked versions in the main bin directory, and dynamically linked versions under lib/ghc-VERSION/bin. (It is the dynamically linked copy of lib/ghc-VERSION/bin/ghc-pkg that is crashing due to lack of shared libraries during the install.)

I don't understand why there are two versions?

comment:7 Changed 7 months ago by bos

  • Owner set to hvr

comment:8 Changed 7 months ago by bos

  • Status changed from new to patch

Patch at http://lpaste.net/92952 - will push unless someone grumbles.

comment:9 Changed 7 months ago by bos

  • Owner changed from hvr to bos

comment:10 Changed 7 months ago by Bryan O'Sullivan <bryano@…>

In 865956a6ccd88e71aa07a33667242b95ecf98793/ghc:

Cause "make install" to install dynamic libraries (#8194)

Our special ghc-cabal command needs to be told that we are building with
dynamic library support when it does its copying. We do so by passing an
extra parameter from ghc.mk.

comment:11 Changed 7 months ago by bos

  • Resolution set to fixed
  • Status changed from patch to closed
Note: See TracTickets for help on using tickets.