Skip to content
This repository has been archived by the owner on Jun 20, 2024. It is now read-only.

fix: make the no-std version work #189

Closed
wants to merge 1 commit into from

Conversation

cryptowen
Copy link

The original version will not work since the dependencies use std by default.

@prestwich
Copy link
Member

Updates cause cargo test --no-default-features to fail due to lack of a global allocator

@prestwich prestwich self-requested a review August 12, 2020 18:30
@prestwich prestwich added the bug Something isn't working label Aug 12, 2020
@cryptowen
Copy link
Author

[lib]
crate-type = ["cdylib", "rlib"]

What is the code above used for?
cargo test --no-default-features works without that.
And I checked some other no-std crates, they do not have that.

@cryptowen
Copy link
Author

And even cargo build --no-default-features fails, it works to use it as a no-std dependency.

This is an example: https://github.com/huwenchao/bitcoin-spv-lib/blob/master/contracts/bitcoin-spv-lib/Cargo.toml#L10

@prestwich
Copy link
Member

the lib specifies linkages. See the docs here: https://doc.rust-lang.org/reference/linkage.html

@prestwich
Copy link
Member

Check out #190 and let me know if it works for you

@cryptowen
Copy link
Author

Check out #190 and let me know if it works for you

It works! Thanks a lot.

@cryptowen cryptowen closed this Aug 26, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants