commercialhaskell / stack

The Haskell Tool Stack
http://haskellstack.org
BSD 3-Clause "New" or "Revised" License
3.98k stars 842 forks source link

ghc-cabal uses wrong loader path #3847

Open ghost opened 6 years ago

ghost commented 6 years ago

Steps to reproduce

  1. Install 64bit Gentoo
  2. Set resolver to lts-10.4
  3. call stack build

Expected

Setup the resolver target.

Actual

Build would fail with following error:

utils/ghc-cabal/dist-install/build/tmp/ghc-cabal-bindist: line 3: /home/pk/.stack/programs/x86_64-linux/ghc-ncurses6-nopie-8.2.2.temp/ghc-8.2.2/utils/ghc-cabal/dist-install/build/tmp/ghc-cabal: No such file or directory

Running strace on the ghc-cabal binary gives:

execve("./utils/ghc-cabal/dist-install/build/tmp/ghc-cabal", ["./utils/ghc-cabal/dist-install/b"...], 0x7ffd07a8bcd0 /* 38 vars */) = -1 ENOENT (No such file or directory)
fstat(2, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 2), ...}) = 0
write(2, "strace: exec: No such file or di"..., 40strace: exec: No such file or directory
) = 40
getpid()                                = 898
exit_group(1)                           = ?
+++ exited with 1 +++

Calling file on the binary:

utils/ghc-cabal/dist-install/build/tmp/ghc-cabal: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, BuildID[sha1]=d7c5b6e1e62eb0e96cbbd27acf6cb6445aff3992, with debug_info, not stripped

I checked if the loader exists in the /lib directory, but it was missing. Creating symlink with /lib64/ loader solved the problem.

Stack version

$ stack --version
Version 1.6.3, Git revision b27e629b8c4ce369e3b8273f04db193b060000db (5454 commits) x86_64 hpack-0.20.0

Method of installation

mgsloan commented 6 years ago

What project does this repro apply to?

unode commented 6 years ago

Related to #2387?

ghost commented 6 years ago

Sorry, I disabled notifications through email. I run into this issue while upgrading my raytracer pavolzetor/currypath to newer lts snapshot.

jpalus commented 6 years ago

I hit the same issue, is there any way to get binary distribution with interpreter set to /lib64/ld-linux-x86-64.so.2 which I believe is used by most of the world?

mpilgrem commented 6 months ago

@ghost, @jpalus - I am working through issues, including old ones. Do you know if this is still a problem with current versions of Gentoo, GHC and Stack?