Skip to content

Commit

Permalink
fix(ci)
Browse files Browse the repository at this point in the history
  • Loading branch information
hengyoush committed Oct 19, 2024
1 parent 584b28e commit 9580e98
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
sudo apt install -y clang
pwd
ls -l
make clean && make build-bpf && make btfgen && make
make clean && make build-bpf && make btfgen BUILD_ARCH=x86_64 ARCH_BPF_NAME=x86 && make
# - name: Test
# run: make test
Expand Down
6 changes: 2 additions & 4 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ builds:
env:
- CGO_ENABLED=1
- CC=aarch64-linux-gnu-gcc
- BUILD_ARCH=arm64
flags:
- -tags=static
ldflags:
Expand All @@ -37,15 +36,14 @@ builds:
pre:
- bash -c 'sudo make clean || true'
- bash -c 'sudo make build-bpf || true'
- bash -c 'sudo make btfgen'
- bash -c 'sudo make btfgen BUILD_ARCH=arm64 ARCH_BPF_NAME=arm64'

- id: kyanos-amd64
binary: kyanos
env:
- CGO_ENABLED=1
- CC=gcc
# - CGO_LDFLAGS="-Xlinker -rpath=. -static"
- BUILD_ARCH=x86_64
flags:
- -tags=static
ldflags:
Expand All @@ -59,7 +57,7 @@ builds:
pre:
- bash -c 'sudo make clean || true'
- bash -c 'sudo make build-bpf || true'
- bash -c 'sudo make btfgen'
- bash -c 'sudo make btfgen BUILD_ARCH=x86_64 ARCH_BPF_NAME=x86'

archives:
- builds:
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ kyanos: $(GO_FILES)

.PHONY: btfgen
btfgen:
./btfgen.sh
./btfgen.sh $(BUILD_ARCH) $(ARCH_BPF_NAME)

# delete failed targets
.DELETE_ON_ERROR:
Expand Down
6 changes: 3 additions & 3 deletions btfgen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ BTFHUB_REPO="https://github.com/aquasecurity/btfhub.git"
BTFHUB_ARCH_REPO="https://github.com/aquasecurity/btfhub-archive.git"


KYANOS_BPF_CORE="${BASEDIR}/bpf/agent_x86_bpfel.o"
KYANOS_BPF_CORE="${BASEDIR}/bpf/agent_$1_bpfel.o"

BTFHUB_DIR="${BASEDIR}/deps/btfhub"
BTFHUB_ARCH_DIR="${BASEDIR}/deps/btfhub-archive"
Expand Down Expand Up @@ -53,7 +53,7 @@ CMDS="rsync git cp rm mv"
for cmd in ${CMDS}; do
command -v $cmd 2>&1 >/dev/null || die "cmd ${cmd} not found"
done
[ ! -f ${KYANOS_BPF_CORE} ] && die "tracee CO-RE obj not found"
[ ! -f ${KYANOS_BPF_CORE} ] && die "kyanos CO-RE obj not found: ${KYANOS_BPF_CORE}"

[ ! -d ${BTFHUB_DIR} ] && git clone "${BTFHUB_REPO}" ${BTFHUB_DIR}
[ ! -d ${BTFHUB_ARCH_DIR} ] && git clone "${BTFHUB_ARCH_REPO}" ${BTFHUB_ARCH_DIR}
Expand All @@ -79,7 +79,7 @@ rsync -avz \
# generate tailored BTFs

[ ! -f ./tools/btfgen.sh ] && die "could not find btfgen.sh"
./tools/btfgen.sh -a ${BUILD_ARCH} -o ${KYANOS_BPF_CORE}
./tools/btfgen.sh -a $2 -o ${KYANOS_BPF_CORE}


# move tailored BTFs to dist
Expand Down

0 comments on commit 9580e98

Please sign in to comment.