Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 14 Oct 2023 21:55:56 +0200
From:      Christopher Beppler <freebsd@funzi.org>
To:        ports@freebsd.org
Subject:   Re: go: errors parsing go.mod: unexpected input character '\x1f'
Message-ID:  <676041e5-aecb-450c-be8d-f0d1185d2319@funzi.org>
In-Reply-To: <7d322368-390e-40b0-98c0-b04bd52eb6bc@funzi.org>
References:  <7d322368-390e-40b0-98c0-b04bd52eb6bc@funzi.org>

next in thread | previous in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format.
--------------lvPunUO2000v0CW0nFxZQZcZ
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: quoted-printable

Am 14.10.23 um 21:39 schrieb Christopher Beppler:
> Hey there porting experts,
>
> I am in the process of migrating the sysutils/loki port to=20
> USES=3Dgo:modules instead of the quite cumbersome GH_TUPLE shenanigans.
> [...]

Some progress, the error is a different one now (Updated Makefile below):

=3D=3D=3D>=C2=A0 License AGPLv3 accepted by the user
=3D=3D=3D>=C2=A0 License AGPLv3 accepted by the user
=3D=3D=3D>=C2=A0=C2=A0 grafana-loki-2.9.1 depends on file: /usr/local/sbi=
n/pkg - found
=3D=3D=3D>=C2=A0=C2=A0 grafana-loki-2.9.1 depends on file: /usr/local/bin=
/go120 - found
=3D=3D=3D>=C2=A0=C2=A0 grafana-loki-2.9.1 depends on package: ca_root_nss=
>0 - found
=3D> v2.9.1.mod doesn't seem to exist in=20
/usr/ports/distfiles/go/sysutils_loki/loki-v2.9.1.
=3D> Attempting to fetch=20
https://proxy.golang.org/github.com/grafana/loki/@v/v2.9.1.mod
fetch: https://proxy.golang.org/github.com/grafana/loki/@v/v2.9.1.mod:=20
Not Found
=3D> Attempting to fetch=20
http://distcache.FreeBSD.org/ports-distfiles/go/sysutils_loki/loki-v2.9.1=
/v2.9.1.mod
fetch:=20
http://distcache.FreeBSD.org/ports-distfiles/go/sysutils_loki/loki-v2.9.1=
/v2.9.1.mod:=20
Not Found
=3D> Couldn't fetch it - please try to retrieve this
=3D> port manually into /usr/ports/distfiles/go/sysutils_loki/loki-v2.9.1=
=20
and try again.
*** Error code 1

If I open=20
https://proxy.golang.org/github.com/grafana/loki/@v/v2.9.1.mod, I can see

not found:github.com/grafana/loki@v2.9.1: invalid version: module contain=
s a go.mod file, so module path must match major version ("github.com/gra=
fana/loki/v2")

Is this a bug (similar to https://github.com/golang/go/issues/35732) in=20
go or am I missing something?

>
> This is the (reduced) Makefile I am using that reproduces the issue:
> [...]

Correcting this to:

PORTNAME=3D=C2=A0=C2=A0=C2=A0 loki
DISTVERSIONPREFIX=3D=C2=A0=C2=A0=C2=A0 v
DISTVERSION=3D=C2=A0=C2=A0=C2=A0 2.9.1
CATEGORIES=3D=C2=A0=C2=A0=C2=A0 sysutils
PKGNAMEPREFIX=3D=C2=A0=C2=A0=C2=A0 grafana-

USES=3D=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 go:modules

USE_RC_SUBR=3D=C2=A0=C2=A0=C2=A0 loki

GO_MODULE=3D=C2=A0=C2=A0=C2=A0 github.com/grafana/loki
GO_TARGET=3D=C2=A0=C2=A0=C2=A0 ./cmd/loki ./cmd/loki-canary ./cmd/logcli=20
./clients/cmd/promtail

.include <bsd.port.mk>

Having still cpe and USES_GITHUB=3Dyes enabled was wrong.

--------------lvPunUO2000v0CW0nFxZQZcZ
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE html>
<html>
  <head>
    <meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3DUTF=
-8">
  </head>
  <body>
    Am 14.10.23 um 21:39 schrieb Christopher Beppler:<br>
    <blockquote type=3D"cite"
      cite=3D"mid:7d322368-390e-40b0-98c0-b04bd52eb6bc@funzi.org">Hey
      there porting experts,
      <br>
      <br>
      I am in the process of migrating the sysutils/loki port to
      USES=3Dgo:modules instead of the quite cumbersome GH_TUPLE
      shenanigans.
      <br>
      [...]<br>
    </blockquote>
    <p>Some progress, the error is a different one now (Updated Makefile
      below):<br>
    </p>
    <p>=3D=3D=3D&gt;=C2=A0 License AGPLv3 accepted by the user<br>
      =3D=3D=3D&gt;=C2=A0 License AGPLv3 accepted by the user<br>
      =3D=3D=3D&gt;=C2=A0=C2=A0 grafana-loki-2.9.1 depends on file: /usr/=
local/sbin/pkg
      - found<br>
      =3D=3D=3D&gt;=C2=A0=C2=A0 grafana-loki-2.9.1 depends on file: /usr/=
local/bin/go120
      - found<br>
      =3D=3D=3D&gt;=C2=A0=C2=A0 grafana-loki-2.9.1 depends on package: ca=
_root_nss&gt;0
      - found<br>
      =3D&gt; v2.9.1.mod doesn't seem to exist in
      /usr/ports/distfiles/go/sysutils_loki/loki-v2.9.1.<br>
      =3D&gt; Attempting to fetch
      <a class=3D"moz-txt-link-freetext" href=3D"https://proxy.golang.org=
/github.com/grafana/loki/@v/v2.9.1.mod">https://proxy.golang.org/github.c=
om/grafana/loki/@v/v2.9.1.mod</a><br>
      fetch:
      <a class=3D"moz-txt-link-freetext" href=3D"https://proxy.golang.org=
/github.com/grafana/loki/@v/v2.9.1.mod">https://proxy.golang.org/github.c=
om/grafana/loki/@v/v2.9.1.mod</a>:
      Not Found<br>
      =3D&gt; Attempting to fetch
<a class=3D"moz-txt-link-freetext" href=3D"http://distcache.FreeBSD.org/p=
orts-distfiles/go/sysutils_loki/loki-v2.9.1/v2.9.1.mod">http://distcache.=
FreeBSD.org/ports-distfiles/go/sysutils_loki/loki-v2.9.1/v2.9.1.mod</a><b=
r>
      fetch:
<a class=3D"moz-txt-link-freetext" href=3D"http://distcache.FreeBSD.org/p=
orts-distfiles/go/sysutils_loki/loki-v2.9.1/v2.9.1.mod">http://distcache.=
FreeBSD.org/ports-distfiles/go/sysutils_loki/loki-v2.9.1/v2.9.1.mod</a>:
      Not Found<br>
      =3D&gt; Couldn't fetch it - please try to retrieve this<br>
      =3D&gt; port manually into
      /usr/ports/distfiles/go/sysutils_loki/loki-v2.9.1 and try again.<br=
>
      *** Error code 1<br>
    </p>
    <p>If I open
      <a class=3D"moz-txt-link-freetext" href=3D"https://proxy.golang.org=
/github.com/grafana/loki/@v/v2.9.1.mod">https://proxy.golang.org/github.c=
om/grafana/loki/@v/v2.9.1.mod</a>, I
      can see <br>
    </p>
    <pre>not found: <a class=3D"moz-txt-link-abbreviated" href=3D"mailto:=
github.com/grafana/loki@v2.9.1">github.com/grafana/loki@v2.9.1</a>: inval=
id version: module contains a go.mod file, so module path must match majo=
r version ("github.com/grafana/loki/v2")</pre>
    <p></p>
    <p>Is this a bug (similar to
      <a class=3D"moz-txt-link-freetext" href=3D"https://github.com/golan=
g/go/issues/35732">https://github.com/golang/go/issues/35732</a>) in go o=
r am I missing
      something?<br>
    </p>
    <blockquote type=3D"cite"
      cite=3D"mid:7d322368-390e-40b0-98c0-b04bd52eb6bc@funzi.org">
      <br>
      This is the (reduced) Makefile I am using that reproduces the
      issue:
      <br>
      [...]<br>
    </blockquote>
    <p>Correcting this to:<br>
    </p>
    <p>PORTNAME=3D=C2=A0=C2=A0=C2=A0 loki<br>
      DISTVERSIONPREFIX=3D=C2=A0=C2=A0=C2=A0 v<br>
      DISTVERSION=3D=C2=A0=C2=A0=C2=A0 2.9.1<br>
      CATEGORIES=3D=C2=A0=C2=A0=C2=A0 sysutils<br>
      PKGNAMEPREFIX=3D=C2=A0=C2=A0=C2=A0 grafana-<br>
      <br>
      USES=3D=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 go:modules<br>
      <br>
      USE_RC_SUBR=3D=C2=A0=C2=A0=C2=A0 loki<br>
      <br>
      GO_MODULE=3D=C2=A0=C2=A0=C2=A0 github.com/grafana/loki<br>
      GO_TARGET=3D=C2=A0=C2=A0=C2=A0 ./cmd/loki ./cmd/loki-canary ./cmd/l=
ogcli
      ./clients/cmd/promtail<br>
      <br>
      .include &lt;bsd.port.mk&gt; <br>
    </p>
    <p>Having still cpe and USES_GITHUB=3Dyes enabled was wrong.</p>
  </body>
</html>

--------------lvPunUO2000v0CW0nFxZQZcZ--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?676041e5-aecb-450c-be8d-f0d1185d2319>