Skip to content

Commit 8bc4c34

Browse files
committed
Fix new rr crate to be no_std
1 parent fc79643 commit 8bc4c34

File tree

5 files changed

+20
-12
lines changed

5 files changed

+20
-12
lines changed

Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/rr/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ all-features = true
1818
[dependencies]
1919
wasmtime-environ = { workspace = true, features = ["component-model"] }
2020
serde = { workspace = true }
21+
serde_derive = { workspace = true }
2122
postcard = { workspace = true }
2223
anyhow = { workspace = true }
2324
log = { workspace = true }

crates/rr/src/events.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use crate::ReplayError;
1+
use crate::{ReplayError, prelude::*};
22
use anyhow::Result;
33
use core::fmt;
44
use serde::{Deserialize, Serialize};

crates/rr/src/io.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
use super::RREvent;
2-
use anyhow::Result;
1+
use crate::{RREvent, prelude::*};
32
use core::any::Any;
43
use postcard;
54

65
cfg_if::cfg_if! {
76
if #[cfg(feature = "std")] {
7+
extern crate std;
88
use std::io::{Write, Seek, Read};
99
/// A writer for recording in RR.
1010
pub trait RecordWriter: Write + Send + Sync + Any {}

crates/rr/src/lib.rs

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,24 @@
1-
use anyhow::Result;
2-
use core::fmt;
1+
#![no_std]
2+
3+
pub(crate) mod prelude {
4+
pub use anyhow::{self, Result};
5+
pub use serde::{Deserialize, Serialize};
6+
pub use wasmtime_environ::prelude::*;
7+
}
8+
9+
use crate::prelude::*;
10+
pub use core::fmt;
311
pub use events::{
412
EventError, RRFuncArgVals, ResultEvent, Validate, common_events, component_events, core_events,
513
};
14+
use events::{component_events::RRComponentInstanceId, core_events::RRModuleInstanceId};
615
pub use io::{RecordWriter, ReplayReader, from_replay_reader, to_record_writer};
7-
use serde::{Deserialize, Serialize};
816
use wasmtime_environ::{EntityIndex, WasmChecksum};
917

10-
use events::{component_events::RRComponentInstanceId, core_events::RRModuleInstanceId};
18+
/// Encapsulation of event types comprising an [`RREvent`] sum type
19+
mod events;
20+
/// I/O support for reading and writing traces
21+
mod io;
1122

1223
/// Settings for execution recording.
1324
#[derive(Debug, Clone, Serialize, Deserialize)]
@@ -45,11 +56,6 @@ impl Default for ReplaySettings {
4556
}
4657
}
4758

48-
/// Encapsulation of event types comprising an [`RREvent`] sum type
49-
mod events;
50-
/// I/O support for reading and writing traces
51-
mod io;
52-
5359
/// Macro template for [`RREvent`] and its conversion to/from specific
5460
/// event types
5561
macro_rules! rr_event {

0 commit comments

Comments
 (0)