dhiaayachi / temporal

Temporal service
https://docs.temporal.io
MIT License
0 stars 0 forks source link

Building on FreeBSD: Findings #287

Open dhiaayachi opened 2 weeks ago

dhiaayachi commented 2 weeks ago

I am aware that FreeBSD is not officially supported to run temporal. Nevertheless, I was trying to build the latest version on FreeBSD 14.0-ALPHA4 amd64. Here is how far I got:

Install dependencies:

pkg install -y gmake go120 git

Get the repository:

git clone --recurse-submodules https://github.com/temporalio/temporal.git

Try to build it with the provided GNU-Makefile:

cd temporal
ln -s /usr/local/bin/go120 /usr/local/bin/go
gmake

Output:

e[1;36mInstall/update goimports...e[0m
e[1;36mInstall/update linters...e[0m
e[1;36mInstall/update mockgen tool...e[0m
e[1;36mInstall/update proto plugins...e[0m
e[1;36mInstall/update proto linters...e[0m
e[1;36mBuild temporal-server with CGO_ENABLED=0 for freebsd/amd64...e[0m
CGO_ENABLED=0 go build -o temporal-server ./cmd/server
# github.com/temporalio/tchannel-go
../go/pkg/mod/github.com/temporalio/tchannel-go@v1.22.1-0.20220818200552-1be8d8cffa5b/sockio_unix.go:42:33: undefined: getSendQueueLen
gmake: *** [Makefile:212: temporal-server] Error 1

It would be awesome if someone could have a look. Maybe it's easy to fix. If you need a VM, this vagrant box would suffice.

dhiaayachi commented 2 days ago

Thanks for reporting this! It appears that the issue stems from the use of getSendQueueLen in sockio_unix.go . This function is not available on FreeBSD.

To work around this issue, you can use the provided GNU-Makefile to build temporal-server with the CGO_ENABLED=0 flag set, which disables CGO for the FreeBSD build. However, if you require features that rely on CGO, this workaround may not be suitable.

Would you like to know more about building Temporal on FreeBSD?

dhiaayachi commented 2 days ago

Thanks for reporting this. It looks like you're running into an issue with the getSendQueueLen function being undefined in sockio_unix.go. This function was introduced in tchannel-go v1.21.0. The version of tchannel-go that your Go version is using is v1.22.1.

To resolve this, you can try updating the tchannel-go dependency in your Go project. You can do this by running:

go get -u github.com/temporalio/tchannel-go@v1.21.0

If this doesn't work, please provide your Go version and the output of go mod graph so I can help you further.