From acf38c19cb3de37158bf6931dbef028d82117da6 Mon Sep 17 00:00:00 2001 From: Alex Pozhylenkov Date: Fri, 9 Aug 2024 14:10:10 +0300 Subject: [PATCH] fix: Fixed `cardano` and `wasi-filesystem` WASM component builds (#332) * fix cardano and wasi-filesystem WASM component builds * cleanup http gateway logs * fix --- .../hermes/http_gateway/mod.rs | 23 ++++--------------- wasm/integration-test/cardano/Earthfile | 2 +- .../wasi-filesystem/Earthfile | 2 +- 3 files changed, 6 insertions(+), 21 deletions(-) diff --git a/hermes/bin/src/runtime_extensions/hermes/http_gateway/mod.rs b/hermes/bin/src/runtime_extensions/hermes/http_gateway/mod.rs index 2c1aa00d9..2b0599ae8 100644 --- a/hermes/bin/src/runtime_extensions/hermes/http_gateway/mod.rs +++ b/hermes/bin/src/runtime_extensions/hermes/http_gateway/mod.rs @@ -1,34 +1,19 @@ //! HTTP Gateway use gateway_task::spawn; -use rusty_ulid::Ulid; mod event; mod gateway_task; /// Gateway routing logic mod routing; -/// State. -pub(crate) struct State { - /// UID for wasm instance - pub(crate) instance: Ulid, -} - /// State. -static STATE: once_cell::sync::Lazy = once_cell::sync::Lazy::new(|| { +static STATE: once_cell::sync::Lazy<()> = once_cell::sync::Lazy::new(|| { spawn(); - - State { - instance: rusty_ulid::Ulid::generate(), - } }); /// New context -pub(crate) fn new_context(ctx: &crate::runtime_context::HermesRuntimeContext) { - println!( - "Instance {:?}\n - App name {:?}", - STATE.instance, - ctx.app_name() - ); +pub(crate) fn new_context(_ctx: &crate::runtime_context::HermesRuntimeContext) { + // Init state event + let () = *STATE; } diff --git a/wasm/integration-test/cardano/Earthfile b/wasm/integration-test/cardano/Earthfile index 6e33ff0b4..fb5c3141d 100644 --- a/wasm/integration-test/cardano/Earthfile +++ b/wasm/integration-test/cardano/Earthfile @@ -15,7 +15,7 @@ build: COPY Cargo.toml . COPY wasi+build-rust-bindings/hermes.rs src/hermes.rs - DO rust-ci+CARGO --args "+nightly build --target wasm32-wasip1 --release" \ + DO rust-ci+CARGO --args "build --target wasm32-wasip1 --release" \ --output="wasm32-wasip1/release/cardano_rte_test_component.wasm" COPY wasi-hermes-component-adapter+build/wasi-hermes-component-adapter.wasm wasi_snapshot_preview1.wasm diff --git a/wasm/integration-test/wasi-filesystem/Earthfile b/wasm/integration-test/wasi-filesystem/Earthfile index 7028cc9ba..0597c4d3d 100644 --- a/wasm/integration-test/wasi-filesystem/Earthfile +++ b/wasm/integration-test/wasi-filesystem/Earthfile @@ -15,7 +15,7 @@ build: COPY Cargo.toml . COPY wasi+build-rust-bindings/hermes.rs src/hermes.rs - DO rust-ci+CARGO --args "+nightly build --target wasm32-wasip1 --release" \ + DO rust-ci+CARGO --args "build --target wasm32-wasip1 --release" \ --output="wasm32-wasip1/release/wasi_filesystem.wasm" COPY wasi-hermes-component-adapter+build/wasi-hermes-component-adapter.wasm wasi_snapshot_preview1.wasm