GH-50855: [R] Fix shellcheck errors in the r/inst/build_arrow_static.sh - #50856
Conversation
|
Could you update |
There was a problem hiding this comment.
Pull request overview
This PR updates the R static libarrow build script (r/inst/build_arrow_static.sh) to address ShellCheck findings by improving quoting and modernizing command substitutions, aiming to prevent globbing/word-splitting issues during builds.
Changes:
- Quote parameter expansions and command arguments to satisfy SC2086/SC2223.
- Replace legacy backticks with
$(...)for SC2006. - Introduce a
CMAKE_COMMANDarray to invoke CMake optionally via a wrapper.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| -Dxsimd_SOURCE="${xsimd_SOURCE:-}" \ | ||
| -Dzstd_SOURCE="${zstd_SOURCE:-}" \ | ||
| "${EXTRA_CMAKE_FLAGS}" \ | ||
| -G "${CMAKE_GENERATOR:-Unix Makefiles}" \ | ||
| ${SOURCE_DIR} | ||
| "${SOURCE_DIR}" |
There was a problem hiding this comment.
Fixed.
+# Convert the space-separated options into a Bash array.
+# This avoids ShellCheck SC2086 and preserves argument boundaries.
+read -r -a ARROW_EXTRA_CMAKE_FLAGS <<< "${EXTRA_CMAKE_FLAGS}"
+
mkdir -p "${BUILD_DIR}"
pushd "${BUILD_DIR}"
"${CMAKE_COMMAND[@]}" -DARROW_BOOST_USE_SHARED=OFF \
@@ -117,7 +121,7 @@ pushd "${BUILD_DIR}"
-Dsimdjson_SOURCE="${simdjson_SOURCE:-BUNDLED}" \
-Dxsimd_SOURCE="${xsimd_SOURCE:-}" \
-Dzstd_SOURCE="${zstd_SOURCE:-}" \
- "${EXTRA_CMAKE_FLAGS}" \
+ "${ARROW_EXTRA_CMAKE_FLAGS[@]}" \
-G "${CMAKE_GENERATOR:-Unix Makefiles}" \
"${SOURCE_DIR}"Co-authored-by: Sutou Kouhei <kou@cozmixng.org>
Oops: Thanks. Fixed. |
|
After merging your PR, Conbench analyzed the 3 benchmarking runs that have been run so far on merge-commit a708225. There were no benchmark performance regressions. 🎉 The full Conbench report has more details. It also includes information about 82 possible false positives for unstable benchmarks that are known to sometimes produce them. |
Rationale for this change
This is the sub issue #44748.
....What changes are included in this PR?
....Are these changes tested?
Yes.
Are there any user-facing changes?
No.