Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ Checks: |
clang-analyzer-*,
google-*,
modernize-*,
misc-include-cleaner,
readability-identifier-naming,
readability-isolate-declaration,
-modernize-use-nodiscard,
Expand All @@ -41,5 +42,7 @@ CheckOptions:
value: '_'
- key: modernize-use-scoped-lock.WarnOnSingleLocks
value: 'false'
- key: misc-include-cleaner.IgnoreHeaders
value: 'arrow/.*;avro/.*;aws/.*;cpr/.*;gmock/.*;gtest/.*;nanoarrow/.*;nlohmann/.*;parquet/.*;roaring/.*;spdlog/.*;sqlpp23/.*;sqlite3\.h;thrift/.*;utf8proc\.h;zlib\.h'

HeaderFilterRegex: 'src/iceberg|example'
7 changes: 7 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,10 @@ updates:
day: "sunday"
cooldown:
default-days: 7
groups:
# The codeql-action init/autobuild/analyze steps must all run the
# same version - split PRs cause a version mismatch that fails the
# Analyze jobs. Group them so a single PR bumps all of them together.
codeql-action:
patterns:
- "github/codeql-action*"
4 changes: 2 additions & 2 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,11 @@ jobs:
persist-credentials: false

- name: Initialize CodeQL
uses: github/codeql-action/init@8aad20d150bbac5944a9f9d289da16a4b0d87c1e # v4.36.2
uses: github/codeql-action/init@54f647b7e1bb85c95cddabcd46b0c578ec92bc1a # v4.36.3
with:
languages: actions

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@8aad20d150bbac5944a9f9d289da16a4b0d87c1e # v4.36.2
uses: github/codeql-action/analyze@54f647b7e1bb85c95cddabcd46b0c578ec92bc1a # v4.36.3
with:
category: "/language:actions"
1 change: 1 addition & 0 deletions .github/workflows/cpp-linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ jobs:
-DCMAKE_C_COMPILER_LAUNCHER=sccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=sccache \
-DICEBERG_BUILD_SQL_CATALOG=ON \
-DICEBERG_BUILD_BENCHMARKS=ON \
-DICEBERG_SQL_SQLITE=ON \
-DICEBERG_SQL_POSTGRESQL=ON \
-DICEBERG_SQL_MYSQL=ON
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/sql_catalog_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ jobs:
cmake_extra_args: ""
- title: AMD64 Windows 2025
runs-on: windows-2025
cmake_build_type: Release
cmake_build_type: Debug
cmake_extra_args: -DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake
env:
SCCACHE_DIR: ${{ github.workspace }}/.sccache
Expand Down
16 changes: 10 additions & 6 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,15 @@ env:
jobs:
ubuntu:
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.draft == false }}
name: AMD64 Ubuntu 26.04
name: AMD64 Ubuntu 26.04 (${{ matrix.cmake_build_type }})
runs-on: ubuntu-26.04
timeout-minutes: 30
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
cmake_build_type:
- Debug
- RelWithDebInfo
env:
SCCACHE_DIR: ${{ github.workspace }}/.sccache
SCCACHE_CACHE_SIZE: "2G"
Expand All @@ -59,17 +63,17 @@ jobs:
uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: ${{ github.workspace }}/.sccache
key: sccache-test-ubuntu-${{ github.run_id }}
key: sccache-test-ubuntu-${{ matrix.cmake_build_type }}-${{ github.run_id }}
restore-keys: |
sccache-test-ubuntu-
sccache-test-ubuntu-${{ matrix.cmake_build_type }}-
- name: Setup sccache
uses: mozilla-actions/sccache-action@9e7fa8a12102821edf02ca5dbea1acd0f89a2696 # v0.0.10
- name: Build Iceberg
shell: bash
env:
CC: gcc-14
CXX: g++-14
run: ci/scripts/build_iceberg.sh $(pwd) ON ON
run: ci/scripts/build_iceberg.sh $(pwd) ON ON OFF OFF ON ${{ matrix.cmake_build_type }}
- name: Show sccache stats
shell: bash
run: sccache --show-stats
Expand All @@ -78,7 +82,7 @@ jobs:
uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: ${{ github.workspace }}/.sccache
key: sccache-test-ubuntu-${{ github.run_id }}
key: sccache-test-ubuntu-${{ matrix.cmake_build_type }}-${{ github.run_id }}
- name: Build Example
shell: bash
env:
Expand Down
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
option(ICEBERG_BUILD_STATIC "Build static library" ON)
option(ICEBERG_BUILD_SHARED "Build shared library" OFF)
option(ICEBERG_BUILD_TESTS "Build tests" ON)
option(ICEBERG_BUILD_BENCHMARKS "Build benchmarks" OFF)
option(ICEBERG_BUILD_BUNDLE "Build the battery included library" ON)
option(ICEBERG_BUILD_REST "Build rest catalog client" ON)
option(ICEBERG_BUILD_REST_INTEGRATION_TESTS "Build rest catalog integration tests" OFF)
Expand Down
92 changes: 92 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -228,3 +228,95 @@ Home page: https://arrow.apache.org/
License: https://www.apache.org/licenses/LICENSE-2.0

