8 Commits

Author SHA1 Message Date
ede89d3d9e fix git grep
Some checks failed
Gentoo Utils / build-oci-image (push) Successful in 7s
Gentoo Utils / check-format (push) Successful in 7s
Gentoo Utils / grep (push) Failing after 4s
Gentoo Utils / docs (push) Successful in 12s
Gentoo Utils / build (push) Successful in 19s
Gentoo Utils / test (push) Has been cancelled
Gentoo Utils / fuzz (push) Has been cancelled
2025-12-14 20:41:45 -06:00
61edc25d50 DONT FORK!
Some checks failed
Gentoo Utils / build-oci-image (push) Successful in 6s
Gentoo Utils / grep (push) Failing after 3s
Gentoo Utils / check-format (push) Successful in 8s
Gentoo Utils / docs (push) Successful in 12s
Gentoo Utils / build (push) Successful in 19s
Gentoo Utils / test (push) Successful in 25s
Gentoo Utils / fuzz (push) Failing after 2m15s
2025-12-14 20:09:26 -06:00
f0d7ec56b3 test
Some checks failed
Gentoo Utils / build-oci-image (push) Successful in 8s
Gentoo Utils / grep (push) Failing after 3s
Gentoo Utils / check-format (push) Successful in 7s
Gentoo Utils / docs (push) Successful in 13s
Gentoo Utils / build (push) Successful in 21s
Gentoo Utils / test (push) Successful in 26s
Gentoo Utils / fuzz (push) Successful in 5m58s
2025-12-14 19:58:58 -06:00
e34b7546a4 test 2025-12-14 19:58:58 -06:00
e12212cd2c ci: fix jobs not exiting on failure 2025-12-14 19:58:58 -06:00
104cb98d9e ci: build: remove debugging echos
ci: build: remove redundant source
2025-12-14 19:58:58 -06:00
7f59bb7c02 ci: add fuzz job
ci: fuzz: add timeout

ci: fuzz: add fuzzer timeout
2025-12-14 19:58:58 -06:00
6c0b368f6b scripts: add fuzzer helper script 2025-12-14 19:58:58 -06:00
2 changed files with 61 additions and 5 deletions

View File

@@ -98,10 +98,6 @@ jobs:
- name: build and check
run: |
echo $USER
echo "CC=$CC"
echo "CXX=$CXX"
source /etc/profile
meson setup -Dfuzz=enabled -Dtests=enabled -Dbuildtype=debugoptimized -Ddocs=enabled build
meson compile -C build
@@ -125,6 +121,37 @@ jobs:
meson compile -C build
ninja test -C build
fuzz:
runs-on: brutalisk
env:
CC: 'clang'
CXX: 'clang++'
FUZZER_TIMEOUT_S: 300
needs: [build-oci-image, build]
container:
image: ${{ vars.REGISTRY_URL }}/${{ gitea.repository }}:${{ needs.build-oci-image.outputs.image_tag }}
steps:
- name: Checkout repo
uses: actions/checkout@v5
# FIXME: Get rid of this step when portage has fixes merged?
# needed because portage has fixes upstream we need that arent stable yet
- name: Checkout tip of portage
run: |
git clone https://github.com/gentoo/portage.git
cd portage
python -m venv .venv && ./.venv/bin/pip install -e .
source ./.venv/bin/activate
which emerge
- name: build and fuzz
run: |
source ./portage/.venv/bin/activate
which emerge
meson setup -Dfuzz=enabled -Dtests=enabled -Dbuildtype=debugoptimized build
meson compile atom_parser_fuzzer:alias -C build
timeout 10m ./scripts/fuzz.sh
check-format:
runs-on: brutalisk
needs: [build-oci-image]
@@ -164,5 +191,12 @@ jobs:
uses: actions/checkout@v5
- name: grep for patterns
# negate git grep ret code because 1 means no findings
run: |
git grep -E 'todo!|dbg!' -- '*.rs' && exit 1 || exit 0
echo "if git --no-pager grep -E 'todo!|dbg!' -- '*.rs'..."
if git --no-pager grep -E 'todo!|dbg!' -- '*.rs'; then
exit 0
else
exit 1
fi

22
scripts/fuzz.sh Executable file
View File

@@ -0,0 +1,22 @@
#!/bin/bash
CWD="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"
PROJECT_DIR=$(realpath "${CWD}/../")
in=$(mktemp -u) || exit $?
out=$(mktemp -u) || exit $?
mkfifo ${in} ${out} || exit $?
if [[ -z "$FUZZER_TIMEOUT_S" ]]; then
FUZZER_TIMEOUT_S=600
fi
${PROJECT_DIR}/scripts/atom.py <${in} >${out} \
| ${PROJECT_DIR}/build/fuzz/atom/parser/fuzzer -max_total_time=$FUZZER_TIMEOUT_S >${in} <${out} \
${PROJECT_DIR}/build/atom_parser_fuzzer_corpus \
-only_ascii=1 \
-timeout=2 \
-max_total_time=$FUZZER_TIMEOUT_S \
-timeout_exitcode=0 \
"$@"