Skip to content

Update to 1.85 and Rust Edition 2024 #534

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

Merged
merged 12 commits into from
May 29, 2025
Merged
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

# 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"
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"

- 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"

- 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
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"
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"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

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

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

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/copilot-setup-steps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@ jobs:

- uses: hyperlight-dev/[email protected]
with:
rust-toolchain: "1.81.0"
rust-toolchain: "1.85"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
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"
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"
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"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

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

[workspace.package]
version = "0.5.0"
edition = "2021"
rust-version = "1.81.0"
edition = "2024"
rust-version = "1.85"
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 README.md
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ After having an environment with a hypervisor setup, running the example has the

1. On Linux or WSL, you'll most likely need build essential. For Ubuntu, run `sudo apt install build-essential`. For
Azure Linux, run `sudo dnf install build-essential`.
2. [Rust](https://www.rust-lang.org/tools/install). Install toolchain v1.81 or later.
2. [Rust](https://www.rust-lang.org/tools/install). Install toolchain v1.85 or later.

Also, install the `x86_64-unknown-none` target, it is needed to build the test
guest binaries.
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 && rustup default 1.85
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"
3 changes: 2 additions & 1 deletion rustfmt.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ unstable_features = true # Cargo fmt now needs to be called with `cargo +nightly
group_imports = "StdExternalCrate" # create three groups for std, external and local crates
# Merge imports from the same module
# See: https://rust-lang.github.io/rustfmt/?version=v1.4.38&search=#imports_granularity
imports_granularity = "Module"
imports_granularity = "Module"
style_edition = "2021"
2 changes: 1 addition & 1 deletion src/hyperlight_common/src/flatbuffer_wrappers/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -124,16 +124,20 @@ impl<'a> flatbuffers::Follow<'a> for ErrorCode {
type Inner = Self;
#[inline]
unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
let b = flatbuffers::read_scalar_at::<u64>(buf, loc);
Self(b)
unsafe {
let b = flatbuffers::read_scalar_at::<u64>(buf, loc);
Self(b)
}
}
}

impl flatbuffers::Push for ErrorCode {
type Output = ErrorCode;
#[inline]
unsafe fn push(&self, dst: &mut [u8], _written_len: usize) {
flatbuffers::emplace_scalar::<u64>(dst, self.0);
unsafe {
flatbuffers::emplace_scalar::<u64>(dst, self.0);
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,10 @@ impl<'a> flatbuffers::Follow<'a> for FunctionCall<'a> {
type Inner = FunctionCall<'a>;
#[inline]
unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
Self {
_tab: flatbuffers::Table::new(buf, loc),
unsafe {
Self {
_tab: flatbuffers::Table::new(buf, loc),
}
}
}
}
Expand Down Expand Up @@ -290,14 +292,14 @@ pub fn size_prefixed_root_as_function_call_with_opts<'b, 'o>(
/// # Safety
/// Callers must trust the given bytes do indeed contain a valid `FunctionCall`.
pub unsafe fn root_as_function_call_unchecked(buf: &[u8]) -> FunctionCall {
flatbuffers::root_unchecked::<FunctionCall>(buf)
unsafe { flatbuffers::root_unchecked::<FunctionCall>(buf) }
}
#[inline]
/// Assumes, without verification, that a buffer of bytes contains a size prefixed FunctionCall and returns it.
/// # Safety
/// Callers must trust the given bytes do indeed contain a valid size prefixed `FunctionCall`.
pub unsafe fn size_prefixed_root_as_function_call_unchecked(buf: &[u8]) -> FunctionCall {
flatbuffers::size_prefixed_root_unchecked::<FunctionCall>(buf)
unsafe { flatbuffers::size_prefixed_root_unchecked::<FunctionCall>(buf) }
}
#[inline]
pub fn finish_function_call_buffer<'a, 'b, A: flatbuffers::Allocator + 'a>(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,10 @@ impl<'a> flatbuffers::Follow<'a> for FunctionCallResult<'a> {
type Inner = FunctionCallResult<'a>;
#[inline]
unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
Self {
_tab: flatbuffers::Table::new(buf, loc),
unsafe {
Self {
_tab: flatbuffers::Table::new(buf, loc),
}
}
}
}
Expand Down Expand Up @@ -513,7 +515,7 @@ pub fn size_prefixed_root_as_function_call_result_with_opts<'b, 'o>(
/// # Safety
/// Callers must trust the given bytes do indeed contain a valid `FunctionCallResult`.
pub unsafe fn root_as_function_call_result_unchecked(buf: &[u8]) -> FunctionCallResult {
flatbuffers::root_unchecked::<FunctionCallResult>(buf)
unsafe { flatbuffers::root_unchecked::<FunctionCallResult>(buf) }
}
#[inline]
/// Assumes, without verification, that a buffer of bytes contains a size prefixed FunctionCallResult and returns it.
Expand All @@ -522,7 +524,7 @@ pub unsafe fn root_as_function_call_result_unchecked(buf: &[u8]) -> FunctionCall
pub unsafe fn size_prefixed_root_as_function_call_result_unchecked(
buf: &[u8],
) -> FunctionCallResult {
flatbuffers::size_prefixed_root_unchecked::<FunctionCallResult>(buf)
unsafe { flatbuffers::size_prefixed_root_unchecked::<FunctionCallResult>(buf) }
}
#[inline]
pub fn finish_function_call_result_buffer<'a, 'b, A: flatbuffers::Allocator + 'a>(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,16 +66,20 @@ impl<'a> flatbuffers::Follow<'a> for FunctionCallType {
type Inner = Self;
#[inline]
unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
let b = flatbuffers::read_scalar_at::<u8>(buf, loc);
Self(b)
unsafe {
let b = flatbuffers::read_scalar_at::<u8>(buf, loc);
Self(b)
}
}
}

impl flatbuffers::Push for FunctionCallType {
type Output = FunctionCallType;
#[inline]
unsafe fn push(&self, dst: &mut [u8], _written_len: usize) {
flatbuffers::emplace_scalar::<u8>(dst, self.0);
unsafe {
flatbuffers::emplace_scalar::<u8>(dst, self.0);
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,10 @@ impl<'a> flatbuffers::Follow<'a> for GuestError<'a> {
type Inner = GuestError<'a>;
#[inline]
unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
Self {
_tab: flatbuffers::Table::new(buf, loc),
unsafe {
Self {
_tab: flatbuffers::Table::new(buf, loc),
}
}
}
}
Expand Down Expand Up @@ -192,14 +194,14 @@ pub fn size_prefixed_root_as_guest_error_with_opts<'b, 'o>(
/// # Safety
/// Callers must trust the given bytes do indeed contain a valid `GuestError`.
pub unsafe fn root_as_guest_error_unchecked(buf: &[u8]) -> GuestError {
flatbuffers::root_unchecked::<GuestError>(buf)
unsafe { flatbuffers::root_unchecked::<GuestError>(buf) }
}
#[inline]
/// Assumes, without verification, that a buffer of bytes contains a size prefixed GuestError and returns it.
/// # Safety
/// Callers must trust the given bytes do indeed contain a valid size prefixed `GuestError`.
pub unsafe fn size_prefixed_root_as_guest_error_unchecked(buf: &[u8]) -> GuestError {
flatbuffers::size_prefixed_root_unchecked::<GuestError>(buf)
unsafe { flatbuffers::size_prefixed_root_unchecked::<GuestError>(buf) }
}
#[inline]
pub fn finish_guest_error_buffer<'a, 'b, A: flatbuffers::Allocator + 'a>(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,10 @@ impl<'a> flatbuffers::Follow<'a> for GuestLogData<'a> {
type Inner = GuestLogData<'a>;
#[inline]
unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
Self {
_tab: flatbuffers::Table::new(buf, loc),
unsafe {
Self {
_tab: flatbuffers::Table::new(buf, loc),
}
}
}
}
Expand Down Expand Up @@ -288,14 +290,14 @@ pub fn size_prefixed_root_as_guest_log_data_with_opts<'b, 'o>(
/// # Safety
/// Callers must trust the given bytes do indeed contain a valid `GuestLogData`.
pub unsafe fn root_as_guest_log_data_unchecked(buf: &[u8]) -> GuestLogData {
flatbuffers::root_unchecked::<GuestLogData>(buf)
unsafe { flatbuffers::root_unchecked::<GuestLogData>(buf) }
}
#[inline]
/// Assumes, without verification, that a buffer of bytes contains a size prefixed GuestLogData and returns it.
/// # Safety
/// Callers must trust the given bytes do indeed contain a valid size prefixed `GuestLogData`.
pub unsafe fn size_prefixed_root_as_guest_log_data_unchecked(buf: &[u8]) -> GuestLogData {
flatbuffers::size_prefixed_root_unchecked::<GuestLogData>(buf)
unsafe { flatbuffers::size_prefixed_root_unchecked::<GuestLogData>(buf) }
}
#[inline]
pub fn finish_guest_log_data_buffer<'a, 'b, A: flatbuffers::Allocator + 'a>(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,10 @@ impl<'a> flatbuffers::Follow<'a> for hlbool<'a> {
type Inner = hlbool<'a>;
#[inline]
unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
Self {
_tab: flatbuffers::Table::new(buf, loc),
unsafe {
Self {
_tab: flatbuffers::Table::new(buf, loc),
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,10 @@ impl<'a> flatbuffers::Follow<'a> for hldouble<'a> {
type Inner = hldouble<'a>;
#[inline]
unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
Self {
_tab: flatbuffers::Table::new(buf, loc),
unsafe {
Self {
_tab: flatbuffers::Table::new(buf, loc),
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,10 @@ impl<'a> flatbuffers::Follow<'a> for hlfloat<'a> {
type Inner = hlfloat<'a>;
#[inline]
unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
Self {
_tab: flatbuffers::Table::new(buf, loc),
unsafe {
Self {
_tab: flatbuffers::Table::new(buf, loc),
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,10 @@ impl<'a> flatbuffers::Follow<'a> for hlint<'a> {
type Inner = hlint<'a>;
#[inline]
unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
Self {
_tab: flatbuffers::Table::new(buf, loc),
unsafe {
Self {
_tab: flatbuffers::Table::new(buf, loc),
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,10 @@ impl<'a> flatbuffers::Follow<'a> for hllong<'a> {
type Inner = hllong<'a>;
#[inline]
unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
Self {
_tab: flatbuffers::Table::new(buf, loc),
unsafe {
Self {
_tab: flatbuffers::Table::new(buf, loc),
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,10 @@ impl<'a> flatbuffers::Follow<'a> for hlsizeprefixedbuffer<'a> {
type Inner = hlsizeprefixedbuffer<'a>;
#[inline]
unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
Self {
_tab: flatbuffers::Table::new(buf, loc),
unsafe {
Self {
_tab: flatbuffers::Table::new(buf, loc),
}
}
}
}
Expand Down
Loading