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

HsUnix.h not available to Stack for builds. #1576

Closed
seanparsons opened this issue Dec 29, 2015 · 6 comments
Closed

HsUnix.h not available to Stack for builds. #1576

seanparsons opened this issue Dec 29, 2015 · 6 comments

Comments

@seanparsons
Copy link
Contributor

Most of the history around this is in here: commercialhaskell/stack-ide#96

Installing libghc-unix-dev (on Ubuntu) apparently fixes this, but that pulls in a particular version of GHC with all the usual hilarity that brings. It would appear if someone wants Stack to be totally in control of everything GHC related this should be another element it controls.

@mgsloan mgsloan added this to the P2: Should milestone Dec 30, 2015
@borsboom
Copy link
Contributor

In my attempt to reproduce this on Ubuntu 14.04/trusty, I had a slightly different experience.

    In file included from Posix.hsc:60:0:
    /home/vagrant/.stack/programs/x86_64-linux/ghc-7.10.2/lib/ghc-7.10.2/unix_A3WgcI5QiHK4PDo4jSYdwQ/include/HsUnix.h:79:25: fatal error: bsd/libutil.h: No such file or directory
     #include <bsd/libutil.h>
                             ^

So it's finding the HsUtil.h that's included with the unix package, but HsUtil.h can't find bsd/libutil.h. That file is included in libbsd-dev (at least on Trusty) and running

sudo apt-get install -y libbsd-dev

fixed the build. Since that's an external dependency, it's not something Stack has control over (unless you use the Nix or Docker integration, of course).

Note that installing libghc-unix-dev, as mentioned in commercialhaskell/stack-ide#96, ends up installing libbsd-dev as well, and I think it's likely that rather than installing the system GHC is what actually fixes the problem for people. Also, there was a recently fixed bug that probably masked the error message I saw above (and would have caused the "Could not resolve" error to appear instead, as referenced in commercialhaskell/stack-ide#96).

Please confirm whether installing just libbsd-dev fixes it for your case as well.

@seanparsons
Copy link
Contributor Author

Ah, interesting, I will check that later.

@seanparsons
Copy link
Contributor Author

Confirmed, it's libbsd-dev that fixes the problem!

@seanparsons
Copy link
Contributor Author

I don't understand why I didn't get the error listed by @borsboom above, just this semi-cryptic message:

ide-backend-0.10.0: copy/register
PCould not resolve file /home/sean/workspace/stack-ide/ide-backend/ide-backend-server/In file included from Posix.hsc
rogress: %

@borsboom
Copy link
Contributor

borsboom commented Jan 2, 2016

@seanparsons: see #1561 (comment). Should be fixed in the git master version of Stack.

@seanparsons
Copy link
Contributor Author

Works for me.

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

No branches or pull requests

4 participants