Dune 1.11 silently stopping during build?

Hi guys, new user here :slight_smile:

I have an OCaml project that I’ve been working on for 3 years. It’s using ocamlbuild at the moment, and I decided to give dune a whirl over the weekend. But having an issue with the dune build command, where it seems like it’s not doing anything.

The project is a command-line game, and has a very simple layout. Just three directories: util, game, tty

util is a (wrapped false) library containing auxiliary modules used by game and tty.

game contains all the game logic, and is also a library.

tty implements game as a command-line application. tty/main.ml is the entry point.

So, I set up the dune files like this:
dune init lib util util <-- Then added the (wrapped false) bit manually.
dune init lib game game --libs util
dune init exec main tty --libs util,game

Now, when I run dune build or dune build tty, I get nothing. No output, no error.

dune-project file gets created with (dune lang 1.11) in it.

The _build directory gets created with only log in it. The log has 4 lines:

# dune build
# OCAMLPARAM: unset
$ /usr/bin/getconf _NPROCESSORS_ONLN > /var/folders/vy/ly11c9b91t32x62x39rrykyc0000gn/T/dune9d09bd.output 2> /dev/null
$ /Users/emirkotan/.opam/4.08.0/bin/ocamlc.opt -config > /var/folders/vy/ly11c9b91t32x62x39rrykyc0000gn/T/dune3b0a02.output

Neither of these .output files exist (dune cleaning them up maybe?).

That being said, if I do dune build @@tty/all then it compiles everything, and I get a working executable in _build.

I tried the “hello world” project we get with dune init proj, and dune build works fine in that.

So, I’m not sure if it’s my project layout or a missing config that’s not letting me use the “default” target?

PS: I tried these on both my Mac (Catalina) and Linux (Manjaro) machines, same issue.

Don’t use $ dune build in 1.11. It’s not very user friendly, so we fixed its behavior in 2.0. You should use $ dune build @all instead. If you want to build just the executable, you can do $ dune build ./main/tty.exe.

Ah, got it. Thanks :slight_smile: