Correct way to compose libraries with dune

I want one of my libraries, which I call qfff, to use the pfff library.
Here is what I did :

  1. In my main directory, create a qfff subdirectory.
  2. In that subdirectory, add a dune file with content as follows :

(library
(name qfff_lib)
(libraries pfff))

  1. In that qfff subirectory, add a one-line file named the_end.ml
    and whose content is let example = Php_parser.parse_program

  2. Still in that same qfff subirectory, do a git clone https://github.com/returntocorp/pfff.git --depth=1 followed by ./configure (those steps are indicated in the pfff Wiki)

  3. returing to my main directory, and doing dune build qfff (because at this point I think dune has all the data it needs to understand hat qfff depends on pfff, and I expect it to build pfff automatically as a needed ingredient for qfff).

This produces the error message :

File “qfff/dune”, line 3, characters 12-16:
3 | (libraries pfff))
^^^^
Error: Library “pfff” not found.
→ required by library “qfff_lib” in _build/default/qfff
→ required by _build/default/qfff/.qfff_lib.objs/byte/qfff_lib__The_end.cmo
→ required by _build/default/qfff/qfff_lib.cma
→ required by alias qfff/all
→ required by alias qfff/default

What did I do wrong ?

Looking a little bit at the project, I don’t see a pfff dune lib being declared. I do see a pfff-lang_php though so you might try that one as a dep: (libraries pfff-lang_php).