Open JakubZukal opened 1 month ago
An interesting solution would be to use a different compiler for this, like tinygo. Unfortunately it doesn't work with MIPS arch. https://github.com/tinygo-org/tinygo/issues/1075
Tinygo also doesn't support net/http/httptrace which is used by http2/grpc
@JakubZukal can you check if the latest version has improved with UPX? we removed some dependencies that were adding 5MB in binary size since v0.27
builder# GOARCH=mipsle GOOS=linux GOMIPS=softfloat go build -ldflags="-s -w" -o collie_netbird
builder# ls -la collie_netbird
-rwxr-xr-x 1 root root 29229239 Jun 25 08:12 collie_netbird
builder# mipsel-linux-gnu-strip collie_netbird
builder# ls -la collie_netbird
-rwxr-xr-x 1 root root 29215776 Jun 25 08:17 collie_netbird
builder# upx --best collie_netbird
builder# ls -la collie_netbird
-rwxr-xr-x 1 root root 8332280 Jun 25 08:17 collie_netbird
It is 14.2% smaller than my previous attempt. Great work! I'll try some other options to minify it a bit more, as I need it to be around 7 MB. I'll let you know ASAP.
Is your feature request related to a problem? Please describe. Hi. We are using Netbird on a Collie Router (GL-X300B) and cannot upgrade from version 0.25.3 (5.8M) to 0.27.* (9.8M) due to insufficient space on overlayfs:/overlay. Unfortunately, increasing the space might not be possible for us.
Describe the solution you'd like Smaller executable.
Describe alternatives you've considered I've tried to minify the executable, but it's still not enough.
Additional context Nope.
Is there a way to further shrink the binary a little bit more?