Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build fails on FreeBSD (11.2) #2078

Open
janl opened this issue Jul 29, 2018 · 1 comment
Open

Build fails on FreeBSD (11.2) #2078

janl opened this issue Jul 29, 2018 · 1 comment

Comments

@janl
Copy link

janl commented Jul 29, 2018

I’m trying to build this project under FreeBSD 11.2 and I’m getting this error:

~/go/src/github.com/DataDog/datadog-agent # invoke agent.build --build-exclude=snmp,systemd
# github.com/DataDog/datadog-agent/pkg/secrets
pkg/secrets/check_right.go:23:16: undefined: syscall.S_IRWXG
pkg/secrets/check_right.go:23:29: undefined: syscall.S_IRWXO

I have since learned that the syscall package is somewhat deprecated and x/sys/unix should be used instead, but it leads to the same error with s/syscall/unix/ when ported (the APIs and types are the same). It looks like a limitation in the system bindings for go, but I‘m not a systems-, nor a go developer, so I might be missing some subtlety (I’m asking for help tho).

It appears that this commit landed the code in question: 0ffaa4d

cc @masci who has addressed FreeBSD build issues in the past.

janl added a commit to janl/datadog-agent that referenced this issue Jul 29, 2018
This patch adds a _freebsd.go file that builds instead of the regular
one *only* on Freebsd (to the best of my cross-platform Go abilities).

It imports the C constants S_IRWXG and S_IRWXO and uses them instead
of syscall.S_IRWXG and syscall.S_IRWXO.

Closes DataDog#2078
tolbrino pushed a commit to tolbrino/datadog-agent that referenced this issue Aug 31, 2018
This patch adds a _freebsd.go file that builds instead of the regular
one *only* on Freebsd (to the best of my cross-platform Go abilities).

It imports the C constants S_IRWXG and S_IRWXO and uses them instead
of syscall.S_IRWXG and syscall.S_IRWXO.

Closes DataDog#2078
@urosgruber
Copy link
Contributor

@janl can you please check https://github.com/urosgruber/dd-agent-FreeBSD/tree/v7-next if it works for you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants