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

feat: Build statically linked binaries #353

Merged
merged 2 commits into from Apr 3, 2024

Conversation

yermulnik
Copy link
Collaborator

  • Switch back to ubuntu-latest GH runners but build statically linked Go binaries instead
    • Confirmed Linux amd64 binary works on Linux Mint 19.3 Tricia (based on Ubuntu Bionic 18.04)
    • No penalty on the size of binaries as of look of it
  • While here, brush up and align GH Workflow YAML configs a bit

- Switch back to `ubuntu-latest` GH runners but build statically linked
  Go binaries instead
- While here, brush up and align GH Workflow YAML configs a bit
@yermulnik yermulnik self-assigned this Apr 2, 2024
@yermulnik yermulnik added the enhancement Refactor existing code for better performance and quality label Apr 2, 2024
@warrensbox
Copy link
Owner

I need to test this first throughly. I will try to do it tonight.

@yermulnik
Copy link
Collaborator Author

yermulnik commented Apr 2, 2024

We should be safe with this as we don't use net and the use of os/user belongs in tests only and seemingly doesn't depend on libc. Though we can force Go to use Go-native implementation of os/user calls just to stay on the safe side (which looks to be an overhead in our use case at this moment). More info: https://mt165.co.uk/blog/static-link-go/

@warrensbox
Copy link
Owner

@yermulnik are you able to Merge this and deploy it?

@yermulnik yermulnik merged commit f268ab5 into master Apr 3, 2024
2 checks passed
@yermulnik yermulnik deleted the feature/build_statically_linked_binaries branch April 3, 2024 11:54
@yermulnik
Copy link
Collaborator Author

@warrensbox No luck 😢 https://github.com/warrensbox/terraform-switcher/actions/runs/8538222695/job/23390434393
Also the version bit is still acting up 🤔
image

@MatrixCrawler MatrixCrawler linked an issue Apr 4, 2024 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Refactor existing code for better performance and quality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Static build of tfswitch unavailable?
2 participants