--------------------------------------------------------------------------------

This product bundles utf8proc, which is available under the MIT License:

utf8proc is a software package originally developed by Jan Behrens and the rest
of the Public Software Group, now maintained by the Julia-language developers.
All new work on the utf8proc library is licensed under the MIT "expat" license:

Copyright (c) 2014-2021 by Steven G. Johnson, Jiahao Chen, Tony Kelman, Jonas
Fonseca, and other contributors listed in the git history.

Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.

The original utf8proc is licensed under the same MIT "expat" license:

Copyright (c) 2009, 2013 Public Software Group e. V., Berlin, Germany

Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.

utf8proc also contains data derived from the Unicode data files. The following
license applies to that data:

COPYRIGHT AND PERMISSION NOTICE

Copyright (c) 1991-2007 Unicode, Inc. All rights reserved. Distributed under
the Terms of Use in http://www.unicode.org/copyright.html.

Permission is hereby granted, free of charge, to any person obtaining a
copy of the Unicode data files and any associated documentation (the "Data
Files") or Unicode software and any associated documentation (the
"Software") to deal in the Data Files or Software without restriction,
including without limitation the rights to use, copy, modify, merge,
publish, distribute, and/or sell copies of the Data Files or Software, and
to permit persons to whom the Data Files or Software are furnished to do
so, provided that (a) the above copyright notice(s) and this permission
notice appear with all copies of the Data Files or Software, (b) both the
above copyright notice(s) and this permission notice appear in associated
documentation, and (c) there is clear notice in each modified Data File or
in the Software as well as in the documentation associated with the Data
File(s) or Software that the data or software has been modified.

THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF
THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS
INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR
CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THE DATA FILES OR SOFTWARE.

Except as contained in this notice, the name of a copyright holder shall
not be used in advertising or otherwise to promote the sale, use or other
dealings in these Data Files or Software without prior written
authorization of the copyright holder.

Unicode and the Unicode logo are trademarks of Unicode, Inc., and may be
registered in some jurisdictions. All other trademarks and registered
trademarks mentioned herein are the property of their respective owners.

--------------------------------------------------------------------------------
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ install-deps:

build-api-docs:
cd mkdocs && \
rm -rf docs/api && \
mkdir -p docs/api && \
doxygen Doxyfile && \
echo "Doxygen output created in docs/api/"
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ If you experience network issues when downloading dependencies, you can customiz
- `ICEBERG_AVRO_GIT_URL`: Apache Avro git repository URL
- `ICEBERG_NANOARROW_URL`: Nanoarrow tarball URL
- `ICEBERG_CROARING_URL`: CRoaring tarball URL
- `ICEBERG_UTF8PROC_URL`: utf8proc tarball URL
- `ICEBERG_NLOHMANN_JSON_URL`: nlohmann-json tarball URL
- `ICEBERG_SPDLOG_URL`: spdlog tarball URL
- `ICEBERG_CPR_URL`: cpr tarball URL
Expand Down
36 changes: 20 additions & 16 deletions ci/scripts/build_example.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,18 @@ source_dir=${1}
build_dir=${1}/build
run_example=${ICEBERG_RUN_EXAMPLE:-OFF}

rm -rf "${build_dir}"
# Clean up before configuring. If Windows still holds a just-built exe/dll
# after the retries, let mkdir fail rather than reuse a half-deleted tree.
for attempt in 1 2 3; do
if rm -rf "${build_dir}"; then
break
fi
if [[ "${attempt}" != "3" ]]; then
sleep 2
else
echo "Failed to remove build directory after 3 attempts: ${build_dir}" >&2
fi
done
mkdir "${build_dir}"
pushd ${build_dir}

