cs3110 / textbook

The CS 3110 Textbook, "OCaml Programming: Correct + Efficient + Beautiful"
Other
740 stars 134 forks source link

`dune utop src` not working in nix/nixos #63

Closed quinn-dougherty closed 2 years ago

quinn-dougherty commented 2 years ago

I'm in the parsers subchapter.

I can't actually dune utop src

File "_build/default", line 1, characters 0-0:
Error: Library "utop" not found.
-> required by _build/default/.utop/utop.exe

Very terse dune docs aren't of help.

I'm new to the book, but not to dune (though I've never used dune utop <DIR> command before).

My shell.nix is as follows.

{ pkgs ? import <nixpkgs> {} }:

with pkgs;

mkShell {
  buildInputs = [
    dune_3
    ocamlPackages.ocaml
    ocamlPackages.menhir
    ocamlPackages.utop
  ];
}

and I'm on nixos/unstable channel (if you're not on unstable, just switch dune_3 to dune_2).

jnfoster commented 2 years ago

It sounds like you need to install utop using opam.

We have installation instructions for a variety of platforms (but not Nix) here: https://cs3110.github.io/textbook/chapters/preface/install.html There is also a VM if you prefer.