Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: Fix fuzzer listing #2513

Merged
merged 1 commit into from
Nov 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/fuzzers-list.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
#!/usr/bin/env bash

set -euo pipefail

## Lists the fuzzers that should be run given a set of changed files.

# Find the nearest fuzzer crate, or nothing.
find_fuzz_dir() {
d=${1%/*}
if [ "$d" = . ]; then
if ! [[ "$d" =~ / ]]; then
return
elif [ -d "$d" ] && [[ "$d" = */fuzz ]]; then
echo "$d"
Expand Down
4 changes: 2 additions & 2 deletions .github/list-crates.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
set -eu

if [ $# -eq 0 ]; then
echo "Usage: $0 <changed-files>"
exit 1
echo '[]'
exit 0
fi

# Find the nearest Cargo.toml (except the root).
Expand Down
12 changes: 4 additions & 8 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -159,14 +159,10 @@ fuzzers:
echo "fuzzers must be run with nightly" >&2
exit 1
fi

for dir in $(find . -type d -name fuzz); do
echo "cd $dir && {{ _cargo }} fuzz build"
(
cd $dir
@{{ _cargo }} fuzz build \
{{ if profile == "release" { "--release" } else { "" } }}
)
for dir in $(find ./linkerd -type d -name fuzz); do
echo "cd $dir && cargo +nightly fuzz build"
( cd $dir ; cargo +nightly fuzz build \
{{ if profile == "release" { "--release" } else { "" } }} )
done

export DOCKER_BUILDX_CACHE_DIR := env_var_or_default('DOCKER_BUILDX_CACHE_DIR', '')
Expand Down
Loading