Issue 11604 - Parallel build fails in product/util
Summary: Parallel build fails in product/util
Status: CLOSED WONT_FIX
Alias: None
Product: Build Tools
Classification: Code
Component: code (show other issues)
Version: 644
Hardware: All All
: P3 Trivial (vote)
Target Milestone: ---
Assignee: jsc
QA Contact: issues@tools
URL:
Keywords:
Depends on:
Blocks: 9443
  Show dependency tree
 
Reported: 2003-02-18 15:46 UTC by chris
Modified: 2003-03-11 18:17 UTC (History)
1 user (show)

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


Attachments
Patch made from CVS product/util, branch cws_srx644_ooo20030223 (6.88 KB, patch)
2003-02-18 15:47 UTC, chris
no flags Details | Diff
New revision of patch, removing directory dependencies (6.84 KB, patch)
2003-02-20 14:25 UTC, chris
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this issue.
Description chris 2003-02-18 15:46:26 UTC
With much sweat, I finally managed to track down all the issues that stopped
parallel builds in product util; patch attached.

Here are the issues and how they were solved:

1. All the files in $(FILELIST) are copied into directories created in
$(DIRLIST) targets.  Therefore they must depend on the DESTDIR* or DIRLIST targets.

+$(FILELIST) : $(DIRLIST)
+$(ADDITIONALFILELIST) : $(DIRLIST)

and

-$(DESTDIREXAMPLESCPP)$/% : $(PRJ)$/examples$/cpp$/%
+$(DESTDIREXAMPLESCPP)$/% : $(PRJ)$/examples$/cpp$/% $(DESTDIREXAMPLESCPP)

-$(DESTDIREXAMPLES)$/README : $(PRJ)$/examples$/README
+$(DESTDIREXAMPLES)$/README : $(PRJ)$/examples$/README $(DESTDIREXAMPLES)

-$(DESTDIRIDL)$/% : $(IDLOUT)$/%
+$(DESTDIRIDL)$/% : $(IDLOUT)$/% $(DESTDIRIDL)

etc.

2. Now that proper dependencies are added, the targets that use $? to get the
source filename fail, so use subst instead.

-       $(MY_TEXTCOPY) $(MY_TEXTCOPY_SOURCEPRE) $? $(MY_TEXTCOPY_TARGETPRE) $@
+       $(MY_TEXTCOPY) $(MY_TEXTCOPY_SOURCEPRE) $(PRJ)$/settings$/$(@:f)
$(MY_TEXTCOPY_TARGETPRE) $@

-       $(MY_TEXTCOPY) $(MY_TEXTCOPY_SOURCEPRE) $? $(MY_TEXTCOPY_TARGETPRE) $@
+       $(MY_TEXTCOPY) $(MY_TEXTCOPY_SOURCEPRE) \
+         $(subst,$(DESTDIRIDL),$(IDLOUT) $@) $(MY_TEXTCOPY_TARGETPRE) $@
-       $(MY_TEXTCOPY) $(MY_TEXTCOPY_SOURCEPRE) $? $(MY_TEXTCOPY_TARGETPRE) $@
+       $(MY_TEXTCOPY) $(MY_TEXTCOPY_SOURCEPRE) $(subst,$(DESTDIRINC),$(INCOUT)
$@) $(MY_TEXTCOPY_TARGETPRE) $@
etc.

3. $(DESTDIREXAMPLES) is missing from DIRLIST
@@ -298,6 +298,7 @@ DIRLIST = \
        $(DESTDIRXML)       \
        $(DESTDIRINC)       \
        $(DESTDIRSETTINGS)  \
+       $(DESTDIREXAMPLES)  \

4. There are two archives built - ODK_PART*FILE and PRODUCT*FILE.  The second
archive contains the contents of the first archive plus ADDITIONALFILELIST, but
the additional files must not get built before the first archive is complete, so
added .SEQUENTIAL to the two targets:

-$(BIN)$/$(PRODUCTZIPFILE) : $(BIN)$/$(ODK_PARTZIPFILE) $(ADDITIONALFILELIST)
+$(BIN)$/$(PRODUCTZIPFILE) .SEQUENTIAL : $(BIN)$/$(ODK_PARTZIPFILE)
$(ADDITIONALFILELIST)

-$(BIN)$/$(PRODUCTTARGZFILE) : $(BIN)$/$(ODK_PARTTARGZFILE) $(ADDITIONALFILELIST)
+$(BIN)$/$(PRODUCTTARGZFILE) .SEQUENTIAL : $(BIN)$/$(ODK_PARTTARGZFILE)
$(ADDITIONALFILELIST)

5. Some minor cleanups

Removing targets from ALLTARGETS that are dependencies:

 ALLTARGETS = \
-       $(MISC)$/deltree.txt    \
-       $(DIRLIST)              \
        $(FILELIST)

Remove BUILD_SOSL test, since ADDITIONALFILELIST is built whatever happens:

-.IF "$(BUILD_SOSL)"!=""
-#for OpenOffice build additionally a complete UDK
-ALLTARGETS+= \
-       $(ADDITIONALFILELIST)
-.ENDIF

Move $(GUI)==WNT tests together:

 .IF "$(GUI)"=="WNT"
 ALLTARGETS+= \
-    $(BIN)$/$(ODK_PARTZIPFILE)
-.ELSE
-ALLTARGETS+= \
-    $(BIN)$/$(ODK_PARTTARGZFILE)
-.ENDIF
-
[..]
-
-.IF "$(GUI)"=="WNT"
-ALLTARGETS+= \
+    $(BIN)$/$(ODK_PARTZIPFILE) \
     $(BIN)$/$(PRODUCTZIPFILE)
 .ELSE
 ALLTARGETS+= \
+    $(BIN)$/$(ODK_PARTTARGZFILE) \
     $(BIN)$/$(PRODUCTTARGZFILE)
 .ENDIF

Chris
Comment 1 chris 2003-02-18 15:47:49 UTC
Created attachment 4787 [details]
Patch made from CVS product/util, branch cws_srx644_ooo20030223
Comment 2 hjs 2003-02-19 12:09:02 UTC
from what i remember, the additional dependencies in rules (%) are
simply ignored. could you check if they have any impact?
Comment 3 chris 2003-02-19 15:39:26 UTC
I don't understand what you mean.  What do you mean by 'the additional
dependencies in rules'?
Comment 4 hjs 2003-02-19 16:17:43 UTC
in lines like 

$(DESTDIREXAMPLESCPP)$/% : $(PRJ)$/examples$/cpp$/% $(DESTDIREXAMPLESCPP)

there is a one-to-one relation between the expressions containing % on
both sides. additional expressinons on the right side like those used
in regular targets are not taken into account when evaluating
dependencies.

but as i said, just from memory...



Comment 5 chris 2003-02-20 14:24:01 UTC
You're right, removing those lines did not make any difference,
because I had added a $(DESTDIRS) dependency elsewhere.

Hoever, I also discovered that the dependency on directories
themselves caused the targets to rebuild everything every time, so I
have taken that back out again, and instead added a mkdir call to each
of the targets that need a directory which does not exist.  This makes
the output on screen longer, but now the build works in parallel and
does not rebuild unless a source file is changed.
Comment 6 chris 2003-02-20 14:25:12 UTC
Created attachment 4811 [details]
New revision of patch, removing directory dependencies
Comment 7 hjs 2003-03-04 16:23:37 UTC
hjs->jsc: i have not idea if the next milestone will still need this.
please take care.
Comment 8 jsc 2003-03-06 15:24:10 UTC
this module is not longer needed (since 1.1)
Comment 9 michael.bemmer 2003-03-11 18:10:23 UTC
As mentioned on the qa dev list on March 5th I will close all resolved duplicate
issues. Please see this posting for details. First step in IssueZilla is
unfortunately to set them to verified.
Comment 10 michael.bemmer 2003-03-11 18:17:59 UTC
As mentioned on the qa dev list on March 5th I will close all resolved
<wontfix/duplicate/worksforme/invalid> issues. Please see this posting for details.