-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
git hash in --build-id #2805
Comments
@htuch could you please ask this question on stackoverflow using the bazel tag (so that other users can also benefit from an answer)? Bazel devs are monitoring SO and I am sure we'll find someone to answer your question there. thanks so much! |
We could remove My best guess would be to use the the stamping data in a genrule to write a linker script, then reference that linker script on the linker command line, but I don't know if you can do the equivalent of |
@buchgr I think this is probably the right forum as we need to have some changes made to Bazel to get this to work I believe. @lberki Yeah, if there was a way to suppress the We're going to need a workaround until Bazel gains this support, so I will investigate and update this issue. |
AFAIK it will be 0.5 |
I think there's a bit more to it than just the above commit. I tried writing a It would probably be most convenient if we can just add something like Can we reopen this issue to get to a working implementation? |
Friendly ping to @buchgr to reopen. Thanks. |
This is a workaround for bazelbuild/bazel#2805. Small reorganization of version_generated.cc rules, since we rely on them here and this can also assist with the Google import of Envoy and its versioning scheme. Also added docs on build types and how to do release builds.
This is a workaround for bazelbuild/bazel#2805. Small reorganization of version_generated.cc rules, since we rely on them here and this can also assist with the Google import of Envoy and its versioning scheme. Also added docs on build types and how to do release builds.
Here's the plan: we are going to add a Then you can write a LGTY? |
@lberki LGTM,thanks. One question; what will happen to other linker params that are inserted by CROSSTOOLS or via the Bazel internally? I'm kind of worried we might still see the |
I was hoping that later |
Yeah, seems likely but needs verification. Ideally we have some Bazel test for this functionality that demonstrates this. |
Since 724706b bazel doesn't emit --build-id=md5 |
@oquenchil is this issue resolved with the additional_linker_inputs attribute? |
I'm still working on adding the additional_linker_inputs attribute but Harvey can use a workaround meanwhile which is ugly but does the job for now. |
We're tracking this on the Envoy side in envoyproxy/envoy#2625. We need to find someone with cycles to validate the new Bazel native solutions, CC: @jmillikin-stripe. |
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 incc_binary
or--stamp
on the CLI. Manually specifying alinkopt
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
The text was updated successfully, but these errors were encountered: