Issue 62118 - dmake complains about circular dependencies when using infered .INCLUDE targets
Summary: dmake complains about circular dependencies when using infered .INCLUDE targets
Status: CLOSED FIXED
Alias: None
Product: Build Tools
Classification: Code
Component: code (show other issues)
Version: current
Hardware: All All
: P3 Trivial (vote)
Target Milestone: ---
Assignee: hjs
QA Contact: issues@tools
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-02-16 00:46 UTC by quetschke
Modified: 2013-08-07 15:34 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments
Patch for dmake/dmake.c (1.09 KB, patch)
2006-02-16 01:35 UTC, quetschke
no flags Details | Diff
Patch for dmake/dmake.c (1.28 KB, patch)
2006-02-26 23:29 UTC, quetschke
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this issue.
Description quetschke 2006-02-16 00:46:11 UTC
This is asically issue 44902 but working on issue 61969 showed some interesting
new aspects of the issue.

The folowing makefile
- - - inc_circ.mk - - -
SHELL*:=/bin/sh 
SHELLFLAGS*:=-ce

TARGET=mytarget

%.dpcc : %.cpp
	@echo making: $@
#	@+echo $@ :  > $@
	@+echo AA=123 > $@

.INCLUDE : $(TARGET).dpcc

ALL : $(TARGET).dpcc
- - - inc_circ.mk - - -

shows the following output:

$ rm -f mytarget.dpcc ; dmake/dmake.exe -r -f inc_circ.mk
making: mytarget.dpcc
dmake:  inc_circ.mk:  line 13:  Error: -- Detected circular dependency in graph
at [mytarget.dpcc]

But if one moves the comment from line 8 to 9 the error vanishes.

Or adding an empty target rule
mytarget :
after the .INCLUDE also helps.

It's not a circular dependency, the problem is that F_VISITED and F_USED both
have the same value but are used in different contexts. Making the include
sets F_VISITED and thus creates the apparent circular dependency in the F_USED
check.

Having the included file as a target in an additional rule resets the F_USED
setting. A lot of the *.dp* rules are "self healing" as they include something
like:
	@+echo $@ : <something> >> $@
Comment 1 quetschke 2006-02-16 01:35:55 UTC
Created attachment 34202 [details]
Patch for dmake/dmake.c
Comment 2 quetschke 2006-02-26 22:48:37 UTC
Committed a testcase (misc-8) to check for this problem to dmake43p01.

Please not that the testcase from the first entry only works if you have a
mytarget.cpp or remove the "%.cpp" part from the makefile.
Comment 3 quetschke 2006-02-26 23:29:16 UTC
Created attachment 34463 [details]
Patch for dmake/dmake.c
Comment 4 quetschke 2006-02-26 23:34:51 UTC
Committed the previous patch to CWS dmake43p01. Reassigning for verification.
Comment 5 quetschke 2006-02-26 23:35:41 UTC
Committed -> FIXED

@ause: Please verify!
Comment 6 hjs 2006-06-13 18:19:30 UTC
oops... doesn't appear here as an issue of dmake43p01. 
patch is applied, sample works
Comment 7 hjs 2006-06-13 18:19:51 UTC
.