Closes #30799:
0$ ./build/src/bitcoind -logsourcelocations -asmap=/tmp/no_file 2>&1 | head -1
12024-09-04T07:01:03Z [init/common.cpp:149] [LogPackageVersion] Bitcoin Core version v28.99.0-b94fe85fbe2f (release build)
-logsourcelocations
format
#30811
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
For detailed information about the code coverage, see the test coverage report.
See the guideline for information on the review process.
Type | Reviewers |
---|---|
ACK | maflcko |
If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.
Reviewers, this pull request conflicts with the following ones:
ccache
performance for different build directories by hebasto)If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.
465@@ -466,6 +466,11 @@ configure_file(contrib/filter-lcov.py filter-lcov.py COPYONLY)
466 # Don't allow extended (non-ASCII) symbols in identifiers. This is easier for code review.
467 try_append_cxx_flags("-fno-extended-identifiers" TARGET core_interface SKIP_LINK)
468
469+# Unify -logsourcelocations format.
This isn’t the only reason. The other is ccache, see commit 7abac98d3e3c1bc8ad66cb5c05184b9c5cc674d5. It would be good to mention this.
Ref: https://gcc.gnu.org/onlinedocs/gcc/Overall-Options.html#index-ffile-prefix-map
According to https://reproducible-builds.org/docs/build-path/ “-ffile-prefix-map=OLD=NEW is an alias for both -fdebug-prefix-map and -fmacro-prefix-map. (available since GCC 8 and Clang 10)”. Ref https://gcc.gnu.org/onlinedocs/gcc/Overall-Options.html#index-ffile-prefix-map and https://clang.llvm.org/docs/ClangCommandLineReference.html#cmdoption-clang-ffile-prefix-map
review ACK 93a0c2da34b45aaf0aab23c5f1b66cb32df06507
Upgrading my review with a logsourcelocations test on Linux (compiled and guix) binaries. I did not test macOS/Windows (compiled and guix) binaries.
However, ccache does not hit across two different build dirs, compiling the same commit.
465@@ -466,6 +466,14 @@ configure_file(contrib/filter-lcov.py filter-lcov.py COPYONLY)
466 # Don't allow extended (non-ASCII) symbols in identifiers. This is easier for code review.
467 try_append_cxx_flags("-fno-extended-identifiers" TARGET core_interface SKIP_LINK)
468
469+# Make builds location independent. This helps to:
470+# 1. Unify the -logsourcelocations format.
471+# 2. Improve ccache efficiency across different directories.
Can you explain this. How would this be tested?
I tried with cmake -B ./bld-1-cmake
and cmake -B ./bld-2-cmake
and it did not work.
-I
argument passed to the compiler contains the full path/to/the/src
directory, which means the compiler invocations differ, and ccache wont hit?
Ah, thanks for testing. I guess this is a possible cmake regression, but I haven’t ever used different dirs with autotools, so I can’t say for sure.
Seems fine to fix here, or in a follow-up, as this pull request is an improvement already and this bug already exists in current master
.
hebasto
DrahtBot
maflcko
fanquake
Labels
Build system