Skip to content

Commit

Permalink
libpcap using static lib
Browse files Browse the repository at this point in the history
  • Loading branch information
jiumos committed Oct 14, 2024
1 parent 01caeb5 commit 9c91759
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 12 deletions.
12 changes: 0 additions & 12 deletions .github/workflows/agent-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,8 @@ jobs:
cd agent
mkdir -p pkg/debian/systemd/usr/sbin/
mkdir -p pkg/debian/systemd/usr/bin/
mkdir -p pkg/debian/systemd/usr/lib/x86_64-linux-gnu/
cp -af output/target/release/deepflow-agent pkg/debian/systemd/usr/sbin/
cp -af output/target/release/ecapture pkg/debian/systemd/usr/bin/
cp -af docker/require/x86_64/libpcap.so.1 pkg/debian/systemd/usr/lib/x86_64-linux-gnu/
mkdir -p pkg/debian/systemd/etc/
cp -af config/deepflow-agent.yaml pkg/debian/systemd/etc/
cp -af config/deepflow-agent.yaml pkg/debian/systemd/etc/deepflow-agent.yaml.sample
Expand All @@ -103,11 +101,7 @@ jobs:
sed -i "s/Version.*/Version: 1.0-${{ env.IMAGE_TAG }}/g" pkg/debian/systemd/DEBIAN/control
dpkg-deb -Zxz --no-uniform-compression -b pkg/debian/systemd x86_64/deepflow-agent-1.0-${{ env.IMAGE_TAG }}.systemd.deb
mkdir -p pkg/debian/upstart/usr/sbin/
mkdir -p pkg/debian/upstart/usr/bin/
mkdir -p pkg/debian/upstart/usr/lib/x86_64-linux-gnu/
cp -af output/target/release/deepflow-agent pkg/debian/upstart/usr/sbin/
cp -af output/target/release/ecapture pkg/debian/upstart/usr/bin/
cp -af docker/require/x86_64/libpcap.so.1 pkg/debian/upstart/usr/lib/x86_64-linux-gnu/
mkdir -p pkg/debian/upstart/etc/
cp -af config/deepflow-agent.yaml pkg/debian/upstart/etc/
cp -af config/deepflow-agent.yaml pkg/debian/upstart/etc/deepflow-agent.yaml.sample
Expand Down Expand Up @@ -225,10 +219,8 @@ jobs:
cd agent
mkdir -p pkg/debian/systemd/usr/sbin/
mkdir -p pkg/debian/systemd/usr/bin/
mkdir -p pkg/debian/systemd/lib/aarch64-linux-gnu/
cp -af output/target/release/deepflow-agent pkg/debian/systemd/usr/sbin/
cp -af output/target/release/ecapture pkg/debian/systemd/usr/bin/
cp -af docker/require/aarch64/libpcap.so.1 pkg/debian/systemd/lib/aarch64-linux-gnu/
mkdir -p pkg/debian/systemd/etc/
cp -af config/deepflow-agent.yaml pkg/debian/systemd/etc/
cp -af config/deepflow-agent.yaml pkg/debian/systemd/etc/deepflow-agent.yaml.sample
Expand All @@ -237,11 +229,7 @@ jobs:
sed -i "s/Version.*/Version: 1.0-${{ env.IMAGE_TAG }}/g" pkg/debian/systemd/DEBIAN/control
dpkg-deb -Zxz --no-uniform-compression -b pkg/debian/systemd aarch64/deepflow-agent-1.0-${{ env.IMAGE_TAG }}.systemd.deb
mkdir -p pkg/debian/upstart/usr/sbin/
mkdir -p pkg/debian/upstart/usr/bin/
mkdir -p pkg/debian/upstart/lib/aarch64-linux-gnu/
cp -af output/target/release/deepflow-agent pkg/debian/upstart/usr/sbin/
cp -af output/target/release/ecapture pkg/debian/upstart/usr/bin/
cp -af docker/require/aarch64/libpcap.so.1 pkg/debian/upstart/lib/aarch64-linux-gnu/
mkdir -p pkg/debian/upstart/etc/
cp -af config/deepflow-agent.yaml pkg/debian/upstart/etc/
cp -af config/deepflow-agent.yaml pkg/debian/upstart/etc/deepflow-agent.yaml.sample
Expand Down
1 change: 1 addition & 0 deletions agent/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ walkdir = "2"
[features]
enterprise = ["extended_profile", "enterprise-utils"]
extended_profile = []
dylib_lib_pcap = []

[[bench]]
name = "common"
Expand Down
3 changes: 3 additions & 0 deletions agent/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,10 @@ fn set_linkage() -> Result<()> {
println!("cargo:rustc-link-lib=dylib=pthread");
println!("cargo:rustc-link-lib=dylib=z");
println!("cargo:rustc-link-lib=dylib=stdc++");
#[cfg(feature = "dylib_lib_pcap")]
println!("cargo:rustc-link-lib=dylib=pcap");
#[cfg(not(feature = "dylib_lib_pcap"))]
println!("cargo:rustc-link-lib=static=pcap");
}
"musl" => {
#[cfg(target_arch = "x86_64")]
Expand Down

0 comments on commit 9c91759

Please sign in to comment.