Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include cstdint in mempool_args.h #76

Closed
wants to merge 1 commit into from

Conversation

AaronDewes
Copy link

Without this, builds fail on Alpine Linux 3.19.

Without this, builds fail on Alpine Linux 3.19
@luke-jr
Copy link
Member

luke-jr commented Mar 31, 2024

Please provide the error so I can put this in the right branch

@AaronDewes
Copy link
Author

#23 112.7 In file included from node/mempool_args.cpp:5:
#23 112.7 ./node/mempool_args.h:20:28: error: 'int32_t' was not declared in this scope
#23 112.7    20 | [[nodiscard]] util::Result<int32_t> ParseDustDynamicOpt(const std::string& optstr, unsigned int max_fee_estimate_blocks);
#23 112.7       |                            ^~~~~~~
#23 112.7 ./node/mempool_args.h:10:1: note: 'int32_t' is defined in header '<cstdint>'; did you forget to '#include <cstdint>'?
#23 112.7     9 | #include <util/result.h>
#23 112.7   +++ |+#include <cstdint>
#23 112.7    10 | 
#23 112.7 ./node/mempool_args.h:20:35: error: template argument 1 is invalid
#23 112.7    20 | [[nodiscard]] util::Result<int32_t> ParseDustDynamicOpt(const std::string& optstr, unsigned int max_fee_estimate_blocks);
#23 112.7       |                                   ^
#23 113.2   CXX      node/libbitcoin_node_a-mini_miner.o
#23 113.6 node/mempool_args.cpp:43:23: error: ambiguating new declaration of 'util::Result<int> ParseDustDynamicOpt(const std::string&, unsigned int)'
#23 113.6    43 | util::Result<int32_t> ParseDustDynamicOpt(const std::string& optstr, const unsigned int max_fee_estimate_blocks)
#23 113.6       |                       ^~~~~~~~~~~~~~~~~~~
#23 113.6 ./node/mempool_args.h:20:37: note: old declaration 'int ParseDustDynamicOpt(const std::string&, unsigned int)'
#23 113.6    20 | [[nodiscard]] util::Result<int32_t> ParseDustDynamicOpt(const std::string& optstr, unsigned int max_fee_estimate_blocks);
#23 113.6       |                                     ^~~~~~~~~~~~~~~~~~~
#23 113.7 node/mempool_args.cpp: In function 'util::Result<void> ApplyArgsManOptions(const ArgsManager&, const CChainParams&, kernel::MemPoolOptions&)':
#23 113.7 node/mempool_args.cpp:121:98: error: no matching function for call to 'ErrorString(const int&)'
#23 113.7   121 |             return util::Error{strprintf(_("Invalid mode for dustdynamic: %s"), util::ErrorString(parsed))};
#23 113.7       |                                                                                 ~~~~~~~~~~~~~~~~~^~~~~~~~
#23 113.7 In file included from ./node/mempool_args.h:9:
#23 113.7 ./util/result.h:81:15: note: candidate: 'template<class T> bilingual_str util::ErrorString(const Result<T>&)'
#23 113.7    81 | bilingual_str ErrorString(const Result<T>& result)
#23 113.7       |               ^~~~~~~~~~~
#23 113.7 ./util/result.h:81:15: note:   template argument deduction/substitution failed:
#23 113.7 node/mempool_args.cpp:121:98: note:   mismatched types 'const util::Result<T>' and 'const int'
#23 113.7   121 |             return util::Error{strprintf(_("Invalid mode for dustdynamic: %s"), util::ErrorString(parsed))};
#23 113.7       |                                                                                 ~~~~~~~~~~~~~~~~~^~~~~~~~
#23 113.7 node/mempool_args.cpp:123:42: error: invalid type argument of unary '*' (have 'int')
#23 113.7   123 |         mempool_opts.dust_relay_target = *parsed;
#23 113.7       |                                          ^~~~~~~
#23 113.9   CXX      node/libbitcoin_node_a-peerman_args.o
#23 114.2   CXX      node/libbitcoin_node_a-psbt.o
#23 114.2 make[2]: *** [Makefile:10617: node/libbitcoin_node_a-mempool_args.o] Error 1
#23 114.2 make[2]: *** Waiting for unfinished jobs....
#23 124.5 make[2]: Leaving directory '/bitcoin-26.1.knots20240325/src'
#23 124.5 make[1]: *** [Makefile:20055: check-recursive] Error 1
#23 124.5 make[1]: Leaving directory '/bitcoin-26.1.knots20240325/src'

@AaronDewes
Copy link
Author

@luke-jr Any update on this?

@levantah
Copy link

Yes, it would be cool if the compilation worked on Alpine Linux. Bitcoin Core master (since 0.21 at least) compiles well so it is IMHO a regression of Knots.

@doitwithnotepad
Copy link

Same error here on Alpine 3.19, @luke-jr introduced here the same error he fixed in this release 8ecc5db

@luke-jr
Copy link
Member

luke-jr commented May 14, 2024

(Fixed in 26.1.knots20240513)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants