Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 726736 - golang-base.eclass : how do I set a higher dev-lang/go version requirement in an ebuild?
Summary: golang-base.eclass : how do I set a higher dev-lang/go version requirement in...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Eclasses (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: William Hubbs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-06-02 07:09 UTC by Alexander Kurakin
Modified: 2020-06-15 11:59 UTC (History)
1 user (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 Alexander Kurakin 2020-06-02 07:09:50 UTC
Good day!

I see we have `>=1.10` as Go compiler versions for Go packages:
https://gitweb.gentoo.org/repo/gentoo.git/tree/eclass/golang-base.eclass#n26

How do I increase (I mean: increase correctly) this constraint in the .ebuild which `inherit golang-build`?
Comment 1 Jeroen Roovers (RETIRED) gentoo-dev 2020-06-02 08:23:21 UTC
You should be able to set DEPEND="... >=dev-lang/go-@version@" regardless of which eclasses the ebuild inherits.
Comment 2 Alexander Kurakin 2020-06-02 08:42:49 UTC
(In reply to Jeroen Roovers from comment #1)
> You should be able to set DEPEND="... >=dev-lang/go-@version@" regardless of
> which eclasses the ebuild inherits.

Thanks! But, will this:

    GO_DEPEND=">=dev-lang/go-1.10"
    DEPEND="${GO_DEPEND}"

override my

DEPEND="... >=dev-lang/go-@version@",

won't it?
Comment 3 William Hubbs gentoo-dev 2020-06-04 13:33:53 UTC
You should use BDEPEND in the ebuild for dev-lang/go instead of DEPEND
since go is only run during the build and isn't needed during runtime.

Also, keep in mind that if your package has go.mod and go.sum in the top
level directory, you should inherit go-module instead of the golang-*
eclasses.

Thanks,

William
Comment 4 Alexander Kurakin 2020-06-04 15:11:38 UTC
(In reply to William Hubbs from comment #3)
> You should use BDEPEND in the ebuild for dev-lang/go instead of DEPEND
> since go is only run during the build and isn't needed during runtime.

Should I use it before or after `inherit`?

And, after all, won't eclass'es
    GO_DEPEND=">=dev-lang/go-1.10"
    DEPEND="${GO_DEPEND}"
override my BDEPEND's setting?

If won't - why?

Thanks.
Comment 5 Alexander Kurakin 2020-06-14 19:44:15 UTC
Ping.
Comment 6 Joonas Niilola gentoo-dev 2020-06-15 05:34:42 UTC
eclass is sourced before ebuild, so ebuild's *DEPEND settings overrides the eclass ones.
Comment 7 Alexander Kurakin 2020-06-15 11:56:42 UTC
Thanks!
Comment 8 Alexander Kurakin 2020-06-15 11:59:02 UTC
P.S. I'm not a Gentoo or Go master but IMHO GO_DEPEND could be a (legal and documented) parameter :)