Skip to content

Commit f7947cc

Browse files
authored
GH-38447: [CI][Release] Don't use "|| {exit,continue}" (#38486)
### Rationale for this change If we use "|| {exit,continue}", "set -x" doesn't work. With "|| exit" ("false" in "a()" doesn't stop the shell execution): ```console $ cat /tmp/with-or-exit.sh set -e a() { false echo "a: failed after" } a || exit 1 echo "top level" false echo "failed after" $ bash /tmp/with-or-exit.sh a: failed after top level ``` Without "|| exit" ("false" in "a()" stops the shell execution): ```console $ cat /tmp/without-or-exit.sh set -e a() { false echo "a: failed after" } a echo "top level" false echo "failed after" $ bash /tmp/without-or-exit.sh ``` ### What changes are included in this PR? * Remove needless `|| exit` * Use `if` instead of `|| continue` ### Are these changes tested? No. * Closes: #38447 Authored-by: Sutou Kouhei <kou@clear-code.com> Signed-off-by: Sutou Kouhei <kou@clear-code.com>
1 parent 47dadb0 commit f7947cc

File tree

1 file changed

+29
-25
lines changed

1 file changed

+29
-25
lines changed

dev/release/verify-release-candidate.sh

+29-25
Original file line numberDiff line numberDiff line change
@@ -153,25 +153,25 @@ verify_dir_artifact_signatures() {
153153
# verify the signature and the checksums of each artifact
154154
find $1 -name '*.asc' | while read sigfile; do
155155
artifact=${sigfile/.asc/}
156-
gpg --verify $sigfile $artifact || exit 1
156+
gpg --verify $sigfile $artifact
157157

158158
# go into the directory because the checksum files contain only the
159159
# basename of the artifact
160160
pushd $(dirname $artifact)
161161
base_artifact=$(basename $artifact)
162162
if [ -f $base_artifact.sha256 ]; then
163-
${sha256_verify} $base_artifact.sha256 || exit 1
163+
${sha256_verify} $base_artifact.sha256
164164
fi
165165
if [ -f $base_artifact.sha512 ]; then
166-
${sha512_verify} $base_artifact.sha512 || exit 1
166+
${sha512_verify} $base_artifact.sha512
167167
fi
168168
popd
169169
done
170170
}
171171

172172
test_binary() {
173173
show_header "Testing binary artifacts"
174-
maybe_setup_conda || exit 1
174+
maybe_setup_conda
175175

176176
local download_dir=binaries
177177
mkdir -p ${download_dir}
@@ -565,7 +565,7 @@ maybe_setup_nodejs() {
565565
test_package_java() {
566566
show_header "Build and test Java libraries"
567567

568-
maybe_setup_conda maven openjdk || exit 1
568+
maybe_setup_conda maven openjdk
569569

570570
pushd java
571571
if [ ${TEST_JAVA} -gt 0 ]; then
@@ -579,15 +579,15 @@ test_and_install_cpp() {
579579
show_header "Build, install and test C++ libraries"
580580

581581
# Build and test C++
582-
maybe_setup_virtualenv numpy || exit 1
582+
maybe_setup_virtualenv numpy
583583
maybe_setup_conda \
584584
--file ci/conda_env_unix.txt \
585585
--file ci/conda_env_cpp.txt \
586586
--file ci/conda_env_gandiva.txt \
587587
ncurses \
588588
numpy \
589589
sqlite \
590-
compilers || exit 1
590+
compilers
591591

592592
if [ "${USE_CONDA}" -gt 0 ]; then
593593
DEFAULT_DEPENDENCY_SOURCE="CONDA"
@@ -671,8 +671,8 @@ test_python() {
671671
show_header "Build and test Python libraries"
672672

673673
# Build and test Python
674-
maybe_setup_virtualenv "cython>=0.29.31" numpy "setuptools_scm<8.0.0" setuptools || exit 1
675-
maybe_setup_conda --file ci/conda_env_python.txt || exit 1
674+
maybe_setup_virtualenv "cython>=0.29.31" numpy "setuptools_scm<8.0.0" setuptools
675+
maybe_setup_conda --file ci/conda_env_python.txt
676676

677677
if [ "${USE_CONDA}" -gt 0 ]; then
678678
CMAKE_PREFIX_PATH="${CONDA_BACKUP_CMAKE_PREFIX_PATH}:${CMAKE_PREFIX_PATH}"
@@ -746,8 +746,8 @@ test_glib() {
746746
show_header "Build and test C GLib libraries"
747747

748748
# Build and test C GLib
749-
maybe_setup_conda glib gobject-introspection meson ninja ruby || exit 1
750-
maybe_setup_virtualenv meson || exit 1
749+
maybe_setup_conda glib gobject-introspection meson ninja ruby
750+
maybe_setup_virtualenv meson
751751

752752
# Install bundler if doesn't exist
753753
if ! bundle --version; then
@@ -781,8 +781,8 @@ test_ruby() {
781781
show_header "Build and test Ruby libraries"
782782

783783
# required dependencies are installed by test_glib
784-
maybe_setup_conda || exit 1
785-
maybe_setup_virtualenv || exit 1
784+
maybe_setup_conda
785+
maybe_setup_virtualenv
786786

787787
which ruby
788788
which bundle
@@ -844,8 +844,8 @@ test_csharp() {
844844
test_js() {
845845
show_header "Build and test JavaScript libraries"
846846

847-
maybe_setup_nodejs || exit 1
848-
maybe_setup_conda nodejs=18 || exit 1
847+
maybe_setup_nodejs
848+
maybe_setup_conda nodejs=18
849849

850850
if ! command -v yarn &> /dev/null; then
851851
npm install yarn
@@ -867,8 +867,8 @@ test_js() {
867867
test_go() {
868868
show_header "Build and test Go libraries"
869869

870-
maybe_setup_go || exit 1
871-
maybe_setup_conda compilers go=1.19 || exit 1
870+
maybe_setup_go
871+
maybe_setup_conda compilers go=1.19
872872

873873
pushd go
874874
go get -v ./...
@@ -900,8 +900,8 @@ test_go() {
900900
test_integration() {
901901
show_header "Build and execute integration tests"
902902

903-
maybe_setup_conda || exit 1
904-
maybe_setup_virtualenv || exit 1
903+
maybe_setup_conda
904+
maybe_setup_virtualenv
905905

906906
pip install -e dev/archery[integration]
907907

@@ -1067,8 +1067,10 @@ test_linux_wheels() {
10671067
local pyver=${python/m}
10681068
for platform in ${platform_tags}; do
10691069
show_header "Testing Python ${pyver} wheel for platform ${platform}"
1070-
CONDA_ENV=wheel-${pyver}-${platform} PYTHON_VERSION=${pyver} maybe_setup_conda || exit 1
1071-
VENV_ENV=wheel-${pyver}-${platform} PYTHON_VERSION=${pyver} maybe_setup_virtualenv || continue
1070+
CONDA_ENV=wheel-${pyver}-${platform} PYTHON_VERSION=${pyver} maybe_setup_conda
1071+
if ! VENV_ENV=wheel-${pyver}-${platform} PYTHON_VERSION=${pyver} maybe_setup_virtualenv; then
1072+
continue
1073+
fi
10721074
pip install pyarrow-${TEST_PYARROW_VERSION:-${VERSION}}-cp${pyver/.}-cp${python/.}-${platform}.whl
10731075
INSTALL_PYARROW=OFF ARROW_GCS=${check_gcs} ${ARROW_DIR}/ci/scripts/python_wheel_unix_test.sh ${ARROW_SOURCE_DIR}
10741076
done
@@ -1100,8 +1102,10 @@ test_macos_wheels() {
11001102
check_s3=OFF
11011103
fi
11021104

1103-
CONDA_ENV=wheel-${pyver}-${platform} PYTHON_VERSION=${pyver} maybe_setup_conda || exit 1
1104-
VENV_ENV=wheel-${pyver}-${platform} PYTHON_VERSION=${pyver} maybe_setup_virtualenv || continue
1105+
CONDA_ENV=wheel-${pyver}-${platform} PYTHON_VERSION=${pyver} maybe_setup_conda
1106+
if ! VENV_ENV=wheel-${pyver}-${platform} PYTHON_VERSION=${pyver} maybe_setup_virtualenv; then
1107+
continue
1108+
fi
11051109

11061110
pip install pyarrow-${VERSION}-cp${pyver/.}-cp${python/.}-${platform}.whl
11071111
INSTALL_PYARROW=OFF ARROW_FLIGHT=${check_flight} ARROW_GCS=${check_gcs} ARROW_S3=${check_s3} \
@@ -1112,7 +1116,7 @@ test_macos_wheels() {
11121116

11131117
test_wheels() {
11141118
show_header "Downloading Python wheels"
1115-
maybe_setup_conda python || exit 1
1119+
maybe_setup_conda python
11161120

11171121
local wheels_dir=
11181122
if [ "${SOURCE_KIND}" = "local" ]; then
@@ -1151,7 +1155,7 @@ test_wheels() {
11511155

11521156
test_jars() {
11531157
show_header "Testing Java JNI jars"
1154-
maybe_setup_conda maven python || exit 1
1158+
maybe_setup_conda maven python
11551159

11561160
local download_dir=${ARROW_TMPDIR}/jars
11571161
mkdir -p ${download_dir}

0 commit comments

Comments
 (0)