From 5fbe02999c0571b988924241fde685ef99527cfa Mon Sep 17 00:00:00 2001 From: Eric Severance Date: Thu, 9 Jan 2025 23:51:13 -0800 Subject: [PATCH] Fix lint issues in build.sh --- .clusterfuzzlite/build.sh | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/.clusterfuzzlite/build.sh b/.clusterfuzzlite/build.sh index 1491646a4..0f2428e76 100644 --- a/.clusterfuzzlite/build.sh +++ b/.clusterfuzzlite/build.sh @@ -1,30 +1,31 @@ #!/bin/bash -eu -# Build Mestastic and a few needed dependencies using clang++ +# Build Meshtastic and a few needed dependencies using clang++ # and the OSS-Fuzz required build flags. env cd "$SRC" +NPROC=$(nproc || echo 1) LDFLAGS=-lpthread cmake -S "$SRC/yaml-cpp" -B "$SRC/yaml-cpp/build" \ -DBUILD_SHARED_LIBS=OFF -cmake --build "$SRC/yaml-cpp/build" -j "$(nproc)" +cmake --build "$SRC/yaml-cpp/build" -j "$NPROC" cmake --install "$SRC/yaml-cpp/build" --prefix /usr cmake -S "$SRC/orcania" -B "$SRC/orcania/build" \ -DBUILD_STATIC=ON -cmake --build "$SRC/orcania/build" -j "$(nproc)" +cmake --build "$SRC/orcania/build" -j "$NPROC" cmake --install "$SRC/orcania/build" --prefix /usr cmake -S "$SRC/yder" -B "$SRC/yder/build" \ -DBUILD_STATIC=ON -DWITH_JOURNALD=OFF -cmake --build "$SRC/yder/build" -j "$(nproc)" +cmake --build "$SRC/yder/build" -j "$NPROC" cmake --install "$SRC/yder/build" --prefix /usr cmake -S "$SRC/ulfius" -B "$SRC/ulfius/build" \ -DBUILD_STATIC=ON -DWITH_JANSSON=OFF -DWITH_CURL=OFF -DWITH_WEBSOCKET=OFF -cmake --build "$SRC/ulfius/build" -j "$(nproc)" +cmake --build "$SRC/ulfius/build" -j "$NPROC" cmake --install "$SRC/ulfius/build" --prefix /usr cd "$SRC/firmware" @@ -52,7 +53,8 @@ for f in .clusterfuzzlite/*_fuzzer.cpp; do cp ".pio/build/$PIO_ENV/program" "$OUT/$fuzzer" # Copy shared libraries used by the fuzzer. - cp -f $(ldd ".pio/build/$PIO_ENV/program" | sed -n 's/[^=]\+=> \([^ ]\+\).*/\1/p') "$OUT/lib/" + read -ra shared_libs < <(ldd ".pio/build/$PIO_ENV/program" | sed -n 's/[^=]\+=> \([^ ]\+\).*/\1/p') + cp -f "${shared_libs[@]}" "$OUT/lib/" # Build the initial fuzzer seed corpus. corpus_name="${fuzzer}_seed_corpus"