Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 710638

Summary: go-module.eclass: go-module_live_vendor() in live ebuild dies if repo doesn't contain a vendor/ directory
Product: Gentoo Linux Reporter: Quentin Minster <quentin>
Component: EclassesAssignee: William Hubbs <williamh>
Status: UNCONFIRMED ---    
Severity: normal CC: jstein
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Quentin Minster 2020-02-24 09:05:55 UTC
In the go-module eclass, the go-module_live_vendor() function is described like this:

    # This function is used in live ebuilds to vendor the dependencies when
    # upstream doesn't vendor them.

However, in the body of the function, there's this check:

    [[ -d "${S}"/vendor ]] || die "${FUNCNAME} only allowed when upstream isn't vendoring"

It makes the ebuild die when a vendor/ directory *doesn't exist*, which seems to contradict the "when upstream doesn't vendor them" statement from the description and the error message.

Shouldn't the check be the other way around? As in:

    [[ ! -d "${S}"/vendor ]] || die "${FUNCNAME} only allowed when upstream isn't vendoring"

For a Go tool I'm currently packaging, modifying the check as above results in the live ebuild successfully vendoring the dependencies and building the tool. With the original check, the ebuild chokes when calling go-module_live_vendor() because there *isn't* a vendor/ directory in the cloned repo.

Example ebuild: https://github.com/laomaiweng/laomaiweng-overlay/blob/master/app-crypt/age/age-9999.ebuild
Comment out line 41 that works around the seemingly backwards check.

Reproducible: Always