Skip to content

bindings/rust: expose std as a Cargo feature - #287

Open
rnzorgani-ledger wants to merge 1 commit into
supranational:masterfrom
LedgerHQ:feat/std-cargo-feature
Open

bindings/rust: expose std as a Cargo feature#287
rnzorgani-ledger wants to merge 1 commit into
supranational:masterfrom
LedgerHQ:feat/std-cargo-feature

Conversation

@rnzorgani-ledger

@rnzorgani-ledger rnzorgani-ledger commented Jul 27, 2026

Copy link
Copy Markdown

std is currently inferred purely from the target triple in build.rs, so a consumer building for a hosted-looking target cannot opt out of std and the threadpool dependency. This makes std a real, default-on Cargo feature gating threadpool, and folds it into build.rs no_std detection so --no-default-features (or BLST_TEST_NO_STD) yields a genuine no_std build. Target-based detection and the wasm32/unknown auto no-threads behaviour are preserved.

Currently std is inferred purely from the target triple in build.rs, so
a
consumer building for a hosted target that happens to look std-capable
(e.g. powerpc-unknown-linux-gnu firmware) cannot opt out of std and the
threadpool dependency.

Make `std` a real, default-on Cargo feature that gates the `threadpool`
dependency, and fold it into the build.rs no_std detection so
`--no-default-features` (or BLST_TEST_NO_STD) yields a genuine no_std
build. Target-based detection and the wasm32/unknown auto no-threads
behaviour are preserved.
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

Successfully merging this pull request may close these issues.

1 participant