Golang dependencies and glide

Mojca Miklavec mojca at macports.org
Tue Sep 4 09:54:35 UTC 2018


On Tue, 4 Sep 2018 at 10:16, Aaron Madlon-Kay wrote:
>
> I have created a portfile for a tool written in golang:
> https://github.com/amake/macports-ports/blob/dashing/textproc/dashing/Portfile
>
> I was lazy and used glide (a golang package manager, which we have a port for) to grab the dependencies.
>
> I note that no other golang port seems to use glide; further, some ports seem to bend over backwards to handle dependencies themselves:
> https://github.com/macports/macports-ports/blob/1e2bf83ad9b3fd5677d14b16bb4ded83ecfd39da/sysutils/peco/Portfile#L60
>
> I am aware of e.g. this thread about language package managers:
> https://lists.macports.org/pipermail/macports-dev/2017-November/036851.html
>
> However I am not very knowledgeable about golang or glide. Does anyone know if glide breaks the rules?

As a general rule we try to avoid using external package managers to
install one particular package.

As an extreme example consider "npm install whatever" which will fetch
a completely different set of dependencies depending on when you call
it. We now ship "npm", so users can run "npm" themselves in a local
tree, but we probably don't package any javascript package (there
might be some exceptions every now and then). I admit that I know
absolutely nothing about go package manager, so I don't know how it
works.

But the main question boils down to: assuming that one dependency (of
dashing, let's say) gets updated tomorrow. Will the resulting binary
still be the same if you rebuild it the day after tomorrow?

Our current support for go-based software and libraries is pretty much
non-existant. The fact that everything needs to be done manually is
super suboptimal. Ideally we would have a PortGroup which could take
care of dependencies in a similar way as this is done for python or
perl port, so that supporting go packages would be easy to do, but
this requires a volunteer with sufficient knowledge (or willingness to
learn) of go packaging as well as some basic tcl. (Ruby is an example
of partially implemented support and semi-abandoned packages. Perl and
Python are supported and maintained relatively well, even though there
is still a lot of room for improvement.)

Mojca


More information about the macports-dev mailing list