Skip to content

GH-51670: [C++][Dev] Fix shellcheck errors in the cpp/examples/minimal_build directory - #51671

Open
hiroyuki-sato wants to merge 3 commits into
apache:mainfrom
hiroyuki-sato:topic/shellcheck-minimal_build_dir
Open

hiroyuki-sato wants to merge 3 commits into
apache:mainfrom
hiroyuki-sato:topic/shellcheck-minimal_build_dir

Conversation

@hiroyuki-sato

@hiroyuki-sato hiroyuki-sato commented Oct 1, 2026 •

Copy link
Copy Markdown
Collaborator

Rationale for this change

This is the sub issue #44748.

  • SC2046: Quote this to prevent word splitting
  • SC2086: Double quote to prevent globbing and word splitting
  • SC2223: This default assignment may cause DoS due to globbing. Quote it
In build_arrow.sh line 23:
mkdir -p $ARROW_BUILD_DIR
         ^--------------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean:
mkdir -p "$ARROW_BUILD_DIR"


In build_arrow.sh line 24:
pushd $ARROW_BUILD_DIR
      ^--------------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean:
pushd "$ARROW_BUILD_DIR"


In build_arrow.sh line 30:
    $ARROW_CMAKE_OPTIONS
    ^------------------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean:
    "$ARROW_CMAKE_OPTIONS"


In build_arrow.sh line 32:
make -j$NPROC
       ^----^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean:
make -j"$NPROC"


In build_example.sh line 21:
mkdir -p $EXAMPLE_BUILD_DIR
         ^----------------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean:
mkdir -p "$EXAMPLE_BUILD_DIR"


In build_example.sh line 22:
pushd $EXAMPLE_BUILD_DIR
      ^----------------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean:
pushd "$EXAMPLE_BUILD_DIR"


In run_static.sh line 21:
: ${ARROW_DIR:=/arrow}
  ^------------------^ SC2223 (info): This default assignment may cause DoS due to globbing. Quote it.


In run_static.sh line 22:
: ${EXAMPLE_DIR:=/io}
  ^-----------------^ SC2223 (info): This default assignment may cause DoS due to globbing. Quote it.


In run_static.sh line 23:
: ${ARROW_BUILD_DIR:=/build/arrow}
  ^-- SC2223 (info): This default assignment may cause DoS due to globbing. Quote it.


In run_static.sh line 24:
: ${EXAMPLE_BUILD_DIR:=/build/example}
  ^-- SC2223 (info): This default assignment may cause DoS due to globbing. Quote it.


In run_static.sh line 26:
: ${ARROW_DEPENDENCY_SOURCE:=BUNDLED}
  ^-- SC2223 (info): This default assignment may cause DoS due to globbing. Quote it.


In run_static.sh line 34:
mkdir -p $ARROW_BUILD_DIR
         ^--------------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean:
mkdir -p "$ARROW_BUILD_DIR"


In run_static.sh line 35:
pushd $ARROW_BUILD_DIR
      ^--------------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean:
pushd "$ARROW_BUILD_DIR"


In run_static.sh line 39:
cmake $ARROW_DIR/cpp \
      ^--------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean:
cmake "$ARROW_DIR"/cpp \


In run_static.sh line 43:
    -DARROW_DEPENDENCY_SOURCE=${ARROW_DEPENDENCY_SOURCE} \
                              ^------------------------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean:
    -DARROW_DEPENDENCY_SOURCE="${ARROW_DEPENDENCY_SOURCE}" \


In run_static.sh line 46:
    $ARROW_CMAKE_OPTIONS
    ^------------------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean:
    "$ARROW_CMAKE_OPTIONS"


In run_static.sh line 48:
make -j$NPROC
       ^----^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean:
make -j"$NPROC"


In run_static.sh line 60:
rm -rf $EXAMPLE_BUILD_DIR
       ^----------------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean:
rm -rf "$EXAMPLE_BUILD_DIR"


In run_static.sh line 61:
mkdir -p $EXAMPLE_BUILD_DIR
         ^----------------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean:
mkdir -p "$EXAMPLE_BUILD_DIR"


In run_static.sh line 62:
pushd $EXAMPLE_BUILD_DIR
      ^----------------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean:
pushd "$EXAMPLE_BUILD_DIR"


In run_static.sh line 64:
cmake $EXAMPLE_DIR -DARROW_LINK_SHARED=OFF
      ^----------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean:
cmake "$EXAMPLE_DIR" -DARROW_LINK_SHARED=OFF


In run_static.sh line 76:
pushd $EXAMPLE_DIR
      ^----------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean:
pushd "$EXAMPLE_DIR"


In run_static.sh line 78:
$EXAMPLE_BUILD_DIR/arrow-example
^----------------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean:
"$EXAMPLE_BUILD_DIR"/arrow-example


In run_static.sh line 87:
rm -rf $EXAMPLE_BUILD_DIR
       ^----------------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean:
rm -rf "$EXAMPLE_BUILD_DIR"


In run_static.sh line 88:
mkdir -p $EXAMPLE_BUILD_DIR
         ^----------------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean:
mkdir -p "$EXAMPLE_BUILD_DIR"


In run_static.sh line 90:
  -o $EXAMPLE_BUILD_DIR/arrow-example \
     ^----------------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean:
  -o "$EXAMPLE_BUILD_DIR"/arrow-example \


In run_static.sh line 91:
  $EXAMPLE_DIR/example.cc \
  ^----------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean:
  "$EXAMPLE_DIR"/example.cc \


In run_static.sh line 92:
  $(PKG_CONFIG_PATH=$ARROW_BUILD_DIR/lib/pkgconfig \
  ^-- SC2046 (warning): Quote this to prevent word splitting.


In run_static.sh line 104:
pushd $EXAMPLE_DIR
      ^----------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean:
pushd "$EXAMPLE_DIR"


In run_static.sh line 106:
$EXAMPLE_BUILD_DIR/arrow-example
^----------------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean:
"$EXAMPLE_BUILD_DIR"/arrow-example

For more information:
  https://www.shellcheck.net/wiki/SC2046 -- Quote this to prevent word splitt...
  https://www.shellcheck.net/wiki/SC2086 -- Double quote to prevent globbing ...
  https://www.shellcheck.net/wiki/SC2223 -- This default assignment may cause...

What changes are included in this PR?

  • SC2046: Quote command substitutions
  • SC2086: Quote variables
  • SC2223: Quote default assignments

Are these changes tested?

Yes.

Are there any user-facing changes?

No.

Was AI used for this PR?

In accordance to the AI generation guidelines, please disclose below whether and how AI was used in this PR.

PR code and description written by:

  • Human
  • AI

Reviewed before submission by:

  • Human
  • AI
  • Not reviewed

@github-actions

github-actions Bot commented Oct 1, 2026

Copy link
Copy Markdown

⚠️ GitHub issue #51670 has been automatically assigned in GitHub to PR creator.

@hiroyuki-sato
hiroyuki-sato marked this pull request as ready for review October 1, 2026 02:38
@hiroyuki-sato
hiroyuki-sato requested a review from raulcd as a code owner October 1, 2026 02:38
@hiroyuki-sato

Copy link
Copy Markdown
Collaborator Author

@github-actions crossbow submit example-cpp-minimal-build-*

@github-actions

github-actions Bot commented Oct 1, 2026

Copy link
Copy Markdown

Revision: cb90265

Submitted crossbow builds: ursacomputing/crossbow @ actions-7efe50bfcc

Task Status
example-cpp-minimal-build-static GitHub Actions
example-cpp-minimal-build-static-system-dependency GitHub Actions

@hiroyuki-sato
hiroyuki-sato marked this pull request as draft October 1, 2026 03:09
@hiroyuki-sato

Copy link
Copy Markdown
Collaborator Author

@github-actions crossbow submit example-cpp-minimal-build-*

@github-actions

github-actions Bot commented Oct 1, 2026

Copy link
Copy Markdown

Revision: 33b9969

Submitted crossbow builds: ursacomputing/crossbow @ actions-e706efa4e6

Task Status
example-cpp-minimal-build-static GitHub Actions
example-cpp-minimal-build-static-system-dependency GitHub Actions

@hiroyuki-sato
hiroyuki-sato marked this pull request as ready for review October 1, 2026 07:24
@hiroyuki-sato

Copy link
Copy Markdown
Collaborator Author

I think the CI failure is unrelated to this PR.

This is the last shellcheck fix in the cpp directory. After this, only the files under dev/ will remain in the entire Arrow repository. by the way👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant