Repository navigation
GH-46673: [CI][R][Docs] Accept empty INSTALL_ARGS again - #46682
Conversation
|
|
|
@github-actions crossbow submit debian-docs |
|
|
@github-actions crossbow submit preview-docs |
|
Revision: 224c19b Submitted crossbow builds: ursacomputing/crossbow @ actions-29b57edaf2
|
| if [ -z "${INSTALL_ARGS}" ] ; then | ||
| R_INSTALL_ARGS=() | ||
| else | ||
| read -r -a R_INSTALL_ARGS <<< "$INSTALL_ARGS" | ||
| fi |
There was a problem hiding this comment.
Can we simplify this?
| if [ -z "${INSTALL_ARGS}" ] ; then | |
| R_INSTALL_ARGS=() | |
| else | |
| read -r -a R_INSTALL_ARGS <<< "$INSTALL_ARGS" | |
| fi | |
| R_INSTALL_ARGS=() | |
| for arg in ${INSTALL_ARGS}; do | |
| R_INSTALL_ARGS+=("${arg}") | |
| done |
There was a problem hiding this comment.
for arg in ${INSTALL_ARGS}; violates SC2153.
for arg in ${INSTALL_ARGS}; do
^-------------^ SC2153 (info): Possible misspelling: INSTALL_ARGS may not be assigned. Did you mean R_INSTALL_ARGS?
For more information:
https://www.shellcheck.net/wiki/SC2153 -- Possible misspelling: INSTALL_ARG...
Do we disable SC2153 check?
There was a problem hiding this comment.
Thanks! Thanks! I did simplified read -r -a R_INSTALL_ARGS <<< "${INSTALL_ARGS:-}".
There was a problem hiding this comment.
If you want to use read -r -a <<<, we must add a comment why this words. Because it's not a straightforward way for us. If we use straitforword for + +=, we don't need a comment.
There was a problem hiding this comment.
Thanks! I don't know hot to do it with for and += with SC2086 safe. So, I added the comment.
There was a problem hiding this comment.
SC2086? https://www.shellcheck.net/wiki/SC2086 ?
Could you share the full lint error?
There was a problem hiding this comment.
Thank you for your comment.
Suggested change violates SC2153.
#!/bin/bash
R_INSTALL_ARGS=()
for arg in ${INSTALL_ARGS}; do
R_INSTALL_ARGS+=("${arg}")
donefor arg in ${INSTALL_ARGS}; do
^-------------^ SC2153 (info): Possible misspelling: INSTALL_ARGS may not be assigned. Did you mean R_INSTALL_ARGS?
SC2153 can fix like this.
: "${INSTALL_ARGS:-}"
R_INSTALL_ARGS=()
for arg in ${INSTALL_ARGS}; do
R_INSTALL_ARGS+=("${arg}")
doneThis version doesn't violate shellcheck on my machine.
But, I want to quote ${INSTALL_ARGS} part.
It seems violates SC2086(need quoting).
(I don't know why this syntax passed shellcheck, by the way)
However It doesn't work well.
So, If we use this plan, I think the comment may help.
: "${INSTALL_ARGS:-}"
R_INSTALL_ARGS=()
# Do not Quote ${INSTALL_ARGS} like "${INSTALL_ARGS}"
for arg in ${INSTALL_ARGS}; do
R_INSTALL_ARGS+=("${arg}")
doneI don't know how to fix ${INSTALL_ARGS} part SC2086 safe.
SC2086 meant about the original code.
Before #46663, The original message was
In ci/scripts/r_build.sh line 45:
${R_BIN} CMD INSTALL ${INSTALL_ARGS} arrow*.tar.gz
^------^ SC2086 (info): Double quote to prevent globbing and word splitting.
^-------------^ SC2086 (info): Double quote to prevent globbing and word splitting.
read -r -a R_INSTALL_ARGS <<< "$INSTALL_ARGS" has unfamiliar syntax, but it is SC2086 safe.
I support your decision. Should we change for syntax?
There was a problem hiding this comment.
This version doesn't violate shellcheck on my machine.
But, I want to quote${INSTALL_ARGS}part.
It seems violates SC2086(need quoting).
(I don't know why this syntax passed shellcheck, by the way)
However It doesn't work well.
If ShellCheck doesn't report this usage as an error, there is not a problem. Why do you want to quote this case too?
BTW, we don't need : "${INSTALL_ARGS:-}". We can do it in for: for arg in ${INSTALL_ARGS:-}; do
If we want to care glob here, we can disable glob for INSTALL_ARGS="--X * --Y" by set -f:
R_INSTALL_ARGS=()
set -f
for arg in ${INSTALL_ARGS:-}; do
R_INSTALL_ARGS+=("${arg}")
done
set +fBut it's also unfamiliar syntax. If we want to use set -f too, there is no advantage than read.
There was a problem hiding this comment.
Thank you for your reply. Changed to for syntax.
I just wanted to avoid unnecessary modification accidentally.
I'm now quoting many variables for fixing SC2086.
I'll compare shellcheck carefully for avoid unnecessary quote.
r_buld.sh already passed shellcheck. So, I may don't need care.
Co-authored-by: Sutou Kouhei <kou@cozmixng.org>
|
@github-actions crossbow submit preview-docs |
|
Revision: c8a2a1c Submitted crossbow builds: ursacomputing/crossbow @ actions-0d4aee9e28
|
|
Could you update "What changes are included in this PR?" in the PR description? |
|
Thanks! Updated PR description. |
|
@github-actions crossbow submit preview-docs |
|
Revision: fe6b479 Submitted crossbow builds: ursacomputing/crossbow @ actions-699fc50655
|
|
After merging your PR, Conbench analyzed the 4 benchmarking runs that have been run so far on merge-commit 35e8136. There were 69 benchmark results with an error:
There were no benchmark performance regressions. 🎉 The full Conbench report has more details. It also includes information about 44 possible false positives for unstable benchmarks that are known to sometimes produce them. |
Rationale for this change
This PR fixes the bug introduced in #46527.
If the environment variable
INSTALL_ARGSdoesn't set,the R command should execute,
CMD INSTALL arrow*tar.gz.After #46527 change, It executed
CMD INSTALL '' arrow*tar.gzWhat changes are included in this PR?
Split
INSTALL_ARGStoR_INSTALL_ARGSas array and use"${R_INSTALL_ARGS[@]}".Are these changes tested?
Yes.
Are there any user-facing changes?
No.