Skip to content

Add a Gnu build-id to gitlab-pages binary

Bob Van Landuyt requested to merge bvl-add-gnu-build-id into master

What does this MR do?

By default go binaries only include a Go build-id. Which is deterministic and unique.

They don't include a Gnu build-id that should have the same properties.

The Gnu build-id is used by several observably tools including perf. Having a Gnu build-id allow these tools to uniquely identify a binary and avoid conflicts when resolving debug symbols for those binaries.

We're generating a Gnu build-id from the Go build-id, that way we're sure to also have a deterministic and unique build-id. We do this by compiling the binary once, getting the Go build-id from that, and then re-building including a Gnu build-id.

For gitlab-com/gl-infra/scalability#1536 (closed)

More about the reasoning for this approach in this comment by Matt: gitlab-com/gl-infra/scalability#1464 (comment 769013218)

This is consistent with how we're generating Gnu build-id's in Gitaly (gitaly!4192 (merged)) and Workhorse (gitlab!78721 (merged))

TODO

Edited by Bob Van Landuyt

Merge request reports