Skip to content

Fix json+no_std build of ergotree-ir (missing alloc imports) - #903

Open
mwaddip wants to merge 1 commit into
ergoplatform:developfrom
mwaddip:fix/sigma-protocol-json-no-std
Open

Fix json+no_std build of ergotree-ir (missing alloc imports)#903
mwaddip wants to merge 1 commit into
ergoplatform:developfrom
mwaddip:fix/sigma-protocol-json-no-std

Conversation

@mwaddip

@mwaddip mwaddip commented Jun 12, 2026

Copy link
Copy Markdown

cargo check -p ergo-nipopow — or any build resolving ergotree-ir with the json feature but without std — fails since 072f858: the SigmaBoolean base16 serializer added to chain/json/sigma_protocol.rs uses String::deserialize / .to_string() from the std prelude, without the alloc imports the crate uses elsewhere under no_std.

CI and workspace-wide builds never hit it: the workspace dep table pins default-features = false, but some member always enables ergotree-ir/std and feature unification applies it to every crate in the graph. A solo -p ergo-nipopow build resolves exactly the broken combination.

Fix: the two missing alloc::string imports — the same pattern the rest of the crate uses (e.g. serialization/serializable.rs).

…module

072f858 added std-prelude-style code (String::deserialize,
.to_string()) to chain/json/sigma_protocol.rs without the alloc imports
the crate uses elsewhere under no_std, breaking any build that resolves
ergotree-ir with the json feature but without std — e.g.
`cargo check -p ergo-nipopow`, which inherits default-features = false
from the workspace dependency table. Workspace-wide builds (and CI)
mask the breakage via feature unification, since some member always
enables ergotree-ir/std.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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