🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.debian.bugs.dist
Article #2718

Bug#1152595: dh-go: go.work gets a use and a replace for the same module under autopkgtest

#2718
From: Juan Manuel Méndez Rey
Date: Fri, 30 Oct 2026 11:30
42 lines
3361 bytes
Package: dh-go
Version: 1.69
Severity: normal
Tags: patch

When a package's module is not at its import path root (XS-Go-Import-Path
github.com/josephburnett/jd, module github.com/josephburnett/jd/v2 in v2/),
autopkgtest fails with

  go: workspace module github.com/josephburnett/jd/v2 is replaced at all
  versions in the go.work file.

_create_go_work_file writes "use ./src/.../jd/v2" for the child module, then
skips replaces only for @targets (line 1038), which holds the import path
root. Under autopkgtest the installed copy of the package itself is in
auto_module_mappings, so go.work also gets "replace .../jd/v2 => ...". A
plain build never has the package installed, so it does not show there.

@use_modules, filled a few lines above (961-973), already holds every module
that got a use line, including the root case. The fix is to check it instead:

-        next if grep { $_ eq $module } @targets;
+        next if grep { $_ eq $module } @use_modules;

Workaround meanwhile: DH_GOLANG_BUILDPKG := github.com/josephburnett/jd/v2/...
puts the module in @targets. With it autopkgtest passes and the .deb is byte
identical, so only the workspace changes.

https://salsa.debian.org/go-team/dh-go/-/merge_requests/9 (open) rebuilds
@use_modules in the same function but does not touch this check; with it the
list can hold a parent module, so comparing against @targets stays wrong.
Related go.work bugs: https://bugs.debian.org/1149023 and
https://bugs.debian.org/1151332 .

The diff above is the whole fix; I can also open it as a merge request on
https://salsa.debian.org/go-team/dh-go .
Technical Details
Message-ID: <NTSY4-8NRf-79@gated-at.bofh.it>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!3.eu.feeder.erje.net!feeder.erje.net!news.samoylyk.net!gothmog.csi.it!bofh.it!news.nic.it!robomod

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!3.eu.feeder.erje.net!feeder.erje.net!news.samoylyk.net!gothmog.csi.it!bofh.it!news.nic.it!robomod
From: Juan Manuel Méndez Rey <juan.mendezr@proton.me>
Newsgroups: linux.debian.bugs.dist
Subject: Bug#1152595: dh-go: go.work gets a use and a replace for the same module under autopkgtest
Date: Fri, 30 Oct 2026 12:30:04 +0100
Message-ID: <NTSY4-8NRf-79@gated-at.bofh.it>
X-Mailbox-Line: From debian-bugs-dist-request@lists.debian.org  Fri Oct 30 11:28:54 2026
Old-Return-Path: <debbugs@buxtehude.debian.org>
X-Spam-Flag: NO
X-Spam-Score: -1.44
Reply-To: Juan Manuel Méndez Rey <juan.mendezr@proton.me>, 1152595@bugs.debian.org
Resent-To: debian-bugs-dist@lists.debian.org
Resent-Cc: team+pkg-go@tracker.debian.org
X-Debian-Pr-Message: report 1152595
X-Debian-Pr-Package: dh-go
X-Debian-Pr-Keywords: patch
X-Debian-Pr-Source: dh-go
Feedback-ID: 176548819:user:proton
X-Pm-Message-ID: 1030025bb1d2fd9408953d6ba93b94c11fe36ba6
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Debian-Message: from BTS
X-Mailing-List: <debian-bugs-dist@lists.debian.org> archive/latest/1999758
List-ID: <debian-bugs-dist.lists.debian.org>
List-URL: <https://lists.debian.org/debian-bugs-dist/>
Approved: robomod@news.nic.it
Lines: 42
Organization: linux.* mail to news gateway
Sender: robomod@news.nic.it
X-Original-Date: Fri, 30 Oct 2026 11:23:59 +0000
X-Original-Message-ID: <df9a513282072df9e1f4ab06056f7fa0@proton.me>