bitcoin/test/lint
Wladimir J. van der Laan 9996b1806a
Merge #21064: refactor: use std::shared_mutex & remove Boost Thread
060a2a64d4 ci: remove boost thread installation (fanquake)
06e1d7d81d build: don't build or use Boost Thread (fanquake)
7097add83c refactor: replace Boost shared_mutex with std shared_mutex in sigcache (fanquake)
8e55981ef8 refactor: replace Boost shared_mutex with std shared_mutex in cuckoocache tests (fanquake)

Pull request description:

  This replaces `boost::shared_mutex` and `boost::unique_lock` with [`std::shared_mutex`](https://en.cppreference.com/w/cpp/thread/shared_mutex) & [`std::unique_lock`](https://en.cppreference.com/w/cpp/thread/unique_lock).

  Even though [some concerns were raised](https://github.com/bitcoin/bitcoin/issues/16684#issuecomment-726214696) in #16684 with regard to `std::shared_mutex` being unsafe to use across some glibc versions, I still think this change is an improvement. As I mentioned in #21022, I also think trying to restrict standard library feature usage based on bugs in glibc is not only hard to do, but it's not currently clear exactly how we do that in practice (does it also extend to patching out use in our dependencies, should we be implementing more runtime checks for features we are using, when do we consider an affected glibc "old enough" not to worry about? etc). If you take a look through the [glibc bug tracker](https://sourceware.org/bugzilla/describecomponents.cgi?product=glibc) you'll no doubt find plenty of (active) bug reports for standard library code we already using. Obviously not to say we shouldn't try and avoid buggy code where possible.

  Two other points:

  [Cory mentioned in #21022](https://github.com/bitcoin/bitcoin/pull/21022#issuecomment-769274179):
  > It also seems reasonable to me to worry that boost hits the same underlying glibc bug, and we've just not happened to trigger the right conditions yet.

  Moving away from Boost to the standard library also removes the potential for differences related to Boosts configuration. Boost has multiple versions of `shared_mutex`, and what you end up using, and what it's backed by depends on:
  * The version of Boost.
  * The platform you're building for.
  * Which version of `BOOST_THREAD_VERSION` is defined: (2,3,4 or 5) default=2. (see [here](https://www.boost.org/doc/libs/1_70_0/doc/html/thread/build.html#thread.build.configuration) for some of the differences).
  * Is `BOOST_THREAD_V2_SHARED_MUTEX` defined? (not by default). If so, you might get the ["less performant, but more robust"](https://github.com/boostorg/thread/issues/230#issuecomment-475937761) version of `shared_mutex`.

  A lot of these factors are eliminated by our use of depends, but users will have varying configurations. It's also not inconceivable to think that a distro, or some package manager might start defining something like `BOOST_THREAD_VERSION=3`. Boost tried to change the default from 2 to 3 at one point.

  With this change, we no longer use Boost Thread, so this PR also removes it from depends, the build system, CI etc.

  Previous similar PRs were #19183 & #20922. The authors are included in the commits here.
  Also related to #21022 - pthread sanity checking.

ACKs for top commit:
  laanwj:
    Code review ACK 060a2a64d4
  vasild:
    ACK 060a2a64d4

Tree-SHA512: 572d14d8c9de20bc434511f20d3f431836393ff915b2fe9de5a47a02dca76805ad5c3fc4cceecb4cd43f3ba939a0508178c4e60e62abdbaaa6b3e8db20b75b03
2021-02-12 11:39:36 +01:00
..
check-doc.py scripted-diff: Bump copyright headers 2020-12-31 09:45:41 +01:00
commit-script-check.sh scripted-diff: Bump copyright headers 2020-12-31 09:45:41 +01:00
extended-lint-all.sh scripted-diff: Bump copyright headers 2020-04-16 13:33:09 -04:00
extended-lint-cppcheck.sh refactor: Improve use of explicit keyword 2020-12-01 18:36:39 +01:00
git-subtree-check.sh scripted-diff: Bump copyright headers 2020-12-31 09:45:41 +01:00
lint-all.sh Run all lint scripts 2019-05-16 16:42:59 +02:00
lint-assertions.sh scripted-diff: Bump copyright headers 2020-12-31 09:45:41 +01:00
lint-circular-dependencies.sh Remove the remaining fee estimation globals 2020-12-03 12:56:37 +01:00
lint-cpp.sh lint: add C++ code linter 2020-09-01 14:23:08 +08:00
lint-filenames.sh scripted-diff: Bump copyright of files changed in 2019 2019-12-30 10:42:20 +13:00
lint-format-strings.py Refactor: Copy CWallet signals and print function to LegacyScriptPubKeyMan 2020-01-23 16:35:08 -05:00
lint-format-strings.sh scripted-diff: Bump copyright headers 2020-04-16 13:33:09 -04:00
lint-git-commit-check.sh ci: Drop Travis-specific way to set COMMIT_RANGE variable 2020-12-21 12:10:59 +02:00
lint-include-guards.sh scripted-diff: Bump copyright headers 2020-12-31 09:45:41 +01:00
lint-includes.sh Merge #21064: refactor: use std::shared_mutex & remove Boost Thread 2021-02-12 11:39:36 +01:00
lint-locale-dependence.sh Merge #18817: doc: Document differences in bitcoind and bitcoin-qt locale handling 2020-08-29 10:03:45 +02:00
lint-logs.sh scripted-diff: Bump copyright of files changed in 2019 2019-12-30 10:42:20 +13:00
lint-python-mutable-default-parameters.sh lint: Catch use of [] or {} as default parameter values in Python functions 2019-08-26 10:53:10 +00:00
lint-python-utf8-encoding.sh scripted-diff: Bump copyright headers 2020-12-31 09:45:41 +01:00
lint-python.sh scripted-diff: Bump copyright headers 2020-12-31 09:45:41 +01:00
lint-qt.sh test: Add lint to prevent SIGNAL/SLOT connect style 2018-08-21 09:43:55 +01:00
lint-shebang.sh scripted-diff: Bump copyright headers 2020-12-31 09:45:41 +01:00
lint-shell-locale.sh macOS fix: Work around empty (sub)expression error when using BSD grep 2018-08-31 00:52:48 +02:00
lint-shell.sh ci: Drop Travis-specific workaround for shellcheck 2020-12-21 12:11:00 +02:00
lint-spelling.ignore-words.txt lint: ignore gitian keys file for spelling linter 2021-01-02 19:06:28 +01:00
lint-spelling.sh lint: ignore gitian keys file for spelling linter 2021-01-02 19:06:28 +01:00
lint-submodule.sh ci: Check for submodules 2020-02-10 16:48:15 +01:00
lint-tests.sh Obsolete #!/bin/bash shebang 2018-06-20 11:12:41 +03:00
lint-whitespace.sh lint: Skip whitespace lint for guix patches 2021-01-17 18:43:58 -05:00
README.md test: Add option to git-subtree-check to do full check, add help 2020-12-04 09:36:17 +01:00

This folder contains lint scripts.

check-doc.py

Check for missing documentation of command line options.

commit-script-check.sh

Verification of scripted diffs. Scripted diffs are only assumed to run on the latest LTS release of Ubuntu. Running them on other operating systems might require installing GNU tools, such as GNU sed.

git-subtree-check.sh

Run this script from the root of the repository to verify that a subtree matches the contents of the commit it claims to have been updated to.

Usage: test/lint/git-subtree-check.sh [-r] DIR [COMMIT]
       test/lint/git-subtree-check.sh -?
  • DIR is the prefix within the repository to check.
  • COMMIT is the commit to check, if it is not provided, HEAD will be used.
  • -r checks that subtree commit is present in repository.

To do a full check with -r, make sure that you have fetched the upstream repository branch in which the subtree is maintained:

To do so, add the upstream repository as remote:

git remote add --fetch secp256k1 https://github.com/bitcoin-core/secp256k1.git

lint-all.sh

Calls other scripts with the lint- prefix.