`dune build @doc` generates nothing

I have a weird problem with dune build @doc @doc-private which generates nothing. And I’m trying to find a reason why it would behave this way.

After running dune build @doc @doc-private the _build/default/_doc/_html folder is empty. dune rules @doc and dune rules @doc-private don’t display anything. While if I do dune build _build/default/_doc/_html/api/Apicore/index.html the html file is correctly generated.

my lib apicore is public, defined like this

(library
 (name apicore)
 (public_name api.apicore)

Is it mandatory to build the doc from the root of the dune project? Right now I’m trying to run the build from api which is a subfolder of the project root, because I’d like to build the doc only for that specific project.

I can generate the doc for my whole project with odig without issue. I run it like this, if it makes a difference

dune build @install
odig odoc --doc-dir=_build/install/default/doc --lib-dir=_build/install/default/lib/

Any idea what I could be doing wrongly?

I’m running dune 3.0.3 and (lang dune 3.0).