You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
aya/.github/workflows/build-aya.yml

49 lines
1.0 KiB
YAML

name: build-aya
on:
push:
branches:
- main
- ci
pull_request:
branches:
- main
env:
CARGO_TERM_COLOR: always
jobs:
build-test:
strategy:
fail-fast: false
matrix:
arch:
- x86_64-unknown-linux-gnu
- aarch64-unknown-linux-gnu
- armv7-unknown-linux-gnueabi
- riscv64gc-unknown-linux-gnu
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
- uses: taiki-e/install-action@cargo-hack
- name: Check
Build tests with all features Remove mem::forget::<HashMap>() calls in tests which fail to compile when HashMap is provided by hashbrown: info: running `cargo check --all-targets --no-default-features` on aya-obj (11/23) Checking aya-obj v0.1.0 (/home/tamird/src/aya/aya-obj) error[E0505]: cannot move out of `map` because it is borrowed --> aya-obj/src/relocation.rs:594:21 | 578 | let map = fake_legacy_map(1); | --- binding `map` declared here 579 | let maps_by_symbol = HashMap::from([(1, ("test_map", Some(1), &map))]); | ---- borrow of `map` occurs here ... 594 | mem::forget(map); | ^^^ move out of `map` occurs here 595 | } | - borrow might be used here, when `maps_by_symbol` is dropped and runs the destructor for type `hashbrown::HashMap<usize, (&str, Option<i32>, &maps::Map)>` error[E0505]: cannot move out of `map_1` because it is borrowed --> aya-obj/src/relocation.rs:655:21 | 632 | let map_1 = fake_legacy_map(1); | ----- binding `map_1` declared here ... 635 | (1, ("test_map_1", Some(1), &map_1)), | ------ borrow of `map_1` occurs here ... 655 | mem::forget(map_1); | ^^^^^ move out of `map_1` occurs here 656 | mem::forget(map_2); 657 | } | - borrow might be used here, when `maps_by_symbol` is dropped and runs the destructor for type `hashbrown::HashMap<usize, (&str, Option<i32>, &maps::Map)>` error[E0505]: cannot move out of `map_2` because it is borrowed --> aya-obj/src/relocation.rs:656:21 | 633 | let map_2 = fake_legacy_map(2); | ----- binding `map_2` declared here ... 636 | (2, ("test_map_2", Some(2), &map_2)), | ------ borrow of `map_2` occurs here ... 656 | mem::forget(map_2); | ^^^^^ move out of `map_2` occurs here 657 | } | - borrow might be used here, when `maps_by_symbol` is dropped and runs the destructor for type `hashbrown::HashMap<usize, (&str, Option<i32>, &maps::Map)>` error[E0505]: cannot move out of `map` because it is borrowed --> aya-obj/src/relocation.rs:694:21 | 678 | let map = fake_btf_map(1); | --- binding `map` declared here 679 | let maps_by_symbol = HashMap::from([(1, ("test_map", Some(1), &map))]); | ---- borrow of `map` occurs here ... 694 | mem::forget(map); | ^^^ move out of `map` occurs here 695 | } | - borrow might be used here, when `maps_by_symbol` is dropped and runs the destructor for type `hashbrown::HashMap<usize, (&str, Option<i32>, &maps::Map)>` error[E0505]: cannot move out of `map_1` because it is borrowed --> aya-obj/src/relocation.rs:755:21 | 732 | let map_1 = fake_btf_map(1); | ----- binding `map_1` declared here ... 735 | (1, ("test_map_1", Some(1), &map_1)), | ------ borrow of `map_1` occurs here ... 755 | mem::forget(map_1); | ^^^^^ move out of `map_1` occurs here 756 | mem::forget(map_2); 757 | } | - borrow might be used here, when `maps_by_symbol` is dropped and runs the destructor for type `hashbrown::HashMap<usize, (&str, Option<i32>, &maps::Map)>` error[E0505]: cannot move out of `map_2` because it is borrowed --> aya-obj/src/relocation.rs:756:21 | 733 | let map_2 = fake_btf_map(2); | ----- binding `map_2` declared here ... 736 | (2, ("test_map_2", Some(2), &map_2)), | ------ borrow of `map_2` occurs here ... 756 | mem::forget(map_2); | ^^^^^ move out of `map_2` occurs here 757 | } | - borrow might be used here, when `maps_by_symbol` is dropped and runs the destructor for type `hashbrown::HashMap<usize, (&str, Option<i32>, &maps::Map)>` For more information about this error, try `rustc --explain E0505`. error: could not compile `aya-obj` due to 6 previous errors warning: build failed, waiting for other jobs to finish... error: process didn't exit successfully: `/home/tamird/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/cargo check --all-targets --manifest-path aya-obj/Cargo.toml --no-default-features` (exit status: 101)
2 years ago
run: cargo hack check --all-targets --feature-powerset --ignore-private
- uses: Swatinem/rust-cache@v2
- name: Prereqs
run: cargo install cross --git https://github.com/cross-rs/cross
- name: Build
run: cross build --verbose --target ${{ matrix.arch }}
- name: Run test
env:
RUST_BACKTRACE: full
run: cross test --verbose --target ${{ matrix.arch }}