-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
grpc: add ability to compile with or without tracing #6954
Conversation
|
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #6954 +/- ##
==========================================
- Coverage 83.72% 83.61% -0.12%
==========================================
Files 287 288 +1
Lines 30915 30921 +6
==========================================
- Hits 25884 25854 -30
- Misses 3969 3999 +30
- Partials 1062 1068 +6
|
I added a release notes string, the test failure looks like a flake to me. Seems ready for review :) |
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.
LGTM; just one administrivia item.
golang.org/x/net/trace is the only dependency of gRPC Go that depends -- through html/template and text/template -- on reflect's MethodByName. Binaries with MethodByName are not eligible for Go dead code elimination. As of protobuf v1.32.0 combined with Go 1.22, Go protobufs support compilation with dead code elimination. This commit allows users of gRPC Go to also make use of dead code elimination for smaller binary sizes. Signed-off-by: Chris Koch <chrisko@google.com>
Thanks @dfawley! |
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.
Thanks!
See grpc/grpc-go#6954 Before: ``` -rw-r--r-- 1 smira smira 68241300 Feb 20 20:08 _out/initramfs-amd64.xz ``` After: ``` -rw-r--r-- 1 smira smira 66376648 Feb 20 20:08 _out/initramfs-amd64.xz ``` Signed-off-by: Andrey Smirnov <andrey.smirnov@siderolabs.com>
See grpc/grpc-go#6954 Before: ``` -rw-r--r-- 1 smira smira 68241300 Feb 20 20:08 _out/initramfs-amd64.xz ``` After: ``` -rw-r--r-- 1 smira smira 66376648 Feb 20 20:08 _out/initramfs-amd64.xz ``` Signed-off-by: Andrey Smirnov <andrey.smirnov@siderolabs.com>
golang.org/x/net/trace is the only dependency of gRPC Go that depends -- through html/template and text/template -- on reflect's MethodByName. Binaries with MethodByName are not eligible for Go dead code elimination.
As of protobuf v1.32.0 combined with Go 1.22, Go protobufs support compilation with dead code elimination. This commit allows users of gRPC Go to also make use of dead code elimination for smaller binary sizes.
What's the best place to insert a build test to make sure that
go build -tags=grpcnotrace ./...
still builds?RELEASE NOTES:
x/net/trace
by usinggrpcnotrace
to enable dead code elimination