refactor: Add missing include in bitcoinkernel_wrapper.h #33825

pull maflcko wants to merge 1 commits into bitcoin:master from maflcko:2511-bld-include changing 1 files +1 −0
  1. maflcko commented at 11:33 am on November 8, 2025: member

    Otherwise, the compilation may fail with:

     0/home/admin/actions-runner/_work/_temp/src/kernel/bitcoinkernel_wrapper.h:271:14: error: no type named 'exception_ptr' in namespace 'std'; did you mean 'exception'?
     1  271 |         std::exception_ptr exception;
     2      |         ~~~~~^~~~~~~~~~~~~
     3      |              exception
     4/cxx_build/include/c++/v1/__exception/exception.h:72:33: note: 'exception' declared here
     5   72 | class _LIBCPP_EXPORTED_FROM_ABI exception {
     6      |                                 ^
     7In file included from /home/admin/actions-runner/_work/_temp/src/bitcoin-chainstate.cpp:1:
     8/home/admin/actions-runner/_work/_temp/src/kernel/bitcoinkernel_wrapper.h:284:35: error: no member named 'current_exception' in namespace 'std'
     9  284 |             data.exception = std::current_exception();
    10      |                                   ^~~~~~~~~~~~~~~~~
    11/home/admin/actions-runner/_work/_temp/src/kernel/bitcoinkernel_wrapper.h:290:14: error: no member named 'rethrow_exception' in namespace 'std'
    12  290 |         std::rethrow_exception(user_data.exception);
    13      |              ^~~~~~~~~~~~~~~~~
    14/home/admin/actions-runner/_work/_temp/src/kernel/bitcoinkernel_wrapper.h:273:65: error: no viable conversion from 'std::nullptr_t' to 'std::exception'
    15  273 |     UserData user_data = UserData{.bytes = &bytes, .exception = nullptr};
    16      |                                                                 ^~~~~~~
    17/home/admin/actions-runner/_work/_temp/src/kernel/bitcoinkernel_wrapper.h:733:16: note: in instantiation of function template specialization 'btck::write_bytes<btck_Block>' requested here
    18  733 |         return write_bytes(get(), btck_block_to_bytes);
    19      |                ^
    20/cxx_build/include/c++/v1/__exception/exception.h:75:25: note: candidate constructor not viable: no known conversion from 'std::nullptr_t' to 'const exception &' for 1st argument
    21   75 |   _LIBCPP_HIDE_FROM_ABI exception(const exception&) _NOEXCEPT            = default;
    22      |                         ^         ~~~~~~~~~~~~~~~~
    234 errors generated.
    
  2. refactor: Add missing include in bitcoinkernel_wrapper.h fa1e8d8bad
  3. TheCharlatan approved
  4. TheCharlatan commented at 12:07 pm on November 8, 2025: contributor
    ACK fa1e8d8bad92f5fba2b086d78581df4c8123b098
  5. hebasto commented at 2:23 pm on November 8, 2025: member

    ACK fa1e8d8bad92f5fba2b086d78581df4c8123b098.

    Here is IWYU’s diff based on #33810:

     0--- a/src/kernel/bitcoinkernel_wrapper.h
     1+++ b/src/kernel/bitcoinkernel_wrapper.h
     2@@ -5,12 +5,19 @@
     3 #ifndef BITCOIN_KERNEL_BITCOINKERNEL_WRAPPER_H
     4 #define BITCOIN_KERNEL_BITCOINKERNEL_WRAPPER_H
     5 
     6-#include <kernel/bitcoinkernel.h>
     7+#include <kernel/bitcoinkernel.h> // IWYU pragma: export
     8+// IWYU pragma: no_include "kernel/bitcoinkernel.h"
     9 
    10 #include <array>
    11+#include <concepts>
    12+#include <cstddef>
    13+#include <cstdint>
    14+#include <exception>
    15 #include <functional>
    16+#include <iterator>
    17 #include <memory>
    18 #include <optional>
    19+#include <ranges>
    20 #include <span>
    21 #include <stdexcept>
    22 #include <string>
    23@@ -19,7 +26,13 @@
    24 #include <utility>
    25 #include <vector>
    26 
    27+class TestKernelNotifications;
    28+class TestValidationInterface;
    29+
    30 namespace btck {
    31+class Block;
    32+class BlockSpentOutputs;
    33+class ChainView;
    34 
    35 enum class LogCategory : btck_LogCategory {
    36     ALL = btck_LogCategory_ALL,
    
  6. yuvicc commented at 2:34 pm on November 8, 2025: contributor
    ACK fa1e8d8bad92f5fba2b086d78581df4c8123b098
  7. hebasto merged this on Nov 8, 2025
  8. hebasto closed this on Nov 8, 2025

  9. sfgroupltd78-gif commented at 1:28 am on November 9, 2025: none
    with the pull request files athttps:
  10. bitcoin deleted a comment on Nov 9, 2025
  11. maflcko deleted the branch on Nov 10, 2025
  12. maflcko commented at 1:50 pm on November 10, 2025: member

    Here is IWYU’s diff based on #33810:

    I can’t find that in the CI output. I don’t think iwyu runs on stand-alone headers without a cpp file?

  13. hebasto commented at 2:01 pm on November 10, 2025: member

    Here is IWYU’s diff based on #33810:

    I can’t find that in the CI output.

    It’s here: https://github.com/hebasto/bitcoin/actions/runs/19194191546/job/54872770781:

    0<snip>
    12025-11-08T14:21:35.1873049Z (/home/runner/work/_temp/src/kernel/bitcoinkernel_wrapper.h has correct #includes/fwd-decls)
    2<snip>
    

    I don’t think iwyu runs on stand-alone headers without a cpp file?

    Correct. However, this issue has been addressed as follows:

    0#include <kernel/bitcoinkernel_wrapper.h> // IWYU pragma: associated
    

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2025-11-23 00:13 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me