fuzz: replace : with _ for Windows

This commit is contained in:
Mitchell Hashimoto
2026-03-01 06:45:11 -08:00
parent 4f34a0b7d2
commit e8f861f561
911 changed files with 32 additions and 5 deletions

View File

@@ -712,11 +712,6 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
sparse-checkout: |
/*
!test/fuzz-libghostty/corpus/vt-parser-cmin
!test/fuzz-libghostty/corpus/vt-parser-min
# This could be from a script if we wanted to but inlining here for now
# in one place.

View File

@@ -2,6 +2,9 @@
- `ghostty-fuzz` is a binary built with `afl-cc`
- Build `ghostty-fuzz` with `zig build`
- After running `afl-cmin`/`afl-tmin`, run `corpus/sanitize-filenames.sh`
before committing to replace colons with underscores (colons are invalid
on Windows NTFS).
## Important: stdin-based input

View File

@@ -118,6 +118,16 @@ This is slow (hundreds of executions per file) but produces the most
compact corpus. It can be skipped if you only need edge-level
deduplication from `afl-cmin`.
### Windows compatibility
AFL++ output filenames contain colons (e.g., `id:000024,time:0,...`), which
are invalid on Windows (NTFS). After running `afl-cmin` or `afl-tmin`,
rename the output files to replace colons with underscores before committing:
```sh
./corpus/sanitize-filenames.sh
```
### Corpus directories
| Directory | Contents |

View File

@@ -0,0 +1,19 @@
#!/bin/sh
# Rename AFL++ output files to replace colons with underscores.
# Colons are invalid on Windows (NTFS).
#
# Usage: ./sanitize-filenames.sh [directory ...]
# Defaults to vt-parser-cmin and vt-parser-min in the same directory as this script.
cd "$(dirname "$0")" || exit 1
dirs="${@:-vt-parser-cmin vt-parser-min}"
for dir in $dirs; do
[ -d "$dir" ] || continue
for f in "$dir"/*; do
[ -f "$f" ] || continue
newname=$(echo "$f" | tr ':' '_')
[ "$f" != "$newname" ] && mv "$f" "$newname"
done
done

Some files were not shown because too many files have changed in this diff Show More