From owner-freebsd-ports@freebsd.org Sat Jun 22 20:31:42 2019 Return-Path: Delivered-To: freebsd-ports@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BC51015B809A for ; Sat, 22 Jun 2019 20:31:42 +0000 (UTC) (envelope-from adamw@adamw.org) Received: from mail-wr1-x444.google.com (mail-wr1-x444.google.com [IPv6:2a00:1450:4864:20::444]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AF9C48B51D for ; Sat, 22 Jun 2019 20:31:41 +0000 (UTC) (envelope-from adamw@adamw.org) Received: by mail-wr1-x444.google.com with SMTP id m3so9820376wrv.2 for ; Sat, 22 Jun 2019 13:31:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adamw-org.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=pQ/ZGG69clHFINn5FZKr57W9bgIafhUL+1dBQW64l3o=; b=NY6UG3N6pn4bvRwJ+FdUT4x+2M41zve850bQvCRevX7KSnWu5kpicYDgtDDGMta+1u 5s+q83z9OjsKyEBaQ0bpwq0AOtT1pYmAXXnrcPdvMH8f+ycwn0OCP/FyD9MWWeR1dc8l D0RWwQjxSl8hHPNREUDI419O9uOsenmDOeHhkDeM0jp3Uk9v/obcpjr/4EEADFr7tVvr DOJtEDx7Xeb6lNJdEJVWEkQHT7HaMcnlLScXfMOfsBTiBSoyCioWbVP3gxx+RNC087x5 oagwSj+vu2BwpWRxWyj7cBgy54PQHNP5s5d6Enkq1twyZ2KKJh5cVRSOc0D7ADcp9jPU OrFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=pQ/ZGG69clHFINn5FZKr57W9bgIafhUL+1dBQW64l3o=; b=CJXlXJrK4fods3RIEQ1/mBoL7jXrk/anuSpPt2tcN1WYJUFMaRmLc2n01it6aq/vmX d4ETC+0ZS1i2zFO8r3o57r5cscpRK6C1XYCE5YCfx3LJ1wlOz/WnJ2vYf0NLO0XUqNXM EQx3hBm75OThBRMp7nzFBN0e/3npc2+9f3874f5ddPVE5bMZ4jcqYUACbVPxjmeO6lh3 G6JRcAkHVnkL5AZkK81rM1ZZ1Cv9MMFhy6d5z51iewCYisGBwoLD1babLHCNyUWsOQOH 4vakU+CisY2WY32+vr+t0eC6hA4VhzEYMeoecgnDQ/TwXk4Ppm6aQl6XQY8bf4kGAWXF r5Rw== X-Gm-Message-State: APjAAAUSq4UKwq16gPAsRl7MsWSOC7YaF+doWFxB/QccSNOfzWzBUA5E m94Vo2wycJCF3c7wMN6W/HSDm4CWJst2rnIcqbTxPw== X-Google-Smtp-Source: APXvYqxhPMEFXyh69tzLzalhrgqpqbPkr2GeFRLTH00Tj9ABsuTFznWup+MYmheT0qK6VsBuqJeFtceAfIB/U61Gk30= X-Received: by 2002:adf:f948:: with SMTP id q8mr3271843wrr.196.1561235500513; Sat, 22 Jun 2019 13:31:40 -0700 (PDT) MIME-Version: 1.0 References: <5d0e8e03.1c69fb81.5e249.9640@mx.google.com> In-Reply-To: <5d0e8e03.1c69fb81.5e249.9640@mx.google.com> From: Adam Weinberger Date: Sat, 22 Jun 2019 14:31:24 -0600 Message-ID: Subject: Re: How to handle go dependencies To: Bernhard Froehlich Cc: "Danilo G. Baio" , FreeBSD Ports , Matthias Fechner Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: AF9C48B51D X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=adamw-org.20150623.gappssmtp.com header.s=20150623 header.b=NY6UG3N6; spf=pass (mx1.freebsd.org: domain of adamw@adamw.org designates 2a00:1450:4864:20::444 as permitted sender) smtp.mailfrom=adamw@adamw.org X-Spamd-Result: default: False [-3.83 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; R_DKIM_ALLOW(-0.20)[adamw-org.20150623.gappssmtp.com:s=20150623]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-ports@freebsd.org]; DMARC_NA(0.00)[adamw.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[adamw-org.20150623.gappssmtp.com:+]; MX_GOOD(-0.01)[cached: alt1.aspmx.l.google.com]; RCVD_IN_DNSWL_NONE(0.00)[4.4.4.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.5.4.1.0.0.a.2.list.dnswl.org : 127.0.5.0]; NEURAL_HAM_SHORT(-0.82)[-0.819,0]; IP_SCORE(-0.50)[ip: (2.41), ipnet: 2a00:1450::/32(-2.54), asn: 15169(-2.33), country: US(-0.06)]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Jun 2019 20:31:43 -0000 On Sat, Jun 22, 2019 at 2:22 PM Bernhard Froehlich wrot= e: > > > Am 22.06.2019 19:47 schrieb Adam Weinberger : > > > > On Sat, Jun 22, 2019 at 11:10 AM Bernhard Froehlich = wrote: > > > > > > > > > Am 22.06.2019 17:56 schrieb Adam Weinberger : > > > > > > > > On Sat, Jun 22, 2019 at 8:21 AM Danilo G. Baio = wrote: > > > > > > > > > > On Sat, Jun 22, 2019 at 11:58:49AM +0200, Matthias Fechner wrote: > > > > > > Dear all, > > > > > > > > > > > > I just prepare the gitlab-ce upgrade to version 12.0.0. > > > > > > But I have some problem with a package that uses go to compile. > > > > > > > > > > > > The new version of devel/gitaly has changed the way the package= is defined. > > > > > > They removed now all files from the vendor/ folder and add depe= ndencies > > > > > > in a `go.mod` file. > > > > > > > > > > > > If I now build the port it tries to fetch the files while no ne= twork > > > > > > access is allowed. > > > > > > > > > > > > What is the correct way to getting these dependencies fetched a= nd > > > > > > correctly included into the work-source in the fetch step using= go? > > > > > > > > > > > > Thanks a lot! > > > > > > > > > > > > Gru=C3=9F > > > > > > Matthias > > > > > > > > > > > > > > > > Try this and remove the go.mod file > > > > > > > > > > ports-mgmt/modules2tuple > > > > > https://github.com/dmgk/modules2tuple > > > > > > > > > > Examples: > > > > > net/geoipupdate > > > > > shells/antibody > > > > > > > > Just a note here, both those ports are mine, and I have no idea if > > > > that's the right thing to do; it built right so I did it. I don't > > > > understand Go packaging at all, and I'd sure appreciate someone wit= h > > > > Go knowledge verifying whether removing go.mod is the proper thing = to > > > > do. > > > > > > The correct magic that you are searching is: > > > > > > MAKE_ENV+=3D GOFLAGS=3D-mod=3Dvendor > > > > > > (like it is used in mail/smtprelay) > > > > With that I still get: > > > > $GOPATH/go.mod exists but should not > > *** Error code 1 > > > > Stop. > > > > Which port is that? I had a look at shells/antibody which you mentioned a= nd came up with that: > > --- /home/decke/dev/ports/shells/antibody/Makefile 2019-06-12 18:57:= 58.189631000 +0000 > +++ /home/decke/dev/myports/shells/antibody/Makefile 2019-06-22 20:13:= 05.627718000 +0000 > @@ -21,23 +21,18 @@ > > USE_GITHUB=3D yes > GH_ACCOUNT=3D getantibody > -GH_SUBDIR=3D src/github.com/${GH_ACCOUNT_DEFAULT}/${PORTNAME} > # Not needed: go-spew, go-difflib > -GH_TUPLE=3D alecthomas:kingpin:a39589:kingpin/src/github.com/alecth= omas/kingpin \ > - alecthomas:template:a0175e:tempalte/src/github.com/alecth= omas/template \ > - alecthomas:units:2efee8:units/src/github.com/alecthomas/u= nits \ > - caarlos0:gohome:75f08ebc:gohome/src/github.com/caarlos0/g= ohome \ > - getantibody:folder:v1.0.0:folder/src/github.com/getantibo= dy/folder \ > - golang:crypto:1a580b:crypto/src/golang.org/x/crypto \ > - golang:net:2491c5:net/src/golang.org/x/net \ > - golang:sync:1d60e4:sync/src/golang.org/x/sync \ > - golang:sys:7c87d1:sys/src/golang.org/x/sys > +GH_TUPLE=3D alecthomas:kingpin:a39589:kingpin/vendor/github.com/ale= cthomas/kingpin \ > + alecthomas:template:a0175e:template/vendor/github.com/ale= cthomas/template \ > + alecthomas:units:2efee8:units/vendor/github.com/alecthoma= s/units \ > + caarlos0:gohome:75f08ebc:gohome/vendor/github.com/caarlos= 0/gohome \ > + getantibody:folder:v1.0.0:folder/vendor/github.com/getant= ibody/folder \ > + golang:crypto:1a580b:crypto/vendor/golang.org/x/crypto \ > + golang:net:2491c5:net/vendor/golang.org/x/net \ > + golang:sync:1d60e4:sync/vendor/golang.org/x/sync \ > + golang:sys:7c87d1:sys/vendor/golang.org/x/sys > > -do-build: > - ${RM} ${WRKSRC}/go.mod > - cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${BUILD_ENV} GOPATH=3D${WRK= SRC} go build > - > -do-install: > - ${INSTALL_PROGRAM} ${WRKSRC}/antibody-${PORTVERSION} ${STAGEDIR}$= {PREFIX}/bin/antibody > +GO_PKGNAME=3D github.com/getantibody/antibody > +MAKE_ENV+=3D GOFLAGS=3D-mod=3Dvendor > > .include > > It looks much more complicated than it is. In GH_TUPLE replace src with v= endor to have the dependencies in the path where go will look for. Add GOFL= AGS=3D-mod=3Dvendor to force go to use the sources it finds there and ignor= e go.mod/go.sum And last but not least set GO_PKGNAME and let our Uses/go.m= k do the magic. Wow, I had no idea about any of this! Please, can you add a Wiki page for how to do Go ports? Or send some text (even in plain text format) to the doc team and they can format it for the PHB. # Adam --=20 Adam Weinberger adamw@adamw.org https://www.adamw.org