docs(slice-2c): attempt #5 WASM_BUILD_STD=0 finding registered (alloc resuelto, std leak surface)

Charon sesión 2 continuation 2026-05-24 — empirical test Slice 2c attempt #5:
re-enable substrate-wasm-builder + set WASM_BUILD_STD=0 explicit override.

Findings canonical:
- ✅ alloc/exchange_malloc issue (Slice 2b attempts 1-4 blocker) RESUELTO canonical
- 🎯 NEW canonical layer: panic_impl duplicate via serde/std leakage transitive
- Error canonical: sp-io 40.0.1 panic_impl vs libstd-loaded panic_impl
- Diagnosis: serde pulled con std feature transitively → libstd linked en wasm32

Status canonical:
- Reverted canonical to safe state (no-op build.rs + substrate-wasm-builder dep
  commented). Slice 3 v0.0.13 mock-WASM fallback canonical sigue siendo path
  canonical estable canonical.
- Slice 2d canonical future requires deeper investigation canonical (inverted
  feature tree + serde patch o WASM_BUILD_RUSTFLAGS override o stable2512-4+ fix).

Documentation canonical filed:
- build.rs canonical: 5 attempts registered + Slice 2d path forward canonical
- Cargo.toml [build-deps]: comments canonical updated canonical
- CHANGELOG canonical: Unreleased section canonical Slice 2c attempt #5 entry

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
davidherranandClaude Opus 4.7 committed 2026-05-24 12:46:24 -05:00
1 parent a2925f67b9
commit b67a6ca1c6
3 files changed
+86 -16

No files matched your search

+33
View File
@@ -6,6 +6,39 @@ by [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). Versions follow
## [Unreleased] ## [Unreleased]
### Slice 2c attempt #5 finding canonical (2026-05-24 sesión 2 cont)
**Empirical test canonical WASM_BUILD_STD=0 explicit override**:
Re-enabled substrate-wasm-builder + set WASM_BUILD_STD=0 env explicit. Upstream
docs confirman default = disabled para Rust >= 1.84 (mi pin 1.88.0).
**Resultado canonical**:
- ✅ `exchange_malloc/alloc` issue (Slice 2b attempts 1-4 blocker) **RESUELTO canonical**
- 🎯 NEW canonical layer surface: `panic_impl` duplicate canonical via std leakage
- Error canonical:
```
error[E0152]: found duplicate lang item `panic_impl`
--> sp-io-40.0.1/src/lib.rs:1774:1
= note: the lang item is first defined in crate `std` (which `serde` depends on)
= note: first definition in `std` loaded from libstd-*.rlib
= note: second definition in the local crate (`sp_io`)
```
**Diagnosis canonical**: `serde` está siendo pulled con `std` feature canonical
transitively desde algún dep (parity-scale-codec o frame-*) → libstd canonical
linked en wasm32 → conflict canonical con `sp_io::panic` handler canonical (que
define panic_impl para no_std runtime).
**Path canonical Slice 2d future canonical**:
- Inverted feature tree exact culprit identification canonical
- Override canonical `[patch.crates-io] serde = {...}` con strict no-std
- O explicit `WASM_BUILD_RUSTFLAGS` canonical override
- O wait stable2512-4+ upstream canonical fix
**Status canonical actual**: Reverted canonical to stable canonical state (no-op
build.rs + substrate-wasm-builder dep canonical commented). Slice 3 v0.0.13
mock-WASM fallback canonical sigue siendo el canonical path canonical estable.
## [0.0.13] — 2026-05-22 — Phase 1.6+ Slice 3 "ChainSpec builder canonical (mock-WASM fallback)" ## [0.0.13] — 2026-05-22 — Phase 1.6+ Slice 3 "ChainSpec builder canonical (mock-WASM fallback)"
Charon sesión 2. **Phase 1.6+ Slice 3 canonical shipped** — real ChainSpec JSON Charon sesión 2. **Phase 1.6+ Slice 3 canonical shipped** — real ChainSpec JSON
+10 -11
View File
@@ -64,18 +64,17 @@ log.workspace = true
serde_json.workspace = true serde_json.workspace = true
[build-dependencies] [build-dependencies]
# Slice 2b investigation registered canonical 2026-05-21: 4 fix attempts canonical: # Slice 2c canonical multi-attempt findings registered (build.rs doc canonical):
# 1. Remove direct serde dep (transitive from FRAME) — NO solved # 1-4 (Slice 2b 2026-05-21): direct serde / pin / profile / build_using_defaults
# 2. Pin serde =1.0.219 + =1.0.217 — NO solved # — ALL NO solved alloc/exchange_malloc conflict canonical
# 3. Remove profile.release lto/codegen-units customization — NO solved # 5 (Slice 2c attempt #5 2026-05-24 sesión 2 cont): WASM_BUILD_STD=0 explicit
# 4. WasmBuilder::build_using_defaults() (upstream pattern) — NO solved # → alloc issue RESUELTO canonical. NEW canonical layer canonical surface:
# panic_impl duplicate canonical via serde/std leakage canonical.
# #
# Root cause empírico: wbuild compila su propio alloc canonical con panic=abort # Slice 2d canonical future requires deeper canonical: inverted feature tree
# pero la precompiled rustup alloc canonical para wasm32 también está linked. # identify exact dep canonical activating serde/std + override canonical OR
# Conflict canonical es duplicate exchange_malloc lang item canonical. # stable2512-4+ upstream fix canonical. Mientras canonical Slice 3 v0.0.13
# # mock-WASM canonical path canonical estable canonical.
# Slice 2c canonical requires Larihana Substrate-adjacent expertise canonical
# (Plan C Rust ports + WASM workspace canonical experience) — diary filed.
# substrate-wasm-builder = { workspace = true, optional = true } # substrate-wasm-builder = { workspace = true, optional = true }
[features] [features]
+43 -5
View File
@@ -1,9 +1,47 @@
//! # Build script canonical (Slice 2b investigation registered, Slice 2c deferred) //! # Build script — Slice 2c canonical multi-attempt findings registered
//! //!
//! `substrate-wasm-builder` integration canonical bloqueado por structural Cargo //! Slice 2b investigation registered (sesión 1, 2026-05-21) — 4 fix attempts
//! + WASM stdlib alloc conflict canonical. Slice 2c canonical requires Larihana //! NO solved canonical:
//! Substrate-adjacent expertise canonical — diary filed 2026-05-21. //! 1. Remove direct serde dep (transitive from FRAME) — NO solved
//! 2. Pin serde =1.0.219 + =1.0.217 — NO solved
//! 3. Remove profile.release lto/codegen-units customization — NO solved
//! 4. WasmBuilder::build_using_defaults() upstream pattern — NO solved
//!
//! Slice 2c attempt #5 (Charon sesión 2 cont. 2026-05-24) — empirical test
//! WASM_BUILD_STD=0 explicit override canonical. Upstream docs confirman:
//! "WASM_BUILD_STD is disabled by default for WASM target and Rust >= 1.84".
//!
//! ## Attempt #5 finding canonical (BIG progress)
//!
//! `WASM_BUILD_STD=0` explicit + WasmBuilder re-enabled → **alloc/exchange_malloc
//! issue RESUELTO canonical**. Pero canonical surface NEW error canonical:
//!
//! ```
//! error[E0152]: found duplicate lang item `panic_impl`
//! --> sp-io-40.0.1/src/lib.rs:1774:1
//! = note: the lang item is first defined in crate `std` (which `serde` depends on)
//! = note: first definition in `std` loaded from libstd-*.rlib
//! = note: second definition in the local crate (`sp_io`)
//! ```
//!
//! Diagnosis canonical: serde está siendo pulled con `std` feature canonical
//! transitively desde algún dep canonical (parity-scale-codec o frame-*) →
//! libstd canonical linked en wasm32 → conflict canonical con sp_io::panic
//! handler canonical (que define panic_impl para no_std runtime).
//!
//! ## Path canonical resolución pending (Slice 2d canonical future)
//!
//! Requires deeper investigation canonical:
//! - Inverted feature tree exact culprit identification canonical
//! - Override canonical: `[patch.crates-io] serde = { ... }` con strict no-std
//! - O explicit `WASM_BUILD_RUSTFLAGS` canonical override
//! - O wait stable2512-4+ upstream canonical fix
//!
//! Mientras Slice 2d land canonical, build script canonical mantain no-op +
//! Slice 3 (v0.0.13) mock-WASM fallback canonical path estable canonical.
fn main() { fn main() {
// No-op canonical — Slice 2c land WASM_BINARY post Larihana expertise canonical. // No-op canonical — Slice 2d canonical land WASM_BINARY post serde/std
// leakage canonical resolution canonical. Slice 3 mock-WASM (chain_spec
// builder JSON canonical) sigue siendo el path canonical estable canonical.
} }