Hi,
[ Disclaimer: I'm rather new to the Go ecosystem, but I've modified some
existing packages in a similar manner before. They couldn't conflict
anyway since they changed hosters, but that was looked into at the time.
References below. ]
Daniel Milde <daniel@milde.cz> (2021-02-02):
> I have noticed, that autopkgtest failed for golang-github-rivo-tview because
> golang-github-gdamore-tcell.v2 installs gocode into the same directory as
> golang-github-gdamore-tcell:
>
> https://qa.debian.org/excuses.php?package=golang-github-rivo-tview
> https://ci.debian.net/data/autopkgtest/testing/amd64/g/golang-github-antonmedv-expr/10191213/log.gz
>
> What is the best approach to fix it?
It looks to me this would be better [debian/control]:
-XS-Go-Import-Path: github.com/gdamore/tcell
+XS-Go-Import-Path: github.com/gdamore/tcell/v2
After all, that's what getting declared through go.mod, and what callers
are expecting to embed in theirs, isn't it?
Of course, it doesn't help that dh-make-golang doesn't know about this,
and that there aren't any well-established practice, apparently, see the
mini-thread (3 mails total) here:
https://lists.debian.org/debian-go/2020/12/msg00044.html
> Something like this maybe?
>
> override_dh_auto_install:
> dh_auto_install
> -mv $(CURDIR)/debian/golang-github-gdamore-tcell.v2/usr/share/gocode/src/github.com/gdamore/{tcell,tcell.v2}
You shouldn't ignore errors from mv, and the mv foo{a,b} syntax doesn't
work with dash, so that should be avoided anyway.
Besides, the change to Go-Import-Path mentioned above seems to have the
nice side effect of getting all files shipped in the right directory in
the first place:
$ dpkg --contents ../golang-github-gdamore-tcell.v2-dev_2.1.0-3_all.deb
./
./usr/
./usr/share/
./usr/share/doc/
./usr/share/doc/golang-github-gdamore-tcell.v2-dev/
./usr/share/doc/golang-github-gdamore-tcell.v2-dev/changelog.Debian.gz
./usr/share/doc/golang-github-gdamore-tcell.v2-dev/copyright
./usr/share/gocode/
./usr/share/gocode/src/
./usr/share/gocode/src/github.com/
./usr/share/gocode/src/github.com/gdamore/
./usr/share/gocode/src/github.com/gdamore/tcell/
./usr/share/gocode/src/github.com/gdamore/tcell/v2/
…
which means:
- no need to post-process anything through overrides in debian/rules;
- no need to declare breaks/replaces/conflicts against the existing
binary package (golang-github-gdamore-tcell-dev).
Introducing a new package that can't be co-installed with the existing
one(s) is something that should look fishy in the general case, unless
you have a very good reason to be doing that. :)
I'll repeat the disclaimer: I'm very new to the Go ecosystem (in general
and in Debian), and I have a vested interest in unstucking my own
packages, but the patch I suggested above looks to me like it would
solve the co-installability problem instead of papering over it with
“you must not install both packages at the same time”, I think?
Cheers,
--
Cyril Brulebois -- Debian Consultant @ DEBAMAX -- https://debamax.com/
Attachment:
signature.asc
Description: PGP signature