Skip to content

Fix Go 1.27.2 and JSONv2 compatibility - #1774

Merged
ernado merged 1 commit into
ogen-go:mainfrom
dzsibi:main
Nov 13, 2026
Merged

ernado merged 1 commit into
ogen-go:mainfrom
dzsibi:main

Conversation

@dzsibi

@dzsibi dzsibi commented Oct 12, 2026

Copy link
Copy Markdown
Contributor

Problem

ogen is currently not compatible with the latest go version (at the time of writing this is go 1.27.2). While the type alias issue could be resolved by setting GOEXPERIMENT=nojsonv2, the tools version mismatch cannot be bypassed like that. @ernado, could you please review?

There are multiple issues:

JSONv2 alias for jsontext.RawMessage

panic: runtime error: invalid memory address or nil pointer dereference [recovered, repanicked]

tools v5 format

internal error in importing "encoding/json" (cannot decode "encoding/json", export data version 5 is greater than maximum supported version 4); please report an issue

go vet error

gen/walk.go:90:38: github.com/go-faster/errors.Wrapf format %q has arg pattern of wrong type int

Changes

  • Upgrade x/tools to v0.50.0 for export-data format 5 support; minimum Go version becomes 1.26.
  • Resolve aliased external types while preserving their original package names; add RawMessage regression tests.
  • Fix a vet formatting error and test stable Go in both JSON modes with separate caches.

Related PRs

  • #1748 and #1763 fix the interface-alias panic, but derive package names from the unaliased type. For encoding/json.RawMessage = jsontext.Value, that combines package name jsontext with type name RawMessage, producing an incorrect qualifier. This keeps the alias's types.TypeName, preserving json.RawMessage while inspecting its type for encoding support.
  • #1755 upgrades x/tools only to v0.49.0, which lacks the format-5 support required for Go 1.27.2.

@dzsibi

dzsibi commented Nov 2, 2026

Copy link
Copy Markdown
Contributor Author

@ernado, sorry to be a bother, but could you help getting this (or an alternate solution to the same problem) merged?

@ernado ernado closed this Nov 13, 2026
@ernado ernado reopened this Nov 13, 2026
@ernado
ernado merged commit 1b1abdb into ogen-go:main Nov 13, 2026
16 of 17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants