Skip to content

Conversation

JyotikaGargg
Copy link
Contributor

@JyotikaGargg JyotikaGargg commented Feb 28, 2023

As our gosqlcmd.exe binary size is too big : ~21.2 MB
I have reduced the size of go binaries .And it got significantly reduced to ~4.8 MB. 
Following are the commands that i applied :
go build -ldflags="-s -w" 
This flag strips the symbol table and DWARF symbol table from the binary, which can significantly reduce its size.(~15MB).

As we would be going to ship both the binaries , so added a Go Task to support the same.

@JyotikaGargg JyotikaGargg marked this pull request as ready for review February 28, 2023 10:56
Copy link
Collaborator

@stuartpa stuartpa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@JyotikaGargg JyotikaGargg merged commit 124f03c into main Feb 28, 2023
displayName: 'Go: build sqlcmd with debug symbols'
inputs:
command: 'build'
arguments: '-o $(Build.BinariesDirectory)/${{ parameters.BinaryName }}_debug -ldflags="-X main.version=${{ parameters.VersionTag }}"'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

e }}_debug -ldflags=

Is this binary getting signed and added to the zip/tar?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants