GitLab support?
I'm running into a third-party opam package that's hosted on GitLab and has a broken checksum, presumably because GitLab changed the compression parameters and recompressed the release tarball.
Is there a way for GitLab users to use dune-release to publish tarballs that won't change?
I'm thinking of the following options:
- Implement full support for the GitLab API, assuming it has a similar mechanism to upload release artifacts.
- Maintain a GitHub mirror of the target project only for releases.
Any suggestion that would help avoid recurring checksum problems?
At the moment I can't think of a way (especially as I would like to replace all git commands by using the GitHub API to make it less fragile and side-effecty), one would need to create a separate backend for the GitLab API.
What you could do at the moment is to use the tagging using dune-release (creating annotated tags) and use dune-release distrib to create the tarball and upload it manually. That's probably still less of a hassle than a separate GitHub mirror and at least the tarballs are in the expected place. You can use dune-release opam pkg to generate the opam file, though you'll need to edit the URL to point to the GitLab URL.
I'm in the process of setting up a CI on GitLab to release my own packages. I'm looking into your suggestion of using dune-release distrib to do it, but I'm facing a weird issue.
dune-release distrib --skip-tests
(I use --skip-tests because I'm already running the tests in another job)
This command fails with the following message.
[-] Building source archive dune-release: [ERROR] /builds/richard.degenne/ocaml-perfectconfiguration: No VCS repository found
However, all GitLab jobs are run within a Git repository. Is there a reason why dune-release would fail to recognize the repo?
Also side question: is there a documentation about how the tarball is built? I'm starting to feel like it would be easier to build the tarball myself rather than trying to twist dune-release in a use-case it's clearly not intended for.
dune-release: [ERROR] /builds/richard.degenne/ocaml-perfectconfiguration: No VCS repository found
It is possible that the current working directory isn't /builds/richard.degenne/ocaml-perfectconfiguration because there is a fallback path which uses the current directory. Maybe you can set the CI?
Also side question: is there a documentation about how the tarball is built?
No, there is only the source at the moment.
For what it's worth, I ended up rebuilding a whole pipeline from scratch for GitLab's CI, and in particular, I was able to retrieve the shasum directly from the package registry API.
You can read up about it here.
https://blog.richarddegenne.fr/2023/10/20/setting-up-a-private-opam-repository-on-gitlab-step-by-step/
That might be good input for the day you'd want to extend dune-release to GitLab's.