GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — "make test" is failed with go version 1.21.0 · Issue #1221 · oapi-codegen/oapi-codegen

"make test" is failed with go version 1.21.0 #1221

New issue
Copy link
New issue
Copy link
Closed
#1249
Closed
"make test" is failed with go version 1.21.0#1221
#1249
Copy link
Labels
bugSomething isn't working☢️ breaking changeThis change would break existing users' code🧠 needs more thinking

Description

@ShouheiNishi
ShouheiNishi
opened on Aug 29, 2023
Issue body actions

Using go version 1.21.0, "make test" is failed.

$ git status
HEAD detached at deepmap/master
nothing to commit, working tree clean
$ git log | head
commit 5d1cceae130876e666916b06ef4801419810bd80
Author: Jamie Tanna <[email protected]>
Date:   Mon Aug 28 17:35:00 2023 +0100

    Deprecate `pkg/runtime` and `pkg/types`

    As we're now using the oapi-codegen/runtime package for this, we should
    mark the existing functionality as deprecated.

    This also ignores any internally flagged deprecation warnings, as we
$ go version
go version go1.21.0 linux/amd64
$ make test
git ls-files go.mod '**/*go.mod' -z | xargs -0 -I{} bash -xc 'cd $(dirname {}) && go test -cover ./...'
++ dirname examples/go.mod
+ cd examples
+ go test -cover ./...
go: updates to go.mod needed; to update it:
        go mod tidy
++ dirname go.mod
+ cd .
+ go test -cover ./...
go: updates to go.mod needed; to update it:
        go mod tidy
++ dirname internal/test/go.mod
+ cd internal/test
+ go test -cover ./...
go: updates to go.mod needed; to update it:
        go mod tidy
make: *** [Makefile:28: test] Error 123
$

Activity

