Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bitcoin-core: Switch to "Debug" build configuration #12443

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

hebasto
Copy link
Contributor

@hebasto hebasto commented Sep 3, 2024

This PR ensures consistent usage of the "Debug" build configuration when depends are built with DEBUG=1.

For more details, please refer to this discussion.

Copy link

github-actions bot commented Sep 3, 2024

hebasto has previously contributed to projects/bitcoin-core. The previous PR was #12419

@maflcko
Copy link
Contributor

maflcko commented Sep 3, 2024

This is just a style fixup, not changing any behavior, right?

@hebasto
Copy link
Contributor Author

hebasto commented Sep 3, 2024

This is just a style fixup, not changing any behavior, right?

Hmm. Not exactly:

--- configure_before	2024-09-03 14:24:39.109943431 +0100
+++ configure_after	2024-09-03 14:36:16.687324185 +0100
@@ -31,9 +31,9 @@
 
 Cross compiling ....................... FALSE
 C++ compiler .......................... Clang 18.0.0, /usr/local/bin/clang++
-CMAKE_BUILD_TYPE ...................... RelWithDebInfo
-Preprocessor defined macros ........... ABORT_ON_FAILED_ASSUME _LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_DEBUG BOOST_MULTI_INDEX_ENABLE_SAFE_MODE
-C++ compiler flags .................... -O1 -fno-omit-frame-pointer -gline-tables-only -Wno-error=enum-constexpr-conversion -Wno-error=incompatible-function-pointer-types -Wno-error=int-conversion -Wno-error=deprecated-declarations -Wno-error=implicit-function-declaration -Wno-error=implicit-int -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION -fsanitize=address -fsanitize-address-use-after-scope -fsanitize=fuzzer-no-link -stdlib=libc++ -std=c++20 -fPIC -Wall -Wextra -Wgnu -Wformat -Wformat-security -Wvla -Wshadow-field -Wthread-safety -Wloop-analysis -Wredundant-decls -Wunused-member-function -Wdate-time -Wconditional-uninitialized -Woverloaded-virtual -Wsuggest-override -Wimplicit-fallthrough -Wunreachable-code -Wdocumentation -Wself-assign -Wundef -Wno-unused-parameter -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 -Wstack-protector -fstack-protector-all -fcf-protection=full -fstack-clash-protection
+CMAKE_BUILD_TYPE ...................... Debug
+Preprocessor defined macros ........... ABORT_ON_FAILED_ASSUME _LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_DEBUG BOOST_MULTI_INDEX_ENABLE_SAFE_MODE DEBUG DEBUG_LOCKORDER DEBUG_LOCKCONTENTION RPC_DOC_CHECK ABORT_ON_FAILED_ASSUME
+C++ compiler flags .................... -O1 -fno-omit-frame-pointer -gline-tables-only -Wno-error=enum-constexpr-conversion -Wno-error=incompatible-function-pointer-types -Wno-error=int-conversion -Wno-error=deprecated-declarations -Wno-error=implicit-function-declaration -Wno-error=implicit-int -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION -fsanitize=address -fsanitize-address-use-after-scope -fsanitize=fuzzer-no-link -stdlib=libc++ -std=c++20 -fPIC -Wall -Wextra -Wgnu -Wformat -Wformat-security -Wvla -Wshadow-field -Wthread-safety -Wloop-analysis -Wredundant-decls -Wunused-member-function -Wdate-time -Wconditional-uninitialized -Woverloaded-virtual -Wsuggest-override -Wimplicit-fallthrough -Wunreachable-code -Wdocumentation -Wself-assign -Wundef -Wno-unused-parameter -Wstack-protector -fstack-protector-all -fcf-protection=full -fstack-clash-protection
 Linker flags .......................... -O1 -fno-omit-frame-pointer -gline-tables-only -Wno-error=enum-constexpr-conversion -Wno-error=incompatible-function-pointer-types -Wno-error=int-conversion -Wno-error=deprecated-declarations -Wno-error=implicit-function-declaration -Wno-error=implicit-int -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION -fsanitize=address -fsanitize-address-use-after-scope -fsanitize=fuzzer-no-link -stdlib=libc++ -fsanitize=fuzzer -fstack-protector-all -fcf-protection=full -fstack-clash-protection -Wl,-z,relro -Wl,-z,now -Wl,-z,separate-code -fPIE -pie
 
 NOTE: The summary above may not exactly match the final applied build flags

New preprocessor flags: -DDEBUG -DDEBUG_LOCKORDER -DDEBUG_LOCKCONTENTION -DRPC_DOC_CHECK
Skipped preprocessor flags: -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3.

@hebasto
Copy link
Contributor Author

hebasto commented Sep 3, 2024

Skipped preprocessor flags: -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3.

I don't think we want such a change.

@maflcko
Copy link
Contributor

maflcko commented Sep 3, 2024

I don't think we want such a change.

Maybe mark as Draft for now? Otherwise it will get merged in this repo, as soon as CI passes.

@fanquake
Copy link
Contributor

fanquake commented Sep 9, 2024

Could push and compare again now that bitcoin/bitcoin#30824 is merged.

This change ensures consistent usage of the "Debug" build configuration
when depends are built with `DEBUG=1`.
@hebasto
Copy link
Contributor Author

hebasto commented Sep 9, 2024

Could push and compare again now that bitcoin/bitcoin#30824 is merged.

Done. Here is the diff:

--- before	2024-09-09 14:09:36.536299760 +0100
+++ after	2024-09-09 14:10:29.821815704 +0100
@@ -1,8 +1,8 @@
 
 Cross compiling ....................... FALSE
 C++ compiler .......................... Clang 18.0.0, /usr/local/bin/clang++
-CMAKE_BUILD_TYPE ...................... RelWithDebInfo
-Preprocessor defined macros ........... ABORT_ON_FAILED_ASSUME _LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_DEBUG BOOST_MULTI_INDEX_ENABLE_SAFE_MODE
+CMAKE_BUILD_TYPE ...................... Debug
+Preprocessor defined macros ........... ABORT_ON_FAILED_ASSUME _LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_DEBUG BOOST_MULTI_INDEX_ENABLE_SAFE_MODE DEBUG DEBUG_LOCKORDER DEBUG_LOCKCONTENTION RPC_DOC_CHECK ABORT_ON_FAILED_ASSUME
 C++ compiler flags .................... -O1 -fno-omit-frame-pointer -gline-tables-only -Wno-error=enum-constexpr-conversion -Wno-error=incompatible-function-pointer-types -Wno-error=int-conversion -Wno-error=deprecated-declarations -Wno-error=implicit-function-declaration -Wno-error=implicit-int -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION -fsanitize=address -fsanitize-address-use-after-scope -fsanitize=fuzzer-no-link -stdlib=libc++ -std=c++20 -fPIC -Wall -Wextra -Wgnu -Wformat -Wformat-security -Wvla -Wshadow-field -Wthread-safety -Wloop-analysis -Wredundant-decls -Wunused-member-function -Wdate-time -Wconditional-uninitialized -Woverloaded-virtual -Wsuggest-override -Wimplicit-fallthrough -Wunreachable-code -Wdocumentation -Wself-assign -Wundef -Wno-unused-parameter -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 -Wstack-protector -fstack-protector-all -fcf-protection=full -fstack-clash-protection
 Linker flags .......................... -O1 -fno-omit-frame-pointer -gline-tables-only -Wno-error=enum-constexpr-conversion -Wno-error=incompatible-function-pointer-types -Wno-error=int-conversion -Wno-error=deprecated-declarations -Wno-error=implicit-function-declaration -Wno-error=implicit-int -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION -fsanitize=address -fsanitize-address-use-after-scope -fsanitize=fuzzer-no-link -stdlib=libc++ -fsanitize=fuzzer -fstack-protector-all -fcf-protection=full -fstack-clash-protection -Wl,-z,relro -Wl,-z,now -Wl,-z,separate-code -fPIE -pie
 

@DonggeLiu
Copy link
Contributor

Is this ready for review? Thanks : )

@maflcko
Copy link
Contributor

maflcko commented Oct 1, 2024

Adding DEBUG DEBUG_LOCKORDER DEBUG_LOCKCONTENTION RPC_DOC_CHECK seems fine. In theory RPC_DOC_CHECK could be enabled for fuzzing either way.

lgtm

cc @hebasto @fanquake please close or approve

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants