Bram Moolenaar | 23 Dec 2003 17:43
Picon

Re: :conf should run in $BDIR


Peter Simons wrote:

> I find myself running :conf like this
> 
>     :chdir $BDIR
>     :conf header {required} boost/spirit.hpp {language = C++}
>     :chdir -
> 
> because the compilation process will sometimes leave files
> behind, such as conftest.rpo in case of C++, and I don't
> want them to clutter up the main source. IMHO, :conf should
> do this automatically, since these tests really are platform
> dependent anyway.

Well, a configure check should not leave temp files behind in any case.
A drastic solution would be to delete all "conftest.*" files.  But that
might delete a bit too much.

Currently the directory doesn't matter, but for later checks it might
matter.  Since source files may be used in tests, changing to the $BDIR
directory doesn't seem appropriate.  The general rule is: The configure
checks should be handled just like the actual source is going to be
handled.  Thus if you always change to $BDIR when compiling a file the
configure check should do that same.

--

-- 
From "know your smileys":
 *<|:-)	Santa Claus (Ho Ho Ho)

(Continue reading)

Peter Simons | 24 Dec 2003 17:05
Picon
Gravatar

Re: :conf should run in $BDIR

Bram Moolenaar writes:

 >> :chdir $BDIR
 >> :conf header {required} boost/spirit.hpp {language = C++}
 >> :chdir -

 > Well, a configure check should not leave temp files
 > behind in any case.

I agree! 

But that will be _very_ hard to accomplish. The *.rpo files
generated by the C++ compiler are a good example. GCC will
generate them, when the '-frepo' flag is given in CXXFLAGS.
Other compilers have similar mechanisms, all of which are
triggered by different flags (and leave different file names
behind). Personally, I wouldn't even try to catch all those
cases; it's a lost cause to begin with.

Besides, leaving result files behind allows for checking
whether a test has to be (re-)run or not, so it's not
necessarily a bad idea, IMHO. It's just that those files
should be in $BDIR, not in the source directory.

Peter

-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
(Continue reading)

Bram Moolenaar | 24 Dec 2003 17:44
Picon

Re: :conf should run in $BDIR


Peter Simons wrote:

> Bram Moolenaar writes:
> 
>  >> :chdir $BDIR
>  >> :conf header {required} boost/spirit.hpp {language = C++}
>  >> :chdir -
> 
>  > Well, a configure check should not leave temp files
>  > behind in any case.
> 
> I agree! 
> 
> But that will be _very_ hard to accomplish. The *.rpo files
> generated by the C++ compiler are a good example. GCC will
> generate them, when the '-frepo' flag is given in CXXFLAGS.
> Other compilers have similar mechanisms, all of which are
> triggered by different flags (and leave different file names
> behind). Personally, I wouldn't even try to catch all those
> cases; it's a lost cause to begin with.

Doesn't this mean that compiling the actual source files also produces
these .rpo files?  Thus it's not a configure-specific problem.

> Besides, leaving result files behind allows for checking
> whether a test has to be (re-)run or not, so it's not
> necessarily a bad idea, IMHO. It's just that those files
> should be in $BDIR, not in the source directory.

(Continue reading)

Peter Simons | 24 Dec 2003 17:57
Picon
Gravatar

Re: :conf should run in $BDIR

Bram Moolenaar writes:

 > Doesn't this mean that compiling the actual source files
 > also produces these .rpo files?

Yes, that's right..

 > Since I still think that compiling for config checks
 > should be done the same way as compiling source files for
 > production, perhaps a solution would be to do all
 > compilation in $BDIR?

I would like that. I treat my source hierarchies as "read
only" anyway, because I don't want version controlled
directories to be cluttered up with generated files.

Peter

-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
Bram Moolenaar | 24 Dec 2003 18:47
Picon

Re: :conf should run in $BDIR


Peter Simons wrote:

>  > Doesn't this mean that compiling the actual source files
>  > also produces these .rpo files?
> 
> Yes, that's right..
> 
> 
>  > Since I still think that compiling for config checks
>  > should be done the same way as compiling source files for
>  > production, perhaps a solution would be to do all
>  > compilation in $BDIR?
> 
> I would like that. I treat my source hierarchies as "read
> only" anyway, because I don't want version controlled
> directories to be cluttered up with generated files.

You could redefine the action for compiling to do a ":cd $BDIR" first.
Taking care that the argument(s) get a "../" before them.  And probably
add a "-I .." argument.

I don't think building should always be done in $BDIR, because it is not
what a first-time user would expect.

If this is a generic way to build, we could add a global setting for it
and have all the build actions use it.  You can imagine that this is a
bit of work.

--

-- 
(Continue reading)


Gmane