Skip to content

Commit dbc9c1c

Browse files
authored
refactor: use gcc-14 in ubuntu ci (#355)
1 parent ad14e5a commit dbc9c1c

File tree

10 files changed

+64
-51
lines changed

10 files changed

+64
-51
lines changed

.devcontainer/Dockerfile.template

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,11 @@ RUN apt update && \
2626
bash-completion \
2727
build-essential \
2828
ccache \
29+
clangd \
2930
cmake \
3031
curl \
31-
gcc \
32-
g++ \
32+
gcc-14 \
33+
g++-14 \
3334
git \
3435
htop \
3536
libboost-all-dev \

.github/workflows/cpp-linter.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ jobs:
3636
shell: bash
3737
run: sudo apt-get update && sudo apt-get install -y libcurl4-openssl-dev
3838
- name: Run build
39+
env:
40+
CC: gcc-14
41+
CXX: g++-14
3942
run: |
4043
mkdir build && cd build
4144
cmake .. -G Ninja -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
@@ -54,7 +57,8 @@ jobs:
5457
thread-comments: true
5558
ignore: 'build|cmake_modules|ci'
5659
database: build
57-
extra-args: '-I$PWD/src -I$PWD/build/src'
60+
# need '-fno-builtin-std-forward_like', see https://github.com/llvm/llvm-project/issues/101614
61+
extra-args: '-I$PWD/src -I$PWD/build/src -fno-builtin-std-forward_like'
5862
- name: Fail fast?!
5963
if: steps.linter.outputs.checks-failed != 0
6064
run: |

.github/workflows/docs.yml

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

1818
jobs:
1919
docs:
20-
runs-on: ubuntu-latest
20+
runs-on: ubuntu-24.04
2121

2222
steps:
2323
- uses: actions/[email protected]

.github/workflows/license_check.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ on: pull_request
2222
jobs:
2323
license-check:
2424
name: "License Check"
25-
runs-on: ubuntu-latest
25+
runs-on: ubuntu-24.04
2626
steps:
2727
- name: Checkout repository
2828
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0

.github/workflows/rc.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ permissions:
3030
jobs:
3131
archive:
3232
name: Archive
33-
runs-on: ubuntu-latest
33+
runs-on: ubuntu-24.04
3434
timeout-minutes: 5
3535
steps:
3636
- name: Checkout
@@ -77,6 +77,10 @@ jobs:
7777
- macos-26
7878
- ubuntu-24.04
7979
# - windows-latest
80+
include:
81+
- os: ubuntu-24.04
82+
CC: gcc-14
83+
CXX: g++-14
8084
steps:
8185
- name: Checkout
8286
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
@@ -85,6 +89,12 @@ jobs:
8589
with:
8690
name: archive
8791

92+
- name: Set Ubuntu Compilers
93+
if: ${{ startsWith(matrix.runs-on, 'ubuntu') }}
94+
run: |
95+
echo "CC=${{ matrix.CC }}" >> $GITHUB_ENV
96+
echo "CXX=${{ matrix.CXX }}" >> $GITHUB_ENV
97+
8898
- name: Verify
8999
run: |
90100
tar_gz=$(echo apache-iceberg-cpp-*.tar.gz)
@@ -109,7 +119,7 @@ jobs:
109119
if: github.ref_type == 'tag'
110120
needs:
111121
- verify
112-
runs-on: ubuntu-latest
122+
runs-on: ubuntu-24.04
113123
permissions:
114124
contents: write
115125
steps:

.github/workflows/sanitizer_test.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ jobs:
4646
shell: bash
4747
run: sudo apt-get update && sudo apt-get install -y libcurl4-openssl-dev
4848
- name: Configure and Build with ASAN & UBSAN
49+
env:
50+
CC: gcc-14
51+
CXX: g++-14
4952
run: |
5053
mkdir build && cd build
5154
cmake .. -G Ninja -DCMAKE_BUILD_TYPE=Debug -DICEBERG_ENABLE_ASAN=ON -DICEBERG_ENABLE_UBSAN=ON

.github/workflows/test.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,15 @@ jobs:
5151
run: sudo apt-get update && sudo apt-get install -y libcurl4-openssl-dev
5252
- name: Build Iceberg
5353
shell: bash
54+
env:
55+
CC: gcc-14
56+
CXX: g++-14
5457
run: ci/scripts/build_iceberg.sh $(pwd)
5558
- name: Build Example
5659
shell: bash
60+
env:
61+
CC: gcc-14
62+
CXX: g++-14
5763
run: ci/scripts/build_example.sh $(pwd)/example
5864
macos:
5965
name: AArch64 macOS 26
@@ -102,6 +108,8 @@ jobs:
102108
include:
103109
- title: AMD64 Ubuntu 24.04
104110
runs-on: ubuntu-24.04
111+
CC: gcc-14
112+
CXX: g++-14
105113
- title: AMD64 Windows 2025
106114
runs-on: windows-2025
107115
meson-setup-args: --vsenv
@@ -117,6 +125,11 @@ jobs:
117125
run: |
118126
python3 -m pip install --upgrade pip
119127
python3 -m pip install -r requirements.txt
128+
- name: Set Ubuntu Compilers
129+
if: ${{ startsWith(matrix.runs-on, 'ubuntu') }}
130+
run: |
131+
echo "CC=${{ matrix.CC }}" >> $GITHUB_ENV
132+
echo "CXX=${{ matrix.CXX }}" >> $GITHUB_ENV
120133
- name: Build Iceberg
121134
run: |
122135
meson setup builddir ${{ matrix.meson-setup-args || '' }}

cmake_modules/IcebergThirdpartyToolchain.cmake

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ function(resolve_arrow_dependency)
9797
set(ARROW_WITH_ZLIB ON)
9898
set(ZLIB_SOURCE "SYSTEM")
9999
set(ARROW_VERBOSE_THIRDPARTY_BUILD OFF)
100+
set(CMAKE_CXX_STANDARD 17)
100101

101102
fetchcontent_declare(VendoredArrow
102103
${FC_DECLARE_COMMON_OPTIONS}
@@ -323,7 +324,7 @@ function(resolve_croaring_dependency)
323324
set(CROARING_URL "$ENV{ICEBERG_CROARING_URL}")
324325
else()
325326
set(CROARING_URL
326-
"https://github.com/RoaringBitmap/CRoaring/archive/refs/tags/v4.3.11.tar.gz")
327+
"https://github.com/RoaringBitmap/CRoaring/archive/refs/tags/v4.4.3.tar.gz")
327328
endif()
328329

329330
fetchcontent_declare(croaring
@@ -542,7 +543,7 @@ function(resolve_cpr_dependency)
542543
RUNTIME DESTINATION "${ICEBERG_INSTALL_BINDIR}"
543544
ARCHIVE DESTINATION "${ICEBERG_INSTALL_LIBDIR}"
544545
LIBRARY DESTINATION "${ICEBERG_INSTALL_LIBDIR}")
545-
list(APPEND ICEBERG_SYSTEM_DEPENDENCIES OpenSSL)
546+
list(APPEND ICEBERG_SYSTEM_DEPENDENCIES OpenSSL CURL)
546547
else()
547548
set(CPR_VENDORED FALSE)
548549
list(APPEND ICEBERG_SYSTEM_DEPENDENCIES cpr)

src/iceberg/iceberg-config.cmake.in

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -72,19 +72,6 @@ endmacro()
7272
# Find system dependencies
7373
iceberg_find_dependencies("${ICEBERG_SYSTEM_DEPENDENCIES}")
7474

75-
# Create missing CRoaring targets if they don't exist
76-
if(NOT TARGET roaring::roaring-headers)
77-
add_library(roaring::roaring-headers INTERFACE IMPORTED)
78-
endif()
79-
80-
if(NOT TARGET roaring::roaring-headers-cpp)
81-
add_library(roaring::roaring-headers-cpp INTERFACE IMPORTED)
82-
endif()
83-
84-
if(NOT TARGET CURL::libcurl)
85-
add_library(CURL::libcurl INTERFACE IMPORTED)
86-
endif()
87-
8875
include("${CMAKE_CURRENT_LIST_DIR}/iceberg-targets.cmake")
8976

9077
if(TARGET iceberg::arrow_static)

src/iceberg/table_metadata.cc

Lines changed: 23 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#include <algorithm>
2323
#include <chrono>
2424
#include <format>
25+
#include <ranges>
2526
#include <string>
2627

2728
#include <nlohmann/json.hpp>
@@ -184,51 +185,45 @@ Result<TableMetadataCache::SnapshotsMapRef> TableMetadataCache::GetSnapshotsById
184185

185186
Result<TableMetadataCache::SchemasMap> TableMetadataCache::InitSchemasMap(
186187
const TableMetadata* metadata) {
187-
SchemasMap schemas_map;
188-
schemas_map.reserve(metadata->schemas.size());
189-
for (const auto& schema : metadata->schemas) {
190-
if (schema->schema_id()) {
191-
schemas_map.emplace(schema->schema_id().value(), schema);
192-
}
193-
}
194-
return schemas_map;
188+
return metadata->schemas | std::views::filter([](const auto& schema) {
189+
return schema->schema_id().has_value();
190+
}) |
191+
std::views::transform([](const auto& schema) {
192+
return std::make_pair(schema->schema_id().value(), schema);
193+
}) |
194+
std::ranges::to<SchemasMap>();
195195
}
196196

197197
Result<TableMetadataCache::PartitionSpecsMap> TableMetadataCache::InitPartitionSpecsMap(
198198
const TableMetadata* metadata) {
199-
PartitionSpecsMap partition_specs_map;
200-
partition_specs_map.reserve(metadata->partition_specs.size());
201-
for (const auto& spec : metadata->partition_specs) {
202-
partition_specs_map.emplace(spec->spec_id(), spec);
203-
}
204-
return partition_specs_map;
199+
return metadata->partition_specs | std::views::transform([](const auto& spec) {
200+
return std::make_pair(spec->spec_id(), spec);
201+
}) |
202+
std::ranges::to<PartitionSpecsMap>();
205203
}
206204

207205
Result<TableMetadataCache::SortOrdersMap> TableMetadataCache::InitSortOrdersMap(
208206
const TableMetadata* metadata) {
209-
SortOrdersMap sort_orders_map;
210-
sort_orders_map.reserve(metadata->sort_orders.size());
211-
for (const auto& order : metadata->sort_orders) {
212-
sort_orders_map.emplace(order->order_id(), order);
213-
}
214-
return sort_orders_map;
207+
return metadata->sort_orders | std::views::transform([](const auto& order) {
208+
return std::make_pair(order->order_id(), order);
209+
}) |
210+
std::ranges::to<SortOrdersMap>();
215211
}
216212

217213
Result<TableMetadataCache::SnapshotsMap> TableMetadataCache::InitSnapshotMap(
218214
const TableMetadata* metadata) {
219-
SnapshotsMap snapshots_map;
220-
snapshots_map.reserve(metadata->snapshots.size());
221-
for (const auto& snapshot : metadata->snapshots) {
222-
snapshots_map.emplace(snapshot->snapshot_id, snapshot);
223-
}
224-
return snapshots_map;
215+
return metadata->snapshots | std::views::transform([](const auto& snapshot) {
216+
return std::make_pair(snapshot->snapshot_id, snapshot);
217+
}) |
218+
std::ranges::to<SnapshotsMap>();
225219
}
226220

227221
// TableMetadataUtil implementation
228222

229223
Result<MetadataFileCodecType> TableMetadataUtil::CodecFromFileName(
230224
std::string_view file_name) {
231-
if (file_name.find(".metadata.json") == std::string::npos) {
225+
auto pos = file_name.find_last_of(".metadata.json");
226+
if (pos == std::string::npos) {
232227
return InvalidArgument("{} is not a valid metadata file", file_name);
233228
}
234229

@@ -237,8 +232,7 @@ Result<MetadataFileCodecType> TableMetadataUtil::CodecFromFileName(
237232
return MetadataFileCodecType::kGzip;
238233
}
239234

240-
std::string_view file_name_without_suffix =
241-
file_name.substr(0, file_name.find_last_of(".metadata.json"));
235+
std::string_view file_name_without_suffix = file_name.substr(0, pos);
242236
if (file_name_without_suffix.ends_with(".gz")) {
243237
return MetadataFileCodecType::kGzip;
244238
}

0 commit comments

Comments
 (0)