refactor(build): migrate platform options from Cargo features to Kconfig#319
refactor(build): migrate platform options from Cargo features to Kconfig#319dallasxy wants to merge 16 commits into
Conversation
|
Thanks for this PR — migrating to Kconfig is a well-established practice and it looks like a lot of work went into it. I'm trying to understand the motivation and trade-offs better:
|
Motivation: The old cargo/features model had no dependency/mutual-exclusion checks, split config across Cargo.toml, per-board cargo/features, and Makefile wiring, and rust-analyzer often drifted from real build flags. Kconfig adds depends on/select/choice, reviewable per-board defconfigs, and a single path via cfg_map.toml + build.rs → rustc --cfg. Workflow: make BOARD=qemu-gicv3 still works. ensure_config auto-runs defconfig when .config is missing or ARCH/BOARD changed — no manual make defconfig && make for normal builds. Explicit defconfig is only needed for bare cargo build or intentional config refresh. Vendor wheels: Agreed — the vendored wheels should be removed from the repo. |
As hvisor has grown, the flat feature list is no longer expressive enough to describe platform options reliably (dependencies, mutual exclusion, and arch-specific menus). Kconfig provides a single, reviewable configuration surface for local builds, CI, and rust-analyzer.
This PR replaces per-board Cargo features and platform/.../cargo/features with a Kconfig-based configuration flow aligned with common kernel/firmware practice. Platform features are described by CONFIG_* symbols, materialized into a generated root .config, and turned into Rust conditional compilation via build.rs and kconfig/cfg_map.toml.
The branch also includes Jenkins/CI housekeeping (isolated workspaces, GitHub Checks per matrix cell, make defconfig in the build matrix) so CI matches the new build entry points.
Closes: #318