Bug 258359

Summary: Mk/Uses/go.mk: fix gomod-clean target for case when lang/go is not installed
Product: Ports & Packages Reporter: ports.maintainer
Component: Individual Port(s)Assignee: Guangyuan Yang <ygy>
Status: Closed FIXED    
Severity: Affects Some People CC: kbowling
Priority: --- Flags: ygy: maintainer-feedback+
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
Fix gomod-clean target for case when go is not installed none

Description ports.maintainer 2021-09-08 04:06:33 UTC
Created attachment 227753 [details]
Fix gomod-clean target for case when go is not installed

Mk/Uses/go.mk breaks cleaning targets if go is not installed:

# make distclean
===> benchmarks/hey
===>  Cleaning for hey-0.1.4_1
===>  Cleaning Go module cache
env: /usr/local/bin/go: No such file or directory
*** Error code 127

Suggested fix: wrap the "go clean -modules" command with a test that will silently fail if go is not installed.
Comment 1 ports.maintainer 2021-09-21 11:21:40 UTC
It's been two weeks, so maintainer timeout I guess.
Comment 2 Guangyuan Yang freebsd_committer freebsd_triage 2021-11-03 00:26:43 UTC
This looks good to me, will commit with modification (add informational feedback that it has been skipped).
Comment 3 commit-hook freebsd_committer freebsd_triage 2021-11-07 01:29:53 UTC
A commit in branch main references this bug:

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

commit f76516f11076cb293ce87bccfc37797d82844063
Author:     Guangyuan Yang <ygy@FreeBSD.org>
AuthorDate: 2021-11-07 01:26:02 +0000
Commit:     Guangyuan Yang <ygy@FreeBSD.org>
CommitDate: 2021-11-07 01:26:02 +0000

    Mk/Uses/go.mk: fix gomod-clean target when lang/go is not installed

    make distclean target will break when lang/go is not installed. This
    provides an informational feedback and skips the gomod-clean target if
    go executable is not available.

    PR:             258359
    MFH:            2021Q4
    Submitted by:   Rin Morningstar <ports.maintainer@evilphi.com>
    Reviewed by:    dmgk
    Differential Revision:  https://reviews.freebsd.org/D32054

 Mk/Uses/go.mk | 4 ++++
 1 file changed, 4 insertions(+)
Comment 4 commit-hook freebsd_committer freebsd_triage 2021-11-07 01:30:55 UTC
A commit in branch 2021Q4 references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=3271400a5e29ce317d8bf66d395c0a4f2a8c0874

commit 3271400a5e29ce317d8bf66d395c0a4f2a8c0874
Author:     Guangyuan Yang <ygy@FreeBSD.org>
AuthorDate: 2021-11-07 01:26:02 +0000
Commit:     Guangyuan Yang <ygy@FreeBSD.org>
CommitDate: 2021-11-07 01:29:54 +0000

    Mk/Uses/go.mk: fix gomod-clean target when lang/go is not installed

    make distclean target will break when lang/go is not installed. This
    provides an informational feedback and skips the gomod-clean target if
    go executable is not available.

    PR:             258359
    Submitted by:   Rin Morningstar <ports.maintainer@evilphi.com>
    Reviewed by:    dmgk
    Differential Revision:  https://reviews.freebsd.org/D32054

    (cherry picked from commit f76516f11076cb293ce87bccfc37797d82844063)

 Mk/Uses/go.mk | 4 ++++
 1 file changed, 4 insertions(+)