Skip to content

Revert "backport #25972 (ensure WARN_CXXFLAGS are populated to ensure expected --enable-werror behavior) - #6642

Closed
knst wants to merge 2 commits into
dashpay:developfrom
knst:revert-werror-6638
Closed

Revert "backport #25972 (ensure WARN_CXXFLAGS are populated to ensure expected --enable-werror behavior)#6642
knst wants to merge 2 commits into
dashpay:developfrom
knst:revert-werror-6638

Conversation

@knst

@knst knst commented Apr 23, 2025

Copy link
Copy Markdown
Collaborator

Issue being fixed or feature implemented

This reverts only commit enabled extra warnings 9e88380

develop is broken with gcc now
Alternate solution is #6639 [and it's almost ready but not yet]

What was done?

Revert breaking changes.

How Has This Been Tested?

Build succeed with gcc

Breaking Changes

N/A

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated relevant unit/integration/functional/e2e tests
  • I have made corresponding changes to the documentation
  • I have assigned this pull request to a milestone (for repository code-owners and collaborators only)

@knst knst added this to the 23 milestone Apr 23, 2025
@coderabbitai

coderabbitai Bot commented Apr 23, 2025

Copy link
Copy Markdown

Walkthrough

The changes remove the export of the NO_WERROR=1 environment variable from several continuous integration (CI) environment setup scripts, specifically targeting ARM, native (nowallet, qt5, sqlite), and Windows 64-bit configurations. No other environment variables or configuration settings in these scripts were altered. In the build configuration file (configure.ac), the logic for appending multiple compiler warning and suppression flags was modified: these flags are now only added if the user has not overridden CXXFLAGS (i.e., when CXXFLAGS_overridden is "no"). The conditional addition of -Wno-deprecated-copy remains based on the suppress_external_warnings variable. No new flags or settings were introduced, and no other exported or public entities were changed.


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 06a998b2e5af20a460b54eb9868b66ff4e671080 and 9e88380.

📒 Files selected for processing (6)
  • ci/test/00_setup_env_arm.sh (0 hunks)
  • ci/test/00_setup_env_native_nowallet.sh (0 hunks)
  • ci/test/00_setup_env_native_qt5.sh (0 hunks)
  • ci/test/00_setup_env_native_sqlite.sh (0 hunks)
  • ci/test/00_setup_env_win64.sh (0 hunks)
  • configure.ac (1 hunks)
💤 Files with no reviewable changes (5)
  • ci/test/00_setup_env_native_nowallet.sh
  • ci/test/00_setup_env_native_sqlite.sh
  • ci/test/00_setup_env_win64.sh
  • ci/test/00_setup_env_arm.sh
  • ci/test/00_setup_env_native_qt5.sh
🚧 Files skipped from review as they are similar to previous changes (1)
  • configure.ac
✨ Finishing Touches
  • 📝 Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between db5d000 and 06a998b2e5af20a460b54eb9868b66ff4e671080.

📒 Files selected for processing (13)
  • ci/dash/build_src.sh (1 hunks)
  • ci/test/00_setup_env_arm.sh (1 hunks)
  • ci/test/00_setup_env_native_fuzz.sh (1 hunks)
  • ci/test/00_setup_env_native_fuzz_with_valgrind.sh (1 hunks)
  • ci/test/00_setup_env_native_multiprocess.sh (1 hunks)
  • ci/test/00_setup_env_native_nowallet.sh (0 hunks)
  • ci/test/00_setup_env_native_qt5.sh (0 hunks)
  • ci/test/00_setup_env_native_sqlite.sh (0 hunks)
  • ci/test/00_setup_env_native_valgrind.sh (1 hunks)
  • ci/test/00_setup_env_win64.sh (1 hunks)
  • configure.ac (2 hunks)
  • doc/developer-notes.md (1 hunks)
  • src/wallet/walletdb.cpp (1 hunks)
💤 Files with no reviewable changes (3)
  • ci/test/00_setup_env_native_sqlite.sh
  • ci/test/00_setup_env_native_nowallet.sh
  • ci/test/00_setup_env_native_qt5.sh
⏰ Context from checks skipped due to timeout of 90000ms (9)
  • GitHub Check: linux64_multiprocess-build / Build source
  • GitHub Check: linux64_tsan-build / Build source
  • GitHub Check: linux64_ubsan-build / Build source
  • GitHub Check: linux64_sqlite-build / Build source
  • GitHub Check: linux64-build / Build source
  • GitHub Check: linux64_fuzz-build / Build source
  • GitHub Check: linux64_nowallet-build / Build source
  • GitHub Check: win64-build / Build source
  • GitHub Check: x86_64-apple-darwin / Build depends
🔇 Additional comments (13)
src/wallet/walletdb.cpp (1)

1163-1164: Fixed preprocessor directive structure for database backend handling

The changes properly close the #ifdef blocks for both SQLite and BDB database support, ensuring that the error handling code is outside the conditional blocks. This makes the error handling cleaner and more logical, as errors for unsupported database formats are now reported consistently regardless of the specific missing backend.

Also applies to: 1171-1172

configure.ac (4)

213-217: Reversed the default behavior for external warnings suppression

The flag has been changed from --disable-suppress-external-warnings (default: enabled) to --enable-suppress-external-warnings (default: disabled). This reverses the default behavior to not suppress warnings from external dependencies unless explicitly requested.


455-460: Added workaround for GCC return-type warning bug on MinGW-w64

This addition detects and disables the problematic -Werror=return-type warning when using GCC on MinGW-w64, which has a known issue with this warning. The fix includes a test case using assertions that would incorrectly trigger the warning.


466-494: Improved compiler warning flags handling

The code now:

  1. Only applies warning flags when CXXFLAGS are not user-overridden
  2. Tests for broken -Wsuggest-override in GCC before 9.2 and only adds it if working
  3. Only enables -Wdocumentation warnings when external warnings are suppressed

This provides more robust handling of compiler warnings across different environments.


501-503: Conditional handling of warning suppression flags

The code now only suppresses certain warnings (like -Wdeprecated-copy) when external warning suppression is not enabled. This provides more consistent control over which warnings are shown or hidden depending on the configuration.

ci/dash/build_src.sh (1)

36-36: Added external warnings suppression flag to build configuration

Added --enable-suppress-external-warnings to the default build configuration to maintain the previous behavior of suppressing warnings from external dependencies. This aligns with the changes in configure.ac where the default was reversed to require explicit opt-in.

doc/developer-notes.md (2)

217-217: Updated clang-tidy configuration command with external warnings suppression

Added the --enable-suppress-external-warnings flag to the configure command in the documentation for running clang-tidy, aligning with the changes made to the build system.


221-223: Added explanation for external warnings suppression options

Added documentation explaining how the --enable-suppress-external-warnings and --config src/.bear-tidy-config options help denoise clang-tidy output by suppressing warnings from external dependencies, with a note that these can be omitted to see all warnings.

ci/test/00_setup_env_native_fuzz_with_valgrind.sh (1)

17-17: Approve addition of --enable-suppress-external-warnings
Adding --enable-suppress-external-warnings to BITCOIN_CONFIG here ensures that external dependency warnings are opt‑in suppressed, matching the other native fuzz environments.

ci/test/00_setup_env_native_valgrind.sh (1)

14-14: Approve suppress‑external‑warnings flag for Valgrind
The new --enable-suppress-external-warnings flag is correctly appended alongside existing options.

ci/test/00_setup_env_native_fuzz.sh (1)

13-13: Approve new CXXFLAGS for fuzz environment
Defining CXXFLAGS="-Werror -Wno-unused-command-line-argument -Wno-unused-value -Wno-deprecated-builtins -Wno-deprecated-volatile" correctly configures Clang to treat warnings as errors while suppressing known benign warnings.

