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
Hi Jeff, On 15.03.23 at 05:24 Jeff Kowalczyk wrote:
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.
I think it makes sense to enhance the go-modules service to be able to handle such a case. I could solve the issue I had (getting kubescape to print a proper version number) in another way, where I could now disable building git2go/libgit inside kubescape. So this feature for go-modules is not urgent. Kind Regards, 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
On 15.03.23 at 05:24 Jeff Kowalczyk wrote:
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.
As I was in a Python mood, I tried to enhance go-modules to allow specifying a filename for the vendor tarball. This way, having two stanzas with different file names would allow vendoring subdirectories. https://github.com/openSUSE/obs-service-go_modules/pull/27 Not sure if I followed all Python best practices, so please point out any flaws and errors... :-) 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
participants (2)
-
Jeff Kowalczyk
-
Johannes Kastl