Skip to content

Conversation

@murrayn
Copy link
Contributor

@murrayn murrayn commented Nov 13, 2018

Building with clang (e.g. on FreeBSD) is very noisy due to -Wthread-safety-analysis warnings regarding boost. This change removes a number of unnecessary boost includes, and silences the rest of the warnings when building with clang. This allows more potentially interesting warnings to surface from the noise.

Tested on FreeBSD 11.2

@DrahtBot
Copy link
Contributor

DrahtBot commented Nov 13, 2018

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Conflicts

Reviewers, this pull request conflicts with the following ones:

  • #13339 (wallet: Replace %w by wallet name in -walletnotify script by promag)
  • #12833 ([qt] move QSettings to bitcoin_rw.conf where possible by Sjors)
  • #11082 (Add new bitcoin_rw.conf file that is used for settings modified by this software itself by luke-jr)

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.

@maflcko
Copy link
Member

maflcko commented Nov 13, 2018

ACK on removing the unneeded headers. NACK on the verbose annotations to silence warnings. They should instead be fixed in the broken compiler or broken library.

@practicalswift
Copy link
Contributor

practicalswift commented Nov 13, 2018

@murrayn Can you post a few of the warnings? Could it be that you're using an old version of Boost? :-)

ACK on removing the redundant headers

@promag
Copy link
Contributor

promag commented Nov 13, 2018

+1 remove headers.

@murrayn
Copy link
Contributor Author

murrayn commented Nov 14, 2018

@murrayn Can you post a few of the warnings? Could it be that you're using an old version of Boost? :-)

@practicalswift I was originally using boost-libs-1.66.0_1, updated to boost-libs-1.68.0_3 with no improvement.

Here is the warning output from compiling one of the files:

https://0bin.net/paste/JAxYnpYsxSSxXz+4#-ObZEDfUOHpeAnguOYhkZMW5xL9Co7ea8E5E+evc9Zv

@practicalswift
Copy link
Contributor

@murrayn Could you limit this PR to the header removal only? That change seems to have consensus ACK and will likely be a quick merge :-)

@murrayn murrayn force-pushed the clang_warnings branch 2 times, most recently from 5fa7f28 to c5e6cd4 Compare November 14, 2018 09:07
@murrayn murrayn changed the title Remove unreferenced boost headers and quieten remaining clang warnings Remove unreferenced boost headers Nov 14, 2018
@maflcko
Copy link
Member

maflcko commented Nov 14, 2018

ACK c5e6cd459197f0829069641d109b7b7b2f4042f8 (checked that the bitcoind size reduces by about 1%)

Copy link
Contributor

@PastaPastaPasta PastaPastaPasta left a comment

Choose a reason for hiding this comment

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

utACK c5e6cd4

Copy link
Contributor

@ken2812221 ken2812221 left a comment

Choose a reason for hiding this comment

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

Concept ACK.

@murrayn murrayn force-pushed the clang_warnings branch 3 times, most recently from f485779 to 77aab9d Compare November 15, 2018 23:42
Copy link
Member

@maflcko maflcko left a comment

Choose a reason for hiding this comment

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

I looked at a few and they seem to be used some others weren't used. Please make sure you only remove unused ones

@maflcko
Copy link
Member

maflcko commented Nov 16, 2018

utACK c54e5a4

1 similar comment
@practicalswift
Copy link
Contributor

utACK c54e5a4

maflcko pushed a commit to maflcko/bitcoin-core that referenced this pull request Nov 19, 2018
c54e5a4 Remove unreferenced boost headers (Murray Nesbitt)

Pull request description:

  Building with clang (e.g. on FreeBSD) is very noisy due to `-Wthread-safety-analysis` warnings regarding boost. This change removes a number of unnecessary boost includes, and silences the rest of the warnings when building with clang. This allows more potentially interesting warnings to surface from the noise.

  Tested on FreeBSD 11.2

Tree-SHA512: 5e6a0623188b9be59aeae52866799aefb4c3c9ab5e569b07ee8d43fc92e0b5f1f76b96bb54c35c7043148df84641b4a96927fb71f6eb00460c20cd19cf250900
@maflcko maflcko merged commit c54e5a4 into bitcoin:master Nov 19, 2018
@Sjors
Copy link
Member

Sjors commented Nov 19, 2018

On master:

test/lint/lint-includes.sh
Good job! The Boost dependency "boost/filesystem/fstream.hpp" is no longer used.
Please remove it from EXPECTED_BOOST_INCLUDES in test/lint/lint-includes.sh
to make sure this dependency is not accidentally reintroduced.

I'll make a PR.

#endif

#include <boost/filesystem.hpp>
#include <boost/filesystem/fstream.hpp>
Copy link
Member

Choose a reason for hiding this comment

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

Next time you're removing a header please check carefully that it's not used; we're also using includes to signal dependencies; so it being included indirectly, somehow, is not a good reason to remove it at the direct use site.

laanwj added a commit that referenced this pull request Nov 20, 2018
e816b34 revert removal of fstream.hpp header in fs.h (Karl-Johan Alm)

Pull request description:

  We cannot (yet) remove the EXPECTED_BOOST_INCLUDES entry as this header is still needed in `fs.h` (see #14763).

  Partially reverts #14718.

Tree-SHA512: e94d8d6208bee14af20a7a529e60a4898358ec8c070a8bf0701e589a2ae33df1305deac83cee619f103c24be0eb3c12a2f490209c125b247acf21561c7de456e
deadalnix pushed a commit to Bitcoin-ABC/bitcoin-abc that referenced this pull request Mar 20, 2020
Summary:
c54e5a41c4 Remove unreferenced boost headers (Murray Nesbitt)

Pull request description:

  Building with clang (e.g. on FreeBSD) is very noisy due to `-Wthread-safety-analysis` warnings regarding boost. This change removes a number of unnecessary boost includes, and silences the rest of the warnings when building with clang. This allows more potentially interesting warnings to surface from the noise.

  Tested on FreeBSD 11.2

Tree-SHA512: 5e6a0623188b9be59aeae52866799aefb4c3c9ab5e569b07ee8d43fc92e0b5f1f76b96bb54c35c7043148df84641b4a96927fb71f6eb00460c20cd19cf250900

Backport of Core [[bitcoin/bitcoin#14718 | PR14718]] and [[bitcoin/bitcoin#14768 | PR14768]] (reverts fs.h changes)

Changes to util/system.cpp were ignored because we diverged here:
https://reviews.bitcoinabc.org/rSTAGING47162673c79c757a9c038c4ddc41fb3022223bde

Test Plan:
  ninja
  ninja check

Reviewers: O1 Bitcoin ABC, #bitcoin_abc, deadalnix

Reviewed By: O1 Bitcoin ABC, #bitcoin_abc, deadalnix

Differential Revision: https://reviews.bitcoinabc.org/D5523
ftrader pushed a commit to bitcoin-cash-node/bitcoin-cash-node that referenced this pull request May 19, 2020
Summary:
c54e5a41c4 Remove unreferenced boost headers (Murray Nesbitt)

Pull request description:

  Building with clang (e.g. on FreeBSD) is very noisy due to `-Wthread-safety-analysis` warnings regarding boost. This change removes a number of unnecessary boost includes, and silences the rest of the warnings when building with clang. This allows more potentially interesting warnings to surface from the noise.

  Tested on FreeBSD 11.2

Tree-SHA512: 5e6a0623188b9be59aeae52866799aefb4c3c9ab5e569b07ee8d43fc92e0b5f1f76b96bb54c35c7043148df84641b4a96927fb71f6eb00460c20cd19cf250900

Backport of Core [[bitcoin/bitcoin#14718 | PR14718]] and [[bitcoin/bitcoin#14768 | PR14768]] (reverts fs.h changes)

Changes to util/system.cpp were ignored because we diverged here:
https://reviews.bitcoinabc.org/rSTAGING47162673c79c757a9c038c4ddc41fb3022223bde

Test Plan:
  ninja
  ninja check

Reviewers: O1 Bitcoin ABC, #bitcoin_abc, deadalnix

Reviewed By: O1 Bitcoin ABC, #bitcoin_abc, deadalnix

Differential Revision: https://reviews.bitcoinabc.org/D5523
Munkybooty pushed a commit to Munkybooty/dash that referenced this pull request Aug 11, 2021
c54e5a4 Remove unreferenced boost headers (Murray Nesbitt)

Pull request description:

  Building with clang (e.g. on FreeBSD) is very noisy due to `-Wthread-safety-analysis` warnings regarding boost. This change removes a number of unnecessary boost includes, and silences the rest of the warnings when building with clang. This allows more potentially interesting warnings to surface from the noise.

  Tested on FreeBSD 11.2

Tree-SHA512: 5e6a0623188b9be59aeae52866799aefb4c3c9ab5e569b07ee8d43fc92e0b5f1f76b96bb54c35c7043148df84641b4a96927fb71f6eb00460c20cd19cf250900
Munkybooty pushed a commit to Munkybooty/dash that referenced this pull request Aug 11, 2021
e816b34 revert removal of fstream.hpp header in fs.h (Karl-Johan Alm)

Pull request description:

  We cannot (yet) remove the EXPECTED_BOOST_INCLUDES entry as this header is still needed in `fs.h` (see bitcoin#14763).

  Partially reverts bitcoin#14718.

Tree-SHA512: e94d8d6208bee14af20a7a529e60a4898358ec8c070a8bf0701e589a2ae33df1305deac83cee619f103c24be0eb3c12a2f490209c125b247acf21561c7de456e
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Sep 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.