I was trying to install TailScale on my OPNsense firewall by following these instructions: https://tailscale.com/kb/1097/install-opnsense
OPNSense is built on FreeBSD and provides its own ports tree so we can build various packages from source.
Unfortunately I was continually getting build failures when running make install
in the /usr/ports/security/tailscale
dir. I kept failing at the point where we were trying to build Go, and was failing at this same point every time I tried. Sometimes accompanied by a hard crash of the server.
bootstrap/cmd/compile/internal/ssa
go build bootstrap/cmd/compile/internal/ssa: /usr/local/go14/pkg/tool/freebsd_amd64/6g: signal: killed
bootstrap/cmd/compile/internal/syntax
bootstrap/cmd/internal/gcprog
bootstrap/internal/goversion
bootstrap/internal/race
bootstrap/cmd/link/internal/sym
bootstrap/cmd/link/internal/loadelf
bootstrap/cmd/link/internal/loadmacho
bootstrap/cmd/link/internal/loadpe
bootstrap/cmd/link/internal/loadxcoff
bootstrap/cmd/link/internal/objfile
bootstrap/cmd/link/internal/ld
bootstrap/cmd/link/internal/amd64
bootstrap/cmd/link/internal/arm
bootstrap/cmd/link/internal/arm64
bootstrap/cmd/link/internal/mips
bootstrap/cmd/link/internal/mips64
bootstrap/cmd/link/internal/ppc64
bootstrap/cmd/link/internal/s390x
bootstrap/cmd/link/internal/wasm
bootstrap/cmd/link/internal/x86
bootstrap/cmd/link
go tool dist: FAILED: /usr/local/go14/bin/go install -gcflags=-l -tags=math_big_pure_go compiler_bootstrap -v bootstrap/cmd/...: exit status 1
*** Error code 2
Stop.
make: stopped in /usr/ports/lang/go
===>>> make build failed for lang/go
===>>> Aborting update
===>>> Update for lang/go failed
===>>> Aborting update
===>>> Update for net/wireguard-go failed
===>>> Aborting update
The only reference I could find on google to this error was an old post on the FreeBSD forums, which had no resolution. (I copied his error log for the example above, because I wasn't smart enough to grab one when I was building). Eventually I came across an issue on the Go-Bootstrap git repo, which suggested the process was killed due to an out of memory issue.
It finally made sense. I run the OPNSense machine in a VM on proxmox, and over time I had tuned it's specs down to just what it requires for it's duties as a router / firewall, trying to build software on it was not something I thought I'd be doing on it. I upped its memory from 1G to 4 temporarily and the build proceeded without any further issue.