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

Contributing via nix-env doesn't work, zlib seems to be missing from derivation #1846

Closed
ErnestKz opened this issue May 19, 2021 · 7 comments · Fixed by #1852
Closed

Contributing via nix-env doesn't work, zlib seems to be missing from derivation #1846

ErnestKz opened this issue May 19, 2021 · 7 comments · Fixed by #1852
Labels
CI Continuous integration type: bug Something isn't right: doesn't work as intended, documentation is missing/outdated, etc..

Comments

@ErnestKz
Copy link

Using NixOS 20.09

Steps to reproduce

Clone repo then follow steps of using-nix
https://github.com/haskell/haskell-language-server#using-nix
cabal build

Actual behaviour

cabal: Failed to build zlib-0.6.2.3
https://gist.github.com/ErnestKz/f0441e3ce1d55cf22331ac849bfeafc5

@ErnestKz
Copy link
Author

I'm a nix noobie, not quite sure how to fix this.

@Ailrun
Copy link
Member

Ailrun commented May 19, 2021

Thank you for the issue. Could you also provide the log for zlib (/home/ek/.cabal/logs/ghc-8.10.4/zlib-0.6.2.3-7f53445b38bac53a1687f527c632e5666d785c000d0b1ce9dde5f157f68bede8.log mentioned in your gist)? That would be more helpful.

@Ailrun Ailrun added CI Continuous integration os: nixos labels May 19, 2021
@ErnestKz
Copy link
Author

cat /home/ek/.cabal/logs/ghc-8.10.4/zlib-0.6.2.3-7f53445b38bac53a1687f527c632e5666d785c000d0b1ce9dde5f157f68bede8.log
Configuring library for zlib-0.6.2.3..
cabal: Missing dependency on a foreign library:
* Missing (or bad) header file: zlib.h
* Missing (or bad) C library: z
This problem can usually be solved by installing the system package that
provides this library (you may need the "-dev" version). If the library is
already installed but in a non-standard location then you can use the flags
--extra-include-dirs= and --extra-lib-dirs= to specify where it is.If the
library file does exist, it may contain errors that are caught by the C
compiler at the preprocessing stage. In this case you can re-run configure
with the verbosity flag -v3 to see the error messages.
If the header file does exist, it may contain errors that are caught by the C
compiler at the preprocessing stage. In this case you can re-run configure
with the verbosity flag -v3 to see the error messages.

@Ailrun
Copy link
Member

Ailrun commented May 19, 2021

Oops sorry, I missed that part (it's actually in your gist). Yeah, I can reproduce the issue in my non-NixOS (Linux) machine. It's maybe an issue of our nix default expression.

If you have nix flake, could you try nix develop too? That one works well for me.

@berberman Could you check this issue with nix-shell; cabal build?

@Ailrun Ailrun added type: bug Something isn't right: doesn't work as intended, documentation is missing/outdated, etc.. and removed os: nixos labels May 19, 2021
@ErnestKz
Copy link
Author

nix develop seems to work so I'll use that for now. Thanks for having a look.

@Ailrun
Copy link
Member

Ailrun commented May 20, 2021

Maybe related issue: edolstra/flake-compat#13

@berberman
Copy link
Collaborator

Thanks for the reporting, there's a mistake in default.nix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI Continuous integration type: bug Something isn't right: doesn't work as intended, documentation is missing/outdated, etc..
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants