Skip to content

Commit 823cda5

Browse files
authored
Merge pull request #80 from Freax13/enhancement/cli-lib-stable
make it possible to build CLI on stable rust
2 parents 981a265 + b438e5b commit 823cda5

File tree

16 files changed

+45
-64
lines changed

16 files changed

+45
-64
lines changed

.github/workflows/build.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,20 @@ jobs:
7575
TEE_TDX: ${{ matrix.tdx }}
7676
TEE_INSECURE: ${{ matrix.insecure }}
7777

78+
build-cli-on-stable:
79+
name: "Build CLI on stable"
80+
runs-on: ubuntu-latest
81+
steps:
82+
- uses: actions/checkout@v4
83+
- uses: Swatinem/rust-cache@v2
84+
with:
85+
key: build-cli-stable
86+
workspaces: |
87+
host
88+
- name: "Build"
89+
run: cargo +stable build --all-features
90+
working-directory: host/mushroom
91+
7892
clippy:
7993
name: "Clippy"
8094
runs-on: ubuntu-latest

common/constants/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ edition = "2021"
66
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
77

88
[dependencies]
9-
x86_64 = "0.15.1"
9+
x86_64 = { version = "0.15.1", default-features = false }

common/loader/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ itertools = { version = "0.12.1", default-features = false }
1313
snp-types = { workspace = true }
1414
thiserror = { version = "1.0.58" }
1515
raw-cpuid = "11.0.1"
16-
x86_64 = "0.15.1"
16+
x86_64 = { version = "0.15.1", default-features = false }

common/loader/src/elf.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ pub fn load_shadow_mapping(
146146
vmpl1_perms.set(VmplPermissions::WRITE, ph.is_write());
147147
vmpl1_perms &= vmpl1_perms_mask;
148148

149-
let mut iter = (start_page..=end_inclusive_page).peekable();
149+
let mut iter = Page::range_inclusive(start_page, end_inclusive_page).peekable();
150150
from_fn(move || {
151151
let page = iter.next()?;
152152

common/profiler-types/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ version = "0.1.0"
44
edition = "2021"
55

66
[dependencies]
7-
bytemuck = { version = "1.15.0", features = ["derive"] }
7+
bytemuck = { version = "1.15.0", features = ["derive", "min_const_generics"] }
88
constants = { workspace = true }

common/profiler-types/src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
use core::{mem::size_of, sync::atomic::AtomicU8};
44

5-
use bytemuck::NoUninit;
5+
use bytemuck::{NoUninit, Zeroable};
66
use constants::MAX_APS_COUNT;
77

88
const NOTIFY_BITS: usize = MAX_APS_COUNT as usize;
@@ -44,14 +44,14 @@ pub const PROFILER_ENTRIES: usize = {
4444
entries
4545
};
4646

47-
#[derive(Clone, Copy, NoUninit)]
47+
#[derive(Clone, Copy, Zeroable, NoUninit)]
4848
#[repr(C, align(16))]
4949
pub struct Entry {
5050
pub time: u64,
5151
pub event: u64,
5252
}
5353

54-
#[derive(Clone, Copy)]
54+
#[derive(Clone, Copy, Zeroable)]
5555
#[repr(C, align(64))]
5656
pub struct PerCpuEntries {
5757
pub entries: [Entry; PROFILER_ENTRIES],

common/snp-types/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ bitflags = { version = "2.4.2", features = ["bytemuck"] }
1010
bit_field = "0.10.2"
1111
bytemuck = { version = "1.15.0", features = ["derive", "min_const_generics"] }
1212
paste = "1.0.14"
13-
x86_64 = "0.15.1"
13+
x86_64 = { version = "0.15.1", default-features = false }

common/tdx-types/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ p256 = { version = "0.13.2", optional = true }
1111
sha2 = { version = "0.10.8", optional = true }
1212
thiserror = { version = "1.0.64", optional = true }
1313
x509-cert = { version = "0.2.5", features = ["pem"], default-features = false, optional = true }
14-
x86_64 = "0.15.1"
14+
x86_64 = { version = "0.15.1", default-features = false }
1515

1616
[features]
1717
std = ["bytemuck/extern_crate_std", "x509-cert?/std"]

host/mushroom-verify/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ sha2 = "0.10.8"
1212
snp-types = { workspace = true, optional = true }
1313
vcek-kds = { workspace = true, optional = true }
1414
tdx-types = { workspace = true, features = ["quote"], optional = true }
15-
x86_64 = { version = "0.15.1", optional = true }
15+
x86_64 = { version = "0.15.1", default-features = false, optional = true }
1616

1717
[features]
1818
default = ["snp", "tdx"]

host/mushroom-verify/src/lib.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#![feature(array_chunks)]
2-
31
use io::input::Header;
42
use sha2::{Digest, Sha256};
53

0 commit comments

Comments
 (0)