Bug 224948 - Mk/Uses/go.mk: Allow ports to override make targets and include <bsd.port.pre.mk>
Summary: Mk/Uses/go.mk: Allow ports to override make targets and include <bsd.port.pre...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Ports Framework (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Ben Woods
URL:
Keywords: patch, patch-ready
Depends on:
Blocks: 224844
  Show dependency treegraph
 
Reported: 2018-01-06 07:00 UTC by Ben Woods
Modified: 2018-03-11 02:27 UTC (History)
2 users (show)

See Also:
jlaffaye: maintainer-feedback+
woodsb02: merge-quarterly-


Attachments
Patch to allow ports with USES=go to override make targets and include <bsd.port.pre.mk> (582 bytes, patch)
2018-01-06 07:00 UTC, Ben Woods
woodsb02: maintainer-approval? (jlaffaye)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ben Woods freebsd_committer 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 2018-01-06 07:01:54 UTC
Assign to go maintainer.
Comment 2 Ben Woods freebsd_committer 2018-03-04 05:32:01 UTC
Julien: ping - can I please go ahead and commit this?
Comment 3 Julien Laffaye freebsd_committer 2018-03-10 22:13:50 UTC
Please commit.
Comment 4 commit-hook freebsd_committer 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 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.