ci/test/00_setup_env_arm.sh (1)

28-28: Approve addition of --enable-suppress-external-warnings for ARM
Including the new flag alongside --enable-reduce-exports ensures external warnings are opt‑in suppressed in the ARM cross‑build environment.

ci/test/00_setup_env_win64.sh (1)

16-16: Simplifying BITCOIN_CONFIG by removing manual warning suppressions

The custom CXXFLAGS warnings flags and the NO_WERROR export have been stripped out here, aligning with the revert’s goal to restore a working GCC build. Please verify that:

  1. All other ci/test/00_setup_env_*.sh scripts have been updated to use the same trimmed-down BITCOIN_CONFIG.
  2. The Windows CI job now completes successfully under GCC without the suppressed warning flags.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Quoting inside BITCOIN_CONFIG may not be interpreted as intended
Embedding single‐quoted CFLAGS='-O0 -g0' and CXXFLAGS='-O0 -g0' inside a double‑quoted BITCOIN_CONFIG string will leave literal quotes in the value and break tokenization when passed to ./configure. Consider exporting these environment variables separately for clarity and correctness:

- export BITCOIN_CONFIG="${BITCOIN_CONFIG} --disable-hardening CFLAGS='-O0 -g0' CXXFLAGS='-O0 -g0'"
+ export CFLAGS="-O0 -g0"
+ export CXXFLAGS="-O0 -g0"
+ export BITCOIN_CONFIG="${BITCOIN_CONFIG} --disable-hardening"
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
export BITCOIN_CONFIG="${BITCOIN_CONFIG} --disable-hardening CFLAGS='-O0 -g0' CXXFLAGS='-O0 -g0'"
export CFLAGS="-O0 -g0"
export CXXFLAGS="-O0 -g0"
export BITCOIN_CONFIG="${BITCOIN_CONFIG} --disable-hardening"

Comment thread ci/test/00_setup_env_native_fuzz.sh Outdated

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Quoting CC/CXX assignments in BITCOIN_CONFIG will be literal
Using CC='clang-18 -ftrivial-auto-var-init=pattern' and CXX='clang++-18 -ftrivial-auto-var-init=pattern' inside a double‑quoted string will not group the two arguments as intended. Instead, export the tools separately and simplify BITCOIN_CONFIG:

- export BITCOIN_CONFIG="--enable-zmq --disable-ccache --enable-fuzz --with-sanitizers=fuzzer,address,undefined,integer --enable-suppress-external-warnings CC='clang-18 -ftrivial-auto-var-init=pattern' CXX='clang++-18 -ftrivial-auto-var-init=pattern' --with-boost-process"
+ export CC="clang-18 -ftrivial-auto-var-init=pattern"
+ export CXX="clang++-18 -ftrivial-auto-var-init=pattern"
+ export BITCOIN_CONFIG="--enable-zmq --disable-ccache --enable-fuzz --with-sanitizers=fuzzer,address,undefined,integer --enable-suppress-external-warnings --with-boost-process"

@knst
knst force-pushed the revert-werror-6638 branch from 06a998b to 9e88380 Compare April 25, 2025 18:14
@knst knst changed the title Revert "Merge #6637: build: merge bitcoin#28092, #28999, #27872, #29486, #25972 (ensure WARN_CXXFLAGS are populated to ensure expected --enable-werror behavior) Revert "backport #25972 (ensure WARN_CXXFLAGS are populated to ensure expected --enable-werror behavior) Apr 25, 2025
@knst

knst commented Apr 25, 2025

Copy link
Copy Markdown
Collaborator Author

I reduced scope of this PR to only one commit (backport bitcoin#25972), just in case #6639 will be delayed longer.

@knst knst closed this Apr 25, 2025
@UdjinM6 UdjinM6 removed this from the 23 milestone Apr 30, 2025
@UdjinM6 UdjinM6 modified the milestone: 23 Jul 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants