Skip to content

Commit fdd3e15

Browse files
raulcdamoebakounealrichardson
authored
GH-44950: [C++] Bump minimum CMake version to 3.25 (#44989)
### Rationale for this change We want to upgrade our CMake version to 3.25 as discussed on the ML: https://lists.apache.org/thread/h8jp16ktrj11fmjmjhlg6xvkvv9wzvjk ### What changes are included in this PR? - Bump minimal CMake version to 3.25 - Manually install CMake on distributions where CMake < 3.25 was installed via package repositories - Minor fixes to CI in order to have passing builds everywhere ### Are these changes tested? Yes, via CI. ### Are there any user-facing changes? Yes, the minimum CMake version to be used to build Arrow is bumped to 3.25. **This PR includes breaking changes to build systems.** * GitHub Issue: #44950 Lead-authored-by: Raúl Cumplido <[email protected]> Co-authored-by: Bryce Mecum <[email protected]> Co-authored-by: Sutou Kouhei <[email protected]> Co-authored-by: Sutou Kouhei <[email protected]> Co-authored-by: Neal Richardson <[email protected]> Signed-off-by: Sutou Kouhei <[email protected]>
1 parent f8ba543 commit fdd3e15

39 files changed

+493
-65
lines changed

.env

+1
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ UBUNTU=22.04
5454

5555
# Default versions for various dependencies
5656
CLANG_TOOLS=14
57+
CMAKE=3.25.0
5758
CUDA=11.2.2
5859
DASK=latest
5960
DOTNET=8.0

.github/workflows/cpp.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ jobs:
156156

157157
build-example:
158158
name: C++ Minimal Build Example
159-
runs-on: ubuntu-latest
159+
runs-on: ubuntu-24.04
160160
if: ${{ !contains(github.event.pull_request.title, 'WIP') }}
161161
timeout-minutes: 45
162162
steps:

.github/workflows/dev.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141

4242
lint:
4343
name: Lint C++, Python, R, Docker, RAT
44-
runs-on: ubuntu-latest
44+
runs-on: ubuntu-24.04
4545
if: ${{ !contains(github.event.pull_request.title, 'WIP') }}
4646
timeout-minutes: 15
4747
steps:

ci/docker/centos-7-cpp.dockerfile

+5-2
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ RUN \
3737
-e 's/mirror\.centos\.org/vault.centos.org/' \
3838
/etc/yum.repos.d/CentOS-SCLo-scl*.repo && \
3939
yum install -y \
40-
cmake3 \
4140
curl \
4241
devtoolset-8 \
4342
diffutils \
@@ -49,9 +48,13 @@ RUN \
4948
wget \
5049
which
5150

51+
ARG cmake
52+
COPY ci/scripts/install_cmake.sh /arrow/ci/scripts/
53+
RUN /arrow/ci/scripts/install_cmake.sh ${cmake} /usr/local/
54+
5255
COPY ci/scripts/install_sccache.sh /arrow/ci/scripts/
5356
RUN bash /arrow/ci/scripts/install_sccache.sh unknown-linux-musl /usr/local/bin
5457

5558
ENV \
5659
ARROW_R_DEV=TRUE \
57-
CMAKE=/usr/bin/cmake3
60+
CMAKE=/usr/local/bin/cmake

ci/docker/linux-r.dockerfile

+4
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,10 @@ RUN /arrow/ci/scripts/r_docker_configure.sh
5151
COPY ci/scripts/install_sccache.sh /arrow/ci/scripts/
5252
RUN /arrow/ci/scripts/install_sccache.sh unknown-linux-musl /usr/local/bin
5353

54+
ARG cmake
55+
COPY ci/scripts/install_cmake.sh /arrow/ci/scripts/
56+
RUN /arrow/ci/scripts/install_cmake.sh ${cmake} /usr/local/
57+
5458
COPY ci/scripts/r_deps.sh /arrow/ci/scripts/
5559
COPY r/DESCRIPTION /arrow/r/
5660
RUN /arrow/ci/scripts/r_deps.sh /arrow

ci/docker/python-wheel-manylinux.dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ ENV PATH=/opt/python/${CPYTHON_VERSION}-${CPYTHON_VERSION}/bin:${PATH}
5353
# Install CMake
5454
ARG cmake=3.29.2
5555
COPY ci/scripts/install_cmake.sh arrow/ci/scripts/
56-
RUN /arrow/ci/scripts/install_cmake.sh ${arch} linux ${cmake} /usr/local
56+
RUN /arrow/ci/scripts/install_cmake.sh ${cmake} /usr/local
5757

5858
# Install Ninja
5959
ARG ninja=1.10.2

ci/docker/ubuntu-20.04-cpp-minimal.dockerfile

+4-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ RUN apt-get update -y -q && \
2727
apt-get install -y -q \
2828
build-essential \
2929
ccache \
30-
cmake \
3130
curl \
3231
gdb \
3332
git \
@@ -68,6 +67,10 @@ RUN latest_system_llvm=10 && \
6867
apt-get clean && \
6968
rm -rf /var/lib/apt/lists*
7069

70+
ARG cmake
71+
COPY ci/scripts/install_cmake.sh /arrow/ci/scripts/
72+
RUN /arrow/ci/scripts/install_cmake.sh ${cmake} /usr/local/
73+
7174
COPY ci/scripts/install_minio.sh /arrow/ci/scripts/
7275
RUN /arrow/ci/scripts/install_minio.sh latest /usr/local
7376

ci/docker/ubuntu-20.04-cpp.dockerfile

+4-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ RUN apt-get update -y -q && \
6767
autoconf \
6868
ca-certificates \
6969
ccache \
70-
cmake \
7170
curl \
7271
g++ \
7372
gcc \
@@ -121,6 +120,10 @@ RUN apt-get update -y -q && \
121120
apt-get clean && \
122121
rm -rf /var/lib/apt/lists*
123122

123+
ARG cmake
124+
COPY ci/scripts/install_cmake.sh /arrow/ci/scripts/
125+
RUN /arrow/ci/scripts/install_cmake.sh ${cmake} /usr/local/
126+
124127
COPY ci/scripts/install_minio.sh /arrow/ci/scripts/
125128
RUN /arrow/ci/scripts/install_minio.sh latest /usr/local
126129

ci/docker/ubuntu-22.04-cpp-minimal.dockerfile

+4
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,10 @@ RUN latest_system_llvm=14 && \
6868
apt-get clean && \
6969
rm -rf /var/lib/apt/lists*
7070

71+
ARG cmake
72+
COPY ci/scripts/install_cmake.sh /arrow/ci/scripts/
73+
RUN /arrow/ci/scripts/install_cmake.sh ${cmake} /usr/local/
74+
7175
COPY ci/scripts/install_minio.sh /arrow/ci/scripts/
7276
RUN /arrow/ci/scripts/install_minio.sh latest /usr/local
7377

ci/docker/ubuntu-22.04-cpp.dockerfile

+4-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ RUN apt-get update -y -q && \
7171
ceph \
7272
ceph-fuse \
7373
ceph-mds \
74-
cmake \
7574
curl \
7675
gdb \
7776
git \
@@ -168,6 +167,10 @@ RUN if [ "${gcc}" = "" ]; then \
168167
# make sure zlib is cached in the EMSDK folder
169168
RUN source ~/emsdk/emsdk_env.sh && embuilder --pic build zlib
170169

170+
ARG cmake
171+
COPY ci/scripts/install_cmake.sh /arrow/ci/scripts/
172+
RUN /arrow/ci/scripts/install_cmake.sh ${cmake} /usr/local/
173+
171174
COPY ci/scripts/install_minio.sh /arrow/ci/scripts/
172175
RUN /arrow/ci/scripts/install_minio.sh latest /usr/local
173176

ci/docker/ubuntu-22.04-verify-rc.dockerfile

+4
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,7 @@ RUN /setup-ubuntu.sh && \
2424
rm /setup-ubuntu.sh && \
2525
apt-get clean && \
2626
rm -rf /var/lib/apt/lists*
27+
28+
ARG cmake
29+
COPY ci/scripts/install_cmake.sh /arrow/ci/scripts/
30+
RUN /arrow/ci/scripts/install_cmake.sh ${cmake} /usr/local/

ci/rtools/README.md

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<!---
2+
Licensed to the Apache Software Foundation (ASF) under one
3+
or more contributor license agreements. See the NOTICE file
4+
distributed with this work for additional information
5+
regarding copyright ownership. The ASF licenses this file
6+
to you under the Apache License, Version 2.0 (the
7+
"License"); you may not use this file except in compliance
8+
with the License. You may obtain a copy of the License at
9+
10+
http://www.apache.org/licenses/LICENSE-2.0
11+
12+
Unless required by applicable law or agreed to in writing,
13+
software distributed under the License is distributed on an
14+
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
KIND, either express or implied. See the License for the
16+
specific language governing permissions and limitations
17+
under the License.
18+
-->
19+
20+
# rtools40 patches for AWS SDK and related libs
21+
22+
The patches in this directory are solely for the purpose of building Arrow C++
23+
under [Rtools40](https://cran.r-project.org/bin/windows/Rtools/rtools40.html)
24+
and not used elsewhere. Once we've dropped support for Rtools40, we can consider
25+
removing these patches.
26+
27+
The larger reason these patches are needed is that Rtools provides their own
28+
packages and their versions of the AWS libraries weren't compatible with CMake
29+
3.25. Our solution was to bundle the AWS libs instead and these patches were
30+
required to get them building under the Rtools40 environment.
31+
32+
The patches were added while upgrading the minimum required CMake version to
33+
3.25 in [GH-44950](https://github.com/apache/arrow/issues/44950). Please see the
34+
associated PR, [GH-44989](https://github.com/apache/arrow/pull/44989), for more
35+
context.

ci/rtools/aws_c_common_ep.patch

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
18+
diff --git a/include/aws/common/byte_order.inl b/include/aws/common/byte_order.inl
19+
index 1204be0..0abd9cb 100644
20+
--- a/include/aws/common/byte_order.inl
21+
+++ b/include/aws/common/byte_order.inl
22+
@@ -13,7 +13,7 @@
23+
# include <stdlib.h>
24+
#else
25+
# include <netinet/in.h>
26+
-#endif /* _MSC_VER */
27+
+#endif /* _WIN32 */
28+
29+
AWS_EXTERN_C_BEGIN
30+
31+
@@ -39,7 +39,7 @@ AWS_STATIC_IMPL uint64_t aws_hton64(uint64_t x) {
32+
uint64_t v;
33+
__asm__("bswap %q0" : "=r"(v) : "0"(x));
34+
return v;
35+
-#elif defined(_MSC_VER)
36+
+#elif defined(_WIN32)
37+
return _byteswap_uint64(x);
38+
#else
39+
uint32_t low = x & UINT32_MAX;

ci/rtools/aws_c_io_ep.patch

+56
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
18+
diff --git a/source/windows/secure_channel_tls_handler.c b/source/windows/secure_channel_tls_handler.c
19+
index 50caf02..29fe850 100644
20+
--- a/source/windows/secure_channel_tls_handler.c
21+
+++ b/source/windows/secure_channel_tls_handler.c
22+
@@ -35,6 +36,25 @@
23+
# pragma warning(disable : 4306) /* Identifier is type cast to a larger pointer. */
24+
#endif
25+
26+
+#ifndef SP_PROT_TLS1_0_SERVER
27+
+#define SP_PROT_TLS1_0_SERVER SP_PROT_TLS1_SERVER
28+
+#endif
29+
+#ifndef SP_PROT_TLS1_0_CLIENT
30+
+#define SP_PROT_TLS1_0_CLIENT SP_PROT_TLS1_CLIENT
31+
+#endif
32+
+#ifndef SP_PROT_TLS1_1_SERVER
33+
+#define SP_PROT_TLS1_1_SERVER 0x00000100
34+
+#endif
35+
+#ifndef SP_PROT_TLS1_1_CLIENT
36+
+#define SP_PROT_TLS1_1_CLIENT 0x00000200
37+
+#endif
38+
+#ifndef SCH_USE_STRONG_CRYPTO
39+
+#define SCH_USE_STRONG_CRYPTO 0x00400000
40+
+#endif
41+
+#ifndef SECBUFFER_ALERT
42+
+#define SECBUFFER_ALERT 0x11
43+
+#endif
44+
+
45+
#define KB_1 1024
46+
#define READ_OUT_SIZE (16 * KB_1)
47+
#define READ_IN_SIZE READ_OUT_SIZE
48+
@@ -456,7 +476,7 @@ static int s_fillin_alpn_data(
49+
50+
*extension_length += sizeof(uint32_t) + sizeof(uint16_t);
51+
52+
- *extension_name = SecApplicationProtocolNegotiationExt_ALPN;
53+
+ *extension_name = 2;
54+
/*now add the protocols*/
55+
for (size_t i = 0; i < protocols_count; ++i) {
56+
struct aws_byte_cursor *protocol_ptr = NULL;

0 commit comments

Comments
 (0)