I personally find patching the source packages preferable, but for practical reasons, having dh-golang produce "helper" modules (dummy requires) as you suggest workable.
do we have an idea how many packages are affected by this? -rt On Sun, Jul 19, 2026 at 1:02 PM Mathias Gibbens <[email protected]> wrote: > Hi all, > > We've got several existing Go packages that don't have an upstream > go.mod file. But now with module-aware builds, we must have a go.mod > present for things to properly work. > > One approach could be for dh-golang to generate a stub go.mod > automatically during the configure stage if Go code is present in a > top-level or first-level directory but there's no go.mod. This might be > a bit "magical" as a source file would be injected during the package > build whose origin might not be obvious. > > Alternatively, we could add a patch to each affected package that > creates the missing go.mod file. The advantage here is that it's more > clear where the go.mod file comes from, but is likely much more work- > intense, with each affected packaging needing manual attention. > > Is there a group consensus on which approach to take? > > Mathias > -- regards, Reinhard
