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:

    /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'?
      271 |         std::exception_ptr exception;
          |         ~~~~~^~~~~~~~~~~~~
          |              exception
    /cxx_build/include/c++/v1/__exception/exception.h:72:33: note: 'exception' declared here
       72 | class _LIBCPP_EXPORTED_FROM_ABI exception {
          |                                 ^
    In file included from /home/admin/actions-runner/_work/_temp/src/bitcoin-chainstate.cpp:1:
    /home/admin/actions-runner/_work/_temp/src/kernel/bitcoinkernel_wrapper.h:284:35: error: no member named 'current_exception' in namespace 'std'
      284 |             data.exception = std::current_exception();
          |                                   ^~~~~~~~~~~~~~~~~
    /home/admin/actions-runner/_work/_temp/src/kernel/bitcoinkernel_wrapper.h:290:14: error: no member named 'rethrow_exception' in namespace 'std'
      290 |         std::rethrow_exception(user_data.exception);
          |              ^~~~~~~~~~~~~~~~~
    /home/admin/actions-runner/_work/_temp/src/kernel/bitcoinkernel_wrapper.h:273:65: error: no viable conversion from 'std::nullptr_t' to 'std::exception'
      273 |     UserData user_data = UserData{.bytes = &bytes, .exception = nullptr};
          |                                                                 ^~~~~~~
    /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
      733 |         return write_bytes(get(), btck_block_to_bytes);
          |                ^
    /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
       75 |   _LIBCPP_HIDE_FROM_ABI exception(const exception&) _NOEXCEPT            = default;
          |                         ^         ~~~~~~~~~~~~~~~~
    4 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:

    --- a/src/kernel/bitcoinkernel_wrapper.h
    +++ b/src/kernel/bitcoinkernel_wrapper.h
    @@ -5,12 +5,19 @@
     #ifndef BITCOIN_KERNEL_BITCOINKERNEL_WRAPPER_H
     #define BITCOIN_KERNEL_BITCOINKERNEL_WRAPPER_H
     
    -#include <kernel/bitcoinkernel.h>
    +#include <kernel/bitcoinkernel.h> // IWYU pragma: export
    +// IWYU pragma: no_include "kernel/bitcoinkernel.h"
     
     #include <array>
    +#include <concepts>
    +#include <cstddef>
    +#include <cstdint>
    +#include <exception>
     #include <functional>
    +#include <iterator>
     #include <memory>
     #include <optional>
    +#include <ranges>
     #include <span>
     #include <stdexcept>
     #include <string>
    @@ -19,7 +26,13 @@
     #include <utility>
     #include <vector>
     
    +class TestKernelNotifications;
    +class TestValidationInterface;
    +
     namespace btck {
    +class Block;
    +class BlockSpentOutputs;
    +class ChainView;
     
     enum class LogCategory : btck_LogCategory {
         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:

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

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

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

    #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: 2026-04-22 09:12 UTC

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