Skip to content

Commit

Permalink
Merge branch 'catpure'
Browse files Browse the repository at this point in the history
  • Loading branch information
rootmos committed Nov 1, 2022
2 parents 9ffc0a4 + cfc17b9 commit c074843
Show file tree
Hide file tree
Showing 11 changed files with 1,320 additions and 63 deletions.
17 changes: 10 additions & 7 deletions .github/workflows/build-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ jobs:
ARCH: ubuntu2204
UNPRIVILEGED: ubuntu
TEST_OUTPUT_DIR: /tmp/tests
WORKDIR: /tmp/workdir
steps:
- name: Install minimal dependencies
run: |
Expand All @@ -28,7 +29,7 @@ jobs:
echo "$UNPRIVILEGED ALL = NOPASSWD: $(which apt-get)" | tee -a /etc/sudoers
- name: Build package
run: sudo -u $UNPRIVILEGED env SUDO=sudo build/ubuntu/mk
run: sudo -u $UNPRIVILEGED --preserve-env=WORKDIR env SUDO=sudo build/ubuntu/mk

- name: Archive source package
uses: actions/upload-artifact@v3
Expand All @@ -42,9 +43,10 @@ jobs:

- name: Test system installation
run: |
sudo -u $UNPRIVILEGED --preserve-env=TEST_OUTPUT_DIR env SUT=$(which hlua) tools/test-harness -c hlua
sudo -u $UNPRIVILEGED --preserve-env=TEST_OUTPUT_DIR env SUT=$(which hpython) tools/test-harness -c hpython
sudo -u $UNPRIVILEGED --preserve-env=TEST_OUTPUT_DIR env SUT=$(which hnode) tools/test-harness -c hnode
export TOOLS=$(readlink -f "$WORKDIR"/*/tools)
sudo -u $UNPRIVILEGED --preserve-env=TEST_OUTPUT_DIR,TOOLS env SUT=$(which hlua) tools/test-harness -c hlua
sudo -u $UNPRIVILEGED --preserve-env=TEST_OUTPUT_DIR,TOOLS env SUT=$(which hpython) tools/test-harness -c hpython
sudo -u $UNPRIVILEGED --preserve-env=TEST_OUTPUT_DIR,TOOLS env SUT=$(which hnode) tools/test-harness -c hnode
- name: Archive test results
uses: actions/upload-artifact@v3
Expand Down Expand Up @@ -93,9 +95,10 @@ jobs:

- name: Test system installation
run: |
sudo -u $UNPRIVILEGED --preserve-env=TEST_OUTPUT_DIR env SUT=$(which hlua) tools/test-harness -c hlua
sudo -u $UNPRIVILEGED --preserve-env=TEST_OUTPUT_DIR env SUT=$(which hpython) tools/test-harness -c hpython
sudo -u $UNPRIVILEGED --preserve-env=TEST_OUTPUT_DIR env SUT=$(which hnode) tools/test-harness -c hnode
export TOOLS=$(readlink -f build/archlinux/src/*/tools)
sudo -u $UNPRIVILEGED --preserve-env=TEST_OUTPUT_DIR,TOOLS env SUT=$(which hlua) tools/test-harness -c hlua
sudo -u $UNPRIVILEGED --preserve-env=TEST_OUTPUT_DIR,TOOLS env SUT=$(which hpython) tools/test-harness -c hpython
sudo -u $UNPRIVILEGED --preserve-env=TEST_OUTPUT_DIR,TOOLS env SUT=$(which hnode) tools/test-harness -c hnode
- name: Archive test results
uses: actions/upload-artifact@v3
Expand Down
2 changes: 1 addition & 1 deletion .version
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
VERSION_MAJOR=0
VERSION_MINOR=7
VERSION_PATCH=0
VERSION_PATCH=1
3 changes: 2 additions & 1 deletion build/archlinux/PKGBUILD.template
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ EOF
}

build() {
make tools build -C "$ROOT"
make tools -C "$ROOT"
make build -C "$ROOT"
}

check() {
Expand Down
9 changes: 7 additions & 2 deletions build/ubuntu/mk
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,13 @@ OUTPUT_DIR=${OUTPUT_DIR-$SCRIPT_DIR/out}

HOST_TOOLS=${HOST_TOOLS-$(readlink -f "$SCRIPT_DIR/../../tools")}

WORKDIR=$(mktemp -d)
trap 'rm -rf $WORKDIR' EXIT
WORKDIR=${WORKDIR-}
if [ -z "$WORKDIR" ]; then
WORKDIR=$(mktemp -d)
trap 'rm -rf $WORKDIR' EXIT
else
mkdir -p "$WORKDIR"
fi

read SHA256 TARBALL < <("$HOST_TOOLS/archive" -O "$WORKDIR")
echo 1>&2 "- source tarball: $(basename "$TARBALL") $SHA256"
Expand Down
2 changes: 2 additions & 0 deletions tools/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
lib
capture
strace-log-watch
7 changes: 7 additions & 0 deletions tools/.k
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
run() {
make LOG_LEVEL=DEBUG && ./capture -o stdout -- echo "hello" && cat stdout
}

libr() {
"$HOME/git/libr/bundle.sh" -o r.h fail logging util
}
16 changes: 14 additions & 2 deletions tools/Makefile
Original file line number Diff line number Diff line change
@@ -1,13 +1,25 @@
CC = gcc

CFLAGS = -Wall -Werror -O2
LDFLAGS =
LOG_LEVEL ?= WARN
EXTRA_CFLAGS ?= -DLOG_LEVEL=LOG_$(LOG_LEVEL)
EXTRA_LDFLAGS ?=

.PHONY: all
all: bpf lib
all: bpf lib capture strace-log-watch

.PHONY: bpf
bpf:
$(MAKE) -C bpf

lib: lib.c
$(CC) -o "$@" "$<" -ldl
$(CC) $(CFLAGS) $(EXTRA_CFLAGS) -o "$@" "$<" $(LDFLAGS) -ldl $(EXTRA_LDFLAGS)

%: %.c
$(CC) $(CFLAGS) $(EXTRA_CFLAGS) -o "$@" "$<" $(LDFLAGS) $(EXTRA_LDFLAGS)

.PHONY: clean
clean:
rm -f lib capture strace-log-watch
$(MAKE) -C bpf clean
Loading

0 comments on commit c074843

Please sign in to comment.