Skip to content

Commit

Permalink
cloud-hypervisor: use the old param syntax in >=36.0
Browse files Browse the repository at this point in the history
  • Loading branch information
astro committed Nov 2, 2023
1 parent 402333c commit d07c3ef
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/runners/cloud-hypervisor.nix
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,12 @@ let
free_page_reporting = "on";
};

# cloud-hypervisor >= 30.0 has a new command-line arguments syntax
hasNewArgSyntax = builtins.compareVersions pkgs.cloud-hypervisor.version "30.0" >= 0;
# cloud-hypervisor >= 30.0 < 36.0 temporarily replaced clap with argh
hasArghSyntax =
builtins.compareVersions pkgs.cloud-hypervisor.version "30.0" >= 0 &&
builtins.compareVersions pkgs.cloud-hypervisor.version "36.0" < 0;
arg =
if hasNewArgSyntax
if hasArghSyntax
then switch: params:
# `--switch param0 --switch param1 ...`
builtins.concatMap (param: [ switch param ]) params
Expand Down

0 comments on commit d07c3ef

Please sign in to comment.