Skip to content

How does garble remove buildinfo? #695

Answered by mvdan
Blank-c asked this question in Q&A
Discussion options

You must be logged in to vote

Mainly in here:

garble/main.go

Lines 2172 to 2178 in 059c1d6

// Starting in Go 1.17, Go's version is implicitly injected by the linker.
// It's the same method as -X, so we can override it with an extra flag.
flags = append(flags, "-X=runtime.buildVersion=unknown")
// Ensure we strip the -buildid flag, to not leak any build IDs for the
// link operation or the main package's compilation.
flags = flagSetValue(flags, "-buildid", "")

If any information isn't being removed from a build by garble, please raise an issue following the template.

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by lu4p
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants