Skip to content
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

[debug] collect all binaries generated with -g #277

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

vvlevchenko
Copy link

Summary

This prototype of fix #276

Use Cases

build of debug binaries with graalvm

@vvlevchenko vvlevchenko requested a review from a team as a code owner July 14, 2023 12:29
@linux-foundation-easycla
Copy link

CLA Not Signed

@anthonydahanne
Copy link
Member

anthonydahanne commented Jul 14, 2023

hello @vvlevchenko !
Thanks for your issue and PR! Please don't forget to sign the CLA!

I understand that native-image -g would produce 2 binaries.
You seem to suggest in your PR that the user would specify GraalVM arguments to pass the -g
How do you envision buildpacks to embed them? the 2 binaries in the same layer with an option (env var) to choose between each of them? or rather using multi process selection (https://buildpacks.io/docs/app-developer-guide/run-an-app/)?
Thanks!

@dmikusa
Copy link
Contributor

dmikusa commented Jul 14, 2023

I think this merits a discussion about default behavior as well.

Paketo targets producing production images, which would not typically include debug information as that would result in larger images.

I like the idea of auto detecting the -g flag, so when that's present we'd retain the debug info but I think we should output a warning message as a reminder that the debug flag is on and will result in larger images.

@vvlevchenko
Copy link
Author

vvlevchenko commented Jul 25, 2023

I think this merits a discussion about default behavior as well.

Paketo targets producing production images, which would not typically include debug information as that would result in larger images.

I like the idea of auto detecting the -g flag, so when that's present we'd retain the debug info but I think we should output a warning message as a reminder that the debug flag is on and will result in larger images.

Hello @dmikusa,

Sorry for delay, the main reason why user need debug info for containerised build is lack of debugger support for Windows and Mac OS hosts, so the user on these platforms can only relay on containerised builds or debugging JVM variants which is not the same.

@vvlevchenko
Copy link
Author

Hello @anthonydahanne!
Sorry for delay,

hello @vvlevchenko ! Thanks for your issue and PR! Please don't forget to sign the CLA!
we're in process with legal here :)

I understand that native-image -g would produce 2 binaries. You seem to suggest in your PR that the user would specify GraalVM arguments to pass the -g How do you envision buildpacks to embed them? the 2 binaries in the same layer with an option (env var) to choose between each of them? or rather using multi process selection (https://buildpacks.io/docs/app-developer-guide/run-an-app/)? Thanks!

Actually I amn't very familiar with buildpacks, and perhaps there are better ways. Scenario to debug binary is after getting the result image we're creating docker container which contains gdbserver, with entrypoint gdbserver :<port> /application/application

@dmikusa
Copy link
Contributor

dmikusa commented Jul 25, 2023

Thanks for the additional information.

A couple of additional concerns/discussion points:

  1. We have an RFC for remote debugging. I think we should attempt to align any changes here with that RFC, that way we're following consistent patterns when it comes to remote debugging.
  2. I think we need to look more closely at how it is detecting the output file. First, I think it should only deviate and look for debug files if we're doing a remote debug (i.e. it sees the -g flag). I don't want to have a case where it accidentally detects multiple files. Second, I think we should consider if there's a need to have the search operation configurable. We use pattern matching in a lot of places, would people expect that here as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

debug symbols are dropped if user specify -g flag for native-image
3 participants