Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Produce statically linked builds #473

Merged
merged 3 commits into from
Mar 16, 2023
Merged

Produce statically linked builds #473

merged 3 commits into from
Mar 16, 2023

Conversation

metachris
Copy link
Collaborator

📝 Summary

  • Added make build-static and make build-portable-static (to not change default make build behaviour, and the static builds don't work on macOS)
  • Creating statically linked binaries in Docker
  • Creating statically linked binaries in goreleaser

✅ I have run these commands

  • make lint
  • make test-race
  • go mod tidy

@codecov-commenter
Copy link

codecov-commenter commented Mar 15, 2023

Codecov Report

Merging #473 (9dfd203) into main (dbc02c6) will increase coverage by 0.23%.
The diff coverage is n/a.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

@@            Coverage Diff             @@
##             main     #473      +/-   ##
==========================================
+ Coverage   68.64%   68.88%   +0.23%     
==========================================
  Files           8        8              
  Lines        1263     1263              
==========================================
+ Hits          867      870       +3     
+ Misses        346      345       -1     
+ Partials       50       48       -2     
Flag Coverage Δ
unittests 68.88% <ø> (+0.23%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

see 1 file with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

jtraglia
jtraglia previously approved these changes Mar 16, 2023
Copy link
Collaborator

@jtraglia jtraglia left a comment

Choose a reason for hiding this comment

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

LGTM, though I needed to lookup what -tags osusergo,netgo did. This article explained things pretty well:

The makefile would benefit from de-duplication, but we can do that in another PR.

@jtraglia
Copy link
Collaborator

jtraglia commented Mar 16, 2023

@metachris decided to push some changes. If you don't like them, feel free to revert. In these changes, I explicitly define a EXTRA_ENV variable instead of just setting CGO_FLAGS directly, that way it shows up in the console output.

@metachris
Copy link
Collaborator Author

i love it, that's amazing, thanks!

@metachris metachris requested a review from jtraglia March 16, 2023 18:22
Copy link
Collaborator

@jtraglia jtraglia left a comment

Choose a reason for hiding this comment

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

LGTM 🥇

@metachris metachris merged commit 49b4aaa into main Mar 16, 2023
@metachris metachris deleted the make-static branch March 16, 2023 19:31
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