Skip to content

Commit b96a88d

Browse files
Fix for musl systems and update deps
1 parent d1c272e commit b96a88d

File tree

15 files changed

+459
-257
lines changed

15 files changed

+459
-257
lines changed

Cargo.lock

Lines changed: 404 additions & 220 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,15 @@
22
members = ["src/libkrun"]
33
resolver = "2"
44

5+
[workspace.dependencies]
6+
libc = { git = "https://github.com/frc4533-lincoln/libc.git", branch = "main", features = ["extra_traits"] }
7+
vmm-sys-util = "0.12.1"
8+
kvm-bindings = { version = "0.11", features = ["fam-wrappers"] }
9+
kvm-ioctls = "0.21"
10+
vm-memory = { version = "0.16", features = ["backend-mmap"] }
11+
tokio = { version = "1", features = ["rt", "sync"] }
12+
serde = { version = "1", features = ["derive"] }
13+
514
[profile.dev]
615
#panic = "abort"
716

src/arch/Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,16 @@ amd-sev = [ "tee" ]
1010
efi = []
1111

1212
[dependencies]
13-
libc = ">=0.2.39"
14-
vm-memory = { version = ">=0.13", features = ["backend-mmap"] }
13+
libc.workspace = true
14+
vm-memory.workspace = true
1515

1616
arch_gen = { path = "../arch_gen" }
1717
smbios = { path = "../smbios" }
1818
utils = { path = "../utils" }
1919

2020
[target.'cfg(target_os = "linux")'.dependencies]
21-
kvm-bindings = { version = ">=0.8", features = ["fam-wrappers"] }
22-
kvm-ioctls = ">=0.17"
21+
kvm-bindings.workspace = true
22+
kvm-ioctls.workspace = true
2323

2424
[target.'cfg(target_arch = "aarch64")'.dependencies]
2525
vm-fdt = ">= 0.2.0"

src/cpuid/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ authors = ["Amazon Firecracker team <[email protected]>"]
55
edition = "2021"
66

77
[dependencies]
8-
vmm-sys-util = ">=0.11"
8+
vmm-sys-util.workspace = true
99

1010
[target.'cfg(target_os = "linux")'.dependencies]
11-
kvm-bindings = { version = ">=0.8", features = ["fam-wrappers"] }
12-
kvm-ioctls = ">=0.17"
11+
kvm-bindings.workspace = true
12+
kvm-ioctls.workspace = true

src/cpuid/src/transformer/common.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ pub fn use_host_cpuid_function(
123123
edx: entry.edx,
124124
padding: [0, 0, 0],
125125
})
126-
.map_err(FamError)?;
126+
.map_err(|e| FamError(e))?;
127127

128128
count += 1;
129129
}

src/devices/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@ intaglio = "1.10.0"
1919
bitflags = "1.2.0"
2020
crossbeam-channel = "0.5"
2121
env_logger = "0.9.0"
22-
libc = { git = "https://github.com/frc4533-lincoln/libc.git", branch = "main" }
22+
libc.workspace = true
2323
log = "0.4.0"
2424
nix = { version = "0.24.1", features = ["poll"] }
2525
pw = { package = "pipewire", version = "0.8.0", optional = true }
2626
rand = "0.8.5"
2727
thiserror = { version = "1.0", optional = true }
2828
virtio-bindings = "0.2.0"
29-
vm-memory = { version = ">=0.13", features = ["backend-mmap"] }
29+
vm-memory.workspace = true
3030
zerocopy = { version = "0.6.3", optional = true }
3131
zerocopy-derive = { version = "0.6.3", optional = true }
3232
ipnetwork = "0.21"

src/devices/src/virtio/fs/linux/overlayfs.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1996,13 +1996,25 @@ impl OverlayFs {
19961996

19971997
// Perform the rename
19981998
let res = unsafe {
1999+
#[cfg(target_env = "gnu")]
2000+
{
19992001
libc::renameat2(
20002002
old_parent_data.file.as_raw_fd(),
20012003
old_name.as_ptr(),
20022004
new_parent_data.file.as_raw_fd(),
20032005
new_name.as_ptr(),
20042006
flags,
20052007
)
2008+
}
2009+
#[cfg(target_env = "musl")]
2010+
{
2011+
libc::renameat(
2012+
old_parent_data.file.as_raw_fd(),
2013+
old_name.as_ptr(),
2014+
new_parent_data.file.as_raw_fd(),
2015+
new_name.as_ptr(),
2016+
)
2017+
}
20062018
};
20072019

20082020
if res < 0 {

src/imago/Cargo.toml

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -47,25 +47,20 @@ version = "0.8"
4747
features = ["std"]
4848

4949
[dependencies.serde]
50-
version = "1.0"
51-
features = ["derive"]
50+
workspace = true
5251

5352
[dependencies.tokio]
54-
version = "1"
55-
features = [
56-
"rt",
57-
"sync",
58-
]
53+
workspace = true
5954

6055
[dependencies.tracing]
6156
version = "0.1"
6257

6358
[dependencies.vm-memory]
64-
version = "0.16"
6559
optional = true
60+
workspace = true
6661

6762
[build-dependencies.rustc_version]
6863
version = "0.4.0"
6964

7065
[target."cfg(unix)".dependencies.libc]
71-
version = "0.2"
66+
workspace = true

src/kernel/Cargo.toml

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

66
[dependencies]
7-
vm-memory = { version = ">=0.13", features = ["backend-mmap"] }
7+
vm-memory.workspace = true
88

99
utils = { path = "../utils" }

src/libkrun/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ virgl_resource_map2 = []
1818
[dependencies]
1919
crossbeam-channel = "0.5"
2020
env_logger = "0.9.0"
21-
libc = ">=0.2.39"
21+
libc.workspace = true
2222
log = "0.4.0"
2323
once_cell = "1.4.1"
2424
ipnetwork = "0.21"

0 commit comments

Comments
 (0)