Hi Stuart,
----- Mail original -----
> On 2023/10/27 12:01, Laurent Cheylus wrote:
> > update for devel/gopls v0.14.0 (LSP server for Golang)
> > Changelog:
> > https://github.com/golang/tools/releases/tag/gopls%2Fv0.14.0
> >
> > - update Makefile, modules.inc, distinfo and pkg/PLIST for this
> > version
> > - add a patch to fix internal version (replace by MODGO_VERSION
> > with post-patch)
>
> Is there a way to do this without patching like most of the other
> go ports do? -X main.version doesn't work here, but maybe there's
> something else..
>
> <symphytum:/usr/ports>$ grep -R MODGO_LDFLAG `cat ~/plist.go`
As maintainer of other Go ports (sysutils/fzf or security/gosec), I known this usage of MODGO_LDFLAGS to set version in Go binary.
Unfortunately, in gopls v0.14.0, devs changed the way of defining the version, see this commit https://github.com/golang/tools/commit/c28af0abbd9a213421dca5a03f6de8c93830263a
Version is not a string that we can redefine via LDFLAGS but a function that parses internal runtime/debug.ReadBuildInfo to get version.
I did not find a better solution than to patch internal/lsp/debug/info.go to define version with MODGO_VERSION.
I opened an issue on GH to request additional details from the devs, see https://github.com/golang/go/issues/63803
Laurent
No comments:
Post a Comment