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>; Date: Thu, Mar 4, 2021 11:21 PM To: "Alvaro Herrera"<alvhe...@alvh.no-ip.org>; Cc: "walker"<faila...@qq.com>;"pgsql-hackers"<pgsql-hackers@lists.postgresql.org>; Subject: Re: make coverage-html would fail within build directory separate from source tree Alvaro Herrera <alvhe...@alvh.no-ip.org> writes: > 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. Maybe we should too? Actually, our build instructions already say this specifically: You can also run configure in a directory outside the source tree, and then build there, if you want to keep the build directory separate from the original source files. This procedure is called a VPATH build ... Maybe "outside the source tree" needs to be emphasized a bit more. regards, tom lane