Bug 277194 - shells/elvish: Update build flags for enhancing version information.
Summary: shells/elvish: Update build flags for enhancing version information.
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Zsolt Udvari
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-02-20 15:35 UTC by Qi Xiao
Modified: 2024-08-26 18:01 UTC (History)
2 users (show)

See Also:
vendion: maintainer-feedback+


Attachments
Patch for proposed build flag change (557 bytes, patch)
2024-02-20 15:36 UTC, Qi Xiao
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Qi Xiao 2024-02-20 15:35:38 UTC
The instructions for how to enhance Elvish's version information has changed. See https://github.com/elves/elvish/blob/master/PACKAGING.md and https://pkg.go.dev/src.elv.sh@master/pkg/buildinfo for the latest instruction.

Ideally the package revision should also be set, but I'm not sure how to do that, so I'm leaving that out for now.

Elvish's Go package name has also changed to src.elv.sh from github.com/elves/elvish, but since this doesn't seem to impact the usability of the port I'm also keeping that unchanged for now. Feel free to update that too.

diff --git a/shells/elvish/Makefile b/shells/elvish/Makefile
index 5ab1f4d25033..0fbf9b722e62 100644
--- a/shells/elvish/Makefile
+++ b/shells/elvish/Makefile
@@ -27,7 +27,7 @@ GH_TUPLE=     \

 GO_PKGNAME=    github.com/${GH_ACCOUNT}/${PORTNAME}
 GO_TARGET=     ./cmd/elvish
-GO_BUILDFLAGS= -ldflags="-s -w -X src.elv.sh/pkg/buildinfo.Version=${DISTVERSIONPREFIX}${DISTVERSION} -X src.elv.sh/pkg/buildinfo.Reproducible=true" \
+GO_BUILDFLAGS= -ldflags="-s -w -X src.elv.sh/pkg/buildinfo.BuildVariant=freebsd" \
                -buildmode=pie
 GO_TESTFLAGS=  -race
 CGO_ENABLED=   0
Comment 1 Qi Xiao 2024-02-20 15:36:46 UTC
Created attachment 248643 [details]
Patch for proposed build flag change

Here's the same patch as an attachment.
Comment 2 Adam Jimerson 2024-08-26 12:25:11 UTC
Comment on attachment 248643 [details]
Patch for proposed build flag change

Looks good to me, thanks and sorry for the delay.
Comment 3 commit-hook freebsd_committer freebsd_triage 2024-08-26 17:56:59 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=3851e5c18b33b7503d89a9cb8408c59a500a97b4

commit 3851e5c18b33b7503d89a9cb8408c59a500a97b4
Author:     Qi Xiao <xiaqqaix@gmail.com>
AuthorDate: 2024-08-26 17:53:09 +0000
Commit:     Zsolt Udvari <uzsolt@FreeBSD.org>
CommitDate: 2024-08-26 17:53:09 +0000

    shells/elvish: fix enchance version information

    The instructions for how to enhance Elvish's version information has
    changed.

    While I'm here remove empty line from GH_TUPLE.

    PR:             277194
    Approved by:    Adam Jimerson <vendion@gmail.com> (maintainer)

 shells/elvish/Makefile | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
Comment 4 Zsolt Udvari freebsd_committer freebsd_triage 2024-08-26 18:01:12 UTC
Committed, thanks!