Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stack cant find GHC #3268

Closed
denumerate opened this issue Jul 14, 2017 · 10 comments
Closed

Stack cant find GHC #3268

denumerate opened this issue Jul 14, 2017 · 10 comments
Milestone

Comments

@denumerate
Copy link

denumerate commented Jul 14, 2017

A project that already has been set up is unable to find the GHC.
stack build results in:

No compiler found, expected minor version match with ghc-8.0.2 (x86_64-ncurses6-nopie) (based on resolver setting in /home/iam/Work/has/grove/stack.yaml).
To install the correct GHC into /home/iam/.stack/programs/x86_64-linux/, try running "stack setup" or use the "--install-ghc" flag. To use your system GHC installation, run "stack config set system-ghc --global true", or use the "--system-ghc" flag.

stack setup results in:

Unable to find installation URLs for OS key: linux64-ncurses6-nopie

However, in .stack-work, in the install file there is a folder called x86_64-linux-ncurses6, not linux64-ncurses6-nopie

Stack was installed by pacman.
Version 1.4.0 x86_64, the project is using resolver: lts-8.21

Edit: I've been trying to figure out what is going on, and i think i might have a clue. I'm not certain, but arch linux just enabled PIE for the gcc (https://www.reddit.com/r/archlinux/comments/6n5tkp/arch_now_enables_pie_and_ssp_by_default_in_gcc/?st=j53afy9q&sh=15e6c62a) and this fits the time table and might explain that nopie at the end of the os key.

@mgsloan mgsloan added this to the Support milestone Jul 14, 2017
@dschrempf
Copy link

I can confirm this issue.
uname -a

Linux schwarzbaer 4.11.9-1-ARCH #1 SMP PREEMPT Wed Jul 5 18:23:08 CEST 2017 x86_64 GNU/Linux

stack --version

Version 1.4.0 x86_64

@borsboom
Copy link
Contributor

It's because we don't (yet) have GHC bindists that link against ncurses6 on nopie distributions. Have you tried installing ncurses5-compat-libs?

@borsboom
Copy link
Contributor

It would also be super helpful to other Arch users to help work toward having a GHC bindist that works "out of the box". There are instructions for building a Stack-compatible GHC bindist, and then you can modify a local copy of stack-setup-2.yaml with the additional bindist and use stack setup --setup-info-yaml=<PATH> to try it out.

@TimoFreiberg
Copy link

TimoFreiberg commented Jul 14, 2017

After installing libtinfo, stack setup installed ghc-tinfo6-nopie-8.0.2.

Trying to run (for example) stack install hindent, fails when trying to link old-time-1.1.0.3 with the following error:
configure: error: cannot run C compiled programs.
(See old-time-1.1.0.3.txt)

Another failed linking attempt for the dependency clock-0.7.2:
/usr/bin/ld: .stack-work/dist/x86_64-linux-tinfo6-nopie/Cabal-1.24.2.0/build/System/Clock_hsc_make.o: relocation R_X86_64_32 against .rodata' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: Nonrepresentable section on output`
(See clock-0.7.2.txt)

$ uname -r
4.11.9-1-ARCH
$ stack --version
Version 1.4.0, Git revision e714f1dd3fade19496d91bd6a017e435a96a6bcd (4640 commits) x86_64 hpack-0.17.0

I'll look into trying to build a Stack-compatible GHC soon @borsboom

@dawei-dev
Copy link
Contributor

@TimoFreiberg I ran into the same problem. After installing ncurses5-compat-libs, everything back to normal.

@TimoFreiberg
Copy link

@dawei-dev awesome, now it works again.

@denumerate
Copy link
Author

@borsboom the ncurses5-compat-libs package worked. Thanks. But since its on the AUR it can't be added to stack's dependencies, so sadly doesn't work 'out of the box'

@cocreature
Copy link
Contributor

I just built a bindist of 8.0.2 on Archlinux following the instructions provided by @borsboom and it seems to work just fine. What is needed to make an official bindist so we get back to stack working out of the box on Archlinux?

@borsboom
Copy link
Contributor

@borsboom
Copy link
Contributor

This was handled in commercialhaskell/stackage-content#26. A similar issue exists for GHC 8.2.2 though: #3636

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants