woodpecker-ci / woodpecker

Woodpecker is a simple yet powerful CI/CD engine with great extensibility.
https://woodpecker-ci.org
Apache License 2.0
3.88k stars 345 forks source link

Packaging Woodpecker for openSUSE: exit code 1 when running "CGO_ENABLED=0 go generate ./..."? #3795

Closed johanneskastl closed 2 weeks ago

johanneskastl commented 2 weeks ago

Hi,

I am trying to package woodpecker 2.6.0 for openSUSE. I got the CLI and agent binaries working, however I run into a few issues with the server.

The CGO_ENABLED=0 go generate ./... command exits with an error code of 1. Is this to be expected?

[...]
go: downloading github.com/golang/snappy v0.0.4
go: downloading github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd
go: downloading github.com/modern-go/reflect2 v1.0.2
go: downloading github.com/emicklei/go-restful/v3 v3.11.0
2024/06/16 11:02:47 
The swagger spec at "../../docs/swagger.json" is valid against swagger specification 2.0
2024/06/16 11:02:47 
The swagger spec at "../../docs/swagger.json" showed up some valid but possibly unwanted constructs.
2024/06/16 11:02:47 See warnings below:
2024/06/16 11:02:47 - WARNING: Authorization in header has a default value and is required as parameter
16 Jun 24 11:02 UTC INF Starting mockery dry-run=false version=v2.43.2
16 Jun 24 11:02 UTC INF Using config: /IRGENDWAS/woodpecker/.mockery.yaml dry-run=false version=v2.43.2
16 Jun 24 11:02 UTC WRN DEPRECATION: use of the packages config will be the only way to generate mocks in v3. Please migrate your config to use the packages feature. dry-run=false migration=https://vektra.github.io/mockery/v2.43/migrating_to_packages/ url=https://vektra.github.io/mockery/v2.43/features/#packages-configuration version=v2.43.2
16 Jun 24 11:02 UTC INF Walking dry-run=false version=v2.43.2
16 Jun 24 11:02 UTC INF Generating mock dry-run=false interface=Peer qualified-name=go.woodpecker-ci.org/woodpecker/v2/pipeline/rpc version=v2.43.2
16 Jun 24 11:02 UTC INF writing mock to file dry-run=false interface=Peer qualified-name=go.woodpecker-ci.org/woodpecker/v2/pipeline/rpc version=v2.43.2
pipeline/rpc/proto/generate.go:17: running "protoc": exec: "protoc": executable file not found in $PATH
16 Jun 24 11:02 UTC INF Starting mockery dry-run=false version=v2.43.2
16 Jun 24 11:02 UTC INF Using config: /IRGENDWAS/woodpecker/.mockery.yaml dry-run=false version=v2.43.2
16 Jun 24 11:02 UTC WRN DEPRECATION: use of the packages config will be the only way to generate mocks in v3. Please migrate your config to use the packages feature. dry-run=false migration=https://vektra.github.io/mockery/v2.43/migrating_to_packages/ url=https://vektra.github.io/mockery/v2.43/features/#packages-configuration version=v2.43.2
16 Jun 24 11:02 UTC INF Walking dry-run=false version=v2.43.2
16 Jun 24 11:02 UTC INF Generating mock dry-run=false interface=Forge qualified-name=go.woodpecker-ci.org/woodpecker/v2/server/forge version=v2.43.2
16 Jun 24 11:02 UTC INF writing mock to file dry-run=false interface=Forge qualified-name=go.woodpecker-ci.org/woodpecker/v2/server/forge version=v2.43.2
16 Jun 24 11:02 UTC INF Starting mockery dry-run=false version=v2.43.2
16 Jun 24 11:02 UTC INF Using config: /IRGENDWAS/woodpecker/.mockery.yaml dry-run=false version=v2.43.2
16 Jun 24 11:02 UTC WRN DEPRECATION: use of the packages config will be the only way to generate mocks in v3. Please migrate your config to use the packages feature. dry-run=false migration=https://vektra.github.io/mockery/v2.43/migrating_to_packages/ url=https://vektra.github.io/mockery/v2.43/features/#packages-configuration version=v2.43.2
16 Jun 24 11:02 UTC INF Walking dry-run=false version=v2.43.2
16 Jun 24 11:02 UTC INF Generating mock dry-run=false interface=Manager qualified-name=go.woodpecker-ci.org/woodpecker/v2/server/services version=v2.43.2
16 Jun 24 11:02 UTC INF writing mock to file dry-run=false interface=Manager qualified-name=go.woodpecker-ci.org/woodpecker/v2/server/services version=v2.43.2
16 Jun 24 11:02 UTC INF Starting mockery dry-run=false version=v2.43.2
16 Jun 24 11:02 UTC INF Using config: /IRGENDWAS/woodpecker/.mockery.yaml dry-run=false version=v2.43.2
16 Jun 24 11:02 UTC WRN DEPRECATION: use of the packages config will be the only way to generate mocks in v3. Please migrate your config to use the packages feature. dry-run=false migration=https://vektra.github.io/mockery/v2.43/migrating_to_packages/ url=https://vektra.github.io/mockery/v2.43/features/#packages-configuration version=v2.43.2
16 Jun 24 11:02 UTC INF Walking dry-run=false version=v2.43.2
16 Jun 24 11:02 UTC INF Generating mock dry-run=false interface=Store qualified-name=go.woodpecker-ci.org/woodpecker/v2/server/store version=v2.43.2
16 Jun 24 11:02 UTC INF writing mock to file dry-run=false interface=Store qualified-name=go.woodpecker-ci.org/woodpecker/v2/server/store version=v2.43.2
16 Jun 24 11:02 UTC INF Starting mockery dry-run=false version=v2.43.2
16 Jun 24 11:02 UTC INF Using config: /IRGENDWAS/woodpecker/.mockery.yaml dry-run=false version=v2.43.2
16 Jun 24 11:02 UTC WRN DEPRECATION: use of the packages config will be the only way to generate mocks in v3. Please migrate your config to use the packages feature. dry-run=false migration=https://vektra.github.io/mockery/v2.43/migrating_to_packages/ url=https://vektra.github.io/mockery/v2.43/features/#packages-configuration version=v2.43.2
16 Jun 24 11:02 UTC INF Walking dry-run=false version=v2.43.2
16 Jun 24 11:02 UTC INF Generating mock dry-run=false interface=Client qualified-name=go.woodpecker-ci.org/woodpecker/v2/woodpecker-go/woodpecker version=v2.43.2
16 Jun 24 11:02 UTC INF writing mock to file dry-run=false interface=Client qualified-name=go.woodpecker-ci.org/woodpecker/v2/woodpecker-go/woodpecker version=v2.43.2
# echo $?
1
#

Thanks in advance!

Kind Regards, Johannes

qwerty287 commented 2 weeks ago

It works for me without problems. Can you check whether there is an error somewhere?

Besides that, you usually don't need go generate because the files are in the git repo. Just run make build-server

johanneskastl commented 2 weeks ago

Thanks for the fast reply. I'll try without the generate, if that is not necessary. That makes it easier anyways, as the builds are done offline, so preparing all necessary things upfront is... challenging...