I have a package that I updated to build with jbuilder. Before I made the pull request to the opam-repository I wanted to test it so I forked opam-repository and I add as a a remote.
When trying to install the package with opam I get:
# Error: I don't know about package pla (passed through --only-packages/--release)
but the package builds correctly when I do
$ jbuilder build
$ jbuilder install
and also when I run the install command specified in the opam file
This is a common mistake about the -p option. The way to think about -p (in fact, it literally works this way) is that it makes only the listed packages under -p visible to jbuilder. In your case, that means everything but pla should be invisible.
What you’re probably looking for is a way to only build a particular package. To do you should simply pass the appropriate targets to $ jbuilder build. In your case, pla.install could work, or you could select a particular cma or binary. IMO, this is a bit of a usability issue with jbuilder today so feel free to mention this issue in the appropriate issue so that it can be fixed.
When jbuilder is building a package for opam, it should build it against the installed packages rather than the other local packages in the source directory. This is why -p is mandatory in opam builds.