diff --git a/chv.nix b/chv.nix index 1656922..f266595 100644 --- a/chv.nix +++ b/chv.nix @@ -14,38 +14,44 @@ let # Crane lib with proper Rust toolchain craneLib' = craneLib.overrideToolchain rustToolchain; - commonArgs = { - meta = cloud-hypervisor-meta; + commonArgs = + let + src = craneLib'.cleanCargoSource cloud-hypervisor-src; + in + { + inherit src; + # Since Nov 2025 (v50), Cloud Hypervisor has a virtual manifest and the + # main package was moved into a sub directory. + cargoToml = "${src}/cloud-hypervisor/Cargo.toml"; - src = craneLib'.cleanCargoSource cloud-hypervisor-src; + meta = cloud-hypervisor-meta; - # Pragmatic release profile with debug-ability and faster - # compilation times in mind. - env = { - CARGO_PROFILE_RELEASE_DEBUG_ASSERTIONS = "true"; - CARGO_PROFILE_RELEASE_OPT_LEVEL = 2; - CARGO_PROFILE_RELEASE_OVERFLOW_CHECKS = "true"; - CARGO_PROFILE_RELEASE_LTO = "no"; - }; + # Pragmatic release profile with debug-ability and faster + # compilation times in mind. + env = { + CARGO_PROFILE_RELEASE_DEBUG_ASSERTIONS = "true"; + CARGO_PROFILE_RELEASE_OPT_LEVEL = 2; + CARGO_PROFILE_RELEASE_OVERFLOW_CHECKS = "true"; + CARGO_PROFILE_RELEASE_LTO = "no"; + + # Fix build. Reference: + # - https://github.com/sfackler/rust-openssl/issues/1430 + # - https://docs.rs/openssl/latest/openssl/ + OPENSSL_NO_VENDOR = true; + }; - nativeBuildInputs = [ - pkg-config - ]; - buildInputs = [ - openssl - ]; - # Fix build. Reference: - # - https://github.com/sfackler/rust-openssl/issues/1430 - # - https://docs.rs/openssl/latest/openssl/ - OPENSSL_NO_VENDOR = true; - }; + nativeBuildInputs = [ + pkg-config + ]; + buildInputs = [ + openssl + ]; + }; # Downloaded and compiled dependencies. cargoArtifacts = craneLib'.buildDepsOnly ( commonArgs // { - # "suffix '-deps' will be appended - pname = "cloud-hypervisor"; doCheck = false; } ); @@ -54,8 +60,8 @@ let commonArgs // { inherit cargoArtifacts; - pname = "cloud-hypervisor"; - # Don't execute tests here. We want this in a dedicated step. + # Don't execute tests here. Too expensive for local development with + # frequent rebuilds + little benefit. doCheck = false; cargoExtraArgs = "--features kvm"; } diff --git a/flake.lock b/flake.lock index 456495a..d8aa4f6 100644 --- a/flake.lock +++ b/flake.lock @@ -3,11 +3,11 @@ "cloud-hypervisor-src": { "flake": false, "locked": { - "lastModified": 1767691830, - "narHash": "sha256-W815prxSJim1+z2fJ34tM7n2uXHZJfc/kdd50JpxeVY=", + "lastModified": 1767714447, + "narHash": "sha256-d7McdQ8gp72PoeXv4TH7SNRsebB2Y1J3MyDOc6dqOew=", "owner": "cyberus-technology", "repo": "cloud-hypervisor", - "rev": "451cfb7cd7999646b35faaa3666c90da8d758df6", + "rev": "daaea602a21b95bbfc3c1e277e1b7145377bc561", "type": "github" }, "original": {