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

Unable to build using cross-rs #99

Open
KernelPanic0 opened this issue Oct 5, 2024 · 2 comments
Open

Unable to build using cross-rs #99

KernelPanic0 opened this issue Oct 5, 2024 · 2 comments

Comments

@KernelPanic0
Copy link

I am trying to cross compile a rust application (from linux, for windows) which interacts with the bitcoin ecosystem.
The bitcoinconsensus crate causes an issue as upon building everything builds fine other than this crate.

Warning: build failed, waiting for other jobs to finish...
The following warnings were emitted during compilation:

warning: [email protected]+26.0: In file included from depend/bitcoin/src/util/strencodings.cpp:7:0:
warning: [email protected]+26.0: depend/bitcoin/src/util/strencodings.h:15:10: fatal error: charconv: No such file or directory
warning: [email protected]+26.0:  #include <charconv>
warning: [email protected]+26.0:           ^~~~~~~~~~
warning: [email protected]+26.0: compilation terminated.

error: failed to run custom build command for bitcoinconsensus v0.106.0+26.0

Are there any solutions for this?

@KernelPanic0
Copy link
Author

I've tried using a local copy of the bitcoin crate which implements bitcoinconsensus as a feature and edited out the problematic line but still get the following erros:

warning: [email protected]+25.1: In file included from depend/bitcoin/src/util/strencodings.cpp:7:0:
warning: [email protected]+25.1: depend/bitcoin/src/util/strencodings.h: In function 'T LocaleIndependentAtoi(std::string_view)':
warning: [email protected]+25.1: depend/bitcoin/src/util/strencodings.h:132:38: error: 'from_chars' is not a member of 'std'
warning: [email protected]+25.1:      auto [_, error_condition] = std::from_chars(s.data(), s.data() + s.size(), result);
warning: [email protected]+25.1:                                       ^~~~~~~~~~
warning: [email protected]+25.1: depend/bitcoin/src/util/strencodings.h:132:38: note: suggested alternative: '__is_char'
warning: [email protected]+25.1:      auto [_, error_condition] = std::from_chars(s.data(), s.data() + s.size(), result);
warning: [email protected]+25.1:                                       ^~~~~~~~~~
warning: [email protected]+25.1:                                       __is_char
warning: [email protected]+25.1: depend/bitcoin/src/util/strencodings.h: In function 'std::optional<_Tp> ToIntegral(std::string_view)':
warning: [email protected]+25.1: depend/bitcoin/src/util/strencodings.h:185:60: error: 'from_chars' is not a member of 'std'
warning: [email protected]+25.1:      const auto [first_nonmatching, error_condition] = std::from_chars(str.data(), str.data() + str.size(), result);
warning: [email protected]+25.1:                                                             ^~~~~~~~~~
warning: [email protected]+25.1: depend/bitcoin/src/util/strencodings.h:185:60: note: suggested alternative: '__is_char'
warning: [email protected]+25.1:      const auto [first_nonmatching, error_condition] = std::from_chars(str.data(), str.data() + str.size(), result);
warning: [email protected]+25.1:                                                             ^~~~~~~~~~
warning: [email protected]+25.1:                                                             __is_char

error: failed to run custom build command for `bitcoinconsensus v0.105.0+25.1 (/var/www/x/bitcoin/bitcoinconsensus)`

It would be amazing If a solution could be provided, or this crate be made cross-rs friendly

@apoelstra
Copy link
Member

Sounds like your compiler is not C++17 compatible. We definitely cannot change the upstream library to be C++14.

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

No branches or pull requests

2 participants