[cfe-dev] make update not updating clang svn?
George King
gwk.lists at gmail.com
Wed Dec 23 12:06:11 PST 2009
>>> 'make update' did not appear to run 'svn update' for the tools/clang
>>> directory.
> Sometime ago I tracked that problem down to svn info... But now I tried to reproduce and make update worked... Weird.
I took a look at the llvm Makefile. Here is the relevant part:
SVN = svn
SVN-UPDATE-OPTIONS =
AWK = awk
SUB-SVN-DIRS = $(AWK) '/\?\ \ \ \ \ \ / {print $$2}' \
| LC_ALL=C xargs $(SVN) info 2>/dev/null \
| $(AWK) '/Path:\ / {print $$2}'
update:
$(SVN) $(SVN-UPDATE-OPTIONS) update $(LLVM_SRC_ROOT)
@ $(SVN) status $(LLVM_SRC_ROOT) | $(SUB-SVN-DIRS) | xargs $(SVN) $(SVN-UPDATE-OPTIONS) update
My understanding of this pipeline is as follows:
run 'svn status' on llvm
for every line that matches something in awk,
run 'svn info'
pull out the path value with awk
run 'svn update' on that
When I run 'svn status' I get no output, so the rest of the chain does nothing. This explains why it works for the clang developers most of the time: any time you make a local change, then the clang directory gets picked up.
This all seems a bit complicated for the task at hand. The least confusing solution is to just list the sub repositories; how many sub repositories are there? considering that clang is mentioned explicitly in other parts of the makefile, this seems reasonable. Pasted below is a diff to Makefile.
Otherwise, I think the initial 'svn status' should be changed to something along the lines of:
find $(LLVM_SRC_ROOT) -type d -maxdepth 2 ! -regex '.*/\...*'
The regex at the end excludes hidden directories like .svn. I tried svn ls -R, and it was painfully slow. Unfortunately, find does not completely work either. The following bit yields duplicate paths, and then bombs out on the Debug/lib directory:
find . -type d -maxdepth 2 ! -regex '.*/\..*' | xargs svn info
Hope this helps,
george
Index: Makefile
===================================================================
--- Makefile (revision 92033)
+++ Makefile (working copy)
@@ -207,14 +207,10 @@
SVN = svn
SVN-UPDATE-OPTIONS =
-AWK = awk
-SUB-SVN-DIRS = $(AWK) '/\?\ \ \ \ \ \ / {print $$2}' \
- | LC_ALL=C xargs $(SVN) info 2>/dev/null \
- | $(AWK) '/Path:\ / {print $$2}'
update:
$(SVN) $(SVN-UPDATE-OPTIONS) update $(LLVM_SRC_ROOT)
- @ $(SVN) status $(LLVM_SRC_ROOT) | $(SUB-SVN-DIRS) | xargs $(SVN) $(SVN-UPDATE-OPTIONS) update
+ $(SVN) $(SVN-UPDATE-OPTIONS) update $(LLVM_SRC_ROOT)/tools/clang
happiness: update all check unittests
More information about the cfe-dev
mailing list