forked from cilium/cilium
-
Notifications
You must be signed in to change notification settings - Fork 7
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
Deliver Cilium debug symbols as separate files #550
Merged
Merged
Conversation
This file contains 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
r1viollet
reviewed
Mar 7, 2024
r1viollet
reviewed
Mar 7, 2024
nsavoire
reviewed
Mar 7, 2024
… from the builder image + Nico’s feedback
nsavoire
approved these changes
Mar 21, 2024
antonipp
approved these changes
Mar 27, 2024
jaredledvina
approved these changes
Mar 27, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems alright to me
hemanthmalla
approved these changes
Mar 27, 2024
jaredledvina
added a commit
that referenced
this pull request
Apr 2, 2024
Provides debug symbols and ensures `release` and `debug` binaries are from the same build - so symbol files always match. - If the build is invoked with `NOSTRIP=0`, then the `release` image has stripped binaries and the `debug` image has stripped binaries + debug symbol files in `/usr/lib/debug`. - If the build is invoked with `NOSTRIP=1`, then the `release` image has non-stripped binaries and the `debug` image has non-stripped binaries + debug symbol files in `/usr/lib/debug`. The latter is somewhat redundant in the `debug` image since the debug symbols are present both in the binaires and in `/usr/lib/debug`. I'm hoping this will be acceptable upstream. Part of the idea is that we should no longer need to touch `NOSTRIP`. In our current builds, the problem is that both our `release` and `debug` builds are lacking symbols by default. To get builds with symbols, we need to go and hack `.gitlab-ci.yml` and flip `NOSTRIP`, branch, tag and push. We can’t use our default `debug` images because they have no symbols, so delve doesn’t understand anything about the binary it’s running. With this change, all tagged builds deliver a `release` image that is either stripped or not according to `NOSTRIP` (so stripped with our default `.gitlab-ci.yml`), and a `debug` image that includes the symbol files. So the `debug` image works: delve understands the binary, you can do remote debugging from your IDE with port-forward etc. Also, by systematically delivering the debug symbol files in the `debug` image in `/usr/lib/debug`, it makes it easy to split them out for post-processing. If, for instance, I didn’t include the debug files in the non-stripped version of the `debug` image, then it would be harder to identify the files that should be post-processed. So I think this strikes a good balance in terms of making it easy to know where to find debug symbols and something I hope upstream should be OK with (it improves usability of the `debug` image, since currently if `NOSTRIP=0`, then the `debug` image has no symbols and it’s useless with Delve and Co).
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.
Provides debug symbols and ensures
release
anddebug
binaries are from the same build - so symbol files always match.NOSTRIP=0
, then therelease
image has stripped binaries and thedebug
image has stripped binaries + debug symbol files in/usr/lib/debug
.NOSTRIP=1
, then therelease
image has non-stripped binaries and thedebug
image has non-stripped binaries + debug symbol files in/usr/lib/debug
.The latter is somewhat redundant in the
debug
image since the debug symbols are present both in the binaires and in/usr/lib/debug
. I'm hoping this will be acceptable upstream.Part of the idea is that we should no longer need to touch
NOSTRIP
. In our current builds, the problem is that both ourrelease
anddebug
builds are lacking symbols by default. To get builds with symbols, we need to go and hack.gitlab-ci.yml
and flipNOSTRIP
, branch, tag and push. We can’t use our defaultdebug
images because they have no symbols, so delve doesn’t understand anything about the binary it’s running.With this change, all tagged builds deliver a
release
image that is either stripped or not according toNOSTRIP
(so stripped with our default.gitlab-ci.yml
), and adebug
image that includes the symbol files.So the
debug
image works: delve understands the binary, you can do remote debugging from your IDE with port-forward etc.Also, by systematically delivering the debug symbol files in the
debug
image in/usr/lib/debug
, it makes it easy to split them out for post-processing. If, for instance, I didn’t include the debug files in the non-stripped version of thedebug
image, then it would be harder to identify the files that should be post-processed.So I think this strikes a good balance in terms of making it easy to know where to find debug symbols and something I hope upstream should be OK with (it improves usability of the
debug
image, since currently ifNOSTRIP=0
, then thedebug
image has no symbols and it’s useless with Delve and Co).I'd like to merge this in our fork for now so that we can continue experimenting with this whilst I try to upstream equivalent changes to
main
.