You are not logged in.

#1 2017-09-19 19:34:13

Zpalmtree
Member
Registered: 2015-09-06
Posts: 20

New version of haskell stack causes compilation fail

Hiya,

The recent version of (I think) stack, is causing my project to no longer build. I believe it's due to stack, as I got a ton of haskell upgrades, and downgrading cabal-install didn't prevent the issue.

I tried downgrading the stack version, but that caused it to not load the dependencies, I guess I would also have to downgrade the 100+ packages it depends on, and I wasn't sure how to automate that.

Anyway, to the issue. Before updating

stack install

successfully builds a project.

After the issue

stack install

gives this output:

Progress: 6/23
--  While building package network-2.6.3.2 using:
      /tmp/stack19184/network-2.6.3.2/.stack-work/dist/x86_64-linux-tinfo6-nopie/Cabal-1.24.2.0/setup/setup --builddir=.stack-work/dist/x86_64-linux-tinfo6-nopie/Cabal-1.24.2.0 configure --with-ghc=/home/zach/.stack/programs/x86_64-linux/ghc-tinfo6-nopie-8.0.2/bin/ghc --with-ghc-pkg=/home/zach/.stack/programs/x86_64-linux/ghc-tinfo6-nopie-8.0.2/bin/ghc-pkg --user --package-db=clear --package-db=global --package-db=/home/zach/.stack/snapshots/x86_64-linux-tinfo6-nopie/lts-9.2/8.0.2/pkgdb --libdir=/home/zach/.stack/snapshots/x86_64-linux-tinfo6-nopie/lts-9.2/8.0.2/lib --bindir=/home/zach/.stack/snapshots/x86_64-linux-tinfo6-nopie/lts-9.2/8.0.2/bin --datadir=/home/zach/.stack/snapshots/x86_64-linux-tinfo6-nopie/lts-9.2/8.0.2/share --libexecdir=/home/zach/.stack/snapshots/x86_64-linux-tinfo6-nopie/lts-9.2/8.0.2/libexec --sysconfdir=/home/zach/.stack/snapshots/x86_64-linux-tinfo6-nopie/lts-9.2/8.0.2/etc --docdir=/home/zach/.stack/snapshots/x86_64-linux-tinfo6-nopie/lts-9.2/8.0.2/doc/network-2.6.3.2 --htmldir=/home/zach/.stack/snapshots/x86_64-linux-tinfo6-nopie/lts-9.2/8.0.2/doc/network-2.6.3.2 --haddockdir=/home/zach/.stack/snapshots/x86_64-linux-tinfo6-nopie/lts-9.2/8.0.2/doc/network-2.6.3.2 --dependency=base=base-4.9.1.0 --dependency=bytestring=bytestring-0.10.8.1 --dependency=unix=unix-2.7.2.1
    Process exited with code: ExitFailure 1
    Logs have been written to: /media/Documents/Code/Haskell/networked-poker/.stack-work/logs/network-2.6.3.2.log

    [1 of 2] Compiling Main             ( /tmp/stack19184/network-2.6.3.2/Setup.hs, /tmp/stack19184/network-2.6.3.2/.stack-work/dist/x86_64-linux-tinfo6-nopie/Cabal-1.24.2.0/setup/Main.o )
    [2 of 2] Compiling StackSetupShim   ( /home/zach/.stack/setup-exe-src/setup-shim-mPHDZzAJ.hs, /tmp/stack19184/network-2.6.3.2/.stack-work/dist/x86_64-linux-tinfo6-nopie/Cabal-1.24.2.0/setup/StackSetupShim.o )
    Linking /tmp/stack19184/network-2.6.3.2/.stack-work/dist/x86_64-linux-tinfo6-nopie/Cabal-1.24.2.0/setup/setup ...
    Configuring network-2.6.3.2...
    configure: WARNING: unrecognized options: --with-compiler
    checking build system type... x86_64-pc-linux-gnu
    checking host system type... x86_64-pc-linux-gnu
    checking for gcc... /usr/bin/gcc
    checking whether the C compiler works... yes
    checking for C compiler default output file name... a.out
    checking for suffix of executables... 
    checking whether we are cross compiling... configure: error: in `/tmp/stack19184/network-2.6.3.2':
    configure: error: cannot run C compiled programs.
    If you meant to cross compile, use `--host'.
    See `config.log' for more details

Here's a minimal example which should illustrate the issue.

fail.cabal:

name:                fail
build-type:          Simple
version:             0.0.1
cabal-version:       >= 1.20

executable fail
  main-is:             fail.hs
  build-depends:       base >=4.10 && <4.11, network
  default-language:    Haskell2010

stack.yaml:

install-ghc: true
resolver: nightly-2017-09-19
packages:
- .

Then attempt to compile with stack install and you should see a similar error to the above. To confirm it's an error in stack and not cabal, you can create a file

fail.hs:

main = putStrLn "hi!"

And compile with cabal install, and it should work.

I couldn't see anything about this in the forums, sorry if I've missed a similar topic.

Offline

#2 2017-10-03 08:40:32

flounders
Member
From: North Carolina
Registered: 2015-03-01
Posts: 16

Re: New version of haskell stack causes compilation fail

I just ran into this today myself. https://github.com/commercialhaskell/st … -332881927 points to the issue being with ncurses again. I removed the package mentioned in the comment and replaced it with ncurses-full. If you are still having issues, you can run the following:

stack unpack network
cd network-<specific version>
stack init
stack build

That should leave the config.log for you to look through, but my guess is it's complaining about -fPIC and it's probably doing it now because the system's GHC isn't the same as the snapshot's.

Offline

#3 2017-10-23 10:34:19

fazky
Member
Registered: 2012-01-25
Posts: 34

Re: New version of haskell stack causes compilation fail

Hi,

I am having the same problem. Indeed, installing `ncurses-full` from AUR solves the problem. Then, stack pulls a different GHC version for me (ghc-tinfo6-nopie-8.0.2 with normal ncurses and ghc-ncurses6-nopie-8.0.2 with ncurses-full). I am thinking about reporting this issue, let me know what you think.

Dominik

Offline

#4 2017-10-23 11:35:19

Zpalmtree
Member
Registered: 2015-09-06
Posts: 20

Re: New version of haskell stack causes compilation fail

Hiya,

Yeah, I managed to fix it last time by linking libncursesw.so.6.0 to libncurses.so, but that method broke today.
Installing ncurses-full did fix it, thanks!

It would be nice to get it working out the box for sure, I'm not sure whether it needs to be fixed in arch, or stack though.

Offline

#5 2017-10-23 14:05:49

fazky
Member
Registered: 2012-01-25
Posts: 34

Re: New version of haskell stack causes compilation fail

I just realized that I cannot compile my xmonad configuration when ncurses-full is installed (some error about libtinfo), so this is also not really a fix for me.

Offline

#6 2017-10-23 14:36:11

Zpalmtree
Member
Registered: 2015-09-06
Posts: 20

Re: New version of haskell stack causes compilation fail

Yeah, I just noticed I can't run ghc, or ghci, they both complain about libtinfo.so.6 not existing.
Furthermore, hdevtools doesn't function correctly, which is pretty essential to my workflow.

Not sure what the solution is then.

Offline

#7 2017-10-23 15:49:17

fazky
Member
Registered: 2012-01-25
Posts: 34

Re: New version of haskell stack causes compilation fail

I opened an issue at the stack repo.

Offline

#8 2017-10-24 19:15:09

flounders
Member
From: North Carolina
Registered: 2015-03-01
Posts: 16

Re: New version of haskell stack causes compilation fail

Stack ghc seems to still work with ncurses-full and won't without it. What I'm doing for now to get around the system ghc being broken is using stack to manage my xmonad build which you can read more about here: https://github.com/xmonad/xmonad-testing

Offline

#9 2017-10-24 19:36:08

Zpalmtree
Member
Registered: 2015-09-06
Posts: 20

Re: New version of haskell stack causes compilation fail

What worked for me as suggested on the github repo was putting

ghc-build: nopie

In my ~/.stack/config.yaml

Offline

#10 2017-10-25 02:52:28

flounders
Member
From: North Carolina
Registered: 2015-03-01
Posts: 16

Re: New version of haskell stack causes compilation fail

When I use

ghc-build: nopie

in my ~/.stack/config.yaml, it gives me this error:

/home/swilliams/.stack/programs/x86_64-linux/ghc-nopie-8.0.2/lib/ghc-8.0.2/bin/ghc-pkg: error while loading shared libraries: libtinfo.so.5: cannot open shared object file: No such file or directory

with the official ncurses package. I'm only able to work around that with either ncurses-full or not using the nopie build flag. But if I don't have ncurses-full some packages like network refuse to build.

Offline

#11 2017-10-25 07:20:16

Zpalmtree
Member
Registered: 2015-09-06
Posts: 20

Re: New version of haskell stack causes compilation fail

I think you need to install ncurses5-compat-libs as well, my mistake

Offline

#12 2017-10-26 19:32:16

flounders
Member
From: North Carolina
Registered: 2015-03-01
Posts: 16

Re: New version of haskell stack causes compilation fail

That does the trick. Hopefully these problems get sorted out so we don't have to be using AUR packages in the future for community packages.

Offline

#13 2017-10-27 18:02:09

dmp1ce
Member
Registered: 2014-05-30
Posts: 22
Website

Re: New version of haskell stack causes compilation fail

I also ran into this to issue today.

ghc-build: nopie

worked for me.

Offline

#14 2017-11-04 13:41:57

jan_path
Member
From: Kiel, Germany
Registered: 2014-04-25
Posts: 2

Re: New version of haskell stack causes compilation fail

These together worked for me:

  • ncurses-full

  • libtinfo5

  • ghc-build: nopie

Offline

Board footer

Powered by FluxBB