Skip to content

Commit b35e49f

Browse files
authored
apacheGH-46879: [CI][Packaging][Linux] Don't check example build with old CMake (apache#46880)
### Rationale for this change apache#46834 required CMake 3.25 or later for an example CMake project. ### What changes are included in this PR? Don't build the example CMake project with CMake < 3.25 in package verification. Amazon Linux 2023, CentOS 7 and Ubuntu 22.04 don't provide CMake 3.25 or later. ### Are these changes tested? Yes. ### Are there any user-facing changes? No. * GitHub Issue: apache#46879 Authored-by: Sutou Kouhei <[email protected]> Signed-off-by: Raúl Cumplido <[email protected]>
1 parent 136168e commit b35e49f

File tree

2 files changed

+40
-18
lines changed

2 files changed

+40
-18
lines changed

dev/release/verify-apt.sh

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ echo "::endgroup::"
143143

144144

145145
echo "::group::Test Apache Arrow C++"
146+
mkdir -p build
146147
${APT_INSTALL} libarrow-dev=${package_version}
147148
required_packages=()
148149
required_packages+=(cmake)
@@ -152,15 +153,25 @@ required_packages+=(make)
152153
required_packages+=(pkg-config)
153154
required_packages+=(${workaround_missing_packages[@]})
154155
${APT_INSTALL} ${required_packages[@]}
155-
mkdir -p build
156-
cp -a "${TOP_SOURCE_DIR}/cpp/examples/minimal_build" build/
157-
pushd build/minimal_build
158-
cmake .
159-
make -j$(nproc)
160-
./arrow-example
161-
c++ -o arrow-example example.cc $(pkg-config --cflags --libs arrow) -std=c++17
162-
./arrow-example
163-
popd
156+
# cmake version 3.31.6 -> 3.31.6
157+
cmake_version=$(cmake --version | head -n1 | sed -e 's/^cmake version //')
158+
# 3.31.6 -> 3.31
159+
cmake_version_major_minor=${cmake_version%.*}
160+
# 3.31 -> 3
161+
cmake_version_major=${cmake_version_major_minor%.*}
162+
# 3.31 -> 31
163+
cmake_version_minor=${cmake_version_major_minor#*.}
164+
if [ "${cmake_version_major}" -gt "3" ] || \
165+
[ "${cmake_version_major}" -eq "3" -a "${cmake_version_minor}" -ge "25" ]; then
166+
cp -a "${TOP_SOURCE_DIR}/cpp/examples/minimal_build" build/
167+
pushd build/minimal_build
168+
cmake .
169+
make -j$(nproc)
170+
./arrow-example
171+
c++ -o arrow-example example.cc $(pkg-config --cflags --libs arrow) -std=c++17
172+
./arrow-example
173+
popd
174+
fi
164175
echo "::endgroup::"
165176

166177

dev/release/verify-yum.sh

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,7 @@ echo "::endgroup::"
190190

191191

192192
echo "::group::Test Apache Arrow C++"
193+
mkdir -p build
193194
${install_command} ${enablerepo_epel} arrow-devel-${package_version}
194195
if [ -n "${devtoolset}" ]; then
195196
${install_command} ${scl_package}
@@ -214,15 +215,25 @@ else
214215
gcc-c++ \
215216
make
216217
fi
217-
mkdir -p build
218-
cp -a "${TOP_SOURCE_DIR}/cpp/examples/minimal_build" build/
219-
pushd build/minimal_build
220-
${cmake_command} .
221-
make -j$(nproc)
222-
./arrow-example
223-
c++ -o arrow-example example.cc $(pkg-config --cflags --libs arrow) -std=c++17
224-
./arrow-example
225-
popd
218+
# cmake version 3.31.6 -> 3.31.6
219+
cmake_version=$(${cmake_command} --version | head -n1 | sed -e 's/^cmake version //')
220+
# 3.31.6 -> 3.31
221+
cmake_version_major_minor=${cmake_version%.*}
222+
# 3.31 -> 3
223+
cmake_version_major=${cmake_version_major_minor%.*}
224+
# 3.31 -> 31
225+
cmake_version_minor=${cmake_version_major_minor#*.}
226+
if [ "${cmake_version_major}" -gt "3" ] || \
227+
[ "${cmake_version_major}" -eq "3" -a "${cmake_version_minor}" -ge "25" ]; then
228+
cp -a "${TOP_SOURCE_DIR}/cpp/examples/minimal_build" build/
229+
pushd build/minimal_build
230+
${cmake_command} .
231+
make -j$(nproc)
232+
./arrow-example
233+
c++ -o arrow-example example.cc $(pkg-config --cflags --libs arrow) -std=c++17
234+
./arrow-example
235+
popd
236+
fi
226237
echo "::endgroup::"
227238

228239
if [ "${have_glib}" = "yes" ]; then

0 commit comments

Comments
 (0)