Hello Johannes,

Kubescape appears to be the first example, but this is a case I would like obs-service-go_modules to handle or provide a recommended approach in the README. Agreed, there should be two independent vendor.tar.gz. The question of whether we should support multiple stanzas of the service or multiple go.mod per stanza is a good one. Looking briefly at git2go this is a library with bindings to libgit2. It produces no executable binaries so it shouldn't be its own RPM package.  I'll review the specific layout of kubescape and see what might work and stay consistent across similar packages. Thanks for the example.

Jeff



From: Johannes Kastl
Sent: Monday, March 13, 2023 09:39
To: opensuse-go@opensuse.org
Subject: Vendoring sub-packages/subdirectories?

Hi all,

kubescape (https://github.com/kubescape/kubescape) is using a git submodule to
"include" git2go. This is being built in a separate step and needs its own
dependencies.

Is there a way to vendor the "main" program and the one in the subdirectory
using the go-modules service?

Adding a second stanza to the service file and using "subdir" results in a
vendor.tar.gz only containing the files for the subdirectory.

Or do I need to build the subdirectory separately and pull it in via BuildRequires?

Thanks in advance,
Johannes

--
Johannes Kastl
Linux Consultant & Trainer
Tel.: +49 (0) 151 2372 5802
Mail: kastl@b1-systems.de

B1 Systems GmbH
Osterfeldstraße 7 / 85088 Vohburg
http://www.b1-systems.de
GF: Ralph Dehner
Unternehmenssitz: Vohburg / AG: Ingolstadt,HRB 3537