ci: fix Windows cross-compile by gating unix-only harmony code #291

Merged
johnride merged 1 commits from ci/fix-fleet-operator into master 2026-05-23 15:28:09 +00:00
Owner

The harmony_composer CI job builds for x86_64-pc-windows-gnu. It was
failing because workspace members that explicitly request the kvm
feature (kvm examples) caused Cargo to unify that feature into the
harmony build for all targets, including Windows — even though
harmony_composer itself doesn't need kvm.

Three-part fix:

  • Move virt (libvirt bindings) to [target.'cfg(unix)'.dependencies]
    so Cargo never tries to compile it for non-Unix targets, regardless
    of which workspace member requests kvm
  • Remove kvm from harmony's default features; callers that need it
    already opt in explicitly
  • Gate kvm and podman-topology code with #[cfg(unix)] / #[cfg(all(feature = "kvm", unix))]
    so harmony compiles cleanly on Windows. Podman score types
    (PodmanService, PodmanV0Score, ReconcileScore) remain available on
    all platforms since the fleet operator CRD definitions need them.
The harmony_composer CI job builds for x86_64-pc-windows-gnu. It was failing because workspace members that explicitly request the `kvm` feature (kvm examples) caused Cargo to unify that feature into the harmony build for all targets, including Windows — even though harmony_composer itself doesn't need kvm. Three-part fix: - Move `virt` (libvirt bindings) to `[target.'cfg(unix)'.dependencies]` so Cargo never tries to compile it for non-Unix targets, regardless of which workspace member requests `kvm` - Remove `kvm` from harmony's default features; callers that need it already opt in explicitly - Gate kvm and podman-topology code with `#[cfg(unix)]` / `#[cfg(all(feature = "kvm", unix))]` so harmony compiles cleanly on Windows. Podman score types (PodmanService, PodmanV0Score, ReconcileScore) remain available on all platforms since the fleet operator CRD definitions need them.
johnride added 1 commit 2026-05-23 15:27:58 +00:00
ci: fix Windows cross-compile by gating unix-only harmony code
All checks were successful
Run Check Script / check (pull_request) Successful in 2m0s
277c5edb52
The harmony_composer CI job builds for x86_64-pc-windows-gnu. It was
failing because workspace members that explicitly request the `kvm`
feature (kvm examples) caused Cargo to unify that feature into the
harmony build for all targets, including Windows — even though
harmony_composer itself doesn't need kvm.

Three-part fix:
- Move `virt` (libvirt bindings) to `[target.'cfg(unix)'.dependencies]`
  so Cargo never tries to compile it for non-Unix targets, regardless
  of which workspace member requests `kvm`
- Remove `kvm` from harmony's default features; callers that need it
  already opt in explicitly
- Gate kvm and podman-topology code with `#[cfg(unix)]` / `#[cfg(all(feature = "kvm", unix))]`
  so harmony compiles cleanly on Windows. Podman score types
  (PodmanService, PodmanV0Score, ReconcileScore) remain available on
  all platforms since the fleet operator CRD definitions need them.
johnride merged commit 8d28544d05 into master 2026-05-23 15:28:09 +00:00
johnride deleted branch ci/fix-fleet-operator 2026-05-23 15:28:09 +00:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: NationTech/harmony#291
No description provided.