Apm-server on FreeBSD

Is there a way to get apm-server running on FreeBSD?

thanks

Looks like adding linux compat might have solved it

I was able to build it from source using the following diff then running gmake:

diff --git a/Makefile b/Makefile
index 4594aa87d..d6a5c49a4 100644
--- a/Makefile
+++ b/Makefile
@@ -42,7 +42,8 @@ APM_SERVER_BINARIES:= \
        build/apm-server-windows-386.exe \
        build/apm-server-windows-amd64.exe \
        build/apm-server-darwin-amd64 \
-       build/apm-server-darwin-arm64
+       build/apm-server-darwin-arm64 \
+       build/apm-server-freebsd-amd64
 
 # Strip binary and inject the Git commit hash and timestamp.
 LDFLAGS := \
@@ -58,12 +59,13 @@ LDFLAGS := \
 # the apm-server binaries.
 .PHONY: $(APM_SERVER_BINARIES)
 $(APM_SERVER_BINARIES):
-       env CGO_ENABLED=0 GOOS=$(GOOS) GOARCH=$(GOARCH) \
+       env CGO_ENABLED=1 GOOS=$(GOOS) GOARCH=$(GOARCH) \
        $(GO) build -o $@ -trimpath $(GOFLAGS) $(GOMODFLAG) -ldflags "$(LDFLAGS)" ./x-pack/apm-server
 
 build/apm-server-linux-%: GOOS=linux
 build/apm-server-darwin-%: GOOS=darwin
 build/apm-server-windows-%: GOOS=windows
+build/apm-server-freebsd-%: GOOS=freebsd
 build/apm-server-%-386 build/apm-server-%-386.exe: GOARCH=386
 build/apm-server-%-amd64 build/apm-server-%-amd64.exe: GOARCH=amd64
 build/apm-server-%-amd64 build/apm-server-%-amd64.exe: GOFLAGS+=-buildmode=pie
@@ -259,7 +261,7 @@ gofmt: $(GOIMPORTS) add-headers
 ##############################################################################
 
 MODULE_DEPS=$(sort $(shell \
-  $(GO) list -deps -tags=darwin,linux,windows -f "{{with .Module}}{{if not .Main}}{{.Path}}{{end}}{{end}}" ./x-pack/apm-server))
+  $(GO) list -deps -tags=darwin,linux,windows,freebsd -f "{{with .Module}}{{if not .Main}}{{.Path}}{{end}}{{end}}" ./x-pack/apm-server))
 
 notice: NOTICE.txt
 NOTICE.txt build/dependencies-$(APM_SERVER_VERSION).csv: go.mod tools/go.mod

it passes tests, and i'm actually using it in our pre-prod environment for testing. The only thing I'm unsure about is the change to set CGO_ENABLED=1 which is required to compile, but I am unsure of the side effects. gmake test works though.

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.