[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Need help with lazy module loading & gvisor



On Sun, Sep 04, 2022 at 05:44:36PM -0500, John Goerzen wrote:
> Hi folks,
> 
> At least two Debian packages use https://github.com/inetaf/netstack,
> which was a popular pure-Go TCP/IP networking stack.  It was a fork of
> gvisor, pulling out the networking stack from what was a more ambituous
> pure Go operating system project.
> 
> At that URL, upstream says "This repo is no longer maintained. As of Go
> 1.17 and its lazy module loading we no longer need it, so we now just
> use upstream gVisor directly."
> 
> gVisor is indeed /huge/.  Before one of the upstreams had switched to
> netstack, I had attempted to package gVisor and gave up.  The sheer
> number of unpackaged dependencies wouldn't have been suitable for me,
> and as I recall there were build system pecularities also.  I'm a guy
> that doesn't know Go but has packaged up some Go software and that was
> too much in the weeds.
> 

For Debian packaging, you can exclude unneeded pkgs with
DH_GOLANG_EXCLUDES environment in debian/rules file.
https://manpages.debian.org/unstable/dh-golang/Debian::Debhelper::Buildsystem::golang.3pm.en.html#DH_GOLANG_EXCLUDES

The Go compiler can exclude the unneeded pkgs itself, but when packaging
for Debian, we don't have such automatic solution, you need to figure out the
unneeded pkg list yourself, then set DH_GOLANG_EXCLUDES.

One tricky is to run `go mod vendor` in the package that imports the one that
is to be packaged, and see what Go compiler thinks that should be included
in vendor directory.

And for gvisor case, another tricky is just to see what inetaf/netstack
includes.


Reply to: