Caddy: why not decrease the size of release assets?

Created on 20 Feb 2020  路  3Comments  路  Source: caddyserver/caddy

Currently, all release assets have debug info and they are uncompressed. I think it is very necessary to decrease the size of them. Here are some ways:

  1. the original
    image your can see, the debug info of asset is not stripped, which size is 30M.

  2. strip the debug info
    image Decreased by 7M, about 23% of the original size. And it is safe to strip the debug info when build . you can use go build -ldflags="-s -w" to achieve this goal. Just add -ldflags="-s -w" to azure pipeline file.
    see also: https://golang.org/cmd/link/ to know the meaning of arguments above.

  3. compress it
    image Only 6M, about 20% of the original size.

  4. or use UPX to pack it
    image A standalone executable file only 7.2M, so fantastic!

Most helpful comment

Currently the release binaries aren't produced by the azure-pipelines.yml flow. I think Matt hand-rolls them for now while v2 is still in beta.

All 3 comments

Currently the release binaries aren't produced by the azure-pipelines.yml flow. I think Matt hand-rolls them for now while v2 is still in beta.

For the record, I think we need to keep debug info, so that panics and other stack traces contain useful information.

Edit: @Mohammed90 has pointed out to me that stripping debug symbols still preserves stack traces, so that's good.

For future reference, these are the links sources exchanged in our conversation:

https://dominik.honnef.co/posts/2016/10/go-and-strip/

https://groups.google.com/forum/#!topic/Golang-nuts/6K5Ca3GZF5k

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jgsqware picture jgsqware  路  3Comments

ericmdantas picture ericmdantas  路  3Comments

la0wei picture la0wei  路  3Comments

crvv picture crvv  路  3Comments

wayneashleyberry picture wayneashleyberry  路  3Comments