Skip to content

git hash in --build-id #2805

@htuch

Description

@htuch

Some projects, such as Envoy (https://github.com/lyft/envoy/) need the ability to set -Wl,--build-id=<git hash of workspace generating build> to encode the build ID in the .note.gnu.build-id ELF section.

It seems that Bazel uses this for hashing inputs or setting to a fixed value, based on the stamp option in cc_binary or --stamp on the CLI. Manually specifying a linkopt does not override, since this comes before the Bazel supplied --build-id on the command line.

What's the best practice for doing this today in Bazel?

I noticed #216, but this doesn't seem to reference setting the --build-id, it seems to be concerned with obtaining the build information.

CC @mattklein123 envoyproxy/envoy#415

Metadata

Metadata

Assignees

Labels

P2We'll consider working on this in future. (Assignee optional)team-Rules-CPPIssues for C++ rulestype: feature request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions