Hi,

> > The first error is gone, but there is a new one :-).
> >      src/github.com/restic/restic/cmd/restic/main.go:15:2: 
> > github.com/peterbourgon/[email protected] requires
> >         github.com/peterbourgon/ff/[email protected] requires
> >         gopkg.in/[email protected]: module lookup disabled by GOPROXY=off
>
> Thanks for the report. I have already noted these kinds of issues,
> that's why I proposed some lintian checks to add as part of this
> sprint.
>
> This actually needs to be fixed in the build-dependency -dev package
> rather than the specific package you are currently trying to build.
>
> Historically, we packaged Go libraries in Debian without considering
> the logical `go import path` or `major versioning` paths, which means
> dh-golang cannot automatically resolve the mapping.
>
> For a proper fix, we need to ensure go import path
> [github.com/peterbourgon/ff/v3] is available as in build dependencies.
>
> We already have golang-github-peterbourgon-ff-dev packaged in Debian:
> golang-github-peterbourgon-ff-dev | 3.4.0-2       | stable     | all
> golang-github-peterbourgon-ff-dev | 3.4.0-2       | testing    | all
> golang-github-peterbourgon-ff-dev | 3.4.0-2       | unstable   | all
>
> However, that package does not properly respect the Go import path
> rules, so that the go.mod file installed as in a legacy path
> /usr/share/gocode/src/github.com/peterbourgon/ff/go.mod instead of the
> /v3 path.
>
> Since the sprint already has a heavy workload, I suggest using a
> temporary workaround in your debian/rules file for now, and we can
> rely on lintian to help us clean up the `package name mismatch` issue
> in  later stage.
>
> You can workaround by adding DH_GOLANG_MODULE_MAPPINGS variable to
> your debian/rules file using the following format:
>
> DH_GOLANG_MODULE_MAPPINGS :=
> github.com/peterbourgon/ff/v3:github.com/peterbourgon/ff
>
> You can check manpage of dh-golang for more details.

Direct link to man page for others to find faster:
https://manpages.debian.org/unstable/dh-go/Debian::Debhelper::Buildsystem::golang.3pm.en.html

I ran into this same issue with Trufflehog:

src/github.com/trufflesecurity/trufflehog/v3/main.go:13:2:
github.com/couchbase/gocb/[email protected] requires
github.com/couchbaselabs/gocaves/[email protected]:
module lookup disabled by GOPROXY=off
src/github.com/trufflesecurity/trufflehog/v3/main.go:14:2:
github.com/couchbase/gocb/[email protected] requires
github.com/couchbaselabs/gocaves/[email protected]:
module lookup disabled by GOPROXY=off
src/github.com/trufflesecurity/trufflehog/v3/main.go:15:2:
github.com/couchbase/gocb/[email protected] requires
github.com/couchbaselabs/gocaves/[email protected]:
module lookup disabled by GOPROXY=off

This github.com/couchbaselabs/gocaves/client is vendored inside two Go packages:

ii  golang-github-couchbase-gocb-dev     2.6.3-1      all
Couchbase Go SDK (library)
ii  golang-github-couchbase-gocbcore-dev 10.2.3-1     all          IO
component of gocb (library)

golang-github-couchbase-gocbcore-dev:
/usr/share/gocode/src/github.com/couchbase/gocbcore/vendor/github.com/couchbaselabs/gocaves/client/go.mod
golang-github-couchbase-gocb-dev:
/usr/share/gocode/src/github.com/couchbase/gocb/vendor/github.com/couchbaselabs/gocaves/client/go.mod

Should I be able to use DH_GOLANG_MODULE_MAPPINGS to get past this? If
so, what is the correct syntax?

This did *not* work:

DH_GOLANG_MODULE_MAPPINGS := \
  
github.com/couchbaselabs/gocaves/[email protected]:github.com/couchbaselabs/gocaves/client

Reply via email to