Skip to content

Commit

Permalink
fix: Fixed cardano and wasi-filesystem WASM component builds (#332)
Browse files Browse the repository at this point in the history
* fix cardano and wasi-filesystem WASM component builds

* cleanup http gateway logs

* fix
  • Loading branch information
Mr-Leshiy authored Aug 9, 2024
1 parent 6fa7ff9 commit acf38c1
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 21 deletions.
23 changes: 4 additions & 19 deletions hermes/bin/src/runtime_extensions/hermes/http_gateway/mod.rs
Original file line number Diff line number Diff line change
@@ -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<State> = 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;
}
2 changes: 1 addition & 1 deletion wasm/integration-test/cardano/Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion wasm/integration-test/wasi-filesystem/Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit acf38c1

Please sign in to comment.