Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 23 Jun 2019 16:40:48 -0500
From:      Dmitri Goutnik <dg@syrec.org>
To:        freebsd-ports@freebsd.org
Subject:   Re: How to handle go dependencies
Message-ID:  <20190623214048.GE40599@xombo.localdomain>
In-Reply-To: <d033ae4e-0d9c-183e-bd59-58117dde9460@fechner.net>
References:  <5d0e8e03.1c69fb81.5e249.9640@mx.google.com> <CAP7rwchtYTf5XPoTgk6B2drdPjzP%2B5opq-sN=kGsTJei6dT_Dg@mail.gmail.com> <20190622205205.GB40599@xombo.localdomain> <4de2a97c-8c41-74e4-cda1-4fdec9554e8f@fechner.net> <20190623095737.GA89814@urd.tobik.me> <d033ae4e-0d9c-183e-bd59-58117dde9460@fechner.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On 19-06-23 22:21:44, Matthias Fechner wrote:
> Am 23.06.2019 um 11:57 schrieb Tobias Kortkamp:
> > Please do not use it.  It is broken in many ways.  Use Dimtri's
> > devel/modules2tuple instead.  Change to WRKSRC of your port and run
> > `go mod vendor` then `modules2tuple vendor/modules.txt` and it will
> > spit out an appropriate GH_TUPLE etc.
> 
> thanks that looks fine now. I added also a target `gomod-deps` to get
> that more easily generated.
> It currently seems to only support GH and not GL, this could maybe
> improved later.
> 
> > Probably you need
> > USE_GITHUB=	nodefault
> >
> > and it should work.
> 
> seems ok, I have now the following:
> https://gitlab.fechner.net/mfechner/Gitlab/commit/e83876fb9de9c79c39ba85801ebb242a08f5412c
> 
> But now I get the error message:
> =======================<phase: check-sanity   >============================
> The
> https://gitlab.com/gitlab-org/gitaly-proto/repository/f4db5d05d437abe1154d7308ca044d3577b5ccba/archive.tar.gz?dummy=/:gitaly-proto
> MASTER_SITES line has
> a group with invalid characters, only use [a-zA-Z0-9_]
> *** Error code 1
> 
> This seems to be a bug in the ports?
> Why is a `-` an invalid character, it exists in:
> https://gitlab.com/gitlab-org/gitaly/
> 
> Is there a way out?
> 
> Gruß
> Matthias
> 

Hi Matthias,

Gitaly seems to be using gmake for build so USES=go won't work here because 
go.mk would add a "do-build" target (as port's Makefile doesn't define one 
explicitly) and it will break the build,

-USES=		gmake go go:modules
+USES=		gmake
-MAKE_ENV+=	GOPATH=${WRKSRC}

The group error is coming from this GL_TUPLE line:

gitlab-org:gitaly-proto:f4db5d05d437abe1154d7308ca044d3577b5ccba:gitaly-proto/vendor/gitlab.com/gitlab-org/gitaly-proto

"gitaly-proto" is not a valid group name (contains "-"); can be fixed by 
changing the group name to e.g. "gitaly_proto"

Upstream's Makefile is disabling Go modules support by setting 
GO111MODULES=off so "rm go.mod" can be removed from post-patch (go.mod is 
ignored with GO111MODULES=off):

 post-patch:
 	${REINPLACE_CMD} -e "s|%%PREFIX%%|${PREFIX}|" ${WRKSRC}/config.toml.example
 	${MV} ${WRKSRC}/config.toml.example ${WRKSRC}/config.toml.sample
-	${RM} ${WRKSRC}/go.mod

-- Dmitri Goutnik
dg@syrec.org



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20190623214048.GE40599>