-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Go's syscall package FreeBSD is missing S_IRWXG and S_IRWXO #2079
Conversation
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
ec94e6f
to
5fa8041
Compare
// This product includes software developed at Datadog (https://www.datadoghq.com/). | ||
// Copyright 2018 Datadog, Inc. | ||
|
||
// +build freebsd |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this line might be double the trouble, but doesn’t hurt either
I found this during DataDog/datadog-agent#2079 Change-Id: I51d57e7e3cedb8b23e720bc03f38504dc0ad063d GitHub-Last-Rev: 4e1c193 GitHub-Pull-Request: #13 Reviewed-on: https://go-review.googlesource.com/126620 Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com> Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
ping cc @masci <3 |
Hi @janl, thanks for opening this PR! (and for the detailed explanation of the root cause) The one downside I see to your PR is that it adds a dependency on Anyway, do you plan to use the features provided in the If you don't plan to, I'd suggest removing the Let me know what you think! |
@olivielpeau thanks for the detailed and thoughtful reply. I didn’t realise That said, an alternative patch could be a bit more “risky”. These constants are ancient Unix 25+year old constants and likely to have the same bitmask values everywhere. Given that this patch introduces a FreeBSD-only compilation path, you could be open to accept using the raw bitmask values in the two places needed. The FreeBSD-only complication path could be removed once you require a go version that this is fixed in. If you’re interested, I can amend the patch. |
@janl Using the raw bitmask values sounds good to me, if you could amend your patch this way that'd be great, thanks 👍. Could you also leave a |
@janl Thanks again for your contributions here. Were you still interested in working through the changes olivielpeau suggested? |
@janl Thanks again for your contributions here. It sounds like you might have gotten busy with other projects. Should we close this PR and revisit at a future date? |
Thanks again @janl for your contributions here. Any chance you will be able to work on the changes suggested by @olivielpeau or shall we close for now and revisit later? |
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 #2078
The relevant diff is: