No_std support for floresta-common #254
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I have tried to make
floresta-common
be able to compile without the standard library.no-std
feature inCargo.toml
, together with a defaultstd
feature.core2
andhashbrown
dependencies (used in theno-std
prelude).sha2
,miniscript
andbitcoin
default features disabled to avoid importingstd-lib
, although our newstd
feature enables it.descriptors-no-std
feature to use them without thestd-lib
.It should be able to compile without
std-lib
by runningcargo build --no-default-features --features no-std
, but we get an error with the current fork of thebitcoin
crate. Concretely atbitcoin/src/consensus/encode.rs
:UtreexoBlock
andCompactLeafData
are not found in the scope. The first one is because the import requires thestd-lib
, the second one perhaps because of theimpl_consensus_encoding!
macro used forCompactLeafData
.The rest of floresta crates use the
std
version offloresta-common
, just as before, so this change shouldn't break current things.