-
Notifications
You must be signed in to change notification settings - Fork 18k
x/sys/unix: missing ETHTOOL_FLAG_ constants in v0.23.0 #68761
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
Comments
Related Issues and Documentation (Emoji vote if this was helpful or unhelpful; more detailed feedback welcome in this discussion.) |
This is from https://go.dev/cl/600516. The constants disappeared, apparently because they changed from #define macros to enums. Somehow we didn't pick up the enums, and thought that the names had in fact disappeared from the kernel. CC @mauri870 |
@ianlancetaylor Thanks for the ping. What is the proper way to guarantee these constants don't disappear when they are converted into enums? Should we always default to define them manually when this happens? I don't think there is a way to handle this during auto generation, at least not currently. This is not the first time x/sys breaks because of disappearing constants as well. |
I haven't looked closely, but I suspect that we need to add the names to x/sys/unix/linux/types.go. See the But I could be mistaken about this. |
Thanks, there is a mention to a perl command in x/sys/unix/linux/types.go, but it needs to be executed manually and the output added manually to the constants list. I will send a fix shortly. I think it is worth it to integrate this into the automated mkall.sh workflow somehow in the future. |
Some constants were removed in CL 600516 that included changes for the Linux kernel 6.10. This kernel version moved C defines to an enum ethtool_header_flags that was not picked up by the mkall.sh script. For enums, there is a perl script that needs to be run manually, and the output must be added by hand to the list of constants in unix/linux/types.go. Fixes golang/go#68761
Change https://go.dev/cl/604098 mentions this issue: |
I'm sorry for the inconvenience. The issue should be fixed in the linked CL. Some parts of x/sys are not fully autogenerated, I'll pay more attention when updating this in the future. |
Go version
go version go1.22.5 linux/amd64
Output of
go env
in your module/workspace:What did you do?
Tried to run e.g. https://github.com/mdlayher/ethtool/blob/main/client_linux.go#L567 with
golang.org/x/sys
v0.23.0What did you see happen?
In the commit https://cs.opensource.google/go/x/sys/+/31ef9e726f987c593d73c3c35ca1c7477cf0e480, the constants
ETHTOOL_FLAG_*
were removed (https://cs.opensource.google/go/x/sys/+/31ef9e726f987c593d73c3c35ca1c7477cf0e480:unix/zerrors_linux.go;dlc=d03a807229bc212694753d74c81119a9b4adb711).What did you expect to see?
The constants to stay :)
The text was updated successfully, but these errors were encountered: