Your message dated Fri, 06 Nov 2026 18:19:03 +0000
with message-id <[email protected]>
and subject line Bug#1151332: fixed in dh-go 1.70
has caused the Debian Bug report #1151332,
regarding dh-go: an installed copy of the package being built shadows its own 
go.mod
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
1151332: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1151332
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: dh-go
Version: 1.69
Severity: important

_get_go_module_dependencies() sends the module path through
auto_module_mappings before it reads go.mod. DH_GOPKG and the use targets go
through the same mapping. When the package being built declares a /vN module
path, and an older version of itself is installed at the directory without
the suffix, the mapping points the walk at the installed copy. The
requirements of the sources being built are then never followed, and the
modules they need end up neither replaced nor stubbed in go.work.

The mapping is mine, from commit 1ff68b9 for bug 1149023. It was tested from
the consumer side only, where the module being built and the mapped module
are never the same.

Reproducer, two native packages. Package one ships
usr/share/gocode/src/example.debian.org/walkstub/go.mod with the line
"module example.debian.org/walkstub/v2". Package two declares
XS-Go-Import-Path: example.debian.org/walkstub/v2, has the same module line
in its own go.mod, requires github.com/google/go-containerregistry v0.20.7,
build depends on package one, and prints _build/go.work after
dh_auto_configure. Both builds are sbuild runs in a clean sid chroot:

  package one installed   Checking dependencies of   go.work replace lines
  no                      362                        1548, auto/sdk stubbed
  yes                     2                          1495, auto/sdk missing

With package one installed the log shows the shadowing twice:

  Checking dependencies of example.debian.org/walkstub/v2
  ... installed at example.debian.org/walkstub

In a real package the build stops. golang-github-theupdateframework-go-tuf,
ported to dh-go with XS-Go-Import-Path github.com/theupdateframework/go-tuf/v2
while sid still ships the library at the path without the suffix, fails with

  github.com/google/[email protected] requires
  go.opentelemetry.io/auto/[email protected]: module lookup disabled by GOPROXY=off

for a module that is in neither its go.mod nor its debian/rules. A circular 
build dependency is
what installs the old version, which is normal for a library that its own
reverse dependency needs to run the tests.

Please merge
https://salsa.debian.org/go-team/dh-go/-/merge_requests/6

The patch only follows the mapping when the build directory does not already
hold that module at its own path:

--- a/lib/Debian/Debhelper/Buildsystem/golang.pm
+++ b/lib/Debian/Debhelper/Buildsystem/golang.pm
@@
-    } elsif (exists $this->{auto_module_mappings}{$gomodule}) {
+    } elsif (exists $this->{auto_module_mappings}{$gomodule}
+        and not -e $this->get_buildpath("src/$gomodule/go.mod"))
+    {
         # A module can be installed at a path other than its module
         # path, e.g. github.com/foo/bar/v2 under github.com/foo/bar.
         # Its requirements must still be followed, otherwise they end
         # up neither replaced nor stubbed in go.work.
+        #
+        # Only follow the mapping when the build directory does not hold
+        # that module already. The sources of the package being built are
+        # copied to src/$DH_GOPKG, and an older version of the same module
+        # can be installed at another path. The mapping would then send the
+        # walk to the installed copy instead of the source being built.
         $gomodule = $this->{auto_module_mappings}{$gomodule};
         verbose_print("... installed at $gomodule");
     }

I also rebuilt every source that build depends on dh-go, 27 of them, in a
clean sid chroot with the patch in place. All 27 come back
"Status: successful", the eight with a -vN-dev binary among them. I took
go-sendxmpp from sid, 0.17.1-1, because the version in testing does not
build against the dependencies in sid with 1.69 either.

Verified with the same two packages: the shadowed build goes back to 362
dependency checks, 1548 replace lines and the stub. The case of bug 1149023
is unchanged, checked with a consumer package whose dependency is installed
at the path without the suffix and whose requirements only the mapping can
reach: the mapping is still followed and that requirement is still stubbed,
with 1.69 and with the patch.

--- End Message ---
--- Begin Message ---
Source: dh-go
Source-Version: 1.70
Done: Dr. Tobias Quathamer <[email protected]>

We believe that the bug you reported is fixed in the latest version of
dh-go, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to [email protected],
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Dr. Tobias Quathamer <[email protected]> (supplier of updated dh-go package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [email protected])


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Format: 1.8
Date: Fri, 06 Nov 2026 18:52:19 +0100
Source: dh-go
Architecture: source
Version: 1.70
Distribution: unstable
Urgency: medium
Maintainer: Debian Go Packaging Team <[email protected]>
Changed-By: Dr. Tobias Quathamer <[email protected]>
Closes: 1150077 1151331 1151332 1151333 1152595
Changes:
 dh-go (1.70) unstable; urgency=medium
 .
   [ Juan Manuel Mendez Rey ]
   * Do not let an installed copy shadow the module being built
     Closes: #1151332
   * Name the build patterns which match no package
     Closes: #1151333
   * Report the module which is missing, not the one which requires it
     Closes: #1151331
 .
   [ Dr. Tobias Quathamer ]
   * Fix wrong location of go.mod in the build directory.
     Closes: #1150077
   * Run perltidy
   * Fix go.work in autopkgtest.
     Thanks to Juan Manuel Méndez Rey <[email protected]>
     Closes: #1152595
 .
   [ Tiago Ilieve ]
   * Look for module in the package parent directories
   * Skip modules for directories already mapped
Checksums-Sha1:
 692e0a946131ec3639603b3f07dfbad5a9bbfbfd 1726 dh-go_1.70.dsc
 4bb5e2ea0d389e39bb52b598b256b341cdde7936 29312 dh-go_1.70.tar.xz
 e615de7df008859681cbdc02d64d0e20ebb9c3d0 5376 dh-go_1.70_amd64.buildinfo
Checksums-Sha256:
 c851a054a2b9968922f282ba7a406d1052d06bb23ef18e04b4f4d1aac0edea13 1726 
dh-go_1.70.dsc
 fa47bddcd3780e00294058a71def918032d6a7b02de5beeb933ddde1432ce1ec 29312 
dh-go_1.70.tar.xz
 6a30b9f063beb64e4bc9c87c7d3adb4390ddac91f94748811ef286a71855cc09 5376 
dh-go_1.70_amd64.buildinfo
Files:
 c2654c3d11640e3afbda31f169be0c01 1726 golang optional dh-go_1.70.dsc
 64173298564461d571a33bcc8715ebeb 29312 golang optional dh-go_1.70.tar.xz
 167be381f6daa4e2a42c444debbbb3e4 5376 golang optional 
dh-go_1.70_amd64.buildinfo

-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEE0cuPObxd7STF0seMEwLx8Dbr6xkFAmruFTUACgkQEwLx8Dbr
6xl4ew//agsgk2MY37FcPSuNuGxbM+1gUcJa4VZRJLuCKpq0pL6YmC+ZW1ikDvVA
VjSvNZY0ZD3q1s9FYshxsTftVJhV7Em6OytgSzCBMnyIMe+qUAOisSftHjVBEkIE
ODASFteYqBE+6VoE5mgp3jG/rZPLErTum9A9YjguT1JSHgmwn1lljM21XCChzPpE
S9rQb5QfUd7gFaRihhdf+mEviZc7WtBSty/1879VO5RHMDD/yWijKW6mggB/BCr0
gdAiW2D1KnZ2Ia275rrOQvQs3lD4ioLpMLZVkSq1FHExdFI+Sa5YZKpwWgxya+bN
nXXhl3+//poOhS5rWBwzrTaahRlUJ9Bt2x0NdovKGKZv9Sl+qdW+w+FMmLLYXFVx
A63aXcyvCcCORPvRHSpIlZg/cjiZLkaAVt1F6WBsgYBoIV6FIqxoblyASxpECdUo
ZrdE6vBLsT9bzMDJa4+SwF59gYRsXOoY2oHDBJvb1r5wvqfoID6yE1xNnQAqy7Kp
hzw3kYssaoizhl+16XY8guQb6wxzdMtO4G25NJ3RYBgTubh4EBmnnVeBYOjWH2UN
xmUR6m5NAEoCxOhUgFwu3JfmqhpK/AbnGARrI7BExkUsQ78miyyAgHi2kpP5FST0
pEZt5zOrlw4gEkx4stFk1Oli74wuUdHhf8AzuZUvO1byj48xuNI=
=Vd0z
-----END PGP SIGNATURE-----

Attachment: pgpJ4ZGlMqDkS.pgp
Description: PGP signature


--- End Message ---

Reply via email to