kou commented on code in PR #51091:
URL: https://github.com/apache/arrow/pull/51091#discussion_r3946439724
##########
cpp/build-support/fuzzing/generate_corpuses.sh:
##########
@@ -39,51 +39,59 @@ OUT=$1
# Arrow IPC
-rm -rf ${CORPUS_DIR}
-${OUT}/arrow-ipc-generate-fuzz-corpus -stream ${CORPUS_DIR}
+rm -rf "${CORPUS_DIR}"
+"${OUT}/arrow-ipc-generate-fuzz-corpus" -stream "${CORPUS_DIR}"
+
+IPC_INTEGRATION_DIR="${ARROW_ROOT}/testing/data/arrow-ipc-stream/integration"
+
# Add "golden" IPC integration files
-IPC_INTEGRATION_FILES=$(find
${ARROW_ROOT}/testing/data/arrow-ipc-stream/integration -name "*.stream")
-[ -z "${IPC_INTEGRATION_FILES}" ] && exit 1
# Several IPC integration files can have the same name, make sure
# they all appear in the corpus by numbering the duplicates.
-cp --backup=numbered ${IPC_INTEGRATION_FILES} ${CORPUS_DIR}
-${ARROW_CPP}/build-support/fuzzing/pack_corpus.py ${CORPUS_DIR}
${OUT}/arrow-ipc-stream-fuzz_seed_corpus.zip
+# Use shell globbing to keep this ShellCheck-safe and compatible with Bash 3.2
on macOS.
+# IPC integration files are expected to be directly under each subdirectory.
+cp --backup=numbered \
+ "${IPC_INTEGRATION_DIR}"/*/*.stream \
+ "${CORPUS_DIR}"
Review Comment:
Can we use `find ${IPC_INTEGRATION_DIR} -name "*.stream" -exec cp
--backup=numbered '{}' "${CORPUS_DIR}" \;` instead of `while` and `read`
because we removed `[ "${#IPC_INTEGRATION_FILES[@]}" -eq 0 ] && exit 1`?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]