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

Update documentation to build with Nix #55

Open
adamflott opened this issue Sep 15, 2020 · 4 comments
Open

Update documentation to build with Nix #55

adamflott opened this issue Sep 15, 2020 · 4 comments
Assignees
Labels
documentation Improvements or additions to documentation

Comments

@adamflott
Copy link

In order to build and prevent a build problem on Nix,

pcre-light           > Cabal-simple_mPHDZzAJ_3.0.1.0_ghc-8.8.4: Missing dependency on a foreign                                                                                                                                                                    
pcre-light           > library:                                                                                                                                                                                                                                    
pcre-light           > * Missing (or bad) C library: pcre                                                                        
pcre-light           > This problem can usually be solved by installing the system package that                                                                                                                                                                    
pcre-light           > provides this library (you may need the "-dev" version). If the library is                                                                                                                                                                  
pcre-light           > already installed but in a non-standard location then you can use the flags                                                                                                                                                                 
pcre-light           > --extra-include-dirs= and --extra-lib-dirs= to specify where it is.If the                                 
pcre-light           > library file does exist, it may contain errors that are caught by the C                                   
pcre-light           > compiler at the preprocessing stage. In this case you can re-run configure                                
pcre-light           > with the verbosity flag -v3 to see the error messages.                        

The user needs to specify on the command line,

stack install --nix-packages pcre

or in stack.yaml

nix:
  enable: true
  packages: [pcre]

Or use another method documented at https://docs.haskellstack.org/en/latest/nix_integration/

Btw: love this tool!

@vaclavsvejcar vaclavsvejcar added the documentation Improvements or additions to documentation label Sep 16, 2020
@vaclavsvejcar vaclavsvejcar self-assigned this Sep 16, 2020
@vaclavsvejcar
Copy link
Owner

Hello @adamflott ,

thanks for reporting this one! As I have zero experience with Nix, I never checked whether it actually builds or not. If I got it correctly, can I just add the

nix:
  enable: true
  packages: [pcre]

to headroom's stack.yaml and that will fix the things for all users eventually trying to use it with Nix?

Also thanks a lot for your kind words, I'm really happy you like this tool 🙂 If you have any ideas how to further improve it, let me know or feel free to open new issue with feature request.

@vaclavsvejcar
Copy link
Owner

@adamflott Hello Adam, can you please just confirm what changes needs to be done in order to fix & close the issue? Thanks in advance! 🙂

@adamflott
Copy link
Author

I don't have a lot of expertise in Nix (despite running NixOS on my machine machine :), but it looks like you can't just use that stanza in stack.yaml, on my non-Nix machine:

Executable named nix-shell not found on path: ....

A better option is probably using the nix way with default.nix or even something in the Makefile like

os := $(shell lsb_release -i -s | tr -d '"')
build:
ifeq ($(os),Ubuntu)
        stack install
else ifeq ($(os),NixOS)
        stack install --nix --nix-packages zlib
else
        echo "OS not supported"
endif

@vaclavsvejcar
Copy link
Owner

@adamflott Thanks for the details. If you try to make this working for you locally anyway, would you feel comfortable enough to push the necessary changes as PR? You still have way more Nix knowledge than me, I never had chance to use it yet. 😀

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

No branches or pull requests

2 participants