|
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 | + src = craneLib'.cleanCargoSource cloud-hypervisor-src; |
| 19 | + meta = cloud-hypervisor-meta; |
19 | 20 |
|
20 | | - src = craneLib'.cleanCargoSource cloud-hypervisor-src; |
| 21 | + # Pragmatic release profile with debug-ability and faster |
| 22 | + # compilation times in mind. |
| 23 | + env = { |
| 24 | + CARGO_PROFILE_RELEASE_DEBUG_ASSERTIONS = "true"; |
| 25 | + CARGO_PROFILE_RELEASE_OPT_LEVEL = 2; |
| 26 | + CARGO_PROFILE_RELEASE_OVERFLOW_CHECKS = "true"; |
| 27 | + CARGO_PROFILE_RELEASE_LTO = "no"; |
| 28 | + }; |
21 | 29 |
|
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"; |
| 30 | + nativeBuildInputs = [ |
| 31 | + pkg-config |
| 32 | + ]; |
| 33 | + buildInputs = [ |
| 34 | + openssl |
| 35 | + ]; |
| 36 | + # Fix build. Reference: |
| 37 | + # - https://github.com/sfackler/rust-openssl/issues/1430 |
| 38 | + # - https://docs.rs/openssl/latest/openssl/ |
| 39 | + OPENSSL_NO_VENDOR = true; |
29 | 40 | }; |
30 | 41 |
|
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 | 42 | # Downloaded and compiled dependencies. |
44 | 43 | cargoArtifacts = craneLib'.buildDepsOnly ( |
45 | 44 | commonArgs |
46 | 45 | // { |
47 | | - # "suffix '-deps' will be appended |
48 | | - pname = "cloud-hypervisor"; |
49 | 46 | doCheck = false; |
50 | 47 | } |
51 | 48 | ); |
|
54 | 51 | commonArgs |
55 | 52 | // { |
56 | 53 | inherit cargoArtifacts; |
57 | | - pname = "cloud-hypervisor"; |
58 | | - # Don't execute tests here. We want this in a dedicated step. |
| 54 | + # Don't execute tests here. Too expensive for local development with |
| 55 | + # frequent rebuilds + little benefit. |
59 | 56 | doCheck = false; |
60 | 57 | cargoExtraArgs = "--features kvm"; |
61 | 58 | } |
|
0 commit comments