Next
  1. jamietanna commented on Aug 29, 2023

    @jamietanna
    jamietanna
    on Aug 29, 2023
    Member
    More actions

    Thanks for flagging this - it looks like it's not go test but go mod tidy / make tidy that's failing - as we're building with Go 1.20 right now, we're unable to reproduce this right now, but can try and look at it soon

  2. jamietanna
    changed the title [-]"make test" is failed with go version 1.21.0[/-] [+]"make tidy" is failed with go version 1.21.0[/+] on Aug 31, 2023
  3. jamietanna commented on Aug 31, 2023

    @jamietanna
    jamietanna
    on Aug 31, 2023
    Member
    More actions

    I can see the same with running Go 1.21 too, which wants the following diff:

    diff --git examples/go.mod examples/go.mod                                                                                                
    index dd8a415..36c09a5 100644                                                                                                             
    --- examples/go.mod                                                                                                                       
    +++ examples/go.mod                                                                                                                       
    @@ -1,6 +1,8 @@                                                                                                                           
     module github.com/deepmap/oapi-codegen/examples                                                                                          
                                                                                                                                              
    -go 1.20                                                                                                                                  
    +go 1.21                                                                                                                                  
    +                                                                                                                                         
    +toolchain go1.21.0 
  4. jamietanna commented on Aug 31, 2023

    @jamietanna
    jamietanna
    on Aug 31, 2023
    Member
    More actions

    Through discussion in the Gopher Slack, this is due to Go 1.21 spotting that some (transitive) dependencies require Go 1.21, so this is trying to explicitly target it.

    Full list:

    go list -f '{{.GoVersion}} {{.Path }}' -m all

    Produces (roughly, I've manually sorted)

    1.21	github.com/deepmap/oapi-codegen
    
    1.21	github.com/kataras/iris/v12
    1.21	github.com/iris-contrib/httpexpect/v2
    1.21	github.com/gofiber/fiber/v2
    1.20	github.com/valyala/fasthttp
    1.20	github.com/stretchr/testify
    1.20	github.com/kataras/pio
    1.20	github.com/kataras/golog
    1.20	github.com/gin-gonic/gin
    1.20	github.com/gabriel-vasile/mimetype
    1.19	github.com/microcosm-cc/bluemonday
    1.19	github.com/kataras/sitemap
    1.19	github.com/kataras/blocks
    1.18	golang.org/x/tools
    1.18	github.com/tdewolff/minify/v2
    1.18	github.com/matryer/moq
    1.18	github.com/klauspost/compress
    1.18	github.com/kataras/tunnel
    1.18	github.com/go-playground/validator/v10
    1.18	github.com/go-playground/universal-translator
    1.17	golang.org/x/text
    1.17	golang.org/x/sys
    1.17	golang.org/x/sync
    1.17	golang.org/x/net
    1.17	golang.org/x/mod
    1.17	golang.org/x/crypto
    1.17	golang.org/x/arch
    1.17	github.com/Shopify/goreferrer
    1.17	github.com/perimeterx/marshmallow
    1.17	github.com/labstack/echo/v4
    1.17	github.com/go-playground/locales
    1.17	github.com/fatih/color
    1.16	github.com/sanity-io/litter
    1.16	github.com/pelletier/go-toml/v2
    1.16	github.com/mailgun/raymond/v2
    1.16	github.com/leodido/go-urn
    1.16	github.com/go-test/deep
    1.16	github.com/getkin/kin-openapi
    1.16	github.com/BurntSushi/toml
    1.15	gopkg.in/yaml.v2
    1.15	github.com/vmihailenco/tagparser/v2
    1.15	github.com/mattn/go-isatty
    1.15	github.com/mattn/go-colorable
    1.15	github.com/klauspost/cpuid/v2
    1.15	github.com/chenzhuoyu/base64x
    1.15	github.com/bytedance/sonic
    1.14	github.com/mitchellh/go-wordwrap
    1.14	github.com/Joker/jade
    1.14	github.com/iris-contrib/schema
    1.14	github.com/invopop/yaml
    1.14	github.com/go-chi/chi/v5
    1.14	github.com/flosch/pongo2/v4
    1.13	moul.io/http2curl/v2
    1.13	github.com/twitchyliquid64/golang-asm
    1.13	github.com/tdewolff/parse/v2
    1.13	github.com/sirupsen/logrus
    1.13	github.com/go-playground/assert/v2
    1.13	github.com/go-openapi/jsonpointer
    1.13	github.com/CloudyKit/fastprinter
    1.12	github.com/valyala/tcplisten
    1.12	github.com/valyala/fasttemplate
    1.12	github.com/tdewolff/test
    1.12	github.com/stretchr/objx
    1.12	github.com/rivo/uniseg
    1.12	github.com/RaveNoX/go-jsoncommentstrip
    1.12	github.com/niemeyer/pretty
    1.12	github.com/modern-go/reflect2
    1.12	github.com/mailru/easyjson
    1.12	github.com/labstack/gommon
    1.12	github.com/json-iterator/go
    1.12	github.com/Joker/hpp
    1.12	github.com/gorilla/websocket
    1.12	github.com/gorilla/mux
    1.12	github.com/google/gofuzz
    1.12	github.com/gomarkdown/markdown
    1.12	github.com/goccy/go-json
    1.12	github.com/gin-contrib/sse
    1.12	github.com/CloudyKit/jet/v6
    1.12	github.com/apapsch/go-jsonmerge/v2
    1.12	github.com/andybalholm/brotli
    1.11	google.golang.org/protobuf
    1.11	golang.org/x/xerrors
    1.11	golang.org/x/lint
    1.11	github.com/vmihailenco/msgpack/v5
    1.11	github.com/ugorji/go/codec
    1.11	github.com/ugorji/go
    1.10	github.com/google/go-querystring
    1.9	github.com/mattn/go-runewidth
    1.8	github.com/google/go-cmp
    1.5	github.com/josharian/intern
    	rsc.io/pdf
    	gopkg.in/yaml.v3
    	gopkg.in/ini.v1
    	gopkg.in/check.v1
    	golang.org/x/time
    	golang.org/x/term
    	go.etcd.io/bbolt
    	github.com/yusufpapurcu/wmi
    	github.com/yuin/goldmark
    	github.com/yudai/golcs
    	github.com/yudai/gojsondiff
    	github.com/yosssi/ace
    	github.com/yalp/jsonpath
    	github.com/xeipuuv/gojsonschema
    	github.com/xeipuuv/gojsonreference
    	github.com/xeipuuv/gojsonpointer
    	github.com/valyala/bytebufferpool
    	github.com/tklauser/numcpus
    	github.com/tklauser/go-sysconf
    	github.com/tinylib/msgp
    	github.com/spkg/bom
    	github.com/spf13/pflag
    	github.com/shoenig/go-m1cpu
    	github.com/shirou/gopsutil/v3
    	github.com/sergi/go-diff
    	github.com/schollz/closestmatch
    	github.com/russross/blackfriday/v2
    	github.com/redis/go-redis/v9
    	github.com/power-devops/perfstat
    	github.com/pmezard/go-difflib
    	github.com/pkg/errors
    	github.com/philhofer/fwd
    	github.com/nxadm/tail
    	github.com/nats-io/nuid
    	github.com/nats-io/nkeys
    	github.com/nats-io/nats.go
    	github.com/nats-io/jwt/v2
    	github.com/mohae/deepcopy
    	github.com/modern-go/concurrent
    	github.com/minio/highwayhash
    	github.com/mediocregopher/radix/v3
    	github.com/matryer/try
    	github.com/lufia/plan9stats
    	github.com/kr/text
    	github.com/kr/pty
    	github.com/kr/pretty
    	github.com/kataras/neffos
    	github.com/kataras/jwt
    	github.com/juju/gnuflag
    	github.com/iris-contrib/go.uuid
    	github.com/imkira/go-interpol
    	github.com/gorilla/securecookie
    	github.com/gorilla/css
    	github.com/go-openapi/swag
    	github.com/go-ole/go-ole
    	github.com/google/uuid
    	github.com/golang/snappy
    	github.com/golang/protobuf
    	github.com/golang-jwt/jwt
    	github.com/gobwas/ws
    	github.com/gobwas/pool
    	github.com/gobwas/httphead
    	github.com/gobwas/glob
    	github.com/fsnotify/fsnotify
    	github.com/fatih/structs
    	github.com/dustin/go-humanize
    	github.com/djherbis/atime
    	github.com/dgryski/go-rendezvous
    	github.com/dgryski/go-farm
    	github.com/dgraph-io/ristretto
    	github.com/dgraph-io/badger/v2
    	github.com/davecgh/go-spew
    	github.com/cheekybits/is
    	github.com/cespare/xxhash/v2
    	github.com/cespare/xxhash
    	github.com/bmatcuk/doublestar
    	github.com/blang/semver/v4
    	github.com/aymerick/douceur
    	github.com/ajg/form
    
  5. jamietanna
    changed the title [-]"make tidy" is failed with go version 1.21.0[/-] [+]"make test" is failed with go version 1.21.0[/+] on Aug 31, 2023
  6. ShouheiNishi commented on Sep 1, 2023

    @ShouheiNishi
    ShouheiNishi
    on Sep 1, 2023
    ContributorAuthor
    More actions

    Once run make tidy with go 1.21.0, make failed with go 1.20.x.

    First run make tidy on go 1.21.0

    $ git log HEAD | head
    commit beb29bbbf0a66812ebe03110a493e27c07414f85
    Author: Da Faque <[email protected]>
    Date:   Tue Aug 29 17:57:41 2023 +0300
    
        Allow overriding the binary version when VCS not available (#1163)
    
        As mentioned in #1046, for environments, like Nix, that build without a
        Version Control System (VCS) available, we output `(devel)` as the
        version of oapi-codegen even when it's building from source from a Git
        tag.
    $ git status
    HEAD detached at deepmap/master
    nothing to commit, working tree clean
    $ go version
    go version go1.21.0 linux/amd64
    $ make test
    git ls-files go.mod '**/*go.mod' -z | xargs -0 -I{} bash -xc 'cd $(dirname {}) && go test -cover ./...'
    ++ dirname examples/go.mod
    + cd examples
    + go test -cover ./...
    go: updates to go.mod needed; to update it:
            go mod tidy
    ++ dirname go.mod
    + cd .
    + go test -cover ./...
    go: updates to go.mod needed; to update it:
            go mod tidy
    ++ dirname internal/test/go.mod
    + cd internal/test
    + go test -cover ./...
    go: updates to go.mod needed; to update it:
            go mod tidy
    make: *** [Makefile:28: test] Error 123
    $ make tidy
    tidy...
    git ls-files go.mod '**/*go.mod' -z | xargs -0 -I{} bash -xc 'cd $(dirname {}) && go mod tidy'
    ++ dirname examples/go.mod
    + cd examples
    + go mod tidy
    ++ dirname go.mod
    + cd .
    + go mod tidy
    ++ dirname internal/test/go.mod
    + cd internal/test
    + go mod tidy
    $
    

    Switch to go 1.20.x

    $ git status
    HEAD detached at deepmap/master
    Changes not staged for commit:
      (use "git add <file>..." to update what will be committed)
      (use "git restore <file>..." to discard changes in working directory)
            modified:   examples/go.mod
            modified:   examples/go.sum
            modified:   go.mod
            modified:   go.sum
            modified:   internal/test/go.mod
            modified:   internal/test/go.sum
    
    no changes added to commit (use "git add" and/or "git commit -a")
    $ git diff go.mod
    diff --git a/go.mod b/go.mod
    index dd8b906..2122b0e 100644
    --- a/go.mod
    +++ b/go.mod
    @@ -1,6 +1,8 @@
     module github.com/deepmap/oapi-codegen
    
    -go 1.20
    +go 1.21
    +
    +toolchain go1.21.0
    
     require (
            github.com/apapsch/go-jsonmerge/v2 v2.0.0
    $ go version
    go version go1.20.7 linux/amd64
    $ make test
    git ls-files go.mod '**/*go.mod' -z | xargs -0 -I{} bash -xc 'cd $(dirname {}) && go test -cover ./...'
    ++ dirname examples/go.mod
    + cd examples
    + go test -cover ./...
    go: errors parsing go.mod:
    /home/nishi/free5gc-deb/openapi5g/oapi-codegen/examples/go.mod:5: unknown directive: toolchain
    ++ dirname go.mod
    + cd .
    + go test -cover ./...
    go: errors parsing go.mod:
    /home/nishi/free5gc-deb/openapi5g/oapi-codegen/go.mod:5: unknown directive: toolchain
    ++ dirname internal/test/go.mod
    + cd internal/test
    + go test -cover ./...
    go: errors parsing go.mod:
    /home/nishi/free5gc-deb/openapi5g/oapi-codegen/internal/test/go.mod:5: unknown directive: toolchain
    make: *** [Makefile:28: test] Error 123
    $
    
  7. jamietanna
    added
    bugSomething isn't working
    ☢️ breaking changeThis change would break existing users' code
    🧠 needs more thinking
    on Sep 2, 2023
  8. jamietanna
    pinned this issue on Sep 2, 2023
  9. ShouheiNishi commented on Sep 4, 2023

    @ShouheiNishi
    ShouheiNishi
    on Sep 4, 2023
    ContributorAuthor
    More actions

    github.com/gofiber/fiber/[email protected] rollback go version in go.mod.
    gofiber/fiber#2614
    So upgrading this module resolve this dependency issue.
    But I think that Iris module must be downgrade to resolve this issue.

  10. jamietanna commented on Sep 4, 2023

    @jamietanna
    jamietanna
    on Sep 4, 2023
    Member
    More actions

    That's great! Yes, unfortunately Iris will need a downgrade, too.

  11. jamietanna commented on Sep 4, 2023

    @jamietanna
    jamietanna
    on Sep 4, 2023
    Member
    More actions

    Iris PRs:

    • Downgrade Go version requirement to 1.20 kataras/jwt#17
    • Downgrade Go version requirement to 1.20 iris-contrib/httpexpect#1
    • Downgrade Go version requirement to 1.20 kataras/iris#2197
  12. jamietanna
    added 2 commits that reference this issue on Sep 4, 2023

    Bump fiber to v2.49.1

    ba796a0

    Bump fiber to v2.49.1

    19e51b1
  13. 2 remaining items

  14. jamietanna
    added 5 commits that reference this issue on Sep 11, 2023

    Bump Iris to remove Go 1.21 dependency

    This issue will close once commit 62c25ef is merged into the 'main' branch.
    62c25ef

    Build project with Go 1.20 and Go 1.21

    This issue will close once commit c850845 is merged into the 'main' branch.
    c850845

    Build project with Go 1.20 and Go 1.21

    This issue will close once commit 8bc2e89 is merged into the 'main' branch.
    8bc2e89

    Build project with Go 1.20 and Go 1.21

    This issue will close once commit 8161146 is merged into the 'main' branch.
    8161146

    Build project with Go 1.20 and Go 1.21

    This issue will close once commit 6241f8b is merged into the 'main' branch.
    6241f8b
  15. jamietanna
    closed this as completedin #1249on Sep 11, 2023
  16. jamietanna
    added a commit that references this issue on Sep 11, 2023

    Bump Iris to remove Go 1.21 dependency

    This issue will close once commit af55078 is merged into the 'main' branch.
    af55078
  17. jamietanna commented on Sep 11, 2023

    @jamietanna
    jamietanna
    on Sep 11, 2023
    Member
    More actions

    Thanks very much for the report + help on this @ShouheiNishi - https://github.com/deepmap/oapi-codegen/releases/tag/v1.15.0 is released with the fix now

  18. jamietanna
    unpinned this issue on Sep 11, 2023
  19. debuggerpk
    added 3 commits that reference this issue on Sep 18, 2023

    Bump fiber to v2.49.1

    484f29c

    Build project with Go 1.20 and Go 1.21

    85a6f1a

    Bump Iris to remove Go 1.21 dependency

    df677a9
  20. danicc097
    added 3 commits that reference this issue on Aug 31, 2024

    Bump fiber to v2.49.1

    8684025

    Build project with Go 1.20 and Go 1.21

    b9f429f

    Bump Iris to remove Go 1.21 dependency

    92d357c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working☢️ breaking changeThis change would break existing users' code🧠 needs more thinking

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402775 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.