Skip to content

Commit df05f27

Browse files
committed
Remove direct dependency on flatbuffers in hyperlight-host and hyperlight-guest
Signed-off-by: Ludvig Liljenberg <[email protected]>
1 parent 01353de commit df05f27

File tree

9 files changed

+5
-13
lines changed

9 files changed

+5
-13
lines changed

Cargo.lock

-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/hyperlight_common/src/lib.rs

+3
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,6 @@ pub mod flatbuffer_wrappers;
3636
mod flatbuffers;
3737
/// cbindgen:ignore
3838
pub mod mem;
39+
40+
extern crate flatbuffers as fb;
41+
pub use fb::FlatBufferBuilder;

src/hyperlight_guest/Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ buddy_system_allocator = "0.11.0"
2424
hyperlight-common = { workspace = true }
2525
spin = "0.10.0"
2626
log = { version = "0.4", default-features = false }
27-
flatbuffers = { version= "25.2.10", default-features = false }
2827

2928
[build-dependencies]
3029
cc = "1.2"

src/hyperlight_guest/src/host_function_call.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ use alloc::format;
1818
use alloc::string::ToString;
1919
use alloc::vec::Vec;
2020
use core::arch::global_asm;
21-
use flatbuffers::FlatBufferBuilder;
2221

2322
use hyperlight_common::flatbuffer_wrappers::function_call::{FunctionCall, FunctionCallType};
2423
use hyperlight_common::flatbuffer_wrappers::function_types::{
@@ -27,6 +26,7 @@ use hyperlight_common::flatbuffer_wrappers::function_types::{
2726
use hyperlight_common::flatbuffer_wrappers::guest_error::ErrorCode;
2827
use hyperlight_common::flatbuffer_wrappers::util::get_flatbuffer_result;
2928
use hyperlight_common::mem::RunMode;
29+
use hyperlight_common::FlatBufferBuilder;
3030

3131
use crate::error::{HyperlightGuestError, Result};
3232
use crate::host_error::check_for_host_error;

src/hyperlight_host/Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ rand = { version = "0.9" }
2626
cfg-if = { version = "1.0.0" }
2727
libc = { version = "0.2.172" }
2828
paste = "1.0"
29-
flatbuffers = "25.2.10"
3029
page_size = "0.6.0"
3130
termcolor = "1.2.0"
3231
bitflags = "2.9.0"

src/hyperlight_host/src/error.rs

-5
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ use std::time::SystemTimeError;
3232

3333
#[cfg(target_os = "windows")]
3434
use crossbeam_channel::{RecvError, SendError};
35-
use flatbuffers::InvalidFlatbuffer;
3635
use hyperlight_common::flatbuffer_wrappers::function_types::{ParameterValue, ReturnValue};
3736
use hyperlight_common::flatbuffer_wrappers::guest_error::ErrorCode;
3837
use serde::{Deserialize, Serialize};
@@ -167,10 +166,6 @@ pub enum HyperlightError {
167166
#[error("Failed To Convert Size to usize")]
168167
IntConversionFailure(#[from] TryFromIntError),
169168

170-
/// The flatbuffer is invalid
171-
#[error("The flatbuffer is invalid")]
172-
InvalidFlatBuffer(#[from] InvalidFlatbuffer),
173-
174169
/// Conversion of str to Json failed
175170
#[error("Conversion of str data to json failed")]
176171
JsonConversionFailure(#[from] serde_json::Error),

src/hyperlight_host/src/mem/mgr.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ use std::cmp::Ordering;
1919
use std::str::from_utf8;
2020
use std::sync::{Arc, Mutex};
2121

22-
use flatbuffers::FlatBufferBuilder;
2322
use hyperlight_common::flatbuffer_wrappers::function_call::{FunctionCall, FunctionCallType};
2423
use hyperlight_common::flatbuffer_wrappers::function_types::ReturnValue;
2524
use hyperlight_common::flatbuffer_wrappers::guest_error::{ErrorCode, GuestError};
2625
use hyperlight_common::flatbuffer_wrappers::guest_log_data::GuestLogData;
2726
use hyperlight_common::flatbuffer_wrappers::host_function_details::HostFunctionDetails;
27+
use hyperlight_common::FlatBufferBuilder;
2828
use serde_json::from_str;
2929
use tracing::{instrument, Span};
3030

src/tests/rust_guests/callbackguest/Cargo.lock

-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/tests/rust_guests/simpleguest/Cargo.lock

-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)