Bug 243432

Summary: ports-mgmt/portmaster: always recompiles binutils even if already up-to-date
Product: Ports & Packages Reporter: Martin Birgmeier <d8zNeCFG>
Component: Individual Port(s)Assignee: Stefan Esser <se>
Status: Closed FIXED    
Severity: Affects Only Me CC: w.schwarzenfeld
Priority: --- Flags: bugzilla: maintainer-feedback? (se)
Version: Latest   
Hardware: Any   
OS: Any   
See Also: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=241227
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=227347
Attachments:
Description Flags
patch-portmaster-flavors none

Description Martin Birgmeier 2020-01-18 16:41:25 UTC
Scenario:
- Building ports using portmaster

Result:
- If there is a dependency on binutils, the latter always gets rebuilt even if it is up to date.
- The same seems to be the case for py-sphinx and possibly other ports (maybe gperf)

Expected result:
- portmaster should not rebuild a port if it is up-to-date

Maybe this is the case because the BUILD_DEPENDS+= line in ports/Mk/... includes the full path to the desired executable (i.e., "${LOCALBASE}/...")?

-- Martin
Comment 1 Walter Schwarzenfeld freebsd_triage 2020-01-19 06:24:21 UTC
Created attachment 210855 [details]
patch-portmaster-flavors

Please, try this patch. (Only tested quick with a few ports - binutils, gcc9, cmake).
Comment 2 Martin Birgmeier 2020-01-19 08:55:58 UTC
Just trying this now, first with the unpatched and now with the patched version of portmaster, and it seems to work - the unpatched version again tried to recompile binutils, the patched version does not.

So thanks!

-- Martin
Comment 3 commit-hook freebsd_committer 2020-01-21 21:06:03 UTC
A commit references this bug:

Author: se
Date: Tue Jan 21 21:05:20 UTC 2020
New revision: 523745
URL: https://svnweb.freebsd.org/changeset/ports/523745

Log:
  Attempt to fix a problem that leads to repeated building of some ports

  There are build dependencies, that were compiled again and again even
  though the latest version was already installed.

  This fix is based on a patch suggested by Tatsuki Makino, with a small
  change to better comply with the existing style used in this program.

  An extended patch has been provided by Walter Schwarzenfeld, but in my
  tests it did not make a difference. If further testing shows a need for
  the additional commands suggested by Walter, I'll add them (or a variation)
  in a follow-up commit.

  PR:		241227, 242086, 243432
  Submitted by:	Tatsuki Makino
  Approved by:	antoine (implicit)

Changes:
  head/ports-mgmt/portmaster/Makefile
  head/ports-mgmt/portmaster/files/patch-portmaster
Comment 4 Walter Schwarzenfeld freebsd_triage 2020-01-22 23:46:58 UTC
Seems to work after ports r523835.
Comment 5 Martin Birgmeier 2020-01-23 16:46:48 UTC
Thank you for committing the fix, it seems to work!

-- Martin