This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: [v3] testsuite_flags absolute path fix


Richard Henderson <rth@redhat.com> writes:

> On Fri, May 18, 2001 at 12:18:19AM -0700, Benjamin Kosnik wrote:
> > ! glibcpp_srcdir=`cd ${srcdir} && pwd`
> > ! glibcpp_prefixdir=`cd ${prefix} && pwd`
> 
> This is going to interact badly with amd.  This will cause references
> to go through /a/foo/path instead of /nfs/bar/path.  Which will cause
> amd to decide that the automount isn't being used and unmount it in 
> the middle of the build.
> 
> Please only canonicalize relative paths.

This is not only a problem in the v3 testsuite, but is prevalent throughout
most GNU software packages: I've recently experienced an extreme case of
this in the autoconf 2.50 testsuite which uses this `cd ${dir} && pwd`
stuff to `canonicalize' the whole PATH, which causes amd to unmount many
directories during the test and the testsuite to fail miserably ;-(

In fact the same problem exists with the compiler testsuites: trying to
bootstrap and check from a virgin tree reminded me of this problem which
causes dejagnu loosing some of it's input files and aborting early through
the test run:

Running /amnt/zacatecas/volumes/d9/gnu/src/gcc/gcc-3.0-branch-dist/gcc/testsuite/gcc.c-torture/compile/compile.exp ...
FAIL: gcc.c-torture/compile/20001226-1.c,  -O2  
FAIL: gcc.c-torture/compile/20001226-1.c,  -O3 -fomit-frame-pointer  
FAIL: gcc.c-torture/compile/20001226-1.c,  -O3 -g  
FAIL: gcc.c-torture/compile/20001226-1.c,  -Os  
ERROR: tcl error sourcing /amnt/zacatecas/volumes/d9/gnu/src/gcc/gcc-3.0-branch-dist/gcc/testsuite/gcc.c-torture/compile/compile.exp.
ERROR: couldn't open "/amnt/zacatecas/volumes/d9/gnu/src/gcc/gcc-3.0-branch-dist/gcc/testsuite/gcc.c-torture/compile/20010102-1.c": no such file or directory

I had the hack below in my tree, which avoided the whole canonicalization
in the first place, but it is certainly not appropriate for inclusion as
is, but just allowed me to get the tests to complete.

I think a proper solution should look like this:

* don't try to canonicalize absolute pathnames at all

* otherwise, give the user the ability (via environment, make variables
  during configure, configure option?) to specify an alternative pwd
  command: there are several that are amd-aware and manage to return proper
  pathnames, not containing amd's temporary mount points.  pawd (long
  distributed with amd) or (in recent amd distributions) amq -w come to
  mind, and there are almost certainly others.

Something like this could work:

dir=`case $dir in /*) echo $dir ;; *) echo \`cd $dir; ${PWDCMD:-pwd}\` ;; esac`

Thoughts, comments?

	Rainer

-- 
-----------------------------------------------------------------------------
Rainer Orth, Faculty of Technology, Bielefeld University

Email: ro@TechFak.Uni-Bielefeld.DE


Index: gcc/Makefile.in
===================================================================
RCS file: /cvs/gcc/egcs/gcc/Makefile.in,v
retrieving revision 1.602.2.22
diff -u -p -r1.602.2.22 Makefile.in
--- Makefile.in	2001/05/14 19:46:12	1.602.2.22
+++ Makefile.in	2001/05/15 19:43:45
@@ -2167,7 +2169,7 @@ fixinc.sh: $(FIXINCSRCDIR)/mkfixinc.sh $
 stmp-fixinc: fixinc.sh gsyslimits.h
 	rm -rf include; mkdir include
 	-chmod a+rx include
-	(TARGET_MACHINE=$(target); srcdir=`cd $(srcdir); pwd`; \
+	(TARGET_MACHINE=$(target); srcdir=$(srcdir); \
 	INSTALL_ASSERT_H=$(INSTALL_ASSERT_H); SHELL=$(SHELL) ;\
 	export TARGET_MACHINE srcdir INSTALL_ASSERT_H SHELL ; \
 	$(SHELL) ./fixinc.sh `pwd`/include $(SYSTEM_HEADER_DIR) $(OTHER_FIXINCLUDES_DIRS); \
@@ -2835,7 +2837,7 @@ site.exp: ./config.status Makefile
 	@echo "# Do not edit here. If you wish to override these values" >> ./tmp0
 	@echo "# add them to the last section" >> ./tmp0
 	@echo "set rootme \"`pwd`\"" >> ./tmp0
-	@echo "set srcdir \"`cd ${srcdir}; pwd`\"" >> ./tmp0
+	@echo "set srcdir $(srcdir)" >> ./tmp0
 	@echo "set host_triplet $(host_canonical)" >> ./tmp0
 	@echo "set build_triplet $(build_canonical)" >> ./tmp0
 	@echo "set target_triplet $(target)" >> ./tmp0
@@ -2899,7 +2901,7 @@ $(TESTSUITEDIR)/site.exp: site.exp
 
 check-g++: $(TESTSUITEDIR)/site.exp
 	-(rootme=`pwd`; export rootme; \
-	srcdir=`cd ${srcdir}; pwd` ; export srcdir ; \
+	srcdir=${srcdir} ; export srcdir ; \
 	cd $(TESTSUITEDIR); \
 	EXPECT=${EXPECT} ; export EXPECT ; \
 	if [ -f $${rootme}/../expect/expect ] ; then  \
@@ -2909,7 +2911,7 @@ check-g++: $(TESTSUITEDIR)/site.exp
 
 check-gcc: $(TESTSUITEDIR)/site.exp
 	-(rootme=`pwd`; export rootme; \
-	srcdir=`cd ${srcdir}; pwd` ; export srcdir ; \
+	srcdir=${srcdir} ; export srcdir ; \
 	cd $(TESTSUITEDIR); \
 	EXPECT=${EXPECT} ; export EXPECT ; \
 	if [ -f $${rootme}/../expect/expect ] ; then  \
@@ -2919,7 +2921,7 @@ check-gcc: $(TESTSUITEDIR)/site.exp
 
 check-g77: $(TESTSUITEDIR)/site.exp
 	-(rootme=`pwd`; export rootme; \
-	srcdir=`cd ${srcdir}; pwd` ; export srcdir ; \
+	srcdir=${srcdir} ; export srcdir ; \
 	cd $(TESTSUITEDIR); \
 	EXPECT=${EXPECT} ; export EXPECT ; \
 	if [ -f $${rootme}/../expect/expect ] ; then  \
@@ -2929,7 +2931,7 @@ check-g77: $(TESTSUITEDIR)/site.exp
 
 check-objc: $(TESTSUITEDIR)/site.exp
 	-(rootme=`pwd`; export rootme; \
-	srcdir=`cd ${srcdir}; pwd` ; export srcdir ; \
+	srcdir=${srcdir} ; export srcdir ; \
 	cd $(TESTSUITEDIR); \
 	EXPECT=${EXPECT} ; export EXPECT ; \
 	if [ -f $${rootme}/../expect/expect ] ; then  \


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]