chukmunnlee / caddy-openapi

A Caddy module to validate HTTP request and response against a OpenAPI spec (V3) file
Apache License 2.0
23 stars 7 forks source link

Cannot build with go1.22.3 #7

Closed bijancn closed 4 months ago

bijancn commented 5 months ago

I tried to build on MacOs/darwin with the latest go version = 1.22.3 but find this error

2024/05/27 13:41:57 [INFO] Building Caddy
2024/05/27 13:41:57 [INFO] exec (timeout=0s): /opt/homebrew/bin/go mod tidy -e
2024/05/27 13:41:58 [INFO] exec (timeout=0s): /opt/homebrew/bin/go build -o /Users/bijanchokoufenejad/repos/caddy-openapi/dist/caddy-amd6-darwin-cd81d8d -ldflags -w -s -trimpath -tags nobadger
# github.com/lucas-clemente/quic-go/internal/qtls
../../../go/pkg/mod/github.com/lucas-clemente/quic-go@v0.28.0/internal/qtls/go120.go:6:13: cannot use "The version of quic-go you're using can't be built on Go 1.20 yet. For more details, please see https://github.com/lucas-clemente/quic-go/wiki/quic-go-and-Go-versions." (untyped string constant "The version of quic-go you're using can't be built on Go 1.20 yet. F...) as int value in variable declaration
2024/05/27 13:41:58 [INFO] Cleaning up temporary folder: /Users/bijanchokoufenejad/repos/caddy-openapi/buildenv_2024-05-27-1341.184093256
2024/05/27 13:41:58 [FATAL] exit status 1
make: *** [darwin] Error 1

What confuses me a bit is that the error message indicates that quic-go@v0.28.0 cannot work on Go later than 1.20 but you indicate that the build was tested on go version = 1.21.1 in the README?

Anyway, I guess it could solved by upgrading quic-go to the latest version.

chukmunnlee commented 4 months ago

Hi There are some changes in the openapi3 API which I have updated. Can you try compiling

xcaddy build --with github.com/chukmunnlee/caddy-openapi@v0.11.0

I am using go1.22.3.

I have also compiled the caddy binary with my extension only in the release page for v0.11.0.

Thanks for your patience.

chukmunnlee commented 4 months ago

Closed

bijancn commented 4 months ago

Thank you @chukmunnlee ! Works for me as well now. Would you be interested that I add a github actions workflow, so we can have CI/CD verifying the build status automatically for us?

chukmunnlee commented 4 months ago

Sure. Will do when I have some free cycles.

Regards

On Wed, Jun 5, 2024 at 3:36 PM Bijan Chokoufe Nejad < @.***> wrote:

Thank you @chukmunnlee https://github.com/chukmunnlee ! Works for me as well now. Would you be interested that I add a github actions workflow, so we can have CI/CD verifying the build status automatically for us?

— Reply to this email directly, view it on GitHub https://github.com/chukmunnlee/caddy-openapi/issues/7#issuecomment-2149090833, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABJT6UYE6J2WSCHNLL6JKETZF25XPAVCNFSM6AAAAABILBPT4GVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNBZGA4TAOBTGM . You are receiving this because you were mentioned.Message ID: @.***>