Skip to content

refactor(build): migrate platform options from Cargo features to Kconfig#319

Merged
dallasxy merged 19 commits into
syswonder:devfrom
dallasxy:config_refactor
Jul 1, 2026
Merged

refactor(build): migrate platform options from Cargo features to Kconfig#319
dallasxy merged 19 commits into
syswonder:devfrom
dallasxy:config_refactor

Conversation

@dallasxy

@dallasxy dallasxy commented Jun 2, 2026

Copy link
Copy Markdown
Collaborator

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

@github-actions github-actions Bot added riscv64 x86_64 feature New feature or request labels Jun 2, 2026
@dallasxy dallasxy requested review from Inquisitor-201 and liulog June 2, 2026 10:00
@Inquisitor-201

Copy link
Copy Markdown
Contributor

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:

  1. The current cargo/features approach is simple and the team is already familiar with it for adding new boards. What concrete issues have you encountered that Kconfig would help with? Feature dependency/mutual-exclusion enforcement? Or something else?

  2. After this merge, will make BOARD=qemu-gicv3 continue to work, or do contributors need to switch to make defconfig && make?

  3. Noticed tools/kconfig/vendor/ includes vendored .whl files — just curious, are these needed for offline builds, or could they be installed from PyPI instead?

@dallasxy

dallasxy commented Jun 3, 2026

Copy link
Copy Markdown
Collaborator Author

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:

  1. The current cargo/features approach is simple and the team is already familiar with it for adding new boards. What concrete issues have you encountered that Kconfig would help with? Feature dependency/mutual-exclusion enforcement? Or something else?
  2. After this merge, will make BOARD=qemu-gicv3 continue to work, or do contributors need to switch to make defconfig && make?
  3. Noticed tools/kconfig/vendor/ includes vendored .whl files — just curious, are these needed for offline builds, or could they be installed from PyPI instead?

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.

@Inquisitor-201

Inquisitor-201 commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Noticed that depends on in Kconfig. This blocks it on x86_64 — is that intentional? The PCI virtio code uses MSI-X and doesn't seem to have a GIC dependency. Kconfig:180

@dallasxy

Copy link
Copy Markdown
Collaborator Author

Noticed that depends on in Kconfig. This blocks it on x86_64 — is that intentional? The PCI virtio code uses MSI-X and doesn't seem to have a GIC dependency. Kconfig:180

Yes, currently this feature actually relies on the GIC's MSI-X mechanism.

@liulog liulog left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@dallasxy dallasxy merged commit 9dbacc4 into syswonder:dev Jul 1, 2026
24 checks passed
tiniham added a commit to tiniham/hvisor that referenced this pull request Jul 1, 2026
dev moved to Kconfig-based board config while this branch was open. Rebased
and carried aster_guest forward as a proper Kconfig entry (kconfig/Kconfig +
cfg_map.toml) instead of a bare Cargo feature, and pointed run_asterinas.sh
at the new "make defconfig" + .config flow since the old FEATURES= build
argument no longer exists upstream.

No functional changes; qemu/asterinas boot flow re-verified after the
rebase.
tiniham added a commit to tiniham/hvisor that referenced this pull request Jul 1, 2026
dev moved to Kconfig-based board config while this branch was open. Rebased
and carried aster_guest forward as a proper Kconfig entry (kconfig/Kconfig +
cfg_map.toml) instead of a bare Cargo feature, and pointed run_asterinas.sh
at the new "make defconfig" + .config flow since the old FEATURES= build
argument no longer exists upstream.

No functional changes; qemu/asterinas boot flow re-verified after the
rebase.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature or request riscv64 x86_64

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Migrate board configuration from features to Kconfig

3 participants