pantsbuild / binaries

A temporary home for pants static binaries and scripts
16 stars 37 forks source link

Binaries should be stripped to reduce size #2

Closed jsirois closed 5 years ago

jsirois commented 9 years ago

This looks like it saves up to 90% for these static binaries, so a significant boon on initial download:

jsirois@gill ~/dev/3rdparty/binaries (gh-pages) $ find build-support/bin -wholename "*/linux/*" -type f | xargs ls -lh
-rwxr-xr-x 1 jsirois jsirois 14M Jul 29 12:25 build-support/bin/protobuf/linux/i386/2.4.1/protoc
-rwxr-xr-x 1 jsirois jsirois 18M Jul 29 12:25 build-support/bin/protobuf/linux/x86_64/2.4.1/protoc
-rwxr-xr-x 1 jsirois jsirois 19M Jul 29 12:25 build-support/bin/ragel/linux/i386/6.9/ragel
-rwxr-xr-x 1 jsirois jsirois 26M Jul 29 12:25 build-support/bin/ragel/linux/x86_64/6.9/ragel
-rwxr-xr-x 1 jsirois jsirois 15M Jul 29 12:25 build-support/bin/thrift/linux/i386/0.5.0-finagle/thrift
-rwxr-xr-x 1 jsirois jsirois 18M Jul 29 12:25 build-support/bin/thrift/linux/i386/0.7.0/thrift
-rwxr-xr-x 1 jsirois jsirois 23M Jul 29 12:25 build-support/bin/thrift/linux/i386/0.9.1/thrift
-rwxr-xr-x 1 jsirois jsirois 29M Jul 29 12:25 build-support/bin/thrift/linux/i386/0.9.2/thrift
-rwxr-xr-x 1 jsirois jsirois 20M Jul 29 12:25 build-support/bin/thrift/linux/x86_64/0.5.0-finagle/thrift
-rwxr-xr-x 1 jsirois jsirois 24M Jul 29 12:25 build-support/bin/thrift/linux/x86_64/0.7.0/thrift
-rwxr-xr-x 1 jsirois jsirois 30M Jul 29 12:25 build-support/bin/thrift/linux/x86_64/0.9.1/thrift
-rwxr-xr-x 1 jsirois jsirois 39M Jul 29 12:25 build-support/bin/thrift/linux/x86_64/0.9.2/thrift
jsirois@gill ~/dev/3rdparty/binaries (gh-pages) $ find build-support/bin -wholename "*/linux/*" -type f | xargs strip
jsirois@gill ~/dev/3rdparty/binaries (gh-pages *) $ find build-support/bin -wholename "*/linux/*" -type f | xargs ls -lh
-rwxr-xr-x 1 jsirois jsirois 2.5M Jul 29 12:26 build-support/bin/protobuf/linux/i386/2.4.1/protoc
-rwxr-xr-x 1 jsirois jsirois 2.6M Jul 29 12:26 build-support/bin/protobuf/linux/x86_64/2.4.1/protoc
-rwxr-xr-x 1 jsirois jsirois 3.1M Jul 29 12:26 build-support/bin/ragel/linux/i386/6.9/ragel
-rwxr-xr-x 1 jsirois jsirois 3.2M Jul 29 12:26 build-support/bin/ragel/linux/x86_64/6.9/ragel
-rwxr-xr-x 1 jsirois jsirois 2.8M Jul 29 12:26 build-support/bin/thrift/linux/i386/0.5.0-finagle/thrift
-rwxr-xr-x 1 jsirois jsirois 3.3M Jul 29 12:26 build-support/bin/thrift/linux/i386/0.7.0/thrift
-rwxr-xr-x 1 jsirois jsirois 3.7M Jul 29 12:26 build-support/bin/thrift/linux/i386/0.9.1/thrift
-rwxr-xr-x 1 jsirois jsirois 4.1M Jul 29 12:26 build-support/bin/thrift/linux/i386/0.9.2/thrift
-rwxr-xr-x 1 jsirois jsirois 2.9M Jul 29 12:26 build-support/bin/thrift/linux/x86_64/0.5.0-finagle/thrift
-rwxr-xr-x 1 jsirois jsirois 3.3M Jul 29 12:26 build-support/bin/thrift/linux/x86_64/0.7.0/thrift
-rwxr-xr-x 1 jsirois jsirois 3.7M Jul 29 12:26 build-support/bin/thrift/linux/x86_64/0.9.1/thrift
-rwxr-xr-x 1 jsirois jsirois 4.0M Jul 29 12:26 build-support/bin/thrift/linux/x86_64/0.9.2/thrift
jsirois commented 9 years ago

Note that this may be trickier for OSX: http://stackoverflow.com/questions/1931626/how-to-really-strip-a-binary-in-macos