Refactor build.rs files to link static bpf library and handle LIBBPF_… #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: auto_release | |
on: | |
push: | |
branches: [ "**"] | |
permissions: | |
contents: write | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
bpf: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: build bpf | |
if: github.event_name == 'push' && github.ref == 'refs/heads/master' | |
id: build_bpf | |
uses: arloor/rust_musl_action@latest | |
with: | |
use_musl: false | |
extra_deps: cmake zlib1g-dev libelf-dev clang libbpf-dev | |
after_install: | | |
# find / -name libelf.a | |
# find / -name libbpf.a | |
# find / -name libz.a | |
export LIBBPF_SYS_LIBRARY_PATH=/usr/lib:/usr/lib64:/usr/lib/x86_64-linux-gnu | |
echo -e "\e[31mLIBBPF_SYS_LIBRARY_PATH=$LIBBPF_SYS_LIBRARY_PATH\e[0m" | |
args: -p socket_filter --no-default-features --features static | |
apt_mirror: mirrors.mit.edu | |
rust_flags: -C target-feature=+crt-static | |
debug: false | |
- name: ls dir | |
run: | | |
ls ${{ steps.build_bpf.outputs.release_dir }} |