Package definition with dune + opam


I have a short question regarding the definition of new packages through dune. If I create a new project and let dune create the .opam file for me, I can then install it into my local switch by using:

opam install . 

Whenever I do the above, I get the following message:

Package *** does not exist, create as a NEW package? [Y/n]

I’m a bit unsure what that message is telling me? If I would publish the package on the opam package repository, would I still get this message when trying to install it from there?

I didn’t really find anything on Google relating to my question, so I’m thankful for any input :slight_smile:

I believe that indeed, this message is displayed when the package you’re installing is not part of the repositories, as opposed to a local version of an existing package.

opam install . automatically pins the opam packages found in the current directory. The “usual” workflow for pinning is to override existing package definitions in the switch (e.g. to use the development of a package - or, as here, to install the version in your working directory). opam’s simply noting that it’s not overriding anything, it’s just creating a new package.

You’re correct that once published this message would not appear.

Thank you! That makes it a lot clearer :slight_smile: