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

Update Makefile to build debug binary #2062

Open
4 tasks
Taztingo opened this issue Jul 2, 2024 · 1 comment
Open
4 tasks

Update Makefile to build debug binary #2062

Taztingo opened this issue Jul 2, 2024 · 1 comment
Milestone

Comments

@Taztingo
Copy link
Contributor

Taztingo commented Jul 2, 2024

Summary

It is critical that we update the Makefile to include a way to build a binary that is debuggable. The only binary that our Makefile can generate is one that has been optimized to strip debug symbols and introduce inlining. This will be an issue if we need to debug a running binary.

Problem Definition

In order to debug a running binary the developer will need the debug symbols and to have no optimization. This type of binary is not ideal for production, but is required if we want to attach to a remote process.

Proposal

  1. Introduce a new target in the Makefile build-debug.
  2. Remove stripping on the linker by removing both the -s and -w flags from ldflags, but only for build-debug.
  3. Disable optimizations and inling by introducing a set of go compiler flags -gcflags "all=-N -l" to build-debug.
  4. Remove trimming by remove -trimpath from the ldflags for build-debug.

For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate contributors tagged
  • Contributor assigned/self-assigned
@SpicyLemon SpicyLemon added this to the v1.20.0 milestone Aug 19, 2024
@SpicyLemon
Copy link
Contributor

As part of this, we should add the validate-go-version target to the install target (same as how build has it).

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

No branches or pull requests

2 participants