Merge rust-bitcoin/rust-bitcoin#1612: Clean up the manifest files of top level crates

8596e402f2 Fix docs.rs to use all features (Tobin C. Harding)
89086d094d hashes: Use angle braces to make hyperlinks (Tobin C. Harding)
9b5c2ad7af hashes: Clean up optional dependencies (Tobin C. Harding)
5b4f19c01f hashes: Improve std/alloc features (Tobin C. Harding)
132d2f90b6 bitcoin: Enable alloc feature in features list (Tobin C. Harding)
aa62ca224a hashes: Do not enable core2/alloc feature (Tobin C. Harding)
c15f8dee29 Improve manifest package section (Tobin C. Harding)
12f5e37ed9 Add excludes to manifests (Tobin C. Harding)

Pull request description:

  Do a complete overhaul of the manifest of the top level crates (i.e., not `embedded`, `fuzzing` ect.).

  Many of the problems being fixed here were introduced over the last year by my poor understanding of exactly what was going on with _every_ line of code in the manifests, after this PR I hope that is no longer a problem.

  I'm closing #1571 because it is now done more fully at the end of this PR.

  During review please be liberal with any questions so we can ensure everything is spot on now - as we add more crates there are going to be a proliferation of manifest files, best get it right now.

ACKs for top commit:
  apoelstra:
    ACK 8596e402f2
  Kixunil:
    ACK 8596e402f2

Tree-SHA512: 9e4ae21221cd5b185c04b6d1af73983d324e6d4e09abf94763f6eabcff420d9a3b2ec62a88cd20844fda518756862b0e64a85be54187166f3b1b2b206b82cb08
This commit is contained in:
Andrew Poelstra 2023-02-10 17:08:10 +00:00
commit c8e256718b
No known key found for this signature in database
GPG Key ID: C588D63CE41B97C1
4 changed files with 23 additions and 24 deletions

View File

@ -3,16 +3,15 @@ name = "bitcoin"
version = "0.29.0"
authors = ["Andrew Poelstra <apoelstra@wpsoftware.net>"]
license = "CC0-1.0"
homepage = "https://github.com/rust-bitcoin/rust-bitcoin/"
repository = "https://github.com/rust-bitcoin/rust-bitcoin/"
documentation = "https://docs.rs/bitcoin/"
description = "General purpose library for using and interoperating with Bitcoin and other cryptocurrencies."
description = "General purpose library for using and interoperating with Bitcoin."
categories = ["cryptography::cryptocurrencies"]
keywords = [ "crypto", "bitcoin" ]
readme = "README.md"
exclude = ["tests/"]
edition = "2018"
exclude = ["tests", "contrib"]
# Please don't forget to add relevant features to docs.rs below
[features]
default = [ "std", "secp-recovery" ]
rand-std = ["secp256k1/rand-std"]
@ -28,10 +27,10 @@ bitcoinconsensus-std = ["bitcoinconsensus/std", "std"]
# Instead no-std enables additional features required for this crate to be usable without std.
# As a result, both can be enabled without conflict.
std = ["secp256k1/std", "bitcoin_hashes/std", "bech32/std", "bitcoin-internals/std"]
no-std = ["core2/alloc", "bitcoin_hashes/alloc", "secp256k1/alloc"]
no-std = ["core2", "bitcoin_hashes/alloc", "bitcoin_hashes/core2", "secp256k1/alloc"]
[package.metadata.docs.rs]
features = [ "std", "secp-recovery", "base64", "rand", "serde", "bitcoinconsensus" ]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]
[dependencies]
@ -39,10 +38,10 @@ bitcoin-internals = { path = "../internals" }
bech32 = { version = "0.9.0", default-features = false }
bitcoin_hashes = { version = "0.11.0", default-features = false }
secp256k1 = { version = "0.25.0", default-features = false, features = ["bitcoin_hashes"] }
core2 = { version = "0.3.0", optional = true, default-features = false }
base64 = { version = "0.13.0", optional = true }
bitcoinconsensus = { version = "0.20.2-0.5.0", optional = true, default-features = false }
core2 = { version = "0.3.0", default-features = false, features = ["alloc"], optional = true }
# Do NOT use this as a feature! Use the `serde` feature instead.
actual-serde = { package = "serde", version = "1.0.103", default-features = false, features = [ "derive", "alloc" ], optional = true }

View File

@ -3,32 +3,32 @@ name = "bitcoin_hashes"
version = "0.11.0"
authors = ["Andrew Poelstra <apoelstra@wpsoftware.net>"]
license = "CC0-1.0"
description = "Hash functions used by rust-bitcoin which support rustc 1.41.1"
homepage = "https://github.com/rust-bitcoin/bitcoin_hashes/"
repository = "https://github.com/rust-bitcoin/bitcoin_hashes/"
documentation = "https://docs.rs/bitcoin_hashes/"
description = "Hash functions used by the rust-bitcoin eccosystem"
categories = ["algorithms"]
keywords = [ "crypto", "bitcoin", "hash", "digest" ]
readme = "README.md"
edition = "2018"
exclude = ["tests", "contrib"]
[features]
default = ["std"]
std = ["internals/alloc"]
std = ["internals/std"]
alloc = ["internals/alloc"]
schemars = ["actual-schemars", "dyn-clone"]
# If you disable std, you can still use a Write trait via the core2 feature.
# You can also use ToHex via the alloc feature, as it requires Vec/String.
# And you can still just disable std by disabling default features, without enabling these two.
alloc = ["core2/alloc", "internals/alloc"]
serde-std = ["serde/std"]
[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]
[dependencies]
# Only enable this if you explicitly do not want to use "std", otherwise enable "serde-std".
serde = { version = "1.0", default-features = false, optional = true }
# Only enable this if you explicitly do not want to use an allocator, otherwise enable "alloc".
core2 = { version = "0.3.0", optional = true, default_features = false }
# TODO: change to proper version before release
internals = { path = "../internals", package = "bitcoin-internals" }
core2 = { version = "0.3.0", default_features = false, optional = true }
# Only enable this if you explicitly do not want to use "std", otherwise enable "serde-std".
serde = { version = "1.0", default-features = false, optional = true }
# Do NOT use this as a feature! Use the `schemars` feature instead. Can only be used with "std" enabled.
actual-schemars = { package = "schemars", version = "<=0.8.3", optional = true }
# Do NOT enable this dependency, this is just to pin dyn-clone (transitive dep from schemars)

View File

@ -22,7 +22,7 @@
//! SHA512/256 is a hash function that uses the sha512 alogrithm but it truncates
//! the output to 256 bits. It has different initial constants than sha512 so it
//! produces an entirely different hash compared to sha512. More information at
//! https://eprint.iacr.org/2010/548.pdf.
//! <https://eprint.iacr.org/2010/548.pdf>.
use core::str;
use core::ops::Index;
@ -35,7 +35,7 @@ use crate::{sha512, sha512::BLOCK_SIZE, Error};
/// SHA512/256 is a hash function that uses the sha512 alogrithm but it truncates
/// the output to 256 bits. It has different initial constants than sha512 so it
/// produces an entirely different hash compared to sha512. More information at
/// https://eprint.iacr.org/2010/548.pdf.
/// <https://eprint.iacr.org/2010/548.pdf>.
#[derive(Clone)]
pub struct HashEngine(sha512::HashEngine);
@ -73,7 +73,7 @@ impl crate::HashEngine for HashEngine {
crate::internal_macros::hash_type! {
256,
false,
"Output of the SHA512/256 hash function.\n\nSHA512/256 is a hash function that uses the sha512 alogrithm but it truncates the output to 256 bits. It has different initial constants than sha512 so it produces an entirely different hash compared to sha512. More information at https://eprint.iacr.org/2010/548.pdf. ",
"Output of the SHA512/256 hash function.\n\nSHA512/256 is a hash function that uses the sha512 alogrithm but it truncates the output to 256 bits. It has different initial constants than sha512 so it produces an entirely different hash compared to sha512. More information at <https://eprint.iacr.org/2010/548.pdf>. ",
"crate::util::json_hex_string::len_32"
}

View File

@ -10,15 +10,15 @@ categories = ["cryptography::cryptocurrencies"]
keywords = ["internal"]
readme = "README.md"
edition = "2018"
exclude = ["tests", "contrib"]
# Please don't forget to add relevant features to docs.rs below.
[features]
default = []
std = ["alloc"]
alloc = []
[package.metadata.docs.rs]
features = ["std"]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]
[dependencies]