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

Improve nix install docs for projects that depend on dhall-haskell #87

Closed
jmitchell opened this issue Feb 7, 2018 · 8 comments
Closed

Comments

@jmitchell
Copy link
Collaborator

Directions in the getting started wiki page say to install dhall-json like this:

nix-env --install --attr dhall-json

Running that in a local clone of dhall-lang/dhall-json resulted in the following error:

Setup: Encountered missing dependencies:
dhall >=1.9.0 && <1.10

Can the docs be improved to avoid this problem? It would help those who aren't yet familiar with nix and just want to get things working. The directions in various dhall-* projects should be reviewed too.

One potential solution is to add a symlink in ~/.nix-defexpr:

ln -s $DHALL_HASKELL_CLONE_DIR/release ~/.nix-defexpr/dhall
@jmitchell
Copy link
Collaborator Author

After trying to reproduce the issue from scratch I realize my current solution is actually a little more involved. I have the following symlinks in ~/.nix-defexpr:

dhall -> s/dhall-lang/dhall-haskell/release
dhall-bash -> s/dhall-lang/dhall-bash/release
dhall-json -> s/dhall-lang/dhall-json/release
dhall-nix -> s/dhall-lang/dhall-nix/release
dhall-text -> s/dhall-lang/dhall-text/release

And now I can install dhall-json by running nix-env -i dhall-json from any directory.

@Gabriella439
Copy link
Contributor

What version of nixpkgs are you using?

@jmitchell
Copy link
Collaborator Author

I'm using release-17.09. I notice in master dhall's version is 1.8.2, which is outside the required version bounds.

I discovered at some point after the ~/.nix-defexpr hackery that dhall --version unexpectedly reported 1.6.0, the version from release-17.09. I can build and install dhall-haskell v1.9.1 using release.nix from its repo and get dhall --version to report 1.9.1. However, I actually don't have a user-friendly way to install the latest dhall-json yet.

@Gabriella439
Copy link
Contributor

Ah, got it! Yeah, I can update the instructions to support installing the latest version

@Profpatsch
Copy link
Member

I recommend against the usage of nix-env if possible, since it introduces state. Especially when trying to develop Haskell packages (which I’m assuming you did, because you had a local clone of dhall-json) you should follow the developer instructions in the nixpkgs manual.

@jmitchell
Copy link
Collaborator Author

jmitchell commented Feb 7, 2018

For now I'm primarily interested in a supported workflow for installing the latest dhall* binaries using nix. My intent is to tinker with the utilities and custom dhall configs before doing any Haskell development. I suspect that's a common scenario for users.

@Profpatsch
Copy link
Member

Profpatsch commented Feb 7, 2018

Then executing nix-shell -p dhall dhall-json dhall-nix dhall-text dhall-bash -I nixpkgs=/path/to/nixpkgs/checkout/on/recent/master/or/unstable should do what you want and throw you into a shell with all executables in the PATH.

Gabriella439 added a commit to dhall-lang/dhall-json that referenced this issue Feb 10, 2018
Gabriella439 added a commit to dhall-lang/dhall-nix that referenced this issue Feb 10, 2018
Gabriella439 added a commit to dhall-lang/dhall-bash that referenced this issue Feb 10, 2018
Gabriella439 added a commit to dhall-lang/dhall-text that referenced this issue Feb 10, 2018
@Gabriella439
Copy link
Contributor

@jmitchell: I updated the release.nix for each project to specify a dhall-1.9.0 dependency, which should fix the problem that you ran into

Gabriella439 added a commit to dhall-lang/dhall-haskell that referenced this issue Apr 10, 2019
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

3 participants