|
2 | 2 | lib, |
3 | 3 | stdenv, |
4 | 4 | fetchFromGitHub, |
5 | | - makeRustPlatform, |
6 | | - rustc, |
7 | | - cargo, |
8 | | - llvmPackages, |
9 | 5 | cmake, |
10 | 6 | gcc, |
11 | | - |
12 | | - # gcc compile error at deps: aws-lc-sys, function 'memcpy' inlined from 'OPENSSL_memcpy' |
13 | | - # error: '__builtin_memcpy' specified bound exceeds maximum object size |
14 | | - # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91397 |
15 | | - useRustPlatform ? makeRustPlatform { |
16 | | - inherit rustc cargo; |
17 | | - inherit (llvmPackages) stdenv; |
18 | | - }, |
| 7 | + rust-bindgen, |
| 8 | + rustPlatform, |
19 | 9 | }: |
20 | 10 |
|
21 | | -useRustPlatform.buildRustPackage rec { |
| 11 | +rustPlatform.buildRustPackage rec { |
22 | 12 | pname = "firecracker"; |
23 | | - version = "1.9.1"; |
| 13 | + version = "1.10.1"; |
24 | 14 |
|
25 | 15 | src = fetchFromGitHub { |
26 | 16 | owner = "firecracker-microvm"; |
27 | 17 | repo = "firecracker"; |
28 | 18 | rev = "v${version}"; |
29 | | - hash = "sha256-NgT06Xfb6j+d5EcqFjQeaiY08uJJjmrddzdwSoqpKbQ="; |
| 19 | + hash = "sha256-kLQPAHbj8Q425Z5zdwofyHz+sd3bf7zGmcMjKn9yTKc="; |
30 | 20 | }; |
31 | 21 |
|
32 | | - cargoLock = { |
33 | | - lockFile = ./Cargo.lock; |
34 | | - outputHashes = { |
35 | | - "micro_http-0.1.0" = "sha256-bso39jUUyhlNutUxHw8uHtKWQIHmoikfQ5O3RIePboo="; |
36 | | - }; |
37 | | - }; |
| 22 | + useFetchCargoVendor = true; |
| 23 | + cargoHash = "sha256-TnEPNTeeX1KP+9HLD/oGF0sZGcXDHpc1Q1wCWw3L6mU="; |
| 24 | + |
| 25 | + # For [email protected]: use external bindgen. |
| 26 | + AWS_LC_SYS_EXTERNAL_BINDGEN = "true"; |
| 27 | + |
| 28 | + # For [email protected]: fix gcc error: |
| 29 | + # In function 'memcpy', |
| 30 | + # inlined from 'OPENSSL_memcpy' at aws-lc/crypto/asn1/../internal.h |
| 31 | + # inlined from 'aws_lc_0_22_0_i2c_ASN1_BIT_STRING' at aws-lc/crypto/asn1/a_bitstr.c |
| 32 | + # glibc/.../string_fortified.h: error: '__builtin_memcpy' specified bound exceeds maximum object size [-Werror=stringop-overflow=] |
| 33 | + postPatch = '' |
| 34 | + substituteInPlace $cargoDepsCopy/aws-lc-sys-*/aws-lc/crypto/asn1/a_bitstr.c \ |
| 35 | + --replace-warn '(len > INT_MAX - 1)' '(len < 0 || len > INT_MAX - 1)' |
| 36 | + ''; |
38 | 37 |
|
39 | 38 | nativeBuildInputs = [ |
40 | 39 | cmake |
41 | 40 | gcc |
42 | | - useRustPlatform.bindgenHook |
| 41 | + rust-bindgen # for [email protected] |
| 42 | + rustPlatform.bindgenHook |
43 | 43 | ]; |
44 | 44 |
|
45 | 45 | cargoBuildFlags = [ "--workspace" ]; |
| 46 | + cargoTestFlags = [ "--package" "firecracker" "--package" "jailer" ]; |
46 | 47 |
|
47 | 48 | checkFlags = [ |
48 | | - # requires /sys/devices/virtual/dmi |
| 49 | + # basic tests to skip in sandbox |
49 | 50 | "--skip=fingerprint::dump::tests::test_read_valid_sysfs_file" |
50 | | - # requires /dev/kvm |
51 | 51 | "--skip=template::dump::tests::test_dump" |
| 52 | + "--skip=tests::test_filter_apply" |
52 | 53 | "--skip=tests::test_fingerprint_dump_command" |
53 | 54 | "--skip=tests::test_template_dump_command" |
54 | 55 | "--skip=tests::test_template_verify_command" |
55 | 56 | "--skip=utils::tests::test_build_microvm" |
56 | | - # requires seccomp == 0 |
57 | | - "--skip=tests::test_filter_apply" |
| 57 | + # more tests to skip in sandbox |
| 58 | + "--skip=env::tests::test_copy_cache_info" |
| 59 | + "--skip=env::tests::test_dup2" |
| 60 | + "--skip=env::tests::test_mknod_and_own_dev" |
| 61 | + "--skip=env::tests::test_setup_jailed_folder" |
| 62 | + "--skip=env::tests::test_userfaultfd_dev" |
| 63 | + "--skip=resource_limits::tests::test_set_resource_limits" |
58 | 64 | ]; |
59 | 65 |
|
60 | 66 | installPhase = '' |
|
0 commit comments