Running go install using go install from source

Hi everyone,

I’m encountering an issue after compiling Go from source using the official guide at go.dev/doc/install/source. While the initial compilation and tests appear successful, attempts to install any package with go install result in “write barrier prohibited” errors.

Despite extensive research, I haven’t found any solutions specific to this error when building Go from source. Interestingly, using the pre-built Go binary avoids this problem. This leads me to suspect an error in my source compilation process, possibly during the all.bash execution.

Has anyone else encountered this issue? Any guidance would be appreciated, as I’m keen to understand and resolve this for my learning.

For reference, here’s the error message

../../../../../oss/go/src/runtime/mheap.go:537:8: write barrier prohibited
../../../../../oss/go/src/runtime/mgcwork.go:125:20: write barrier prohibited
../../../../../oss/go/src/runtime/mgcwork.go:125:20: write barrier prohibited by caller; (*gcWork).put
../../../../../oss/go/src/runtime/mgcwork.go:183:21: write barrier prohibited
../../../../../oss/go/src/runtime/mgcwork.go:183:21: write barrier prohibited by caller; (*gcWork).putBatch
../../../../../oss/go/src/runtime/mgcwork.go:212:20: write barrier prohibited
../../../../../oss/go/src/runtime/mgcwork.go:259:11: write barrier prohibited
../../../../../oss/go/src/runtime/mgcwork.go:295:11: write barrier prohibited
../../../../../oss/go/src/runtime/debuglog.go:102:14: write barrier prohibited
../../../../../oss/go/src/runtime/debuglog.go:102:14: write barrier prohibited by caller; dlogImpl
../../../../../oss/go/src/runtime/mgcwork.go:183:21: too many errors

And here’s the output of go env:

GO111MODULE=''
GOARCH='arm64'
GOBIN=''
GOCACHE='[home path]/Library/Caches/go-build'
GOENV='[home path]/Library/Application Support/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFLAGS=''
GOHOSTARCH='arm64'
GOHOSTOS='darwin'
GOINSECURE=''
GOMODCACHE='[home path]/go/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='darwin'
GOPATH='[home path]/go'
GOPRIVATE=''
GOPROXY='https://proxy.golang.org,direct'
GOROOT='[git repo path]/go'
GOSUMDB='sum.golang.org'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='[git repo path]/go/pkg/tool/darwin_arm64'
GOVCS=''
GOVERSION='go1.23.2'
GODEBUG=''
GOTELEMETRY='local'
GOTELEMETRYDIR='[home path]/Library/Application Support/go/telemetry'
GCCGO='gccgo'
GOARM64='v8.0'
AR='ar'
CC='clang'
CXX='clang++'
CGO_ENABLED='1'
GOMOD='/dev/null'
GOWORK=''
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
PKG_CONFIG='pkg-config'
GOGCCFLAGS='-fPIC -arch arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -ffile-prefix-map=/var/folders/vx/r97ggjts11n2lvn3hgl5nbsh0000gn/T/go-build2015904587=/tmp/go-build -gno-record-gcc-switches -fno-common'

:point_up: Looks like I managed to recover from this by re-compiling from source. I suspect although without substantial proof that the cause might be due to upgrading MacOS (Sequoia 15.0.1) to a new version that caused the errors.