Expand All @@ -38,26 +49,19 @@ CMAKE_ARGS=(

if is_windows; then
CMAKE_ARGS+=("-DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake")
CMAKE_ARGS+=("-DCMAKE_BUILD_TYPE=Release")
else
CMAKE_ARGS+=("-DCMAKE_BUILD_TYPE=Debug")
fi

build_type="${ICEBERG_BUILD_TYPE:-Debug}"
CMAKE_ARGS+=("-DCMAKE_BUILD_TYPE=${build_type}")

cmake "${CMAKE_ARGS[@]}" ${source_dir}
if is_windows; then
cmake --build . --config Release
if [[ "${run_example}" == "ON" ]]; then
if [[ -x ./demo_example.exe ]]; then
./demo_example.exe
cmake --build .
if [[ "${run_example}" == "ON" ]]; then
if is_windows; then
./demo_example.exe
else
./Release/demo_example.exe
./demo_example
fi
fi
else
cmake --build .
if [[ "${run_example}" == "ON" ]]; then
./demo_example
fi
fi

popd
46 changes: 26 additions & 20 deletions ci/scripts/build_iceberg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
# specific language governing permissions and limitations
# under the License.
#
# Usage: build_iceberg.sh <source_dir> [rest_integration_tests=OFF] [sccache=OFF] [s3=OFF] [sigv4=OFF] [bundle_awssdk=ON]
# Usage: build_iceberg.sh <source_dir> [rest_integration_tests=OFF] [sccache=OFF] [s3=OFF] [sigv4=OFF] [bundle_awssdk=ON] [build_type=Debug]

set -eux

Expand All @@ -37,6 +37,8 @@ is_windows() {
[[ "${OSTYPE}" == "msys" || "${OSTYPE}" == "win32" || "${OSTYPE}" == "cygwin" ]]
}

build_type=${7:-Debug}

CMAKE_ARGS=(
"-G Ninja"
"-DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX:-${ICEBERG_HOME}}"
Expand Down Expand Up @@ -64,16 +66,16 @@ else
fi

if is_windows; then
CMAKE_ARGS+=("-DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake")
CMAKE_ARGS+=("-DCMAKE_BUILD_TYPE=Release")
else
# Pass an externally provided toolchain (e.g. vcpkg for the SigV4 job)
if [[ -n "${CMAKE_TOOLCHAIN_FILE:-}" ]]; then
CMAKE_ARGS+=("-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}")
fi
CMAKE_ARGS+=("-DCMAKE_BUILD_TYPE=Debug")
CMAKE_TOOLCHAIN_FILE="${CMAKE_TOOLCHAIN_FILE:-C:/vcpkg/scripts/buildsystems/vcpkg.cmake}"
fi

# Pass an externally provided toolchain, or the default Windows vcpkg toolchain.
if [[ -n "${CMAKE_TOOLCHAIN_FILE:-}" ]]; then
CMAKE_ARGS+=("-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}")
fi

CMAKE_ARGS+=("-DCMAKE_BUILD_TYPE=${build_type}")

if [[ "${build_enable_sccache}" == "ON" ]]; then
CMAKE_ARGS+=("-DCMAKE_CXX_COMPILER_LAUNCHER=sccache")
CMAKE_ARGS+=("-DCMAKE_C_COMPILER_LAUNCHER=sccache")
Expand All @@ -85,19 +87,23 @@ if [[ -n "${ICEBERG_EXTRA_CMAKE_ARGS:-}" ]]; then
fi

cmake "${CMAKE_ARGS[@]}" ${source_dir}
if is_windows; then
cmake --build . --config Release --target install
if [[ "${run_tests}" == "ON" ]]; then
ctest --output-on-failure -C Release
fi
else
cmake --build . --target install
if [[ "${run_tests}" == "ON" ]]; then

cmake --build . --target install
if [[ "${run_tests}" == "ON" ]]; then
ctest --output-on-failure
fi
fi

popd

# clean up between builds
rm -rf ${build_dir}
# Clean up after the build. Windows can briefly hold a just-built exe/dll,
# so retry but do not fail an otherwise successful CI job.
for attempt in 1 2 3; do
if rm -rf "${build_dir}"; then
break
fi
if [[ "${attempt}" != "3" ]]; then
sleep 2
else
echo "Failed to remove build directory after 3 attempts: ${build_dir}" >&2
fi
done
21 changes: 7 additions & 14 deletions cmake_modules/IcebergSccache.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,12 @@
if(MSVC_TOOLCHAIN AND "${CMAKE_CXX_COMPILER_LAUNCHER}" STREQUAL "sccache")
message(STATUS "Configuring sccache for MSVC")

# Remove /Zi or /ZI
string(REGEX REPLACE "/Z[iI]" "" CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG}")
string(REGEX REPLACE "/Z[iI]" "" CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}")
# Keep MSVC Debug objects cacheable by sccache without affecting Release.
set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT "$<$<CONFIG:Debug,RelWithDebInfo>:Embedded>")

string(REGEX REPLACE "/Z[iI]" "" CMAKE_C_FLAGS_RELWITHDEBINFO
"${CMAKE_C_FLAGS_RELWITHDEBINFO}")
string(REGEX REPLACE "/Z[iI]" "" CMAKE_CXX_FLAGS_RELWITHDEBINFO
"${CMAKE_CXX_FLAGS_RELWITHDEBINFO}")

# Add /Z7
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /Z7")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /Z7")

set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} /Z7")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /Z7")
# CMP0141 normally handles these flags; normalize any flags injected elsewhere.
foreach(flag_var CMAKE_C_FLAGS_DEBUG CMAKE_CXX_FLAGS_DEBUG CMAKE_C_FLAGS_RELWITHDEBINFO
CMAKE_CXX_FLAGS_RELWITHDEBINFO)
string(REGEX REPLACE "/Z[iI]" "/Z7" ${flag_var} "${${flag_var}}")
endforeach()
endif()
Loading