Skip to content

Commit 39db544

Browse files
committed
GH-45885: [C++] Require C++20
1 parent 2a3c5db commit 39db544

File tree

44 files changed

+244
-124
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+244
-124
lines changed

.github/workflows/cpp_windows.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ jobs:
6363
ARROW_WITH_ZLIB: ON
6464
ARROW_WITH_ZSTD: ON
6565
BOOST_SOURCE: BUNDLED
66-
CMAKE_CXX_STANDARD: "17"
66+
CMAKE_CXX_STANDARD: "20"
6767
CMAKE_GENERATOR: Ninja
6868
CMAKE_INSTALL_PREFIX: /usr
6969
CMAKE_UNITY_BUILD: ON

.github/workflows/r.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,12 +229,13 @@ jobs:
229229
# static library. The R is not used here but R 4.1 was the last R to use
230230
# Rtools40.
231231
r-version: "4.1"
232-
rtools-version: 40
232+
rtools-version: ${{ matrix.config.rtools }}
233233
Ncpus: 2
234234
- name: Build Arrow C++
235235
shell: bash
236236
env:
237237
MINGW_ARCH: ${{ matrix.config.arch }}
238+
RTOOLS_VERSION: ${{ matrix.config.rtools }}
238239
run: ci/scripts/r_windows_build.sh
239240
- name: Rename libarrow.zip
240241
# So that they're unique when multiple are downloaded in the next step

.github/workflows/ruby.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ jobs:
349349
ARROW_WITH_SNAPPY: ON
350350
ARROW_WITH_ZLIB: ON
351351
ARROW_WITH_ZSTD: ON
352-
CMAKE_CXX_STANDARD: "17"
352+
CMAKE_CXX_STANDARD: "20"
353353
CMAKE_GENERATOR: Ninja
354354
CMAKE_INSTALL_PREFIX: "${{ github.workspace }}/dist"
355355
VCPKG_BINARY_SOURCES: 'clear;nuget,GitHub,readwrite'

c_glib/meson.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ project(
2121
'arrow-glib',
2222
'c',
2323
'cpp',
24-
default_options: ['c_std=c99', 'cpp_std=c++17'],
24+
default_options: ['c_std=c99', 'cpp_std=c++20'],
2525
license: 'Apache-2.0',
2626
# Debian:
2727
# https://packages.debian.org/search?keywords=meson

ci/docker/centos-7-cpp.dockerfile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ RUN sed -i \
2525
-e 's/mirror\.centos\.org/vault.centos.org/' \
2626
/etc/yum.repos.d/*.repo
2727

28-
# devtoolset is required for C++17
28+
# devtoolset is required for C++20
2929
RUN \
3030
yum install -y \
3131
centos-release-scl \
@@ -38,7 +38,8 @@ RUN \
3838
/etc/yum.repos.d/CentOS-SCLo-scl*.repo && \
3939
yum install -y \
4040
curl \
41-
devtoolset-8 \
41+
devtoolset-11-gcc-c++ \
42+
devtoolset-11-make \
4243
diffutils \
4344
gcc-c++ \
4445
libcurl-devel \

ci/scripts/cpp_build.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ elif [ "${ARROW_EMSCRIPTEN:-OFF}" = "ON" ]; then
168168
-DCMAKE_VERBOSE_MAKEFILE=${CMAKE_VERBOSE_MAKEFILE:-OFF} \
169169
-DCMAKE_C_FLAGS="${CFLAGS:-}" \
170170
-DCMAKE_CXX_FLAGS="${CXXFLAGS:-}" \
171-
-DCMAKE_CXX_STANDARD="${CMAKE_CXX_STANDARD:-17}" \
171+
-DCMAKE_CXX_STANDARD="${CMAKE_CXX_STANDARD:-20}" \
172172
-DCMAKE_INSTALL_LIBDIR=${CMAKE_INSTALL_LIBDIR:-lib} \
173173
-DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX:-${ARROW_HOME}} \
174174
-DCMAKE_UNITY_BUILD=${CMAKE_UNITY_BUILD:-OFF} \
@@ -260,7 +260,7 @@ else
260260
-DCMAKE_VERBOSE_MAKEFILE=${CMAKE_VERBOSE_MAKEFILE:-OFF} \
261261
-DCMAKE_C_FLAGS="${CFLAGS:-}" \
262262
-DCMAKE_CXX_FLAGS="${CXXFLAGS:-}" \
263-
-DCMAKE_CXX_STANDARD="${CMAKE_CXX_STANDARD:-17}" \
263+
-DCMAKE_CXX_STANDARD="${CMAKE_CXX_STANDARD:-20}" \
264264
-DCMAKE_INSTALL_LIBDIR=${CMAKE_INSTALL_LIBDIR:-lib} \
265265
-DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX:-${ARROW_HOME}} \
266266
-DCMAKE_UNITY_BUILD=${CMAKE_UNITY_BUILD:-OFF} \

ci/scripts/r_windows_build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ mv mingw* build
4444
cd build
4545

4646
# This may vary by system/CI provider
47-
MSYS_LIB_DIR="/c/rtools40"
47+
MSYS_LIB_DIR="/c/rtools${RTOOLS_VERSION}"
4848

4949
# Untar the builds we made
5050
ls *.xz | xargs -n 1 tar -xJf

compose.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -465,7 +465,7 @@ services:
465465
ARROW_HOME: /arrow
466466
LIBARROW_MINIMAL: "false"
467467
command: /bin/bash -c "
468-
scl enable devtoolset-8 '/arrow/r/inst/build_arrow_static.sh'"
468+
scl enable devtoolset-11 '/arrow/r/inst/build_arrow_static.sh'"
469469

470470
ubuntu-cpp-bundled:
471471
# Arrow build with BUNDLED dependencies

cpp/CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -530,10 +530,10 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${ARROW_CXXFLAGS}")
530530
# C++ specific flags.
531531
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CXX_COMMON_FLAGS} ${ARROW_CXXFLAGS}")
532532

533-
# Remove --std=c++17 to avoid errors from C compilers
534-
string(REPLACE "-std=c++17" "" CMAKE_C_FLAGS ${CMAKE_C_FLAGS})
533+
# Remove -std=c++20 to avoid errors from C compilers
534+
string(REPLACE "-std=c++20" "" CMAKE_C_FLAGS ${CMAKE_C_FLAGS})
535535

536-
# Add C++-only flags, like -std=c++17
536+
# Add C++-only flags, like -std=c++20
537537
set(CMAKE_CXX_FLAGS "${CXX_ONLY_FLAGS} ${CMAKE_CXX_FLAGS}")
538538

539539
# ASAN / TSAN / UBSAN

cpp/cmake_modules/GandivaAddBitcode.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
# Create bitcode for the given source file.
1919
function(gandiva_add_bitcode SOURCE)
20-
set(CLANG_OPTIONS -std=c++17)
20+
set(CLANG_OPTIONS -std=c++20)
2121
if(MSVC)
2222
# "19.20" means that it's compatible with Visual Studio 16 2019.
2323
# We can update this to "19.30" when we dropped support for Visual

0 commit comments

Comments
 (0)