Skip to content

Commit e004bec

Browse files
fix: install bpf libraries
1 parent 2d0928e commit e004bec

File tree

2 files changed

+3
-13
lines changed

2 files changed

+3
-13
lines changed

.github/workflows/golangci.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
with:
2828
fetch-depth: 0
2929
- name: Generate BPF code
30-
run: go generate ./bpf-prog/block-iptables/...
30+
run: make bpf-lib && go generate ./bpf-prog/block-iptables/...
3131
env:
3232
GOTOOLCHAIN: local
3333
- name: golangci-lint

Makefile

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -199,8 +199,8 @@ ipv6-hp-bpf-binary:
199199
cd $(IPV6_HP_BPF_DIR) && CGO_ENABLED=0 go generate ./...
200200
cd $(IPV6_HP_BPF_DIR)/cmd/ipv6-hp-bpf && CGO_ENABLED=0 go build -v -o $(IPV6_HP_BPF_BUILD_DIR)/ipv6-hp-bpf$(EXE_EXT) -ldflags "-X main.version=$(IPV6_HP_BPF_VERSION)" -gcflags="-dwarflocationlists=true"
201201

202-
# Libraries for ipv6-hp-bpf
203-
ipv6-hp-bpf-lib:
202+
# Libraries for bpf
203+
bpf-lib:
204204
ifeq ($(GOARCH),amd64)
205205
sudo apt-get update && sudo apt-get install -y llvm clang linux-libc-dev linux-headers-generic libbpf-dev libc6-dev nftables iproute2 gcc-multilib
206206
for dir in /usr/include/x86_64-linux-gnu/*; do sudo ln -sfn "$$dir" /usr/include/$$(basename "$$dir"); done
@@ -214,16 +214,6 @@ block-iptables-binary:
214214
cd $(BLOCK_IPTABLES_DIR) && CGO_ENABLED=0 go generate ./...
215215
cd $(BLOCK_IPTABLES_DIR)/cmd/block-iptables && CGO_ENABLED=0 go build -v -o $(BLOCK_IPTABLES_BUILD_DIR)/block-iptables$(EXE_EXT) -ldflags "-X main.version=$(BLOCK_IPTABLES_VERSION)" -gcflags="-dwarflocationlists=true"
216216

217-
# Libraries for block-iptables
218-
block-iptables-lib:
219-
ifeq ($(GOARCH),amd64)
220-
sudo apt-get update && sudo apt-get install -y llvm clang linux-libc-dev linux-headers-generic libbpf-dev libc6-dev nftables iproute2 gcc-multilib
221-
for dir in /usr/include/x86_64-linux-gnu/*; do sudo ln -sfn "$$dir" /usr/include/$$(basename "$$dir"); done
222-
else ifeq ($(GOARCH),arm64)
223-
sudo apt-get update && sudo apt-get install -y llvm clang linux-libc-dev linux-headers-generic libbpf-dev libc6-dev nftables iproute2 gcc-aarch64-linux-gnu
224-
for dir in /usr/include/aarch64-linux-gnu/*; do sudo ln -sfn "$$dir" /usr/include/$$(basename "$$dir"); done
225-
endif
226-
227217
# Build the Azure CNI network binary.
228218
azure-vnet-binary:
229219
cd $(CNI_NET_DIR) && CGO_ENABLED=0 go build -v -o $(CNI_BUILD_DIR)/azure-vnet$(EXE_EXT) -ldflags "-X main.version=$(CNI_VERSION)" -gcflags="-dwarflocationlists=true"

0 commit comments

Comments
 (0)