From: Sebastien Marie Subject: Re: sysutils/k9s: how to patch go ports To: Rafael Sadowski , ports@openbsd.org Date: Sat, 04 Oct 2025 17:14:32 +0200 Rafael Sadowski writes: > I ported sysutils/k9s to OpenBSD. During the build process, I > encountered 2-3 build errors that are easy to fix (hackish). > > sysutils/k9s/patch-pkg_mod_github_com_containerd_containerd@v1_7_28_archive_tar_mostunix_go > sysutils/k9s/patch-pkg_mod_github_com_containerd_containerd@v1_7_28_archive_tar_unix_go > sysutils/k9s/patch-pkg_mod_github_com_containerd_containerd@v1_7_28_client_go > > My problem is that these files are not available at all during the > patch task. Does anyone have any idea what is going on? it is a lang/go module limitation. go dependencies are managed as zip archives in a directory under $WRKDIR, and 'go build' is using this directory as repository source (instead of using network). So the source files of dependencies aren't available at port 'patch' time. During the port 'build' phase, 'go build' will extract them, but not before. I am unsure we have a real proper way to deal with that. But it should be possible to: - vendor all dependencies (eventually patched), and distribute the corresponding tarball - maybe go has a way to divert a dependency, and so only the dependency has to be manually managed (with additional DISTFILES + patch). Regards. -- Sebastien Marie