Disabling agent2 useflag does not remove dev-lang/go dependency. WIth nodeps the package builds fine (as expected): USE=-agent2 emerge =net-analyzer/zabbix-5.0.9-r1 --nodeps Reproducible: Always
go-module.eclass doesn't seem to have a mechanism to make it optional currently.
This pull happens because of go-module.eclass bringing in dev-lang/go through BDEPEND. As far as I understand, this is a bit of a catch-22 with the current approach of shipping everything in one ebuild: 1. To build agent2, go is required 2. To build with go, it is better to inherit a proper eclass 3. For -agent2 cases, go is not required for building However, conditional inherits based on useflags are illegal: https://devmanual.gentoo.org/general-concepts/portage-cache/index.html Using an eclass other than go-module would probably not work, since they all inherit golang-base which again adds dev-lang/go dependency I think there are the following ways to fix this: * Add mechanism for go-module.eclass to make BDEPEND optional. Not sure if this is feasible. * Pull the relevant logic from go-module.eclass into the zabbix ebuild. This IMHO adds too much complexity into the ebuild. * Split the net-analyzer/zabbix ebuild into three(?): * zabbix-agent only with agent-relevant useflags * zabbix-server only with server-relevant useflags * zabbix-agent2 only with agent2-relevant useflags The last approach is the way other distributions, e.g. Alpine, do it. This approach has the drawback of requiring a migration from the existing package.
from now all published builds require go, regardless of -agent2 :( so go is being installed on all my systems, and i dont need it. pls split packages for zabbix (zabbix-agent/agent2). tnx
I really think we should just add a GO_OPTIONAL to the go eclass and allow manual management of the deps as we do for other cases.
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4ab2af9616336aa40b8c824916e85f75d150f5d2 commit 4ab2af9616336aa40b8c824916e85f75d150f5d2 Author: Florian Schmaus <flow@gentoo.org> AuthorDate: 2021-12-12 09:24:37 +0000 Commit: Florian Schmaus <flow@gentoo.org> CommitDate: 2021-12-12 09:46:29 +0000 net-analyzer/zabbix: use GO_OPTIONAL from go-module eclass This makes dev-lang/go an optional dependency. Closes: https://bugs.gentoo.org/775779 Closes: https://github.com/gentoo/gentoo/pull/23261 Signed-off-by: Florian Schmaus <flow@gentoo.org> .../zabbix/{zabbix-5.0.18.ebuild => zabbix-5.0.18-r1.ebuild} | 12 ++++++++++++ .../zabbix/{zabbix-5.4.8.ebuild => zabbix-5.4.8-r1.ebuild} | 12 ++++++++++++ 2 files changed, 24 insertions(+)