Skip to content

2024 edition #355

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 10 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ RUN SNIPPET="export PROMPT_COMMAND='history -a' && export HISTFILE=/commandhisto

USER $USER

ARG RUST_TOOLCHAIN=1.81.0
ARG RUST_TOOLCHAIN=1.85.0

# Install rust
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y \
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/Benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:

- uses: hyperlight-dev/[email protected]
with:
rust-toolchain: "1.81.0"
rust-toolchain: "1.85.0"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/CargoAudit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
# TODO: Once the runner image is updated to include the necessary tools (without downloading), we can switch to the common workflow.
- uses: dtolnay/rust-toolchain@master
with:
toolchain: "1.81.0"
toolchain: "1.85.0"

- uses: rustsec/[email protected]
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/CargoPublish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:

- uses: hyperlight-dev/[email protected]
with:
rust-toolchain: "1.81.0"
rust-toolchain: "1.85.0"

- name: Check crate versions
shell: bash
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/CreateDevcontainerImage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ env:
USER: vscode
GROUP: vscode
LLVM_VERSION: 17
RUST_TOOLCHAIN_DEFAULT: 1.81.0
RUST_TOOLCHAIN_DEFAULT: 1.85.0
RUST_TOOLCHAIN_FILE: rust-toolchain.toml

# There is a single job in this workflow. It's configured to run on the latest available version of Ubuntu.
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/CreateRelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:

- uses: hyperlight-dev/[email protected]
with:
rust-toolchain: "1.81.0"
rust-toolchain: "1.85.0"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Expand All @@ -43,7 +43,7 @@ jobs:

- uses: hyperlight-dev/[email protected]
with:
rust-toolchain: "1.81.0"
rust-toolchain: "1.85.0"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Expand Down Expand Up @@ -105,7 +105,7 @@ jobs:

- uses: hyperlight-dev/[email protected]
with:
rust-toolchain: "1.81.0"
rust-toolchain: "1.85.0"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/dep_build_guest_binaries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:

- uses: hyperlight-dev/[email protected]
with:
rust-toolchain: "1.81.0"
rust-toolchain: "1.85.0"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/dep_fuzzing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:

- uses: hyperlight-dev/[email protected]
with:
rust-toolchain: "1.81.0"
rust-toolchain: "1.85.0"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/dep_rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ jobs:

- uses: hyperlight-dev/[email protected]
with:
rust-toolchain: "1.81.0"
rust-toolchain: "1.85.0"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Expand Down
5 changes: 3 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ exclude = [

[workspace.package]
version = "0.2.0"
edition = "2021"
rust-version = "1.80.0"
edition = "2024"
rust-version = "1.85.0"
license = "Apache-2.0"
homepage = "https://github.com/hyperlight-dev/hyperlight"
repository = "https://github.com/hyperlight-dev/hyperlight"
Expand Down
2 changes: 1 addition & 1 deletion fuzz/fuzz_targets/host_call.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ limitations under the License.
use std::sync::{Mutex, OnceLock};

use hyperlight_host::func::{ParameterValue, ReturnType};
use hyperlight_host::sandbox::uninitialized::GuestBinary;
use hyperlight_host::sandbox::SandboxConfiguration;
use hyperlight_host::sandbox::uninitialized::GuestBinary;
use hyperlight_host::sandbox_state::sandbox::EvolvableSandbox;
use hyperlight_host::sandbox_state::transition::Noop;
use hyperlight_host::{HyperlightError, MultiUseSandbox, UninitializedSandbox};
Expand Down
2 changes: 1 addition & 1 deletion fuzz/fuzz_targets/host_print.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use hyperlight_host::sandbox_state::sandbox::EvolvableSandbox;
use hyperlight_host::sandbox_state::transition::Noop;
use hyperlight_host::{MultiUseSandbox, UninitializedSandbox};
use hyperlight_testing::simple_guest_for_fuzzing_as_string;
use libfuzzer_sys::{fuzz_target, Corpus};
use libfuzzer_sys::{Corpus, fuzz_target};

static SANDBOX: OnceLock<Mutex<MultiUseSandbox>> = OnceLock::new();

Expand Down
2 changes: 1 addition & 1 deletion hack/rust-dependabot-patch.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
FROM dependabot/dependabot-script
RUN rustup toolchain install 1.81.0 && rustup default 1.81.0
RUN rustup toolchain install 1.85.0 && rustup default 1.85.0
2 changes: 1 addition & 1 deletion rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
[toolchain]
channel = "1.81.0"
channel = "1.85.0"
14 changes: 7 additions & 7 deletions src/hyperlight_common/src/flatbuffer_wrappers/function_call.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,18 @@ limitations under the License.
use alloc::string::{String, ToString};
use alloc::vec::Vec;

use anyhow::{bail, Error, Result};
use flatbuffers::{size_prefixed_root, WIPOffset};
use anyhow::{Error, Result, bail};
use flatbuffers::{WIPOffset, size_prefixed_root};
#[cfg(feature = "tracing")]
use tracing::{instrument, Span};
use tracing::{Span, instrument};

use super::function_types::{ParameterValue, ReturnType};
use crate::flatbuffers::hyperlight::generated::{
hlbool, hlboolArgs, hldouble, hldoubleArgs, hlfloat, hlfloatArgs, hlint, hlintArgs, hllong,
hllongArgs, hlstring, hlstringArgs, hluint, hluintArgs, hlulong, hlulongArgs, hlvecbytes,
hlvecbytesArgs, FunctionCall as FbFunctionCall, FunctionCallArgs as FbFunctionCallArgs,
FunctionCall as FbFunctionCall, FunctionCallArgs as FbFunctionCallArgs,
FunctionCallType as FbFunctionCallType, Parameter, ParameterArgs,
ParameterValue as FbParameterValue,
ParameterValue as FbParameterValue, hlbool, hlboolArgs, hldouble, hldoubleArgs, hlfloat,
hlfloatArgs, hlint, hlintArgs, hllong, hllongArgs, hlstring, hlstringArgs, hluint, hluintArgs,
hlulong, hlulongArgs, hlvecbytes, hlvecbytesArgs,
};

/// The type of function call.
Expand Down
12 changes: 6 additions & 6 deletions src/hyperlight_common/src/flatbuffer_wrappers/function_types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,18 @@ limitations under the License.
use alloc::string::{String, ToString};
use alloc::vec::Vec;

use anyhow::{anyhow, bail, Error, Result};
use anyhow::{Error, Result, anyhow, bail};
use flatbuffers::size_prefixed_root;
#[cfg(feature = "tracing")]
use tracing::{instrument, Span};
use tracing::{Span, instrument};

use crate::flatbuffers::hyperlight::generated::{
hlbool, hlboolArgs, hldouble, hldoubleArgs, hlfloat, hlfloatArgs, hlint, hlintArgs, hllong,
hllongArgs, hlsizeprefixedbuffer, hlsizeprefixedbufferArgs, hlstring, hlstringArgs, hluint,
hluintArgs, hlulong, hlulongArgs, hlvoid, hlvoidArgs,
FunctionCallResult as FbFunctionCallResult, FunctionCallResultArgs as FbFunctionCallResultArgs,
Parameter, ParameterType as FbParameterType, ParameterValue as FbParameterValue,
ReturnType as FbReturnType, ReturnValue as FbReturnValue,
ReturnType as FbReturnType, ReturnValue as FbReturnValue, hlbool, hlboolArgs, hldouble,
hldoubleArgs, hlfloat, hlfloatArgs, hlint, hlintArgs, hllong, hllongArgs, hlsizeprefixedbuffer,
hlsizeprefixedbufferArgs, hlstring, hlstringArgs, hluint, hluintArgs, hlulong, hlulongArgs,
hlvoid, hlvoidArgs,
};

/// Supported parameter types with values for function calling.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ use alloc::vec::Vec;
use anyhow::{Error, Result};
use flatbuffers::size_prefixed_root;
#[cfg(feature = "tracing")]
use tracing::{instrument, Span};
use tracing::{Span, instrument};

use crate::flatbuffers::hyperlight::generated::{
ErrorCode as FbErrorCode, GuestError as FbGuestError, GuestErrorArgs,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ limitations under the License.
use alloc::string::{String, ToString};
use alloc::vec::Vec;

use anyhow::{anyhow, Error, Result};
use anyhow::{Error, Result, anyhow};
use flatbuffers::size_prefixed_root;
#[cfg(feature = "tracing")]
use tracing::{instrument, Span};
use tracing::{Span, instrument};

use super::guest_log_level::LogLevel;
use crate::flatbuffers::hyperlight::generated::{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

use anyhow::{bail, Error, Result};
use anyhow::{Error, Result, bail};
use log::Level;
use strum::EnumIter;
#[cfg(feature = "tracing")]
use tracing::{instrument, Span};
use tracing::{Span, instrument};

use crate::flatbuffers::hyperlight::generated::LogLevel as FbLogLevel;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ limitations under the License.
use alloc::string::{String, ToString};
use alloc::vec::Vec;

use anyhow::{anyhow, Error, Result};
use anyhow::{Error, Result, anyhow};
use flatbuffers::{FlatBufferBuilder, WIPOffset};
#[cfg(feature = "tracing")]
use tracing::{instrument, Span};
use tracing::{Span, instrument};

use super::function_types::{ParameterType, ReturnType};
use crate::flatbuffers::hyperlight::generated::{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ limitations under the License.
use alloc::vec::Vec;

use anyhow::{Error, Result};
use flatbuffers::{size_prefixed_root, WIPOffset};
use flatbuffers::{WIPOffset, size_prefixed_root};
#[cfg(feature = "tracing")]
use tracing::{instrument, Span};
use tracing::{Span, instrument};

use super::host_function_definition::HostFunctionDefinition;
use crate::flatbuffers::hyperlight::generated::{
Expand Down Expand Up @@ -57,11 +57,8 @@ impl HostFunctionDetails {
/// Sort the host functions by name.
#[cfg_attr(feature = "tracing", instrument(skip_all, parent = Span::current(), level= "Trace"))]
pub fn sort_host_functions_by_name(&mut self) {
match &mut self.host_functions {
Some(host_functions) => {
host_functions.sort_by(|a, b| a.function_name.cmp(&b.function_name))
}
None => {}
if let Some(host_functions) = &mut self.host_functions {
host_functions.sort_by(|a, b| a.function_name.cmp(&b.function_name))
}
}

Expand Down
14 changes: 7 additions & 7 deletions src/hyperlight_common/src/flatbuffer_wrappers/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ use alloc::vec::Vec;
use flatbuffers::FlatBufferBuilder;

use crate::flatbuffers::hyperlight::generated::{
hlbool as Fbhlbool, hlboolArgs as FbhlboolArgs, hldouble as Fbhldouble,
hldoubleArgs as FbhldoubleArgs, hlfloat as Fbhlfloat, hlfloatArgs as FbhlfloatArgs,
hlint as Fbhlint, hlintArgs as FbhlintArgs, hllong as Fbhllong, hllongArgs as FbhllongArgs,
hlsizeprefixedbuffer as Fbhlsizeprefixedbuffer,
FunctionCallResult as FbFunctionCallResult, FunctionCallResultArgs as FbFunctionCallResultArgs,
ReturnValue as FbReturnValue, hlbool as Fbhlbool, hlboolArgs as FbhlboolArgs,
hldouble as Fbhldouble, hldoubleArgs as FbhldoubleArgs, hlfloat as Fbhlfloat,
hlfloatArgs as FbhlfloatArgs, hlint as Fbhlint, hlintArgs as FbhlintArgs, hllong as Fbhllong,
hllongArgs as FbhllongArgs, hlsizeprefixedbuffer as Fbhlsizeprefixedbuffer,
hlsizeprefixedbufferArgs as FbhlsizeprefixedbufferArgs, hlstring as Fbhlstring,
hlstringArgs as FbhlstringArgs, hluint as Fbhluint, hluintArgs as FbhluintArgs,
hlulong as Fbhlulong, hlulongArgs as FbhlulongArgs, hlvoid as Fbhlvoid,
hlvoidArgs as FbhlvoidArgs, FunctionCallResult as FbFunctionCallResult,
FunctionCallResultArgs as FbFunctionCallResultArgs, ReturnValue as FbReturnValue,
hlvoidArgs as FbhlvoidArgs,
};

/// Flatbuffer-encodes the given value
Expand All @@ -45,7 +45,7 @@ pub trait FlatbufferSerializable {
fn serialize(&self, builder: &mut FlatBufferBuilder) -> FbFunctionCallResultArgs;
}

/// Implementations for basic types below
// Implementations for basic types below

impl FlatbufferSerializable for () {
fn serialize(&self, builder: &mut FlatBufferBuilder) -> FbFunctionCallResultArgs {
Expand Down
3 changes: 3 additions & 0 deletions src/hyperlight_guest/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ description = """
Library to build guest applications for hyperlight.
"""

[lints]
workspace = true

[features]
default = ["libc", "printf"]
libc = [] # compile musl libc
Expand Down
4 changes: 2 additions & 2 deletions src/hyperlight_guest/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,9 @@ fn cargo_main() {
}

if cfg!(windows) {
env::set_var("AR_x86_64_unknown_none", "llvm-ar");
unsafe { env::set_var("AR_x86_64_unknown_none", "llvm-ar") };
} else {
env::set_var("AR_x86_64_pc_windows_msvc", "llvm-lib");
unsafe { env::set_var("AR_x86_64_pc_windows_msvc", "llvm-lib") };
}

cfg.compile("hyperlight_guest");
Expand Down
2 changes: 1 addition & 1 deletion src/hyperlight_guest/src/chkstk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ use hyperlight_common::mem::RunMode;
use crate::guest_error::{set_invalid_runmode_error, set_stack_allocate_error};
use crate::{MIN_STACK_ADDRESS, RUNNING_MODE};

extern "win64" {
unsafe extern "win64" {
fn __chkstk();
fn __chkstk_in_proc();
}
Expand Down
Loading
Loading