[workspace]
resolver = "2"
members = ["api", "core"]

[workspace.package]
version = "0.1.0"
edition = "2024"
license = "Apache-2.0"

authors = [
    "Azure-stars <Azure_stars@126.com>",
    "Yuekai Jia <equation618@gmail.com>",
    "KylinSoft Co., Ltd. <https://www.kylinos.cn/>",
    "朝倉水希 <asakuramizu111@gmail.com>",
    "Mivik <mivikq@gmail.com>",
]
homepage = "https://github.com/arceos-org/arceos"
repository = "https://github.com/arceos-org/starry-next"

[workspace.dependencies]
# ArceOS components from crates.io
axfeat = { version = "0.2.2-preview.1", features = [
    "alloc-slab",
    "fp-simd",
    "fs-ext4",
    "irq",
    "multitask",
    "net",
    "page-alloc-4g",
    "rtc",
    "sched-rr",
    "task-ext",
    "uspace",
] }

axalloc = "0.2.2-preview.1"
axconfig = "0.2.2-preview.1"
axdisplay = "0.2.2-preview.1"
axdriver = "0.2.2-preview.1"
axfs = "0.2.2-preview.1"
axhal = "0.2.2-preview.5"
axinput = "0.2.2-preview.1"
axlog = "0.2.2-preview.1"
axmm = "0.2.2-preview.1"
axnet = "0.2.2-preview.1"
axruntime = "0.2.2-preview.2"
axsync = "0.2.2-preview.1"
axtask = "0.2.2-preview.3"

# Third-party crates
axbacktrace = "0.1"
axerrno = "0.2"
axfs-ng-vfs = "0.1"
axio = "0.3.0-pre.1"
axpoll = "0.1"
bitflags = "2.10"
bytemuck = { version = "1.23", features = ["unsound_ptr_pod_impl"] }
cfg-if = "1.0"
event-listener = { version = "5.4.0", default-features = false }
extern-trait = "0.2"
hashbrown = "0.16"
kspin = "0.1"
lazy_static = { version = "1.5", features = ["spin_no_std"] }
linkme = "0.3.33"
linux-raw-sys = { version = "0.11", default-features = false, features = [
    "no_std",
    "general",
    "net",
    "prctl",
    "system",
] }
memory_addr = "0.4"
scope-local = "0.1"
slab = { version = "0.4.9", default-features = false }
spin = "0.10"
starry-process = "0.2"
starry-signal = { version = "0.2.4-preview.1" }
starry-vm = "0.2"

starry-core = { path = "./core", version = "0.1.0" }
starry-api = { path = "./api", version = "0.1.0" }

[package]
name = "starry-kernel"
version.workspace = true
edition.workspace = true
authors.workspace = true
license.workspace = true
homepage.workspace = true
repository.workspace = true
description = "A Linux-compatible OS kernel built on ArceOS unikernel"

[features]
default = []
qemu = [
    "axfeat/display",
    "axfeat/input",
    "starry-api/input",

    "axfeat/defplat",
    "axfeat/bus-pci",

    # auxilary features
    "axfeat/fs-times",
    "starry-api/dev-log",
]
# NOTE: vsock is temporarily disabled due to version mismatch between
# axnet (0.2.2-preview.1) and axdriver_vsock (0.1.4-preview.3).
# To re-enable, add "axfeat/vsock" and "starry-api/vsock" to the qemu feature
# once compatible versions are published.
smp = ["axfeat/smp"]

[[bin]]
name = "starry-kernel"
path = "src/main.rs"
required-features = ["qemu"]

[dependencies]
axdriver.workspace = true
axerrno.workspace = true
axfeat.workspace = true
axfs.workspace = true
axhal.workspace = true
axlog.workspace = true
axruntime.workspace = true
axsync.workspace = true
axtask.workspace = true
cfg-if.workspace = true
linkme.workspace = true
linux-raw-sys.workspace = true
starry-process.workspace = true
starry-signal.workspace = true

starry-core.workspace = true
starry-api.workspace = true


[package.metadata.vendor-filter]
platforms = ["riscv64gc-unknown-none-elf", "loongarch64-unknown-none-softfloat"]
all-features = true

# Patch to unify axcpu version: axhal (crates.io) uses axcpu 0.3.0-preview.2
# while starry-signal (git) uses axcpu 0.3.0 from git. We unify to the git
# version (0.3.0 satisfies ^0.3.0-preview.2).
#[patch.crates-io]
#axcpu = { git = "https://github.com/arceos-org/axcpu.git", tag = "dev-v03" }