mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-02-09 02:59:31 +08:00
Merge bitcoin/bitcoin#34352: ci, iwyu: Fix warnings in src/primitives and treat them as errors
fdc9fe2da6ci, iwyu: Fix warnings in `src/primitives` and treat them as errors (Hennadii Stepanov) Pull request description: This PR [continues](https://github.com/bitcoin/bitcoin/pull/33725#issuecomment-3466897433) the ongoing effort to enforce IWYU warnings. See [Developer Notes](https://github.com/bitcoin/bitcoin/blob/master/doc/developer-notes.md#using-iwyu). ACKs for top commit: maflcko: review ACKfdc9fe2da6📀 janb84: ACKfdc9fe2da6sedited: ACKfdc9fe2da6Tree-SHA512: d290545c7aab477b4a5bf121b694899a78e0526be72efa31fa4205b0fd840e6e8240d32f9134a18c9dc58c5f91e7847d7f20ca34f8d2edc4d541ac858ec0dccc
This commit is contained in:
@@ -215,7 +215,7 @@ fi
|
|||||||
|
|
||||||
if [[ "${RUN_IWYU}" == true ]]; then
|
if [[ "${RUN_IWYU}" == true ]]; then
|
||||||
# TODO: Consider enforcing IWYU across the entire codebase.
|
# TODO: Consider enforcing IWYU across the entire codebase.
|
||||||
FILES_WITH_ENFORCED_IWYU="/src/((crypto|index|kernel)/.*\\.cpp|node/blockstorage.cpp|node/utxo_snapshot.cpp|core_io.cpp|signet.cpp)"
|
FILES_WITH_ENFORCED_IWYU="/src/((crypto|index|kernel|primitives)/.*\\.cpp|node/blockstorage.cpp|node/utxo_snapshot.cpp|core_io.cpp|signet.cpp)"
|
||||||
jq --arg patterns "$FILES_WITH_ENFORCED_IWYU" 'map(select(.file | test($patterns)))' "${BASE_BUILD_DIR}/compile_commands.json" > "${BASE_BUILD_DIR}/compile_commands_iwyu_errors.json"
|
jq --arg patterns "$FILES_WITH_ENFORCED_IWYU" 'map(select(.file | test($patterns)))' "${BASE_BUILD_DIR}/compile_commands.json" > "${BASE_BUILD_DIR}/compile_commands_iwyu_errors.json"
|
||||||
jq --arg patterns "$FILES_WITH_ENFORCED_IWYU" 'map(select(.file | test($patterns) | not))' "${BASE_BUILD_DIR}/compile_commands.json" > "${BASE_BUILD_DIR}/compile_commands_iwyu_warnings.json"
|
jq --arg patterns "$FILES_WITH_ENFORCED_IWYU" 'map(select(.file | test($patterns) | not))' "${BASE_BUILD_DIR}/compile_commands.json" > "${BASE_BUILD_DIR}/compile_commands_iwyu_warnings.json"
|
||||||
|
|
||||||
@@ -227,6 +227,7 @@ if [[ "${RUN_IWYU}" == true ]]; then
|
|||||||
-p "${BASE_BUILD_DIR}" "${MAKEJOBS}" \
|
-p "${BASE_BUILD_DIR}" "${MAKEJOBS}" \
|
||||||
-- -Xiwyu --cxx17ns -Xiwyu --mapping_file="${BASE_ROOT_DIR}/contrib/devtools/iwyu/bitcoin.core.imp" \
|
-- -Xiwyu --cxx17ns -Xiwyu --mapping_file="${BASE_ROOT_DIR}/contrib/devtools/iwyu/bitcoin.core.imp" \
|
||||||
-Xiwyu --max_line_length=160 \
|
-Xiwyu --max_line_length=160 \
|
||||||
|
-Xiwyu --check_also="*/primitives/*.h" \
|
||||||
2>&1 | tee /tmp/iwyu_ci.out
|
2>&1 | tee /tmp/iwyu_ci.out
|
||||||
python3 "/include-what-you-use/fix_includes.py" --nosafe_headers < /tmp/iwyu_ci.out
|
python3 "/include-what-you-use/fix_includes.py" --nosafe_headers < /tmp/iwyu_ci.out
|
||||||
git diff -U0 | ./contrib/devtools/clang-format-diff.py -binary="clang-format-${TIDY_LLVM_V}" -p1 -i -v
|
git diff -U0 | ./contrib/devtools/clang-format-diff.py -binary="clang-format-${TIDY_LLVM_V}" -p1 -i -v
|
||||||
|
|||||||
@@ -8,6 +8,10 @@
|
|||||||
#include <hash.h>
|
#include <hash.h>
|
||||||
#include <tinyformat.h>
|
#include <tinyformat.h>
|
||||||
|
|
||||||
|
#include <memory>
|
||||||
|
#include <span>
|
||||||
|
#include <sstream>
|
||||||
|
|
||||||
uint256 CBlockHeader::GetHash() const
|
uint256 CBlockHeader::GetHash() const
|
||||||
{
|
{
|
||||||
return (HashWriter{} << *this).GetHash();
|
return (HashWriter{} << *this).GetHash();
|
||||||
|
|||||||
@@ -11,6 +11,11 @@
|
|||||||
#include <uint256.h>
|
#include <uint256.h>
|
||||||
#include <util/time.h>
|
#include <util/time.h>
|
||||||
|
|
||||||
|
#include <cstdint>
|
||||||
|
#include <string>
|
||||||
|
#include <utility>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
/** Nodes collect new transactions into a block, hash them into a hash tree,
|
/** Nodes collect new transactions into a block, hash them into a hash tree,
|
||||||
* and scan through nonce values to make the block's hash satisfy proof-of-work
|
* and scan through nonce values to make the block's hash satisfy proof-of-work
|
||||||
* requirements. When they solve the proof-of-work, they broadcast the block
|
* requirements. When they solve the proof-of-work, they broadcast the block
|
||||||
|
|||||||
@@ -12,10 +12,10 @@
|
|||||||
#include <script/script.h>
|
#include <script/script.h>
|
||||||
#include <serialize.h>
|
#include <serialize.h>
|
||||||
#include <tinyformat.h>
|
#include <tinyformat.h>
|
||||||
#include <uint256.h>
|
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
#include <span>
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
|
|
||||||
std::string COutPoint::ToString() const
|
std::string COutPoint::ToString() const
|
||||||
|
|||||||
@@ -11,8 +11,8 @@
|
|||||||
#include <primitives/transaction_identifier.h> // IWYU pragma: export
|
#include <primitives/transaction_identifier.h> // IWYU pragma: export
|
||||||
#include <script/script.h>
|
#include <script/script.h>
|
||||||
#include <serialize.h>
|
#include <serialize.h>
|
||||||
#include <uint256.h>
|
|
||||||
|
|
||||||
|
#include <compare>
|
||||||
#include <cstddef>
|
#include <cstddef>
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
#include <ios>
|
#include <ios>
|
||||||
|
|||||||
@@ -9,9 +9,12 @@
|
|||||||
#include <uint256.h>
|
#include <uint256.h>
|
||||||
#include <util/types.h>
|
#include <util/types.h>
|
||||||
|
|
||||||
#include <compare>
|
#include <cstddef>
|
||||||
#include <concepts>
|
#include <optional>
|
||||||
|
#include <string>
|
||||||
|
#include <string_view>
|
||||||
#include <tuple>
|
#include <tuple>
|
||||||
|
#include <type_traits>
|
||||||
#include <variant>
|
#include <variant>
|
||||||
|
|
||||||
/** transaction_identifier represents the two canonical transaction identifier
|
/** transaction_identifier represents the two canonical transaction identifier
|
||||||
|
|||||||
Reference in New Issue
Block a user