m13253 / dns-over-https

High performance DNS over HTTPS client & server
https://developers.google.com/speed/public-dns/docs/dns-over-https
MIT License
1.96k stars 221 forks source link

Add ldflags #152

Closed Gontier-Julien closed 1 year ago

Gontier-Julien commented 1 year ago

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

Information on what those two ldflags does:

-s    disable symbol table
-w    disable DWARF generation
m13253 commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

@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: