go-systemd icon indicating copy to clipboard operation
go-systemd copied to clipboard

activation: allow building without tls support

Open xnox opened this issue 1 month ago • 1 comments

When listeners.go APIs are not used by a given application, golang doesn't automatically optimize them out. Add an opt-out build tag to activation/listeners.go, such that one can build an application that uses activation files without the listeners APIs.

For applications that do not already include any "crypto/tls" this can be highly beneficial, for example runc can reduce it's total binary size by 7.6%.

runc project already uses go mod vendor, and can just delete the listeners.go file:

  • https://github.com/opencontainers/runc/pull/5056

But it would be preffered if this opt-out build-tag was available here upstream for people to use in general.

xnox avatar Dec 05 '25 21:12 xnox

Looks like something in the fedora CI tests broke, we need to look into that.

Otherwise I guess it would also be nice to add a CI test to make sure the build tag compiles correctly.

Luap99 avatar Dec 05 '25 21:12 Luap99