Add gravitational_trace.nocrypto build tag#119
Merged
Conversation
espadolini
commented
Apr 2, 2026
| with: | ||
| go-version-file: go.mod | ||
| - name: Check dependencies with the nocrypto build tag | ||
| run: "go list -tags gravitational_trace.nocrypto -deps ./... | sort | tee /dev/stderr | (! grep -q -e ^crypto$ -e ^crypto/ )" |
Contributor
Author
There was a problem hiding this comment.
I haven't used goda because I'm not sure of which version of go that would require, and using go list is good enough for this specific purpose.
rosstimothy
previously approved these changes
Apr 6, 2026
codingllama
reviewed
Apr 6, 2026
c651338 to
d3fcaba
Compare
codingllama
approved these changes
Apr 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds a build tag to exclude functions from the build that depend on
crypto/..., which, for programs that don't otherwise import anything else fromcrypto, can lead to significant reduction in code size (I've seen a 25% - from 4.3 to 3.2 MB - for a small utility program used in Teleport).There doesn't seem to be any strong convention around how to name build tags that are intended for users of libraries; kubernetes-sigs/kustomize uses
kustomize_disable_go_plugin_support, grpc-go hasgrpcnotrace, the go standard library itself usesnetgo,osusergoandnethttpomithttp2; I don't think we should "namespace" build tags here with just atraceprefix, so I pickedgravitational_trace, and using a dot made more sense to me than just concatenating strings, but I don't have strong feelings either way.