I am using dune-release 1.4.0. I have a repository from which I release 3 packages. I am on a branch, with a tag that I prepared previously (without the help of dune-release):
> git describe
v0.3.1
I have the .opam files for my 3 packages in the current directory (plus a dummy .opam file for my dev deps):
> ls *.opam
np.opam requirements_dev.opam scipy.opam sklearn.opam
However dune-release cannot find any of my packages:
> dune-release distrib
[-] Building source archive
dune-release: [ERROR] cannot determine name automatically: use `-p <name>`
> dune-release distrib -p np
[-] Building source archive
dune-release: [ERROR] cannot determine name automatically: use `-p <name>`
> dune-release distrib -p np,scipy,sklearn
[-] Building source archive
dune-release: [ERROR] cannot determine name automatically: use `-p <name>`
The documentation for -p says:
The names PKG_NAMES of the opam packages to release. If absent
provided by the *.opam files present in the current directory.
(Looking at strace, it looks like dune-release it not reading any of my .opam files. Rather it reads my README.md, picks up the main title, adds .opam at the end and tries to open that.)
Thank you for the hint. (I am not completely sure what the name should correspond to though, since I have three packages/libraries in there.) Unfortunately that’s not enough:
> dune-release distrib -p np,scipy,sklearn
[-] Building source archive
Error: The project name is not defined, please add a (name <name>) field to
your dune-project file.
dune-release: [ERROR] run ['dune' 'subst']: exited with 1
> dune-release distrib -p np
[-] Building source archive
Error: The project name is not defined, please add a (name <name>) field to
your dune-project file.
dune-release: [ERROR] run ['dune' 'subst']: exited with 1
Edit: so it turns out that dune-release does not see what is in dune-project unless I commit it. Also, I can’t use ocaml_sklearn as a name, I need to use the name of one of my .opam files. That gets me further: now dune-release complains about missing CHANGES files, tries to build things and fails (it seems it does not like my 3 packages depending on one another), and ends with what looks like success:
[+] Distribution for sklearn 0.3.1-1-gb0703e9
[+] Commit b0703e9753b4e5c7fe50b5c1d79becd23e52fb5f
[+] Archive _build/sklearn-v0.3.1-1-gb0703e9.tbz
dune-release: [WARNING] The repo is dirty. The distribution archive may be
inconsistent.
That’s a limitation we intend to lift in dune. I’m not sure if dune-release enforces this.
dune-release requires CHANGES.md in a to be formatted a certain way so that it can extract the changes for the release you are intending to publish. See the dune repository for an example.
You should report all of these poor error messages to the dune-release issue tracker. The tool works quite well, but it’s a pain to get stared with.