Hello Andrew!

Hi Thorsten,

On Tue, Nov 3, 2026 at 5:14 PM Thorsten Alteholz <[email protected]> wrote:
On 03.11.26 15:43, Andrew Lee wrote:
> I think we should have a general guideline or preference for packaging
> the main repo of a Go project as a whole, rather than splitting out
> individual submodules, unless there is a strong reason to do so.

I am afraid this is not something that the go-team can decide. According
to Debian policy 4.13 embedded code copies should be avoided.

Thank you for the clarification. However, my question was not about
embedded or vendored code, but rather about individual submodules
within a Go monorepo. Monorepos with multiple Go modules are very
common in the Go ecosystem.

For example, in the repository https://github.com/moby/moby, there is
a main module at the root with its own go.mod file, alongside several
submodules located in subdirectories such as api/go.mod,
client/go.mod, and man/go.mod.

In first approximation I'd argue that a monorepo should also be one Debian source package, and produce multiple binary packages if needed. This would follow the principle of least expectation.

The difficulty arises when the modules in the monorepo have different release tags and schedules. Take https://github.com/hashicorp/go-secure-stdlib for example, which I'm in the process of packaging. strutil is git tagged as strutil/v0.1.2, whereas parseutil is tagged as parseutil/v0.2.0. To complicate things further, parseutil/ has a few more unreleased commits after that.

So it's not clear to me how in a "one monorepo = one source package" scenario we can sanely cover differing version numbers for submodules and package the latest tagged version. AFAICS most go packages in Debian are a git snapshot and we just assume that upstream will not merge unfinished code into main. Common go development practice doesn't really cleanly map to source packages in Debian.

Could someone explain how we should handle packaging the main
repository as a single source package in Debian when its individual
submodules have already been packaged as separate source packages? How
to track the separate individual submodules source package update all
at once with a new upstream releases?

I'm not too familiar with transitions like this, the simplest solution I'd suggest is:
- upload moby/moby
- Switch all relevant packages to the build-dep on the new package
- Remove moby/moby/api and moby/moby/client from the archive
- We'll notice if we missed something since it'll FTBFS now


Best regards,
--
-Andrew

Greetings,
Lee

Reply via email to