News for hackers. Stuff that matters.
Re:Self-Contained Pure-Go Web Server with Lua, MD, HTTP/2, Q... by lawl on Thursday April 04, 2019 @08:58PM (#19578656)
A big part is almost certainly the difference between dynamic and static linking.

Can you run ldd on all of these and then report the combined size for each binary+libraries?

Re:Self-Contained Pure-Go Web Server with Lua, MD, HTTP/2, Q... by marcus_holmes on Friday April 05, 2019 @12:11AM (#19579630)
As someone else commented, the huge size of Go executables is down to a design decision to include a map of functions for panic reporting. There was a whole discussion on this recently on HN.

I don't know why the grandparent was downvoted. Go binaries are not small and the claim that this is a "small" single executable is untrue.

Hopefully the Go team will give us a flag to decide for ourselves whether to optimise for executable size or initialisation time. I know I'm fed up of uploading 50Mb files over dodgy wifi+vpn connections to update my server.

(edit fix repetition of design)

Re:Self-Contained Pure-Go Web Server with Lua, MD, HTTP/2, Q... by baldomo on Friday April 05, 2019 @06:34AM (#19581245)
You can actually pass LDFLAGS to any go tool (e.g. go build[1]). The flags are specified in the linker documentation[2]

[1] https://golang.org/cmd/go/#hdr-Compile_packages_and_dependen... [2] https://golang.org/cmd/link/

Re:Self-Contained Pure-Go Web Server with Lua, MD, HTTP/2, Q... by marcus_holmes on Friday April 05, 2019 @07:25AM (#19581479)
which is useful, except as far as I'm aware it doesn't cover this case.

The original is at: https://science.raphael.poss.name/go-executable-size-visuali...

Re:Self-Contained Pure-Go Web Server with Lua, MD, HTTP/2, Q... by throwaway5d097 on Friday April 05, 2019 @12:48AM (#19579790)
That's one thing that might motivate me to set up CI/CD on a server.
Re:Self-Contained Pure-Go Web Server with Lua, MD, HTTP/2, Q... by est31 on Thursday April 04, 2019 @09:14PM (#19578737)
I don't have nginx installed (got the number from a web download of the .deb package), but running this for apache:

$ echo $((`ldd /usr/sbin/apache2 | cut -d">" -f 2 | sed "s/(.*$//;s/ //" | xargs du -L | cut -f 1 | sed "s/$/+/" | xargs echo` 0))

3200

So 3.2 MB of shared library dependencies. 1.8 MB just being the libc which is almost guaranteed to be used by a different program already.

Re:Self-Contained Pure-Go Web Server with Lua, MD, HTTP/2, Q... by koffiezet on Thursday April 11, 2019 @11:53AM (#19635897)
> 1.8 MB just being the libc which is almost guaranteed to be used by a different program already

Not if we're talking about containers :)