-
Notifications
You must be signed in to change notification settings - Fork 20.8k
metrics: disable CPU stats (gosigar) on Darwing when nocgo is passed #20829
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
metrics: disable CPU stats (gosigar) on Darwing when nocgo is passed #20829
Conversation
metrics/cpu_enabled.go
Outdated
@@ -14,7 +14,7 @@ | |||
// You should have received a copy of the GNU Lesser General Public License | |||
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>. | |||
|
|||
// +build !ios | |||
// +build darwin,cgo dragonfly freebsd linux nacl netbsd openbsd solaris windows arm64 |
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 looks very weird. Architectures mixed with platforms. It would also be a maintenance nightmare to keep it always updated. Please use exclusion patterns
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.
Ping @BogdanHabic
@BogdanHabic are you still interested in this PR and in making the changes requested? |
@adamschmideg oh my god, sorry, yes, I somehow missed this notification due to the security ones GitHub has spammed me with. I'll make the changes today! |
Hey @adamschmideg, I've pushed the requested change. The test that is failing is not broken by this change if I'm not mistaken. |
@@ -14,7 +14,7 @@ | |||
// You should have received a copy of the GNU Lesser General Public License | |||
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>. | |||
|
|||
// +build !ios | |||
// +build !ios,!darwin |
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.
I think you should be able to cover all cases here and not need that extra file:
// +build !ios
// +build !darwin cgo
Could you try this version out?
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.
I think it should be
// +build !ios,!darwin | |
// +build !ios,!darwin darwin,cgo |
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 is the truth table I'm using
ios | darwin | Other OS | cgo | cpu enabled |
---|---|---|---|---|
0 | 1 | 0 | 0 | 0 |
0 | 1 | 0 | 1 | 1 |
1 | 0 | 0 | 0 | 0 |
1 | 0 | 0 | 1 | 0 |
0 | 0 | 1 | 0 | 1 |
0 | 0 | 1 | 1 | 1 |
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.
So the Other OS will essentially be caught by !ios,!darwin
, correct? If this is the case, the change you suggested makes sense.
Closing this PR as this fix was not sufficient to prevent geth build failure when building on darwin with CGO disabled. #21041 implements a fix for this issue. |
As the title suggests disables gosigar on darwin when CGO is disabled.
This is because the build fails with the following error when CGO is disabled: