Skip to content

Commit 04a0538

Browse files
authored
feat: archiving fuzzing artifacts #19216 (#19218)
This PR changes the previous archiving method to store directories corpus/crashes separately
2 parents 18efd94 + 282eac5 commit 04a0538

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
crash-reports/
22
output/
3+
corpus/
4+
artifacts/

container-builds/fuzzing-container/src/entrypoint.sh

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -279,9 +279,16 @@ fuzz() {
279279
ARCHIVE_NAME="${fuzzer}.tar.gz"
280280
if compgen -G "$CORPUS/*" >/dev/null || compgen -G "$CRASHES/*" >/dev/null; then
281281
log "Packing corpus & crashes into $ARTIFACTS/$ARCHIVE_NAME"
282-
tar -czf "$ARTIFACTS/$ARCHIVE_NAME" \
283-
-C "$CORPUS" . \
284-
-C "$CRASHES" .
282+
283+
STAGE="$(mktemp -d)"
284+
mkdir -p "$STAGE/corpus" "$STAGE/crashes"
285+
286+
cp -a "$CORPUS/." "$STAGE/corpus/" 2>/dev/null || true
287+
cp -a "$CRASHES/." "$STAGE/crashes/" 2>/dev/null || true
288+
289+
tar -czf "$ARTIFACTS/$ARCHIVE_NAME" -C "$STAGE" corpus crashes
290+
291+
rm -rf "$STAGE"
285292
else
286293
log "Corpus & crashes are empty, skipping packing"
287294
fi

0 commit comments

Comments
 (0)