🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: linux.debian.bugs.dist
1 messages
1 total messages Started by Juan Manuel Méndez Rey Fri, 30 Oct 2026 11:30
Bug#1152595: dh-go: go.work gets a use and a replace for the same module under autopkgtest
#2718
Author: 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 .
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads