Repository: aya-rs/aya (language: rust)

Issue:
`cargo test` does not work on main
This was caused by #677, which added `integration-tests` to the default members.
The integration-tests will only work when run as a privileged user and therefore were only runnable via xtask.

This crept through CI because of all the `--exclude` all over the place.

As a developer on Aya, I need to be able to `cargo test && cargo xtask integration-test` my patches before submitting them.


Discussion / hints:
```console
cargo test
    Blocking waiting for file lock on build directory
   Compiling xtask v0.1.0 (/home/dave/dev/aya-rs/aya/xtask)
   Compiling integration-ebpf v0.1.0 (/home/dave/dev/aya-rs/aya/test/integration-ebpf)
   Compiling integration-test v0.1.0 (/home/dave/dev/aya-rs/aya/test/integration-test)
    Finished test [unoptimized + debuginfo] target(s) in 3.49s
     Running unittests src/lib.rs (target/debug/deps/aya-39bd8b171cd80575)

running 70 tests
test maps::bloom_filter::tests::test_contains_syscall_error ... ok
test maps::bloom_filter::tests::test_contains_not_found ... ok
test maps::bloom_filter::tests::test_insert_ok ... ok
test maps::bloom_filter::tests::test_insert_syscall_error ... ok
test maps::bloom_filter::tests::test_new_not_created ... ok
test maps::bloom_filter::tests::test_new_ok ... ok
test maps::bloom_filter::tests::test_try_from_ok ... ok
test maps::bloom_filter::tests::test_try_from_wrong_map ... ok
test maps::bloom_filter::tests::test_wrong_value_size ... ok
test maps::hash_map::hash_map::tests::test_get_not_found ... ok
test maps::hash_map::hash_map::tests::test_get_syscall_error ... ok
test maps::hash_map::hash_map::tests::test_insert_boxed_ok ... ok
test maps::hash_map::hash_map::tests::test_insert_ok ... ok
test maps::hash_map::hash_map::tests::test_insert_syscall_error ... ok
test maps::hash_map::hash_map::tests::test_iter_key_deleted ... ok
test maps::hash_map::hash_map::tests::test_iter ... ok
test maps::hash_map::hash_map::tests::test_iter_value_error ... ok
test maps::hash_map::hash_map::tests::test_iter_key_error ... ok
test maps::hash_map::hash_map::tests::test_keys ... ok
test maps::hash_map::hash_map::tests::test_keys_empty ... ok
test maps::hash_map::hash_map::tests::test_keys_error ... ok
test maps::hash_map::hash_map::tests::test_new_not_created ... ok
test maps::hash_map::hash_map::tests::test_new_ok ... ok
test maps::hash_map::hash_map::tests::test_remove_ok ... ok
test maps::hash_map::hash_map::tests::test_remove_syscall_error ... ok
test maps::hash_map::hash_map::tests::test_try_from_ok ... ok
test maps::hash_map::hash_map::tests::test_try_from_ok_lru ... ok
test maps::hash_map::hash_map::tests::test_try_from_wrong_map ... ok
test maps::hash_map::hash_map::tests::test_try_from_wrong_map_values ... ok
test maps::hash_map::hash_map::tests::test_wrong_key_size ... ok
test maps::hash_map::hash_map::tests::test_wrong_value_size ... ok
test maps::lpm_trie::tests::test_get_not_found ... ok
test maps::lpm_trie::tests::test_get_syscall_error ... ok
test maps::lpm_trie::tests::test_insert_ok ... ok
test maps::lpm_trie::tests::test_insert_syscall_error ... ok
test maps::lpm_trie::tests::test_new_not_created ... ok
test maps::lpm_trie::tests::test_new_ok ... ok
test maps::lpm_trie::tests::test_remove_ok ... ok
test maps::lpm_trie::tests::test_remove_syscall_error ... ok
test maps::lpm_trie::tests::test_try_from_ok ... ok
test maps::lpm_trie::tests::test_try_from_wrong_map ... ok
test maps::lpm_trie::tests::test_wrong_key_size ... ok
test maps::lpm_trie::tests::test_wrong_value_size ... ok
test maps::perf::perf_buffer::tests::test_invalid_page_count ... ok
test maps::perf::perf_buffer::tests::test_no_events ... ok
test maps::perf::perf_buffer::tests::test_no_out_bufs ... ok
test maps::perf::perf_buffer::tests::test_read_first_lost ... ok
test maps::perf::perf_buffer::tests::test_read_first_sample ... ok
test maps::perf::perf_buffer::tests::test_read_last_sample ... ok
test maps::perf::perf_buffer::tests::test_read_many_with_many_reads ... ok
test maps::perf::perf_buffer::tests::test_read_many_with_one_read ... ok
test maps::perf::perf_buffer::tests::test_read_wrapping_sample_size ... ok
test maps::perf::perf_buffer::tests::test_read_wrapping_value ... ok
test maps::tests::test_create ... ok
test maps::tests::test_create_failed ... ok
test programs::links::tests::test_already_attached ... ok
test programs::links::tests::test_drop_detach ... ok
test programs::links::tests::test_link_map ... ok
test programs::links::tests::test_not_attached ... ok
test programs::links::tests::test_owned_detach ... ok
test sys::bpf::tests::test_perf_link_supported ... ok
test sys::netlink::tests::test_nested_attrs ... ok
test sys::netlink::tests::test_nlattr_iterator_empty ... ok
test programs::links::tests::test_pin ... ok
test sys::netlink::tests::test_nlattr_iterator_many ... ok
test sys::netlink::tests::test_nlattr_iterator_nested ... ok
test sys::netlink::tests::test_nlattr_iterator_one ... ok
test util::tests::test_parse_kernel_symbols ... ok
test util::tests::test_parse_kernel_version_string ... ok
test util::tests::test_parse_online_cpus ... ok

test result: ok. 70 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

     Running unittests src/lib.rs (target/debug/deps/aya_bpf_macros-700aff48609410e3)

running 8 tests
test expand::tests::cgroup_skb_with_name ... ok
test expand::tests::cgroup_skb_with_attach_no_name ... ok
test expand::tests::cgroup_skb_no_name ... ok
test expand::tests::cgroup_device_no_name ... ok
test expand::tests::cgroup_skb_with_attach_and_name ... ok
test expand::tests::priv_function ... ok
test expand::tests::pub_function ... ok
test expand::tests::pub_crate_function ... ok

test result: ok. 8 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

     Running unittests src/lib.rs (target/debug/deps/aya_log-a37aabaccee26d6b)

running 12 tests
test test::test_bytes ... ok
test test::test_bytes_with_args ... ok
test test::test_display_hint_default ... ok
test test::test_display_hint_ipv6_arr_u8_len_16 ... ok
test test::test_display_hint_ipv6_arr_u16_len_8 ... ok
test test::test_display_hint_ipv4 ... ok
test test::test_display_hint_lower_hex ... ok
test test::test_display_hint_lower_mac ... ok
test test::test_display_hint_upper_hex ... ok
test test::test_display_hint_upper_mac ... ok
test test::test_str ... ok
test test::test_str_with_args ... ok

test result: ok. 12 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

     Running unittests src/lib.rs (target/debug/deps/aya_log_common-e8aa135978d2c128)

running 1 test
test test::log_value_length_sufficient ... ok

test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

     Running unittests src/lib.rs (target/debug/deps/aya_log_ebpf_macros-46108358e64bc840)

running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

     Running unittests src/lib.rs (target/debug/deps/aya_log_parser-8e47bab4e03bc086)

running 1 test
test test::test_parse ... ok

test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

     Running unittests src/lib.rs (target/debug/deps/aya_obj-6d59165d81559f7c)

running 79 tests
test btf::btf::tests::test_fixup_ptr ... ok
test btf::btf::tests::test_fixup_func_proto ... ok
test btf::btf::tests::parsing_older_ext_data ... ok
test btf::btf::tests::test_fixup_datasec ... ok
test btf::btf::tests::test_parse_header ... ok
test btf::btf::tests::test_parse_btf ... ok
test btf::btf::tests::test_sanitize_datasec ... ok
test btf::btf::tests::test_sanitize_decl_tag ... ok
test btf::btf::tests::test_sanitize_float ... ok
test btf::btf::tests::test_sanitize_func_and_proto ... ok
test btf::btf::tests::test_sanitize_func_global ... ok
test btf::btf::tests::test_sanitize_type_tag ... ok
test btf::btf::tests::test_sanitize_mem_builtins ... ok
test btf::btf::tests::test_sanitize_var ... ok
test btf::btf::tests::test_write_btf ... ok
test btf::types::tests::test_read_btf_type_array ... ok
test btf::types::tests::test_read_btf_type_const ... ok
test btf::types::tests::test_read_btf_type_enum ... ok
test btf::types::tests::test_read_btf_type_float ... ok
test btf::types::tests::test_read_btf_type_func ... ok
test btf::types::tests::test_read_btf_type_func_datasec ... ok
test btf::types::tests::test_read_btf_type_func_proto ... ok
test btf::types::tests::test_read_btf_type_func_var ... ok
test btf::types::tests::test_read_btf_type_fwd ... ok
test btf::types::tests::test_read_btf_type_int ... ok
test btf::types::tests::test_read_btf_type_ptr ... ok
test btf::types::tests::test_read_btf_type_restrict ... ok
test btf::types::tests::test_read_btf_type_struct ... ok
test btf::types::tests::test_read_btf_type_typedef ... ok
test btf::types::tests::test_read_btf_type_union ... ok
test btf::types::tests::test_read_btf_type_volatile ... ok
test btf::types::tests::test_types_are_compatible ... ok
test btf::types::tests::test_write_btf_func_proto ... ok
test btf::types::tests::test_write_btf_long_unsigned_int ... ok
test btf::types::tests::test_write_btf_signed_short_int ... ok
test btf::types::tests::test_write_btf_uchar ... ok
test obj::tests::sanitizes_empty_btf_files_to_none ... ok
test obj::tests::test_parse_generic_error ... ok
test obj::tests::test_parse_license ... ok
test obj::tests::test_parse_btf_map_section ... ok
test obj::tests::test_parse_map_data ... ok
test obj::tests::test_parse_map_def ... ok
test obj::tests::test_parse_map_def_error ... ok
test obj::tests::test_parse_map_def_with_padding ... ok
test obj::tests::test_parse_map_short ... ok
test obj::tests::test_parse_program ... ok
test obj::tests::test_parse_program_error ... ok
test obj::tests::test_parse_section_btf_tracepoint ... ok
test obj::tests::test_parse_section_cgroup_skb_ingress_named ... ok
test obj::tests::test_parse_section_cgroup_skb_ingress_unnamed ... ok
test obj::tests::test_parse_section_cgroup_skb_no_direction_named ... ok
test obj::tests::test_parse_section_cgroup_skb_no_direction_unamed ... ok
test obj::tests::test_parse_section_data ... ok
test obj::tests::test_parse_section_fentry ... ok
test obj::tests::test_parse_section_fexit ... ok
test obj::tests::test_parse_section_kprobe ... ok
test obj::tests::test_parse_section_lsm ... ok
test obj::tests::test_parse_section_map ... ok
test obj::tests::test_parse_section_raw_tp ... ok
test obj::tests::test_parse_section_lsm_sleepable ... ok
test obj::tests::test_parse_section_multiple_maps ... ok
test obj::tests::test_parse_section_skskb_unnamed ... ok
test obj::tests::test_parse_section_skskb_named ... ok
test obj::tests::test_parse_section_sock_addr_unnamed ... ok
test obj::tests::test_parse_section_socket_filter ... ok
test obj::tests::test_parse_section_sock_addr_named ... ok
test obj::tests::test_parse_section_sockopt_named ... ok
test obj::tests::test_parse_section_sockopt_unnamed ... ok
test obj::tests::test_parse_section_trace_point ... ok
test obj::tests::test_parse_section_uprobe ... ok
test obj::tests::test_parse_section_xdp ... ok
test obj::tests::test_parse_section_xdp_frags ... ok
test obj::tests::test_parse_version ... ok
test obj::tests::test_patch_map_data ... ok
test relocation::test::test_multiple_btf_map_relocation ... ok
test relocation::test::test_multiple_legacy_map_relocation ... ok
test relocation::test::test_single_btf_map_relocation ... ok
test relocation::test::test_single_legacy_map_relocation ... ok
test btf::btf::tests::test_read_btf_from_sys_fs ... ok

test result: ok. 79 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.07s

     Running unittests src/lib.rs (target/debug/deps/aya_tool-2a6257f777724471)

running 2 tests
test generate::test::test_extract_ctypes_prefix ... ok
test generate::test::test_combine_flags ... ok

test result: ok. 2 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

     Running unittests src/bin/aya-tool.rs (target/debug/deps/aya_tool-dbbefdb192216d6f)

running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

     Running unittests src/lib.rs (target/debug/deps/integration_test-0d605dcfc7327d91)

running 34 tests
test tests::btf_relocations::relocate_enum64 ... FAILED
test tests::btf_relocations::relocate_enum ... FAILED
test tests::btf_relocations::relocate_enum64_signed ... FAILED
test tests::btf_relocations::relocate_enum_signed ... FAILED
test tests::elf::test_maps ... FAILED
test tests::bpf_probe_read::bpf_probe_read_user_str_bytes_empty_dest ... FAILED
test tests::bpf_probe_read::bpf_probe_read_user_str_bytes ... FAILED
test tests::bpf_probe_read::bpf_probe_read_kernel_str_bytes_empty_dest ... FAILED
test tests::bpf_probe_read::bpf_probe_read_user_str_bytes_empty_string ... FAILED
test tests::bpf_probe_read::bpf_probe_read_kernel_str_bytes_truncate ... FAILED
test tests::bpf_probe_read::bpf_probe_read_user_str_bytes_truncate ... FAILED
test tests::bpf_probe_read::bpf_probe_read_kernel_str_bytes_empty_string ... FAILED
test tests::bpf_probe_read::bpf_probe_read_kernel_str_bytes ... FAILED
test tests::btf_relocations::relocate_struct_flavors ... FAILED
test tests::btf_relocations::relocate_pointer ... FAILED
test tests::btf_relocations::relocate_field ... FAILED
test tests::load::basic_tracepoint ... FAILED
test tests::rbpf::run_with_rbpf ... FAILED
test tests::rbpf::use_map_with_rbpf ... FAILED
test tests::load::basic_uprobe ... FAILED
test tests::load::multiple_btf_maps ... FAILED
test tests::load::pin_lifecycle_kprobe ... FAILED
test tests::load::pin_lifecycle ... FAILED
test tests::load::pin_lifecycle_tracepoint ... FAILED
test tests::load::long_name ... FAILED
test tests::load::pin_link ... FAILED
test tests::load::pin_lifecycle_uprobe ... FAILED
test tests::load::unload_xdp ... FAILED
test tests::log::log ... FAILED
test tests::smoke::xdp ... FAILED
test tests::relocations::text_64_64_reloc ... FAILED
test tests::smoke::extension ... FAILED
test tests::load::unload_kprobe ... FAILED
test tests::relocations::relocations ... FAILED

failures:

---- tests::btf_relocations::relocate_enum64 stdout ----
thread 'tests::btf_relocations::relocate_enum64' panicked at 'called `Result::unwrap()` on an `Err` value: Error running with BTF

Caused by:
    0: Loading eBPF failed
    1: map error: failed to create map `output_map` with code -1
    2: failed to create map `output_map` with code -1
    3: Operation not permitted (os error 1)', test/integration-test/src/tests/btf_relocations.rs:110:27
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

---- tests::btf_relocations::relocate_enum stdout ----
thread 'tests::btf_relocations::relocate_enum' panicked at 'called `Result::unwrap()` on an `Err` value: Error running with BTF

Caused by:
    0: Loading eBPF failed
    1: map error: failed to create map `output_map` with code -1
    2: failed to create map `output_map` with code -1
    3: Operation not permitted (os error 1)', test/integration-test/src/tests/btf_relocations.rs:60:27

---- tests::btf_relocations::relocate_enum64_signed stdout ----
thread 'tests::btf_relocations::relocate_enum64_signed' panicked at 'called `Result::unwrap()` on an `Err` value: Error running with BTF

Caused by:
    0: Loading eBPF failed
    1: map error: failed to create map `output_map` with code -1
    2: failed to create map `output_map` with code -1
    3: Operation not permitted (os error 1)', test/integration-test/src/tests/btf_relocations.rs:135:27

---- tests::btf_relocations::relocate_enum_signed stdout ----
thread 'tests::btf_relocations::relocate_enum_signed' panicked at 'called `Result::unwrap()` on an `Err` value: Error running with BTF

Caused by:
    0: Loading eBPF failed
    1: map error: failed to create map `output_map` with code -1
    2: failed to create map `output_map` with code -1
    3: Operation not permitted (os error 1)', test/integration-test/src/tests/btf_relocations.rs:85:27

---- tests::elf::test_maps stdout ----
thread 'tests::elf::test_maps' panicked at 'called `Result::unwrap()` on an `Err` value: Error("Could not read file magic")', test/integration-test/src/tests/elf.rs:5:57

---- tests::bpf_probe_read::bpf_probe_read_user_str_bytes_empty_dest stdout ----
thread 'tests::bpf_probe_read::bpf_probe_read_user_str_bytes_empty_dest' panicked at 'called `Result::unwrap()` on an `Err` value: ParseError(ElfError(Error("Could not read file magic")))', test/integration-test/src/tests/bpf_probe_read.rs:106:36

---- tests::bpf_probe_read::bpf_probe_read_user_str_bytes stdout ----
thread 'tests::bpf_probe_read::bpf_probe_read_user_str_bytes' panicked at 'called `Result::unwrap()` on an `Err` value: ParseError(ElfError(Error("Could not read file magic")))', test/integration-test/src/tests/bpf_probe_read.rs:106:36

---- tests::bpf_probe_read::bpf_probe_read_kernel_str_bytes_empty_dest stdout ----
thread 'tests::bpf_probe_read::bpf_probe_read_kernel_str_bytes_empty_dest' panicked at 'called `Result::unwrap()` on an `Err` value: ParseError(ElfError(Error("Could not read file magic")))', test/integration-test/src/tests/bpf_probe_read.rs:106:36

---- tests::bpf_probe_read::bpf_probe_read_user_str_bytes_empty_string stdout ----
thread 'tests::bpf_probe_read::bpf_probe_read_user_str_bytes_empty_string' panicked at 'called `Result::unwrap()` on an `Err` value: ParseError(ElfError(Error("Could not read file magic")))', test/integration-test/src/tests/bpf_probe_read.rs:106:36

---- tests::bpf_probe_read::bpf_probe_read_kernel_str_bytes_truncate stdout ----
thread 'tests::bpf_probe_read::bpf_probe_read_kernel_str_bytes_truncate' panicked at 'called `Result::unwrap()` on an `Err` value: ParseError(ElfError(Error("Could not read file magic")))', test/integration-test/src/tests/bpf_probe_read.rs:106:36

---- tests::bpf_probe_read::bpf_probe_read_user_str_bytes_truncate stdout ----
thread 'tests::bpf_probe_read::bpf_probe_read_user_str_bytes_truncate' panicked at 'called `Result::unwrap()` on an `Err` value: ParseError(ElfError(Error("Could not read file magic")))', test/integration-test/src/tests/bpf_probe_read.rs:106:36

---- tests::bpf_probe_read::bpf_probe_read_kernel_str_bytes_empty_string stdout ----
thread 'tests::bpf_probe_read::bpf_probe_read_kernel_str_bytes_empty_string' panicked at 'called `Result::unwrap()` on an `Err` value: ParseError(ElfError(Error("Could not read file magic")))', test/integration-test/src/tests/bpf_probe_read.rs:106:36

---- tests::bpf_probe_read::bpf_probe_read_kernel_str_bytes stdout ----
thread 'tests::bpf_probe_read::bpf_probe_read_kernel_str_bytes' panicked at 'called `Result::unwrap()` on an `Err` value: ParseError(ElfError(Error("Could not read file magic")))', test/integration-test/src/tests/bpf_probe_read.rs:106:36

---- tests::btf_relocations::relocate_struct_flavors stdout ----
thread 'tests::btf_relocations::relocate_struct_flavors' panicked at 'called `Result::unwrap()` on an `Err` value: Error running without BTF

Caused by:
    0: Loading eBPF failed
    1: map error: failed to create map `output_map` with code -1
    2: failed to create map `output_map` with code -1
    3: Operation not permitted (os error 1)', test/integration-test/src/tests/btf_relocations.rs:188:44

---- tests::btf_relocations::relocate_pointer stdout ----
thread 'tests::btf_relocations::relocate_pointer' panicked at 'called `Result::unwrap()` on an `Err` value: Error running with BTF

Caused by:
    0: Loading eBPF failed
    1: map error: failed to create map `output_map` with code -1
    2: failed to create map `output_map` with code -1
    3: Operation not permitted (os error 1)', test/integration-test/src/tests/btf_relocations.rs:158:27

---- tests::btf_relocations::relocate_field stdout ----
thread 'tests::btf_relocations::relocate_field' panicked at 'called `Result::unwrap()` on an `Err` value: Error running with BTF

Caused by:
    0: Loading eBPF failed
    1: map error: failed to create map `output_map` with code -1
    2: failed to create map `output_map` with code -1
    3: Operation not permitted (os error 1)', test/integration-test/src/tests/btf_relocations.rs:40:27

---- tests::load::basic_tracepoint stdout ----
thread 'tests::load::basic_tracepoint' panicked at 'called `Result::unwrap()` on an `Err` value: ParseError(ElfError(Error("Could not read file magic")))', test/integration-test/src/tests/load.rs:162:42

---- tests::rbpf::run_with_rbpf stdout ----
thread 'tests::rbpf::run_with_rbpf' panicked at 'called `Result::unwrap()` on an `Err` value: ElfError(Error("Could not read file magic"))', test/integration-test/src/tests/rbpf.rs:8:45

---- tests::rbpf::use_map_with_rbpf stdout ----
thread 'tests::rbpf::use_map_with_rbpf' panicked at 'called `Result::unwrap()` on an `Err` value: ElfError(Error("Could not read file magic"))', test/integration-test/src/tests/rbpf.rs:35:57

---- tests::load::basic_uprobe stdout ----
thread 'tests::load::basic_uprobe' panicked at 'called `Result::unwrap()` on an `Err` value: ParseError(ElfError(Error("Could not read file magic")))', test/integration-test/src/tests/load.rs:193:42

---- tests::load::multiple_btf_maps stdout ----
thread 'tests::load::multiple_btf_maps' panicked at 'called `Result::unwrap()` on an `Err` value: ParseError(ElfError(Error("Could not read file magic")))', test/integration-test/src/tests/load.rs:34:50

---- tests::load::pin_lifecycle_kprobe stdout ----
thread 'tests::load::pin_lifecycle_kprobe' panicked at 'called `Result::unwrap()` on an `Err` value: ParseError(ElfError(Error("Could not read file magic")))', test/integration-test/src/tests/load.rs:367:46

---- tests::load::pin_lifecycle stdout ----
thread 'tests::load::pin_lifecycle' panicked at 'called `Result::unwrap()` on an `Err` value: ParseError(ElfError(Error("Could not read file magic")))', test/integration-test/src/tests/load.rs:259:46

---- tests::load::pin_lifecycle_tracepoint stdout ----
thread 'tests::load::pin_lifecycle_tracepoint' panicked at 'called `Result::unwrap()` on an `Err` value: ParseError(ElfError(Error("Could not read file magic")))', test/integration-test/src/tests/load.rs:313:46

---- tests::load::long_name stdout ----
thread 'tests::load::long_name' panicked at 'called `Result::unwrap()` on an `Err` value: ParseError(ElfError(Error("Could not read file magic")))', test/integration-test/src/tests/load.rs:18:47

---- tests::load::pin_link stdout ----
thread 'tests::load::pin_link' panicked at 'called `Result::unwrap()` on an `Err` value: ParseError(ElfError(Error("Could not read file magic")))', test/integration-test/src/tests/load.rs:226:42

---- tests::load::pin_lifecycle_uprobe stdout ----
thread 'tests::load::pin_lifecycle_uprobe' panicked at 'called `Result::unwrap()` on an `Err` value: ParseError(ElfError(Error("Could not read file magic")))', test/integration-test/src/tests/load.rs:425:46

---- tests::load::unload_xdp stdout ----
thread 'tests::load::unload_xdp' panicked at 'called `Result::unwrap()` on an `Err` value: ParseError(ElfError(Error("Could not read file magic")))', test/integration-test/src/tests/load.rs:112:42

---- tests::log::log stdout ----
thread 'tests::log::log' panicked at 'called `Result::unwrap()` on an `Err` value: ParseError(ElfError(Error("Could not read file magic")))', test/integration-test/src/tests/log.rs:40:41

---- tests::smoke::xdp stdout ----
thread 'tests::smoke::xdp' panicked at 'called `Result::unwrap()` on an `Err` value: ParseError(ElfError(Error("Could not read file magic")))', test/integration-test/src/tests/smoke.rs:15:42

---- tests::relocations::text_64_64_reloc stdout ----
thread 'tests::relocations::text_64_64_reloc' panicked at 'called `Result::unwrap()` on an `Err` value: ParseError(ElfError(Error("Could not read file magic")))', test/integration-test/src/tests/relocations.rs:34:36

---- tests::smoke::extension stdout ----
thread 'tests::smoke::extension' panicked at 'called `Result::unwrap()` on an `Err` value: ParseError(ElfError(Error("Could not read file magic")))', test/integration-test/src/tests/smoke.rs:28:42

---- tests::load::unload_kprobe stdout ----
thread 'tests::load::unload_kprobe' panicked at 'called `Result::unwrap()` on an `Err` value: ParseError(ElfError(Error("Could not read file magic")))', test/integration-test/src/tests/load.rs:137:42

---- tests::relocations::relocations stdout ----
thread 'tests::relocations::relocations' panicked at 'called `Result::unwrap()` on an `Err` value: ParseError(ElfError(Error("Could not read file magic")))', test/integration-test/src/tests/relocations.rs:34:36


failures:
    tests::bpf_probe_read::bpf_probe_read_kernel_str_bytes
    tests::bpf_probe_read::bpf_probe_read_kernel_str_bytes_empty_dest
    tests::bpf_probe_read::bpf_probe_read_kernel_str_bytes_empty_string
    tests::bpf_probe_read::bpf_probe_read_kernel_str_bytes_truncate
    tests::bpf_probe_read::bpf_probe_read_user_str_bytes
    tests::bpf_probe_read::bpf_probe_read_user_str_bytes_empty_dest
    tests::bpf_probe_read::bpf_probe_read_user_str_bytes_empty_string
    tests::bpf_probe_read::bpf_probe_read_user_str_bytes_truncate
    tests::btf_relocations::relocate_enum
    tests::btf_relocations::relocate_enum64
    tests::btf_relocations::relocate_enum64_signed
    tests::btf_relocations::relocate_enum_signed
    tests::btf_relocations::relocate_field
    tests::btf_relocations::relocate_pointer
    tests::btf_relocations::relocate_struct_flavors
    tests::elf::test_maps
    tests::load::basic_tracepoint
    tests::load::basic_uprobe
    tests::load::long_name
    tests::load::multiple_btf_maps
    tests::load::pin_lifecycle
    tests::load::pin_lifecycle_kprobe
    tests::load::pin_lifecycle_tracepoint
    tests::load::pin_lifecycle_uprobe
    tests::load::pin_link
    tests::load::unload_kprobe
    tests::load::unload_xdp
    tests::log::log
    tests::rbpf::run_with_rbpf
    tests::rbpf::use_map_with_rbpf
    tests::relocations::relocations
    tests::relocations::text_64_64_reloc
    tests::smoke::extension
    tests::smoke::xdp

test result: FAILED. 0 passed; 34 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.55s

error: test failed, to rerun pass `-p integration-test --lib`
```

Fix patch:
diff --git a/Cargo.toml b/Cargo.toml
index 958be754c..e3ed0b7d6 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -29,7 +29,8 @@ default-members = [
     "aya-log-parser",
     "aya-obj",
     "aya-tool",
-    "test/integration-test",
+    # test/integration-test is omitted; including it in this list causes `cargo test` to run its
+    # tests, and that doesn't work unless they've been built with `cargo xtask`.
     "xtask",
 
     "aya-bpf-macros",


Test patch:
diff --git a/test/integration-ebpf/build.rs b/test/integration-ebpf/build.rs
index 35cb35825..dd4a65016 100644
--- a/test/integration-ebpf/build.rs
+++ b/test/integration-ebpf/build.rs
@@ -2,6 +2,18 @@ use std::{env, path::PathBuf};
 
 use xtask::{create_symlink_to_binary, AYA_BUILD_INTEGRATION_BPF};
 
+/// Building this crate has an undeclared dependency on the `bpf-linker` binary. This would be
+/// better expressed by [artifact-dependencies][bindeps] but issues such as
+/// https://github.com/rust-lang/cargo/issues/12385 make their use impractical for the time being.
+///
+/// This file implements an imperfect solution: it causes cargo to rebuild the crate whenever the
+/// mtime of `which bpf-linker` changes. Note that possibility that a new bpf-linker is added to
+/// $PATH ahead of the one used as the cache key still exists. Solving this in the general case
+/// would require rebuild-if-changed-env=PATH *and* rebuild-if-changed={every-directory-in-PATH}
+/// which would likely mean far too much cache invalidation.
+///
+/// [bindeps]: https://doc.rust-lang.org/nightly/cargo/reference/unstable.html?highlight=feature#artifact-dependencies
+
 fn main() {
     println!("cargo:rerun-if-env-changed={}", AYA_BUILD_INTEGRATION_BPF);
 
diff --git a/test/integration-test/build.rs b/test/integration-test/build.rs
index b1d9e7db0..2b95f068a 100644
--- a/test/integration-test/build.rs
+++ b/test/integration-test/build.rs
@@ -13,6 +13,29 @@ use cargo_metadata::{
 };
 use xtask::{exec, AYA_BUILD_INTEGRATION_BPF, LIBBPF_DIR};
 
+/// This crate has a runtime dependency on artifacts produced by the `integration-ebpf` crate. This
+/// would be better expressed as one or more [artifact-dependencies][bindeps] but issues such as:
+/// * https://github.com/rust-lang/cargo/issues/12374
+/// * https://github.com/rust-lang/cargo/issues/12375
+/// * https://github.com/rust-lang/cargo/issues/12385
+/// prevent their use for the time being.
+///
+/// This file, along with the xtask crate, allows analysis tools such as `cargo check`, `cargo
+/// clippy`, and even `cargo build` to work as users expect. Prior to this file's existence, this
+/// crate's undeclared dependency on artifacts from `integration-ebpf` would cause build (and `cargo check`,
+/// and `cargo clippy`) failures until the user ran certain other commands in the workspace. Conversely,
+/// those same tools (e.g. cargo test --no-run) would produce stale results if run naively because
+/// they'd make use of artifacts from a previous build of `integration-ebpf`.
+///
+/// Note that this solution is imperfect: in particular it has to balance correctness with
+/// performance; an environment variable is used to replace true builds of `integration-ebpf` with
+/// stubs to preserve the property that code generation and linking (in `integration-ebpf`) do not
+/// occur on metadata-only actions such as `cargo check` or `cargo clippy` of this crate. This means
+/// that naively attempting to `cargo test --no-run` this crate will produce binaries that fail at
+/// runtime because the stubs are inadequate for actually running the tests.
+///
+/// [bindeps]: https://doc.rust-lang.org/nightly/cargo/reference/unstable.html?highlight=feature#artifact-dependencies
+
 fn main() {
     println!("cargo:rerun-if-env-changed={}", AYA_BUILD_INTEGRATION_BPF);