Skip to content

Commit fa00b1c

Browse files
committed
ci(fuzz): use pre-installed cargo-fuzz to fix OSS-Fuzz build (thiserror E0463)
`cargo install cargo-fuzz --force` rebuilt cargo-fuzz (and its proc-macro dep `thiserror_impl`) under the base-builder-rust image's sanitizer RUSTFLAGS, which failed the pr_fuzzing checks with `error[E0463]: can't find crate for thiserror_impl` before any project code compiled. The image already ships cargo-fuzz, so use it; only fall back to a clean (RUSTFLAGS-cleared) install if genuinely missing. Note: not locally reproducible without the OSS-Fuzz container; the pr_fuzzing CI checks are the verification. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KfgJznd6jzSeDYsSXGAXkU
1 parent c2b7e81 commit fa00b1c

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

.clusterfuzzlite/build.sh

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,16 @@ set -euo pipefail
66

77
cd "$SRC"/valence-shell/impl/rust-cli
88

9-
# Install cargo-fuzz if not present
10-
cargo install cargo-fuzz --force
9+
# The OSS-Fuzz base-builder-rust image already ships cargo-fuzz. Reinstalling it
10+
# with `cargo install --force` rebuilds cargo-fuzz and its dependencies —
11+
# including the proc-macro crate `thiserror_impl` — under the image's sanitizer
12+
# RUSTFLAGS, which breaks the host build with:
13+
# error[E0463]: can't find crate for `thiserror_impl`
14+
# So prefer the pre-installed cargo-fuzz, and only fall back to a clean install
15+
# (RUSTFLAGS cleared) if it is genuinely missing.
16+
if ! command -v cargo-fuzz >/dev/null 2>&1; then
17+
RUSTFLAGS="" cargo install cargo-fuzz --locked
18+
fi
1119

1220
# Build all fuzz targets
1321
cargo +nightly fuzz build

0 commit comments

Comments
 (0)