From d511b4c2e97a52375e2c82b68e2fb072ccef20c8 Mon Sep 17 00:00:00 2001 From: carole-lavillonniere Date: Mon, 31 Aug 2026 12:15:02 +0200 Subject: [PATCH] build: disable the jsonv2 GOEXPERIMENT Go 1.27 enables the jsonv2 experiment by default, reimplementing encoding/json and making json.RawMessage an alias for jsontext.Value. The repo inherited this from #122, which bumped the go directive from 1.26.6 to 1.27.0 -- that directive is a minimum toolchain requirement, so GOTOOLCHAIN =auto then builds everything with go1.27 and its default experiments. This emulator serializes customer Lambda payloads, so swapping JSON implementation should be a deliberate, tested decision rather than a side effect of a toolchain bump. Pin it off for now. There is no GODEBUG opt-out -- jsonv2 is selected at compile time via build tags -- so it must be an environment variable. Exporting it from the Makefile covers local builds, the docker targets (which re-enter this Makefile in the container) and CI, which invokes only make targets. Fixes the localstack branch, red since Aug 22, without touching the upstream test that the experiment broke. --- Makefile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Makefile b/Makefile index a596dc1..e5d2365 100644 --- a/Makefile +++ b/Makefile @@ -1,10 +1,13 @@ # LOCALSTACK CHANGES 2022-03-10: remove linker flags and add gc flags for delve debugger # LOCALSTACK CHANGES 2022-03-28: change compile src folder # LOCALSTACK CHANGES 2022-11-14: add --rm flag to compile-with-docker +# LOCALSTACK CHANGES 2026-08-31: disable the jsonv2 GOEXPERIMENT (see GOEXPERIMENT below) # RELEASE_BUILD_LINKER_FLAGS disables DWARF and symbol table generation to reduce binary size #RELEASE_BUILD_LINKER_FLAGS=-s -w +export GOEXPERIMENT := nojsonv2 + BINARY_NAME=aws-lambda-rie ARCH=x86_64 GO_ARCH_x86_64 := amd64