Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 775779 - net-analyzer/zabbix-5.0.9-r1: USE=-agent2 pulls dev-lang/go dependency
Summary: net-analyzer/zabbix-5.0.9-r1: USE=-agent2 pulls dev-lang/go dependency
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal with 1 vote (vote)
Assignee: Miroslav Šulc
URL:
Whiteboard:
Keywords: PullRequest
Depends on:
Blocks:
 
Reported: 2021-03-13 10:35 UTC by Alix
Modified: 2021-12-12 09:47 UTC (History)
6 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alix 2021-03-13 10:35:15 UTC
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
Comment 1 Ionen Wolkens gentoo-dev 2021-03-13 10:50:43 UTC
go-module.eclass doesn't seem to have a mechanism to make it optional currently.
Comment 2 Vladimir Timofeenko 2021-03-31 15:44:36 UTC
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.
Comment 3 Jan Hudoba 2021-07-12 13:00:10 UTC
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
Comment 4 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-11-17 12:25:05 UTC
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.
Comment 5 Larry the Git Cow gentoo-dev 2021-12-12 09:47:10 UTC
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(+)