Bug 258359 - Mk/Uses/go.mk: fix gomod-clean target for case when lang/go is not installed
Summary: Mk/Uses/go.mk: fix gomod-clean target for case when lang/go is not installed
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Guangyuan Yang
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-09-08 04:06 UTC by ports.maintainer
Modified: 2021-11-07 01:31 UTC (History)
1 user (show)

See Also:
ygy: maintainer-feedback+


Attachments
Fix gomod-clean target for case when go is not installed (405 bytes, text/plain)
2021-09-08 04:06 UTC, ports.maintainer
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
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(+)