Thanks for your reminder, Tom.

Before I understand VPATH well, I always thought "outside the source tree" 
means the build tree is not under source tree.


Here because of VPATH build, which means build tree should be a subdirectory of 
source tree. according to this rule, I retry this scenario with old version of 
lcov(1.10).
tar -zxf source_dir.tar.gz
cd source_dir
mkdir build_dir && cd build_dir
../configure --enable-coverage
make
make check
make coverage-html


And "make coverage-html" works fine, no any error, or warning, output is like 
this:
/bin/lcov --gcov-tool /bin/gcov -q --no-external -c -i -d . -d 
source_dir/build_dir/../ -o lcov_base.info
/bin/lcov --gcov-tool /bin/gcov -q --no-external -c -d . -d 
source_dir/build_dir/../ -o lcov_test.info
rm -rf coverage
/bin/genhtml -q --legend -o coverage --title='PostgreSQL 13.2' --num-spaces=4 
lcov_base.info lcov_test.info
touch coverage-html-stamp


thanks
walker




------------------ Original ------------------
From:                                                                           
                                             "Tom Lane"                         
                                                           
<t...@sss.pgh.pa.us&gt;;
Date:&nbsp;Thu, Mar 4, 2021 11:21 PM
To:&nbsp;"Alvaro Herrera"<alvhe...@alvh.no-ip.org&gt;;
Cc:&nbsp;"walker"<faila...@qq.com&gt;;"pgsql-hackers"<pgsql-hackers@lists.postgresql.org&gt;;
Subject:&nbsp;Re: make coverage-html would fail within build directory separate 
from source tree



Alvaro Herrera <alvhe...@alvh.no-ip.org&gt; writes:
&gt; Hmm, my build dir is not inside the source dir -- is yours?

I recall that the gcc build instructions strongly warn against that
sort of setup.&nbsp; Maybe we should too?

Actually, our build instructions already say this specifically:

&nbsp;&nbsp;&nbsp; You can also run configure in a directory outside the source 
tree, and
&nbsp;&nbsp;&nbsp; then build there, if you want to keep the build directory 
separate
&nbsp;&nbsp;&nbsp; from the original source files. This procedure is called a 
VPATH
&nbsp;&nbsp;&nbsp; build ...

Maybe "outside the source tree" needs to be emphasized a bit more.

                        regards, tom lane

Reply via email to