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

Add ldflags #152

Merged
merged 1 commit into from
Aug 24, 2023
Merged

Add ldflags #152

merged 1 commit into from
Aug 24, 2023

Conversation

Gontier-Julien
Copy link
Contributor

As discussed in #151 , add the '-s -w' ldflags

Information on what those two ldflags does:

-s    disable symbol table
-w    disable DWARF generation

Signed-off-by: Gontier Julien <gontierjulien68@gmail.com>
@m13253
Copy link
Owner

m13253 commented Aug 24, 2023

I have a question. If we disable the symbol table, will panic messages correctly show which function it crashes in?
I don’t think DWARF is necessary since we are not going to debug into the container. (Unless if disabling it interferes with panic reporting.)

@Gontier-Julien
Copy link
Contributor Author

At the moment it al globally, but i can make if for the dockerfiles only if you want.
As for symbol table it shouldn't interfere with panic messages or at least from what i know.

@Jamesits
Copy link
Collaborator

Jamesits commented Aug 24, 2023

@m13253 disabling the symbol table and DWARF information does not affect Go's own stack trace information. (This is partly the reason the binary is still very large.) There are other flags for not embedding the full file paths, but completely removing them requires a fork of the Go compiler.

References:

@Jamesits Jamesits merged commit d00be8b into m13253:master Aug 24, 2023
1 check passed
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.

3 participants