mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-04-06 07:38:21 +00:00
fuzz: replace : with _ for Windows
This commit is contained in:
5
.github/workflows/test.yml
vendored
5
.github/workflows/test.yml
vendored
@@ -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.
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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 |
|
||||
|
||||
19
test/fuzz-libghostty/corpus/sanitize-filenames.sh
Executable file
19
test/fuzz-libghostty/corpus/sanitize-filenames.sh
Executable 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
Reference in New Issue
Block a user