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]
Other format: [Raw text]

Re: PATCH: testsuite/25741: Gcc testsuite isn't parallel build


This breaks the ability to run "make check" when building out-of-tree
using a relative path to the source directory. I typically do:

svn co ... gcc
mkdir gcc-build
cd gcc-build
../gcc/configure ... options ...
make
make -k check

Now this yields (in the gcc/ subdirectory)
[ssen@repl]$ make check-gcc
test -d testsuite || mkdir testsuite
test -d testsuite/gcc || mkdir testsuite/gcc
(rootme=`${PWDCMD-pwd}`; export rootme; \
srcdir=`cd ../../gcc/gcc; ${PWDCMD-pwd}` ; export srcdir ; \
cd testsuite/gcc; \
rm -f tmp-site.exp; \
sed '/set tmpdir/ s|testsuite|testsuite/gcc|' \
        < ../../site.exp > tmp-site.exp; \
/bin/sh ../../gcc/gcc/../move-if-change tmp-site.exp site.exp; \
EXPECT=`if [ -f ${rootme}/../expect/expect ] ; then echo
${rootme}/../expect/expect ; else echo expect ; fi` ; export EXPECT ;
\
if [ -f ${rootme}/../expect/expect ] ; then  \
   TCL_LIBRARY=`cd .. ; cd ../../gcc/gcc/../tcl/library ; ${PWDCMD-pwd}` ; \
    export TCL_LIBRARY ; fi ; \
`if [ -f ${srcdir}/../dejagnu/runtest ] ; then echo
${srcdir}/../dejagnu/runtest ; else echo runtest; fi` --tool gcc )
../../gcc/gcc/../move-if-change: ../../gcc/gcc/../move-if-change: No
such file or directory
WARNING: Couldn't find the global config file.
WARNING: Couldn't find tool init file
Test Run By ssen on Tue Jan 17 09:10:30 2006
Native configuration is i686-apple-darwin8.4.1

                === gcc tests ===

Schedule of variations:
    unix

Running target unix
Using /opt/dejagnu/share/dejagnu/baseboards/unix.exp as board
description file for target.
Using /opt/dejagnu/share/dejagnu/config/unix.exp as generic interface
file for target.
WARNING: Couldn't find tool config file for unix, using default.

                === gcc Summary ===
[ssen@repl]$

Note the "No such file or directory" errors and the runtest WARNING.
The problem appears to be that now that the test suite cd's into a
subdirectory, it's not accounting for the extra directory when trying
to find the source using "srcdir" substituted in the Makefile by
configure.

I suppose this can be fixed by either checking for whether "srcdir" is
absolute and prepending "../" if not, or just using "abs_srcdir" to
begin with. I chose the second approach.

Tested on i386-apple-darwin8.4.1 by doing a c,objc bootstrap, followed
by "make -j2 -k check-gcc" at the top-level, and seeing the test suite
be run for both languages in parallel (the fact that they ran even in
serial indicates my issue is addressed)

Shantonu

2006-01-17  Shantonu Sen  <ssen@opendarwin.org>

        * Makefile.in (check-%, check-consistency): Use ${abs_srcdir},
        since a relative path to ${srcdir} is not valid after changing to
        the lang-specific testsuite directory

