From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6097 invoked by alias); 20 Jan 2010 16:59:50 -0000 Received: (qmail 6072 invoked by uid 22791); 20 Jan 2010 16:59:47 -0000 X-SWARE-Spam-Status: No, hits=-2.6 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from snape.CeBiTec.Uni-Bielefeld.DE (HELO smtp-relay.CeBiTec.Uni-Bielefeld.DE) (129.70.160.84) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 20 Jan 2010 16:59:43 +0000 Received: from localhost (localhost.CeBiTec.Uni-Bielefeld.DE [127.0.0.1]) by smtp-relay.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTP id 3BA2E76C; Wed, 20 Jan 2010 17:59:41 +0100 (CET) Received: from smtp-relay.CeBiTec.Uni-Bielefeld.DE ([127.0.0.1]) by localhost (malfoy.CeBiTec.Uni-Bielefeld.DE [127.0.0.1]) (amavisd-new, port 10024) with LMTP id oE1NyeucYCfQ; Wed, 20 Jan 2010 17:59:37 +0100 (CET) Received: from manam.CeBiTec.Uni-Bielefeld.DE (manam.CeBiTec.Uni-Bielefeld.DE [129.70.161.120]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp-relay.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTPS id C224976B; Wed, 20 Jan 2010 17:59:37 +0100 (CET) Received: (from ro@localhost) by manam.CeBiTec.Uni-Bielefeld.DE (8.14.3+Sun/8.14.3/Submit) id o0KGxbLi009072; Wed, 20 Jan 2010 17:59:37 +0100 (MET) From: Rainer Orth To: java-patches@gcc.gnu.org Cc: Andrew Haley Subject: Re: PATCH: Avoid command line length limit building tools.zip (PR libgcj/38251) References: Date: Wed, 20 Jan 2010 16:59:00 -0000 In-Reply-To: (Rainer Orth's message of "Fri, 15 Jan 2010 13:47:56 +0100") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (usg-unix-v) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Mailing-List: contact java-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: java-patches-owner@gcc.gnu.org X-SW-Source: 2010-q1/txt/msg00021.txt.bz2 Rainer Orth writes: > I've finally looked into PR libgcj/38251 again where building tools.zip > in classpath/tools fails on systems with low limits on command line > lenght. I think the solution is obvious on second thought: instead of > passing all file names except those below to .svn to jar/zip explicitly, > just prune the copies of the classes and asm directories of .svn subdirs > and then archive the whole remaining hierarchy. The following patch > (only lightly tested so far) does just that. > > A few caveats, though: > > * The test for the .svn dir must check in asm (or classes), since in a > VPATH build, there will be no .svn directory otherwise. > > * find | xargs is a problem for filenames containing whitespace, but > find -print0/xargs -0 or Sun's find -exec \{\} + aren't portable. > > Ok for mainline anyway? Proper testing revealed a couple of problem, fixed by this patch which survived a full bootstrap on alpha-dec-osf4.0f and alpha-dec-osf5.1b. The ChangeLog is unchanged, but the patch itself needed some adjustments: * The [ -d asm/.svn ] && find ... construct doesn't work because if the .svn directory doesn't exist (like in a hg checkout), make aborts since the command exits with exit status 1. Thus I wrap the find in if [ -d asm/.svn ] instead. * Even so, find complaints $ find asm -type d -name .svn -exec rm -rf \{\} \; find: asm/.svn: No such file or directory Using find -depth instead cures this. * Last but not least, it occured to me that the problematic (in the case of directory names with whitespace) find | xargs construct isn't necessary at all since it is just a performance optimization to avoid creating too many processes. Since the number of .svn directories in those trees isn't that large, I think it's better to err on the side of caution and accept the possible performance penalty by using find -exec rm instead. The patch below does just that. Ok for mainline now? Tested as above, and it fixes a regression in GCC 4.4/4.5. Rainer -- ----------------------------------------------------------------------------- Rainer Orth, Center for Biotechnology, Bielefeld University 2010-01-15 Rainer Orth PR libgcj/38251 * tools/Makefile.am (dist-hook): Prune .svn directories in asm and classes copies. * tools/Makefile.in: Regenerate. Revert: 2008-11-05 Andrew Haley * tools/Makefile.am (UPDATE_TOOLS_ZIP, CREATE_TOOLS_ZIP): Exclude .svn direcories. diff -r da043a0a9cee libjava/classpath/tools/Makefile.am --- a/libjava/classpath/tools/Makefile.am Mon Jan 11 04:28:36 2010 +0000 +++ b/libjava/classpath/tools/Makefile.am Wed Jan 20 17:49:17 2010 +0100 @@ -373,6 +373,9 @@ ## BEGIN GCJ LOCAL cp -pR $(srcdir)/asm . cp -pR $(srcdir)/classes . + if [ -d asm/.svn ]; then \ + find asm classes -depth -type d -name .svn -exec rm -rf \{\} \;; \ + fi ## END GCJ LOCAL if CREATE_GJDOC ## Copy over gjdoc resource files. @@ -385,11 +388,11 @@ endif if WITH_JAR -CREATE_TOOLS_ZIP=$(JAR) cf ../$(TOOLS_ZIP) `find . -name .svn -prune -o -type f -print` -UPDATE_TOOLS_ZIP=$(JAR) uf ../$(TOOLS_ZIP) `find . -name .svn -prune -o -type f -print` +CREATE_TOOLS_ZIP=$(JAR) cf ../$(TOOLS_ZIP) . +UPDATE_TOOLS_ZIP=$(JAR) uf ../$(TOOLS_ZIP) . else -CREATE_TOOLS_ZIP=$(ZIP) -r ../$(TOOLS_ZIP) `find . -name .svn -prune -o -type f -print` -UPDATE_TOOLS_ZIP=$(ZIP) -u -r ../$(TOOLS_ZIP) `find . -name .svn -prune -o -type f -print` +CREATE_TOOLS_ZIP=$(ZIP) -r ../$(TOOLS_ZIP) . +UPDATE_TOOLS_ZIP=$(ZIP) -u -r ../$(TOOLS_ZIP) . endif ## First add classpath tools stuff.