Bug 237979

Summary: devel/ccache: make_index: Circular dependency loop found: ccache-3.7.1 depends upon itself.
Product: Ports & Packages Reporter: Trond Endrestøl <Trond.Endrestol>
Component: Individual Port(s)Assignee: Bryan Drewery <bdrewery>
Status: Closed FIXED    
Severity: Affects Some People CC: adamw, leres, r00t, tcberner, thomas-freebsd
Priority: --- Keywords: regression
Version: LatestFlags: bugzilla: maintainer-feedback? (bdrewery)
Hardware: Any   
OS: Any   
See Also: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=238045
Attachments:
Description Flags
Mark ccache dependencies NO_CCACHE
none
Fix the need for gmake
none
Fix ccache and restore tree none

Description Trond Endrestøl 2019-05-19 10:43:47 UTC
After r501985 it's impossible to get something sensible out of make index:

make_index: Circular dependency loop found: ccache-3.7.1 depends upon itself.

And ports-mgmt/synth refuse to run:

# synth status local/fsi-localbase
Scanning existing packages.
 progress: 97.25%              
local/fsi-localbase scan aborted because a circular dependency on devel/ccache was detected.
... backtrace print/indexinfo
... backtrace devel/gmake
... backtrace devel/ccache
... backtrace ports-mgmt/portmaster
... backtrace local/fsi-localbase
Comment 1 thomas-freebsd 2019-05-19 16:01:38 UTC
I have the same problem. Short term workaround is to disable ccache support in synth.

# Minimal reproduce example with Directory_ccache enabled:
[root@stairway:~]# synth force devel/ccache
devel/ccache scan aborted because a circular dependency on devel/ccache was detected.
... backtrace print/indexinfo
... backtrace devel/gmake
... backtrace devel/ccache


# Workaround:
/usr/local/etc/synth/synth.ini:
Directory_ccache= disabled


Seems to be an injected dependency, as this should have broken the loop. Unless it is a buildtime dependency that does not show up:
[root@stairway:~]# pkg info -r ccache-3.7.1
ccache-3.7.1:
[root@stairway:~]# pkg info -d ccache-3.7.1
ccache-3.7.1:


Also tried to force reinstall the dependency chain for print/indexinfo and for ccache.


Messing around with my make.conf does not seem to help:
.if ${.CURDIR:M*/devel/ccache*}
NOCCACHE=yes
WITHOUT_CCACHE_BUILD=yes
.endif
Comment 2 thomas-freebsd 2019-05-19 16:24:27 UTC
(In reply to thomas-freebsd from comment #1)

Think i found a more "proper" workaround with ccache still enabled in Synth.
/etc/make.conf disable ccache for entire ccache build dependency tree:

.if ${.CURDIR:M*/devel/ccache*} || ${.CURDIR:M*/print/indexinfo*} || ${.CURDIR:M*/devel/gmake*}
NOCCACHE=yes
WITHOUT_CCACHE_BUILD=yes
.endif


Note that I have symlinked LiveSystem-make.conf -> /etc/make.conf, and that i have other ccache customization stuff in my make.conf, YMMV.
Comment 3 Tobias C. Berner freebsd_committer freebsd_triage 2019-05-20 04:42:27 UTC
Created attachment 204475 [details]
Mark ccache dependencies NO_CCACHE

Hi 

Attached is another workaround until it is fixed properly.


mfg Tobias
Comment 4 Adam Weinberger freebsd_committer freebsd_triage 2019-05-20 14:06:56 UTC
Created attachment 204482 [details]
Fix the need for gmake

I'm attaching a patch that removes the part of the Makefile that needed gmake. It doesn't appear to me to be doing anything useful anyway. With this patch, you can remove USES=gmake.
Comment 5 Mathieu Arnold freebsd_committer freebsd_triage 2019-05-20 14:16:59 UTC
I added NO_CCACHE in ports r502103, it should be reverted once this is fixed.
Comment 6 Adam Weinberger freebsd_committer freebsd_triage 2019-05-20 14:30:11 UTC
Created attachment 204483 [details]
Fix ccache and restore tree

Thanks @mat. I'm attaching a complete patch that removes the gmake syntax from ccache, removes USES=gmake, and removes the NO_CCACHE from the ports in question.
Comment 7 Bryan Drewery freebsd_committer freebsd_triage 2019-05-20 17:06:46 UTC
Sorry about that. Thanks everyone!
Comment 8 commit-hook freebsd_committer freebsd_triage 2019-05-20 17:06:47 UTC
A commit references this bug:

Author: bdrewery
Date: Mon May 20 17:06:35 UTC 2019
New revision: 502126
URL: https://svnweb.freebsd.org/changeset/ports/502126

Log:
  Fix recursive dependency issue with gmake.

  Add a hard .error so I don't miss this again.

  PR:		237979
  Submitted by:	tcberner, adamw (based on)
  Pointyhat to:	bdrewery

Changes:
  head/devel/ccache/Makefile
  head/devel/ccache/files/extra-patch-Makefile.in
  head/devel/gettext-runtime/Makefile
  head/devel/gmake/Makefile
  head/print/indexinfo/Makefile