Skip to content

Commit

Permalink
feat: add ci to check dynamic libs
Browse files Browse the repository at this point in the history
  • Loading branch information
jiumos committed Oct 17, 2024
1 parent f14c631 commit 781bb6b
Show file tree
Hide file tree
Showing 2 changed files with 111 additions and 1 deletion.
54 changes: 54 additions & 0 deletions .github/workflows/agent-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,33 @@ jobs:
build-args: |
GITHUB_REF_NAME=${{ github.ref_name }}
- name: Check dynamic dependencies
run: |
required_libs=()
in_arm_section=false
while IFS= read -r line; do
if [[ "$line" =~ ^\#\ X86\ Dynamic\ Libraries ]]; then
in_arm_section=true
continue
fi
if [[ "$line" =~ ^\#\ ]] && [[ "$in_arm_section" = true ]]; then
break
fi
if [[ "$in_arm_section" = true ]] && [[ "$line" =~ \*\*([^\*]+)\*\* ]]; then
required_libs+=("${BASH_REMATCH[1]}")
fi
done < agent/README.md
dynamic_libs=$(ldd agent/output/target/release/deepflow-agent | awk '{print $1}' | xargs -n1 basename)
echo "All dynamic dependency: ${dynamic_libs}"
for lib in $dynamic_libs; do
if [[ ! " ${required_libs[@]} " =~ " ${lib} " ]]; then
echo "Warning: Do not introduce any additional dynamic library dependencies!: ${lib}"
exit 1
fi
done
- name: Package code build results
run: |
tar cvf agent-artifact-amd64.tar agent/output/target/release/deepflow-agent agent/output/target/release/deepflow-agent-ctl agent/output/src/ebpf/deepflow-ebpfctl
Expand Down Expand Up @@ -196,6 +223,33 @@ jobs:
build-args: |
GITHUB_REF_NAME=${{ github.ref_name }}
- name: Check dynamic dependencies
run: |
required_libs=()
in_arm_section=false
while IFS= read -r line; do
if [[ "$line" =~ ^\#\ ARM\ Dynamic\ Libraries ]]; then
in_arm_section=true
continue
fi
if [[ "$line" =~ ^\#\ ]] && [[ "$in_arm_section" = true ]]; then
break
fi
if [[ "$in_arm_section" = true ]] && [[ "$line" =~ \*\*([^\*]+)\*\* ]]; then
required_libs+=("${BASH_REMATCH[1]}")
fi
done < agent/README.md
dynamic_libs=$(ldd agent/output/target/release/deepflow-agent | awk '{print $1}' | xargs -n1 basename)
echo "All dynamic dependency: ${dynamic_libs}"
for lib in $dynamic_libs; do
if [[ ! " ${required_libs[@]} " =~ " ${lib} " ]]; then
echo "Warning: Do not introduce any additional dynamic library dependencies!: ${lib}"
exit 1
fi
done
- name: Package code build results
run: |
tar cvf agent-artifact-arm64.tar agent/output/target/release/deepflow-agent agent/output/target/release/deepflow-agent-ctl agent/output/src/ebpf/deepflow-ebpfctl
Expand Down
58 changes: 57 additions & 1 deletion agent/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,59 @@
# trident-rs

trident in rust
trident in rust

# X86 Dynamic Libraries

This project requires the following dynamic libraries:

1. **linux-vdso.so.1**

2. **libpthread.so.0**

3. **libz.so.1**

4. **libstdc++.so.6**

5. **libgcc_s.so.1**

6. **librt.so.1**

7. **libm.so.6**

8. **libdl.so.2**

9. **libc.so.6**

10. **ld-linux-x86-64.so.2**

# ARM Dynamic Libraries

This project requires the following dynamic libraries:

1. **linux-vdso.so.1**

2. **libpthread.so.0**

3. **libz.so.1**

4. **libstdc++.so.6**

5. **libgcc_s.so.1**

6. **librt.so.1**

7. **libm.so.6**

8. **libdl.so.2**

9. **libc.so.6**

10. **ld-linux-aarch64.so.1**

11. **libibverbs.so.1**

12. **libnl-route-3.so.200**

13. **libnl-3.so.200**

# other

0 comments on commit 781bb6b

Please sign in to comment.