Parcourir la source

build: compile the agent without encoding/json v2 (#2096)

Nacho il y a 2 semaines
Parent
commit
a146cb1361
1 fichiers modifiés avec 4 ajouts et 0 suppressions
  1. 4 0
      scripts/build-agents.sh

+ 4 - 0
scripts/build-agents.sh

@@ -32,6 +32,10 @@ fi
 mkdir -p "$OUT"
 export CGO_ENABLED=0
 export GOOS=linux
+# The agent only uses the encoding/json v1 API. json/v2 is on by default in
+# the Go 1.26 toolchain and costs about 124 KB per packed binary (#2095), so it
+# is compiled out unless the caller sets GOEXPERIMENT explicitly.
+export GOEXPERIMENT=${GOEXPERIMENT:-nojsonv2}
 
 build() {
 	local arch=$1 extra=$2