GH-50855: [R] Fix shellcheck errors in the r/inst/build_arrow_static.sh - #50856
Open
hiroyuki-sato wants to merge 4 commits into
Open
GH-50855: [R] Fix shellcheck errors in the r/inst/build_arrow_static.sh#50856hiroyuki-sato wants to merge 4 commits into
hiroyuki-sato wants to merge 4 commits into
Conversation
Member
|
Could you update |
Contributor
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.
Comment on lines
+118
to
+122
| -Dxsimd_SOURCE="${xsimd_SOURCE:-}" \ | ||
| -Dzstd_SOURCE="${zstd_SOURCE:-}" \ | ||
| "${EXTRA_CMAKE_FLAGS}" \ | ||
| -G "${CMAKE_GENERATOR:-Unix Makefiles}" \ | ||
| ${SOURCE_DIR} | ||
| "${SOURCE_DIR}" |
Collaborator
Author
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>
Collaborator
Author
Oops: Thanks. Fixed. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.