Repository navigation
GH-50803: [CI][Dev] Fix shellcheck errors in the ci/scripts/r_windows_build.sh - #50804
Closed
pratyushadk wants to merge 1 commit into
Closed
pratyushadk wants to merge 1 commit into
pratyushadk wants to merge 1 commit into
Conversation
pratyushadk
requested review from
assignUser,
jonkeane,
kou and
raulcd
as code owners
August 4, 2026 13:14
|
|
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request addresses ShellCheck-reported issues in ci/scripts/r_windows_build.sh to improve safety around quoting, default assignments, and filename handling in CI packaging steps for the Windows R build artifacts.
Changes:
- Quote parameter default assignments and path-related variable expansions to avoid globbing/word-splitting (SC2223, SC2086, SC2046).
- Split
export VAR="$(...)"into assignment + export to avoid masking return values (SC2155) and remove an unused variable (SC2034). - Replace
ls *.xz | xargs ...with afind ... -print0 | xargs -0 ...pattern to handle non-alphanumeric filenames safely (SC2011, SC2035).
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 a sub-issue of #44748.
Fix all errors reported by
shellcheckinci/scripts/r_windows_build.sh.What changes are included in this PR?
The following shellcheck error codes are addressed:
: ${VAR:=...}→: "${VAR:=...}") to prevent unintended globbing on lines 22 and 29.export ARROW_HOME="$(cd ...)"into two separate lines (declare, then export) to avoid masking the return value of thecdsubshell.RWINLIB_LIB_DIR="lib"which was declared but never referenced anywhere in the script.ls *.xz | xargs -n 1 tar -xJfwithfind . -maxdepth 1 -name "*.xz" -print0 | xargs -0 -n 1 tar -xJfto safely handle non-alphanumeric filenames and prevent glob arguments from being treated as flags.$(echo "$MINGW_ARCH" | cut ...)in themvcall to prevent word splitting on the result.Are these changes tested?
Verified by running
shellcheck v0.11.0against the modified file locally. The tool now exits with code 0 (no warnings or errors).No functional logic was changed — all modifications are quoting and idiom improvements only.