spqr icon indicating copy to clipboard operation
spqr copied to clipboard

App not building on macOS

Open zetsub0 opened this issue 6 months ago • 2 comments

Describe the bug Got error whyle trying to build on macOS:

make build

go build -pgo=auto -o spqr-balancer -ldflags "-X github.com/pg-sharding/spqr/pkg.GitRevision=`git rev-parse --short HEAD` -X github.com/pg-sharding/spqr/pkg.SpqrVersion=`git describe --tags --abbrev=0`" -gcflags=all="-N -l" ./cmd/balancer
# github.com/pg-sharding/spqr/pkg/conn
pkg/conn/instance.go:190:52: undefined: syscall.SOL_TCP
make: *** [build_balancer] Error 1

To Reproduce Steps to reproduce the behavior:

  1. Clone repo
  2. execute make build

Desktop (please complete the following information):

  • MacBook m3 pro
  • OS: macOS
  • Version 14.4 (23E214)

Additional context I'm not sure but but it seems to me that syscall.IPPROTO_TCP is more suitable than syscall.SOL_TCP in this context. Changed it locally and app built successfully.

zetsub0 avatar Jun 23 '25 10:06 zetsub0

Hi, @zetsub0! We are trying to set up a user tcp socket timeout and, yes, we broke the build on Mac OS. As a temporary workaround, you can comment out this line locally, and then the build will pass.

If you know how to fix this problem, we are open for your PRs!

Denchick avatar Jun 23 '25 11:06 Denchick

I think we need to do something here to make the router buildable.

Denchick avatar Aug 12 '25 09:08 Denchick