dune-release
dune-release copied to clipboard
dune-release publish distrib fails because of missing package delegate
Running dune-release publish distrib in the dune repo fails as follow:
$ dune-release publish distrib --verbose -n dune
dune-release: [INFO] dune-release 1.3.3 running
[-] Publishing distribution
dune-release: [INFO] Parsing opam file dune.opam
dune-release: [ERROR] readthedocs-dune-release-delegate: package delegate
cannot be found. Try `dune-release help delegate` for
more information.
Can I force dune-release to consider the project as a normal github project?
According to the doc, I can do it by passing --delegate github-dune-release-delegate, however that doesn't seem to work:
$ dune-release publish distrib --verbose -n dune --delegate github-dune-release-delegate
dune-release: [INFO] dune-release 1.3.3 running
[-] Publishing distribution
[-] Using delegate github-dune-release-delegate
dune-release: [INFO] Parsing opam file dune.opam
dune-release: [ERROR] Delegate github-dune-release-delegate errored with 127
Ah, after reading the code I found that it works if you set the environment variable instead:
$ DUNE_RELEASE_DELEGATE=github-dune-release-delegate dune-release publish distrib --verbose -n dune
[...]
I guess the doc and code are not in sync and one of them needs to be updated.
Yeah we definitely need to do something about this, in particular it should fallback to github if the dev-repo is on github
Indeed. From a user point of view, the current behaviour is a bit surprising. Indeed, delegates seems like an advanced feature while changing the documentation page is a basic feature. The user shouldn't be confronted with advanced features problems when they only did basic things. So it seems to me that setting a delegate should be done explicitly, not guessed implicitly.
I totally agree, we have a plan to get rid of delegates by the way so this should soon be a problem of the past: https://github.com/ocamllabs/dune-release/issues/188
An extension of this: I you have 2 packages in the same repository, and you go through what @diml describes, the opam file generated by the "main" package is correct, but not the other, they fallback to something like $HOMEPAGE/$TARBALL instead of $GITHUB/.../$TARBALL as they should.
For others with this problem, this seems to work:
- Do everything up to and including the
dune-release distribstep as usual. - Edit your main opam file to set
homepage: "https://github.com/ORG/REPO"(but don't commit). - Run
dune-release publish. - Undo the homepage change.
- Copy
_build/$main.urlas_build/$other-pkg.urlfor each sub-package. - Run
dune-release opam pkg. - Run
dune-release opam submit.
FTR, that's what we have in the Makefile of dune:
opam-release:
dune-release distrib --skip-build --skip-lint --skip-tests -n dune
# See https://github.com/ocamllabs/dune-release/issues/206
DUNE_RELEASE_DELEGATE=github-dune-release-delegate dune-release publish distrib --verbose -n dune
dune-release opam pkg -n dune
dune-release opam submit -n dune