feat: add build flags for reduced binary size#737
feat: add build flags for reduced binary size#737rsdmike merged 11 commits intodevice-management-toolkit:mainfrom
Conversation
… into featAddBuildFlags
… into featAddBuildFlags
5d069e5 to
fb7f618
Compare
|
@rsdmike - Since there isn't a size advantage to the nosqlite flag, I question if we should include it. Found that we actually don't need CGO_ENABLED=1 in any of the build cases, which I think is what we were trying to do with that particular flag. It seems like it's adding unneeded complexity without any real advantage. Major advantage to the 'noui' flag. Thoughts? |
I agree, if it doesnt add value, lets not complicate the build. I say lets get rid of it. For history, I think the CGO requirement originally came from https://github.com/99designs/keyring which used the C Bindings for the keyring. Recently we switched to https://github.com/zalando/go-keyring which is pure go. Similar story for sqlite (used originally the CGO version then the pure go version). So now that we are pure go, we can greatly simplify the CI/CD workflow as we no longer need to coordinate the build across multiple OSes. However, we'll save that optimization I think for a different PR and just remove the nosqlite in this one. FWIW, I did see about a 3MB reduction with removing SQLite, but still not materially different to warrant the extra build complexity.
Thank you for doing this! |
b05f866 to
f4c0adb
Compare
|
🎉 This PR is included in version 1.18.0 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
* feat: add build flags for reduced binary size * feat: support the 3 build types * fix: mismatch of CGO_ENABLED flag * fix: use CGO_ENABLED=0 and scratch base for all builds * revert: remove changes regarding nosqlite tag since benefit was minimal

Build Variants
Binary Sizes (with UI assets embedded)
Key Features
Release Artifacts
Each platform (Linux, Windows, macOS) produces 3 binaries:
CI/CD Updates