Skip to content

Commit 64eed44

Browse files
committed
Merge #987: fix(manifest): correct serde feature configuration for no-std
c7adcfd fix(manifest): correct serde feature configuration for no-std (Rishit Modi) Pull request description: ### Description This PR fixes a bug where the optional serde dependency implicitly leaks the standard library into no-std builds. Previously, serde was missing `default-features = false` in the `[dependencies]` block. When downstream crates attempted to compile miniscript for bare-metal targets (e.g., thumbv7m-none-eabi) using minimal-version dependency resolution, Cargo would resolve serde with its default "std" feature enabled, causing immediate compilation failures. ### Notes to the reviewers I encountered this feature leakage while working on integrating cargo-rbmt CI checks over in bdk_wallet (specifically in this PR: bitcoindevkit/bdk_wallet#494). When the rbmt matrix runs its minimal dependency sweep on no-std bare-metal targets, it exposes this missing feature configuration. Applying this fix locally allowed the embedded target compilation to pass cleanly. ### Changelog notice - Added default-features = false to the optional serde dependency. - Explicitly opted into the alloc feature for serde. - Updated the std feature array to use the weak dependency activation syntax (`"serde?/std"`) ACKs for top commit: trevarj: Nice find. ACK c7adcfd apoelstra: ACK c7adcfd; successfully ran local tests Tree-SHA512: 33c2993856cfa70cba83f4b0f95b5bd9df04d6a50db3485d13ec18ea4d7c9f613f50ad86e6b53f1ad9cf7642165cd67d736a3e81f8f9b480084bb38a67ad728d
2 parents 460d5f1 + c7adcfd commit 64eed44

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ rust-version = "1.63.0"
1313

1414
[features]
1515
default = ["std"]
16-
std = ["bitcoin/std", "bitcoin/secp-recovery", "bech32/std"]
16+
std = ["bitcoin/std", "bitcoin/secp-recovery", "bech32/std", "serde?/std"]
1717
compiler = []
1818
trace = []
1919

@@ -26,7 +26,7 @@ bech32 = { version = "0.11.0", default-features = false, features = ["alloc"] }
2626
bitcoin = { version = "0.32.6", default-features = false }
2727
hex = { package = "hex-conservative", default-features = false, features = ["alloc"], version = "1.0.0" }
2828

29-
serde = { version = "1.0.103", optional = true }
29+
serde = { version = "1.0.103", default-features = false, features = ["alloc"], optional = true }
3030

3131
[dev-dependencies]
3232
serde_test = "1.0.147"

0 commit comments

Comments
 (0)