Debian / dh-make-golang

Automatically creates Debian packaging for Go packages
BSD 3-Clause "New" or "Revised" License
374 stars 76 forks source link

select non-transitional build dep when Go-Import-Path has two or more corresponding -dev packages #99

Open zhsj opened 6 years ago

zhsj commented 6 years ago

For example,

$ dh-make-golang search golang.org/x/text
golang-x-text-dev: golang.org/x/text

It should be golang-golang-x-text-dev instead.

Go through the meta source, following import paths have two or more -dev packages,

github.com/spf13/cobra ['golang-github-dnephin-cobra-dev', 'golang-github-spf13-cobra-dev']
github.com/docker/containerd ['golang-github-containerd-docker-containerd-dev', 'golang-github-docker-containerd-dev']
github.com/docker/docker ['golang-docker-dev', 'golang-github-docker-docker-dev']
github.com/opencontainers/runc ['golang-github-opencontainers-docker-runc-dev', 'golang-github-opencontainers-runc-dev']
github.com/gogo/protobuf ['golang-github-gogo-protobuf-dev', 'golang-gogoprotobuf-dev']
gopkg.in/check.v1 ['golang-check.v1-dev', 'golang-gopkg-check.v1-dev']
gopkg.in/check.v1,
                   launchpad.net/gocheck,
                   github.com/go-check/check ['golang-check.v1-dev', 'golang-gopkg-check.v1-dev']
github.com/jonboulle/clockwork ['golang-clockwork-dev', 'golang-github-jonboulle-clockwork-dev']
github.com/codegangsta/cli ['golang-codegangsta-cli-dev', 'golang-github-codegangsta-cli-dev']
github.com/gorilla/context ['golang-context-dev', 'golang-github-gorilla-context-dev']
github.com/miekg/dns ['golang-dns-dev', 'golang-github-miekg-dns-dev']
github.com/coreos/go-etcd ['golang-etcd-dev', 'golang-github-coreos-go-etcd-dev']
github.com/fsnotify/fsnotify ['golang-fsnotify-dev', 'golang-github-fsnotify-fsnotify-dev', 'golang-github-go-fsnotify-fsnotify-dev']
github.com/BurntSushi/toml ['golang-github-burntsushi-toml-dev', 'golang-toml-dev']
github.com/coreos/go-semver ['golang-github-coreos-go-semver-dev', 'golang-go-semver-dev']
github.com/docker/go ['golang-github-docker-go-dev', 'golang-github-jfrazelle-go-dev']
github.com/golang/snappy ['golang-github-golang-snappy-dev', 'golang-snappy-go-dev']
github.com/gorilla/websocket ['golang-github-gorilla-websocket-dev', 'golang-websocket-dev']
github.com/gucumber/gucumber ['golang-github-gucumber-gucumber-dev', 'golang-github-lsegal-gucumber-dev']
github.com/influxdata/influxdb ['golang-github-influxdb-influxdb-dev', 'influxdb-dev']
github.com/kardianos/osext ['golang-github-kardianos-osext-dev', 'golang-github-kardianos-osext-dev']
github.com/kr/pretty ['golang-github-kr-pretty-dev', 'golang-pretty-dev']
github.com/kr/pty ['golang-github-kr-pty-dev', 'golang-pty-dev']
github.com/kr/text ['golang-github-kr-text-dev', 'golang-text-dev']
github.com/lib/pq ['golang-github-lib-pq-dev', 'golang-pq-dev']
github.com/mreiferson/go-httpclient ['golang-github-mreiferson-go-httpclient-dev', 'golang-mreiferson-httpclient-dev']
github.com/pborman/uuid ['golang-github-pborman-uuid-dev', 'golang-uuid-dev']
github.com/prometheus/client_golang ['golang-github-prometheus-client-golang-dev', 'golang-prometheus-client-dev']
github.com/rcrowley/go-metrics ['golang-github-rcrowley-go-metrics-dev', 'golang-metrics-dev']
github.com/Sirupsen/logrus ['golang-github-sirupsen-logrus-dev', 'golang-logrus-dev']
github.com/sirupsen/logrus ['golang-github-sirupsen-logrus-dev', 'golang-logrus-dev']
github.com/snapcore/snapd ['golang-github-snapcore-snapd-dev', 'golang-github-ubuntu-core-snappy-dev']
github.com/stretchr/objx ['golang-github-stretchr-objx-dev', 'golang-objx-dev']
github.com/syndtr/goleveldb ['golang-github-syndtr-goleveldb-dev', 'golang-goleveldb-dev']
github.com/tchap/go-patricia ['golang-github-tchap-go-patricia-dev', 'golang-go-patricia-dev']
github.com/xi2/xz, xi2.org/x/xz ['golang-github-xi2-xz-dev', 'golang-xi2-x-xz-dev']
golang.org/x/crypto ['golang-go.crypto-dev', 'golang-golang-x-crypto-dev']
golang.org/x/net ['golang-go.net-dev', 'golang-golang-x-net-dev']
golang.org/x/tools ['golang-go.tools-dev', 'golang-golang-x-tools-dev']
golang.org/x/oauth2 ['golang-golang-x-oauth2-dev', 'golang-golang-x-oauth2-google-dev']
golang.org/x/text ['golang-golang-x-text-dev', 'golang-x-text-dev']
cloud.google.com/go ['golang-google-cloud-compute-metadata-dev', 'golang-google-cloud-dev']
gopkg.in/alecthomas/kingpin.v3,
                   gopkg.in/alecthomas/kingpin.v3-unstable,
                   github.com/alecthomas/kingpin, ['golang-gopkg-alecthomas-kingpin.v3-dev', 'golang-gopkg-alecthomas-kingpin.v3-unstable-dev']
gopkg.in/yaml.v2 ['golang-gopkg-yaml.v2-dev', 'golang-yaml.v2-dev']

Most are caused by transitional package, but golang.org/x/oauth2 is caused by package splits.

$ dh-make-golang search golang.org/x/oauth2
golang-golang-x-oauth2-google-dev: golang.org/x/oauth

It should be golang-golang-x-oauth2-dev.

zhsj commented 6 years ago

This seems hard to resolve, since we set Go-Import-Path on source packages. And it can't be set on binary packages.

stapelberg commented 6 years ago

Would it be an improvement to select all matching packages instead of just the first one? That way, we’ll have a little bit of overhead for transitional packages, but the build at least succeeds.

zhsj commented 6 years ago

The build doesn't fail if transitional package has been selected. Actually nothing breaks. Even golang-golang-x-oauth2-google-dev is selected, golang-golang-x-oauth2-dev will be selected by depends.

I think it's only "nice" level to have this issue been fixed.

stapelberg commented 6 years ago

Thanks, updated the title to reflect that.

CyrilBrulebois commented 3 years ago

Not knowing about issues being tracked here, I've rediscovered this issue on my own, and brainstormed possible ideas on the debian-go mailing list:

Adding pointers here in case somebody wanted to pick those up (or shoot them down). :)