Bug 224948

Summary: Mk/Uses/go.mk: Allow ports to override make targets and include <bsd.port.pre.mk>
Product: Ports & Packages Reporter: Ben Woods <woodsb02>
Component: Ports FrameworkAssignee: Ben Woods <woodsb02>
Status: Closed FIXED    
Severity: Affects Only Me CC: jlaffaye, ports-bugs
Priority: --- Keywords: patch, patch-ready
Version: LatestFlags: jlaffaye: maintainer-feedback+
woodsb02: merge-quarterly-
Hardware: Any   
OS: Any   
Bug Depends on:    
Bug Blocks: 224844    
Attachments:
Description Flags
Patch to allow ports with USES=go to override make targets and include <bsd.port.pre.mk> woodsb02: maintainer-approval? (jlaffaye)

Description Ben Woods freebsd_committer freebsd_triage 2018-01-06 07:00:27 UTC
Created attachment 189457 [details]
Patch to allow ports with USES=go to override make targets and include <bsd.port.pre.mk>

Mk/Uses/go.mk: Allow ports to override make targets and include <bsd.port.pre.mk>

Currently, if a port has USES=go.mk, .include <bsd.port.pre.mk> and overrides a make target (e.g. post-extract:), then the following warnings are produced when invoking make on the port:

make: "/usr/local/poudriere/ports/default/CATEGORY/PORT/Makefile" line XX: warning: duplicate script for target "post-extract" ignored
make: "/usr/local/poudriere/ports/default/Mk/Uses/go.mk" line 68: warning: using previous script for "post-extract" defined here

The attached patch fixes this by wrapping the definition of make targets in a separate once-only !defined wrapper which is blocked until post.mk.
This concept was copied from Mk/Uses/python.mk
Comment 1 Ben Woods freebsd_committer freebsd_triage 2018-01-06 07:01:54 UTC
Assign to go maintainer.
Comment 2 Ben Woods freebsd_committer freebsd_triage 2018-03-04 05:32:01 UTC
Julien: ping - can I please go ahead and commit this?
Comment 3 Julien Laffaye freebsd_committer freebsd_triage 2018-03-10 22:13:50 UTC
Please commit.
Comment 4 commit-hook freebsd_committer freebsd_triage 2018-03-11 02:25:14 UTC
A commit references this bug:

Author: woodsb02
Date: Sun Mar 11 02:24:26 UTC 2018
New revision: 464138
URL: https://svnweb.freebsd.org/changeset/ports/464138

Log:
  Allow USES=go ports to override make targets & include <bsd.port.pre.mk>

  Prior to this change, if a port had:
  - USES=go.mk,
  - .include <bsd.port.pre.mk>, and
  - overrode a make target (e.g. post-extract:)

  then the following warnings were produced when invoking make on the port:
    make: "/usr/local/poudriere/ports/default/CATEGORY/PORT/Makefile" line XX: warning: duplicate script for target "post-extract" ignored
    make: "/usr/local/poudriere/ports/default/Mk/Uses/go.mk" line 68: warning: using previous script for "post-extract" defined here

  This change fixes this issue by wrapping the definition of make targets
  in a separate once-only !defined wrapper which is blocked until post.mk.
  This concept was copied from Mk/Uses/python.mk.

  PR:		224948
  Submitted by:	woodsb02
  Approved by:	jlaffaye (maintainer)

Changes:
  head/Mk/Uses/go.mk
Comment 5 Ben Woods freebsd_committer freebsd_triage 2018-03-11 02:27:37 UTC
Committed - thanks!

Rather than merge this change to the 2018Q1 quarterly branch, let this sit in head for ~20 days until the new 2018Q2 is branched.