Skip to content

Introduce cargo features for kernel subsystem configurability #208

@sysheap

Description

@sysheap

Linux's Kconfig allows enabling/disabling nearly every kernel subsystem. We need the same for Solaya using Rust's native cargo features.

Goals

  • Gate kernel subsystems behind cargo features (e.g., net, tcp, ext2, smp, virtio-blk)
  • Use cargo feature dependencies for subsystem relationships (e.g., tcp = ["net"])
  • Add cargo-hack to the Nix flake and CI pipeline to verify all feature combinations compile
  • Add just check-features recipe using cargo hack check --each-feature (and --feature-powerset --depth 2 for pair coverage)

Approach

Start incrementally — add features as subsystems are built rather than designing the full matrix upfront. Initial candidates:

  • net — networking stack
  • tcp (depends on net) — TCP support
  • udp (depends on net) — UDP support
  • virtio-net (depends on net) — VirtIO network driver
  • virtio-blk — VirtIO block driver
  • smp — multi-core support
  • ext2 (depends on virtio-blk) — ext2 filesystem

CI Integration

  • Add cargo hack check --each-feature --no-dev-deps to just ci
  • Ensures no feature combination breaks compilation
  • Use --feature-powerset --depth 2 periodically (nightly) for pair coverage

See also: plans/04-build-system.md for build system context.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions