|
14 | 14 | # Crane lib with proper Rust toolchain |
15 | 15 | craneLib' = craneLib.overrideToolchain rustToolchain; |
16 | 16 |
|
17 | | - commonArgs = { |
18 | | - meta = cloud-hypervisor-meta; |
| 17 | + commonArgs = |
| 18 | + let |
| 19 | + src = craneLib'.cleanCargoSource cloud-hypervisor-src; |
| 20 | + in |
| 21 | + { |
| 22 | + inherit src; |
| 23 | + # Since Nov 2025 (v50), Cloud Hypervisor has a virtual manifest and the |
| 24 | + # main package was moved into a sub directory. |
| 25 | + cargoToml = "${src}/cloud-hypervisor/Cargo.toml"; |
| 26 | + meta = cloud-hypervisor-meta; |
19 | 27 |
|
20 | | - src = craneLib'.cleanCargoSource cloud-hypervisor-src; |
| 28 | + # Pragmatic release profile with debug-ability and faster |
| 29 | + # compilation times in mind. |
| 30 | + env = { |
| 31 | + CARGO_PROFILE_RELEASE_DEBUG_ASSERTIONS = "true"; |
| 32 | + CARGO_PROFILE_RELEASE_OPT_LEVEL = 2; |
| 33 | + CARGO_PROFILE_RELEASE_OVERFLOW_CHECKS = "true"; |
| 34 | + CARGO_PROFILE_RELEASE_LTO = "no"; |
| 35 | + }; |
21 | 36 |
|
22 | | - # Pragmatic release profile with debug-ability and faster |
23 | | - # compilation times in mind. |
24 | | - env = { |
25 | | - CARGO_PROFILE_RELEASE_DEBUG_ASSERTIONS = "true"; |
26 | | - CARGO_PROFILE_RELEASE_OPT_LEVEL = 2; |
27 | | - CARGO_PROFILE_RELEASE_OVERFLOW_CHECKS = "true"; |
28 | | - CARGO_PROFILE_RELEASE_LTO = "no"; |
| 37 | + nativeBuildInputs = [ |
| 38 | + pkg-config |
| 39 | + ]; |
| 40 | + buildInputs = [ |
| 41 | + openssl |
| 42 | + ]; |
| 43 | + # Fix build. Reference: |
| 44 | + # - https://github.com/sfackler/rust-openssl/issues/1430 |
| 45 | + # - https://docs.rs/openssl/latest/openssl/ |
| 46 | + OPENSSL_NO_VENDOR = true; |
29 | 47 | }; |
30 | 48 |
|
31 | | - nativeBuildInputs = [ |
32 | | - pkg-config |
33 | | - ]; |
34 | | - buildInputs = [ |
35 | | - openssl |
36 | | - ]; |
37 | | - # Fix build. Reference: |
38 | | - # - https://github.com/sfackler/rust-openssl/issues/1430 |
39 | | - # - https://docs.rs/openssl/latest/openssl/ |
40 | | - OPENSSL_NO_VENDOR = true; |
41 | | - }; |
42 | | - |
43 | 49 | # Downloaded and compiled dependencies. |
44 | 50 | cargoArtifacts = craneLib'.buildDepsOnly ( |
45 | 51 | commonArgs |
46 | 52 | // { |
47 | 53 | # "suffix '-deps' will be appended |
48 | | - pname = "cloud-hypervisor"; |
49 | 54 | doCheck = false; |
50 | 55 | } |
51 | 56 | ); |
|
54 | 59 | commonArgs |
55 | 60 | // { |
56 | 61 | inherit cargoArtifacts; |
57 | | - pname = "cloud-hypervisor"; |
58 | 62 | # Don't execute tests here. We want this in a dedicated step. |
59 | 63 | doCheck = false; |
60 | 64 | cargoExtraArgs = "--features kvm"; |
|
0 commit comments