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

specify nix integration options in stack.yaml #671

Merged
merged 2 commits into from Dec 15, 2017
Merged

specify nix integration options in stack.yaml #671

merged 2 commits into from Dec 15, 2017

Conversation

ghost
Copy link

@ghost ghost commented Dec 9, 2017

Resolves #668, possibly #669.
I was able to successfully build master using this stack.yaml and running the following:

$ stack --nix --no-nix-pure install

The nix-no-pure preserves LANG and other user environment variables so the documentation files will build successfully. It may be a better nix practice to use a shell.nix as outlined here to set the LANG explicitly. An example file is here

@simonmichael
Copy link
Owner

Great. I didn't know stack had special nix support.

As I was saying on #669, we'd like to make this just work when following standard install flow if possible. Those links look useful.

@simonmichael
Copy link
Owner

@efx can you explain why this fixes your issue ? Also why is it enable:false ?

@simonmichael
Copy link
Owner

I think:

  • adding pure: false to the yaml file can replace --no-nix-pure
  • adding a .nix file doesn't bring any benefit
  • writing --nix on the command line is required for any of this to have an effect ?

@ghost
Copy link
Author

ghost commented Dec 11, 2017

@simonmichael

  1. This fixed my issue because it caused the entire toolchain to build successfully on my Arch Linux environment. As you had mentioned before, Arch Linux seems to have some Haskell toolchain compilation woes. I did not get anywhere toggling various ~/.stack/config settings or installing things via Arch User Repositories. After I found the stack integration links, I ran with that solution and it caused the main compiles to just work.
  2. If a nix section is specified it compiles things in the nix-shell by default. I am not familiar enough with GHCI and the impact on the build chain to make the call, so I opted for a less intrusive method. We could test the settings more and prefer by default if you don't see other problems doing so.
  3. Correct, this requires passing --nix when running stack install.

@simonmichael
Copy link
Owner

I know it fixed your issue on Arch Linux, but I'm hoping we'll find out how/why it did, and the full effects of these changes. It might not be worth complicating our scripts for everyone if it's just a temporary Arch-specific issue, eg.

I see, enabled:true in stack.yaml would mean "always install with nix", while enabled:false means "install with nix if user specifies --nix on command line". Thanks.

@simonmichael simonmichael added packaging Dependencies, version constraints, packaging.. help wanted needs:clarification To unblock: needs to be simplified/clarified/explained/demoed needs:discussion To unblock: needs more discussion/review/exploration platform:nix labels Dec 14, 2017
@simonmichael
Copy link
Owner

Sorry, I have been getting confused by these nix-related discussions. This seems like a good improvement for folks using nix (enabled via --nix flag or in ~/.stack/config.yaml) and low impact on non-nix users. Thanks!

@simonmichael simonmichael merged commit 0ad8c45 into simonmichael:master Dec 15, 2017
@simonmichael simonmichael removed needs:clarification To unblock: needs to be simplified/clarified/explained/demoed needs:discussion To unblock: needs more discussion/review/exploration labels Dec 15, 2017
@ghost ghost deleted the fix-668 branch December 15, 2017 01:46
@ghost
Copy link
Author

ghost commented Dec 15, 2017

@simonmichael no problem! I totally understand the concern for impact on the broader user base. I will be happy to further contribute in getting something that works best across environments.
I think this could be improved still, as I realized I had to pass --nix when using the various make commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
packaging Dependencies, version constraints, packaging.. platform:nix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant