Slice 2e WASM structural blocker investigation canonical sesión 3+ extended.
Substrate-wasm-builder re-enabled feature-gated. 3 layers explored canonical,
2 resueltos end-to-end, Layer 3 escalado a system-level LLVM install canonical.
## 3-layer findings canonical
- Layer 1 alloc/exchange_malloc duplicate → RESUELTO Slice 2c+2d (WASM_BUILD_STD=0)
- Layer 2 getrandom 0.2.17 wasm-incompat → RESUELTO Slice 2e (direct dep + custom feature)
- Layer 3 secp256k1-sys clang wasm32 target unsupported → BLOQUEADO (requires brew LLVM)
## Changes
- crates/origin-chain-runtime/Cargo.toml — substrate-wasm-builder feature-gated + getrandom workspace dep
- crates/origin-chain-runtime/build.rs — conditional WasmBuilder activation
- Cargo.toml workspace — getrandom = { version = "0.2", features = ["custom"] } workspace dep
## Layer 3 path forward canonical (Approach A recommended)
brew install llvm + configure CC_wasm32_unknown_unknown env var + retry build.
Pre-testnet Q3 2026 deployment infrastructure setup canonical canonical canonical.
## Investigation report canonical
Filed monorepo: docs/L7_roadmaps/SLICE_2E_INVESTIGATION_REPORT_V1.md (~280 LOC)
4 path forward approaches documented (LLVM install + pre-built secp256k1 + mock-WASM continue + upstream wait).
## Verification
- cargo test --workspace — 202 tests passing, 0 failures (NO regression)
- Default build unchanged (Slice 3 mock-WASM continues estable canonical)
- Feature-gated --features wasm-build activates substrate-wasm-builder para Layer 3 empirical testing
🔍 Slice 2e advanced canonical canonical. Path documented para Slice 2f future post-LLVM install.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
40 lines
1.5 KiB
Rust
40 lines
1.5 KiB
Rust
//! # Build script — Slice 2e v0.0.35 canonical investigation
|
|
//!
|
|
//! ## History
|
|
//!
|
|
//! - **Slice 2c attempts 1-4** (2026-05-21): direct serde / pin / profile /
|
|
//! build_using_defaults — ALL NO solved alloc/exchange_malloc conflict.
|
|
//! - **Slice 2c attempt #5 + Slice 2d** (2026-05-24): WASM_BUILD_STD=0 explicit
|
|
//! override → alloc/exchange_malloc RESUELTO. NEW layer: panic_impl duplicate
|
|
//! via serde/std leak transitive.
|
|
//! - **Slice 2e v0.0.35** (2026-05-26): re-enable substrate-wasm-builder canonical
|
|
//! con `wasm-build` feature gate. Investigate [patch.crates-io] serde override
|
|
//! + types/std isolation empirical.
|
|
//!
|
|
//! ## Usage canonical
|
|
//!
|
|
//! - Default (no feature): build script no-op, mock-WASM Slice 3 fallback active.
|
|
//! - `--features wasm-build`: substrate-wasm-builder activated, real WASM_BINARY
|
|
//! build attempted. WASM_BUILD_STD=0 must be set to avoid alloc duplicate.
|
|
//!
|
|
//! ## Path forward post-Slice 2e canonical
|
|
//!
|
|
//! Si serde/std leak resolved → Phase 3 pallet-revive smart contracts unblocked
|
|
//! Si NOT resolved → document next attempt path (upstream Substrate stable2512-4+
|
|
//! wait OR sp-io feature gate audit deeper OR alternative WASM builder).
|
|
|
|
#[cfg(feature = "wasm-build")]
|
|
fn main() {
|
|
substrate_wasm_builder::WasmBuilder::new()
|
|
.with_current_project()
|
|
.export_heap_base()
|
|
.import_memory()
|
|
.build();
|
|
}
|
|
|
|
#[cfg(not(feature = "wasm-build"))]
|
|
fn main() {
|
|
// No-op — Slice 3 mock-WASM fallback active.
|
|
// Enable real WASM build with `cargo build --features wasm-build`.
|
|
}
|