Index: gcc/Makefile.in
===================================================================
--- gcc/Makefile.in     (revision 109828)
+++ gcc/Makefile.in     (working copy)
@@ -4003,25 +4003,25 @@
        test -d $(TESTSUITEDIR) || mkdir $(TESTSUITEDIR)
        test -d $(TESTSUITEDIR)/$* || mkdir $(TESTSUITEDIR)/$*
        -(rootme=`${PWD_COMMAND}`; export rootme; \
-       srcdir=`cd ${srcdir}; ${PWD_COMMAND}` ; export srcdir ; \
+       abs_srcdir=`cd ${abs_srcdir}; ${PWD_COMMAND}` ; export abs_srcdir ; \
        cd $(TESTSUITEDIR)/$*; \
        rm -f tmp-site.exp; \
        sed '/set tmpdir/ s|testsuite|$(TESTSUITEDIR)/$*|' \
                < ../../site.exp > tmp-site.exp; \
-       $(SHELL) $(srcdir)/../move-if-change tmp-site.exp site.exp; \
+       $(SHELL) $(abs_srcdir)/../move-if-change tmp-site.exp site.exp; \
        EXPECT=${EXPECT} ; export EXPECT ; \
        if [ -f $${rootme}/../expect/expect ] ; then  \
-          TCL_LIBRARY=`cd .. ; cd ${srcdir}/../tcl/library ;
${PWD_COMMAND}` ; \
+          TCL_LIBRARY=`cd .. ; cd ${abs_srcdir}/../tcl/library ;
${PWD_COMMAND}` ; \
            export TCL_LIBRARY ; fi ; \
        $(RUNTEST) --tool $* $(RUNTESTFLAGS))

 check-consistency: testsuite/site.exp
        -rootme=`${PWD_COMMAND}`; export rootme; \
-       srcdir=`cd ${srcdir}; ${PWD_COMMAND}` ; export srcdir ; \
+       abs_srcdir=`cd ${abs_srcdir}; ${PWD_COMMAND}` ; export abs_srcdir ; \
        cd testsuite; \
        EXPECT=${EXPECT} ; export EXPECT ; \
        if [ -f $${rootme}/../expect/expect ] ; then  \
-          TCL_LIBRARY=`cd .. ; cd ${srcdir}/../tcl/library ;
${PWD_COMMAND}` ; \
+          TCL_LIBRARY=`cd .. ; cd ${abs_srcdir}/../tcl/library ;
${PWD_COMMAND}` ; \
           export TCL_LIBRARY ; fi ; \
        $(RUNTEST) --tool consistency $(RUNTESTFLAGS)




On 1/16/06, Janis Johnson <janis187@us.ibm.com> wrote:
> On Mon, Jan 16, 2006 at 01:46:58PM -0800, Lu, Hongjiu wrote:
> >
> > >Subject: Re: PATCH: testsuite/25741: Gcc testsuite isn't parallel build
> > >safe
> > >Cc: gcc-patches@gcc.gnu.org
> > >Date: Mon, 16 Jan 2006 13:27:03 -0800
> > >In-Reply-To: <20060111225438.GA14482@lucon.org>
> > >User-Agent: Mutt/1.4.1i
> > >
> > >On Wed, Jan 11, 2006 at 02:54:38PM -0800, H. J. Lu wrote:
> > >> The problem is gcc testsuite uses the same tmpdir for testcases of
> > >> differrent compilers. It is very hard to avoid the same prefix being
> > >> used in different testcases for different compilers. As the result,
> > >> "make -j 4 check" may lead to testcases for different compilers with
> > >> the same prefix may override each other. This patch sets a different
> > >> tmpdir for each compiler. The result is at
> > >>
> > >> http://gcc.gnu.org/ml/gcc-testresults/2006-01/msg00551.html
> > >>
> > >> 2006-01-10  H.J. Lu  <hongjiu.lu@intel.com>
> > >>
> > >>    PR testsuite/25741
> > >>    * Makefile.in (check-%): Depend on site.exp instead of
> > >>    $(TESTSUITEDIR)/site.exp. Run "runtest" in separate language
> > >>    directories.
> > >
> > >This is OK.  I tried it with many of my own scripts that run subsets of
> > >tests in odd little ways and only needed to change one of them.
> > >
> >
> > Gcc 3.4, 4.0 and 4.1 have the same problems. I am using the same patch
> > on 4.1. I am enclosing a patch for 3.4 and a patch for 4.0 here. Are
> > they OK to apply?
>
> Apply it to trunk now and if there are no complaints, apply it to
> the branches in a couple of days.
>
> Janis
>


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