On Monday, September 9, 2019 2:46:16 PM PDT William Hubbs wrote: > On Tue, Sep 10, 2019 at 08:35:17AM +1200, Kent Fredric wrote: > > On Mon, 9 Sep 2019 12:34:18 -0500 > > > > William Hubbs wrote: > > > There is another option I want to try which is adding "go mod vendor" to > > > src_unpack for go packages. > > > > Is it infeasible to write a tool that you execute as a maintainer, that > > simulates what "go mod vendor" would do, but instead emits a list of > > entries for SRC_URI, and then have an eclass or something construct the > > vendor dir from those? > > > > That's what is available for rust stuff. > > I'm not sure how feasible something like that is. > > $ go list -m all > > will list the dependencies of a module, but that doesn't look like it > can be translated into src_uri format. > > You would basically have to parse go.mod exactly the way upstream does > it and come up with a way to download the correct versions of the > source. > > William check mail-client/aerc ebuild. I use "go list -m all" and manually format EGO_VENDOR string which will be translated into SRC_URI by eclass. tool is certainly possible and should be quite easy to implement. some manual editing will still be needed if dealing with forked packages/ repos, but looks pretty straightforward. This is very similar approach to cargo ebuilds and it supports offline installs, PM checksumming and does not require packaging every single go dependency as a package.