Skip to content

Update Makefile to build debug binary #2062

Closed
@Taztingo

Description

@Taztingo

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

  • Status

    Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions