asterinas/Cargo.toml

217 lines
8.0 KiB
TOML
Raw Normal View History

# The Cargo workspace configurations shared by all in-kernel crates.
#
# As a kernel project, most crates in Asterinas are written and built for the kernel space.
# But there are also a few userspace crates
# whose crate-level `Cargo.toml` files are not affected by this workspace-level `Cargo.toml`.
# The complete list can be found in the `workspace.exclude` field.
2022-08-08 20:34:16 +00:00
[workspace]
2024-02-27 12:28:43 +00:00
resolver = "2"
2022-08-08 20:34:16 +00:00
members = [
"osdk/deps/frame-allocator",
2025-01-13 06:24:32 +00:00
"osdk/deps/heap-allocator",
2025-01-04 11:43:50 +00:00
"osdk/deps/test-kernel",
2024-06-19 08:18:39 +00:00
"ostd",
"ostd/libs/align_ext",
2024-06-20 06:16:04 +00:00
"ostd/libs/ostd-macros",
2024-06-19 08:18:39 +00:00
"ostd/libs/id-alloc",
"ostd/libs/int-to-c-enum",
"ostd/libs/int-to-c-enum/derive",
2024-06-19 08:18:39 +00:00
"ostd/libs/linux-bzimage/builder",
"ostd/libs/linux-bzimage/boot-params",
"ostd/libs/linux-bzimage/setup",
"ostd/libs/ostd-test",
2024-02-27 08:40:16 +00:00
"kernel",
"kernel/comps/block",
"kernel/comps/cmdline",
2024-02-27 08:40:16 +00:00
"kernel/comps/console",
"kernel/comps/framebuffer",
"kernel/comps/input",
2025-11-04 08:06:28 +00:00
"kernel/comps/i8042",
2024-02-27 08:40:16 +00:00
"kernel/comps/network",
"kernel/comps/softirq",
2025-04-24 10:04:37 +00:00
"kernel/comps/systree",
2024-11-15 08:58:06 +00:00
"kernel/comps/logger",
"kernel/comps/mlsdisk",
2024-02-27 08:40:16 +00:00
"kernel/comps/time",
"kernel/comps/virtio",
2025-07-25 07:25:38 +00:00
"kernel/comps/pci",
2024-02-27 08:40:16 +00:00
"kernel/libs/cpio-decoder",
"kernel/libs/aster-rights",
"kernel/libs/aster-rights-proc",
"kernel/libs/aster-util",
2024-09-06 10:49:37 +00:00
"kernel/libs/aster-bigtcp",
"kernel/libs/device-id",
2024-12-27 08:27:42 +00:00
"kernel/libs/jhash",
2024-02-27 08:40:16 +00:00
"kernel/libs/keyable-arc",
"kernel/libs/logo-ascii-art",
2024-02-27 08:40:16 +00:00
"kernel/libs/typeflags",
"kernel/libs/typeflags-util",
"kernel/libs/atomic-integer-wrapper",
2025-04-18 02:41:54 +00:00
"kernel/libs/xarray",
]
exclude = [
2024-02-27 08:40:16 +00:00
"kernel/libs/comp-sys/cargo-component",
"kernel/libs/comp-sys/component",
"kernel/libs/comp-sys/component-macro",
"kernel/libs/comp-sys/controlled",
2024-02-27 16:44:55 +00:00
"osdk",
2025-09-24 11:42:51 +00:00
"tools/sctrace",
]
2024-05-06 09:36:31 +00:00
[workspace.lints.rust]
unsafe_op_in_unsafe_fn = "warn"
unexpected_cfgs = { level = "allow", check-cfg = ['cfg(ktest)'] }
2025-01-24 16:56:07 +00:00
[workspace.lints.clippy]
allow_attributes = "warn"
# Keys under `workspace.package` and the `package` section of each crate
# follow the ordering suggested at:
# https://github.com/crate-ci/cargo-cargofmt/issues/29#issuecomment-3647516745
#
# FIXME: The current key order is not yet finalized.
# Once `cargo-cargofmt` becomes stable, we will use it to enforce a consistent key order.
[workspace.package]
version = "0.17.0"
repository = "https://github.com/asterinas/asterinas"
license = "MPL-2.0"
edition = "2024"
2025-12-25 07:37:18 +00:00
[workspace.dependencies]
ostd = { version = "0.17.0", path = "ostd" }
# Crates under ostd/libs
align_ext = { path = "ostd/libs/align_ext", version = "0.1.0" }
id-alloc = { path = "ostd/libs/id-alloc", version = "0.1.0" }
int-to-c-enum = { path = "ostd/libs/int-to-c-enum", version = "0.1.0" }
2025-12-25 07:37:18 +00:00
linux-boot-params = { version = "0.17.0", path = "ostd/libs/linux-bzimage/boot-params" }
ostd-macros = { version = "0.17.0", path = "ostd/libs/ostd-macros" }
ostd-test = { version = "0.17.0", path = "ostd/libs/ostd-test" }
# Crates under kernel/comps
aster-block = { path = "kernel/comps/block" }
aster-cmdline = { path = "kernel/comps/cmdline" }
aster-console = { path = "kernel/comps/console" }
aster-framebuffer = { path = "kernel/comps/framebuffer" }
aster-i8042 = { path = "kernel/comps/i8042" }
aster-input = { path = "kernel/comps/input" }
aster-logger = { path = "kernel/comps/logger" }
aster-mlsdisk = { path = "kernel/comps/mlsdisk" }
aster-network = { path = "kernel/comps/network" }
aster-pci = { path = "kernel/comps/pci" }
aster-softirq = { path = "kernel/comps/softirq" }
aster-systree = { path = "kernel/comps/systree" }
aster-time = { path = "kernel/comps/time" }
aster-virtio = { path = "kernel/comps/virtio" }
# Crates under kernel/libs
aster-bigtcp = { path = "kernel/libs/aster-bigtcp" }
aster-rights = { path = "kernel/libs/aster-rights" }
aster-rights-proc = { path = "kernel/libs/aster-rights-proc" }
aster-util = { path = "kernel/libs/aster-util" }
atomic-integer-wrapper = { path = "kernel/libs/atomic-integer-wrapper" }
cpio-decoder = { path = "kernel/libs/cpio-decoder" }
device-id = { path = "kernel/libs/device-id" }
jhash = { path = "kernel/libs/jhash" }
keyable-arc = { path = "kernel/libs/keyable-arc" }
logo-ascii-art = { path = "kernel/libs/logo-ascii-art" }
typeflags = { path = "kernel/libs/typeflags" }
typeflags-util = { path = "kernel/libs/typeflags-util" }
xarray = { path = "kernel/libs/xarray" }
# Crates under kernel/libs/comp-sys
component = { path = "kernel/libs/comp-sys/component" }
controlled = { path = "kernel/libs/comp-sys/controlled" }
# Crates under osdk/deps
osdk-frame-allocator = { path = "osdk/deps/frame-allocator" }
osdk-heap-allocator = { path = "osdk/deps/heap-allocator" }
# External dependencies only for unsafe crates (i.e., crates under ostd directory)
bit_field = "0.10.1"
bytemuck = { version = "1.17.0", features = ["derive"] }
gimli = { version = "0.28", default-features = false, features = ["read-core"] }
minicov = "0.3"
num-traits = { version = "0.2", default-features = false }
ostd-pod = { git = "https://github.com/asterinas/ostd-pod", rev = "c4644be", version = "0.1.1" }
serde = { version = "1.0.192", default-features = false, features = ["alloc", "derive"] }
smallvec = "1.13.2"
uart_16550 = "0.3.0"
volatile = "0.6.1"
# External dependencies only for safe crates (i.e., crates under kernel or osdk/deps directories)
#
# Enable `force-soft` feature to disable `AES-NI` and `CLMUL` intrinsics, ensuring that the implementation
# relies solely on software, and in the software implementation, unsafe code is rarely used.
# FIXME: to utilize `AES-NI` and `CLMUL` intrinsics, some specific flags must be added to `RUSTFLAGS`,
# i.e. `-Ctarget-cpu=sandybridge -Ctarget-feature=+aes,+sse2,+sse4.1,+ssse3`.
# This suggests that `Asterinas` should support saving and restoring the `FPU` state within the kernel context,
# a capability it currently lacks.
aes-gcm = { version = "0.9.4", features = ["force-soft"] }
bittle = "0.5.6"
const_format = "0.2.35"
2025-12-25 07:37:18 +00:00
ctr = "0.8.0"
font8x8 = { version = "0.2.5", default-features = false, features = [ "unicode" ] }
getset = "0.1.2"
hashbrown = { version = "0.14.3", features = ["serde"] }
itertools = "0.10.5"
lending-iterator = "0.1.7"
lru = "0.12.3"
owo-colors = "4.2.2"
paste = "1.0.15"
postcard = "1.0.6"
smoltcp = { git = "https://github.com/asterinas/smoltcp", tag = "r_2024-11-08_f07e5b5", default-features = false, features = [
"alloc",
"log",
"medium-ethernet",
"medium-ip",
"proto-ipv4",
"socket-udp",
"socket-tcp",
] }
takeable = "0.2.2"
time = { version = "0.3", default-features = false, features = ["alloc"] }
# External dependencies for both safe and unsafe crates
bitflags = "1.3"
bitvec = { version = "1.0.1", default-features = false, features = ["alloc"] }
cfg-if = "1.0"
core2 = { version = "0.4.0", default-features = false, features = ["alloc", "nightly"] }
inherit-methods-macro = { git = "https://github.com/asterinas/inherit-methods-macro", rev = "98f7e3e", version = "0.1.0" }
intrusive-collections = { version = "0.9.6", features = ["nightly"] }
libflate = { version = "2.1.0", default-features = false }
log = "0.4"
rand = { version = "0.9.2", default-features = false }
spin = "0.9.4"
xmas-elf = "0.10.0"
# Proc-macro dependencies
proc-macro2 = { version = "1.0.95", features = ["span-locations"] }
quote = "1.0.35"
syn = { version = "2.0.77", features = ["full", "parsing", "fold"] }
2024-05-06 09:36:31 +00:00
# Cargo only looks at the profile settings
# in the Cargo.toml manifest at the root of the workspace
[profile.dev]
panic = "unwind"
2024-05-06 09:36:31 +00:00
[profile.release]
lto = "thin"
panic = "unwind"
2024-05-06 09:36:31 +00:00
# Release profile configuration with Link Time Optimization (LTO) enabled.
#
# This profile is optimized for maximum runtime performance,
# (achieving a 2% reduction in latency for the getpid system call).
# However, enabling LTO significantly increases compilation times,
# approximately doubling them compared to when LTO is not enabled.
[profile.release-lto]
inherits = "release"
lto = true
# lto can only be enabled when panic strategy is abort
panic = "abort"
# set codegen-units as the smallest number
codegen-units = 1