Skip to content
Open
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
16 changes: 10 additions & 6 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is my understanding correct that the timeout was doubled becuase now for ubuntu 2 build configurations are going to be executed?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not really. Each build runs as its own job. I doubled that because this is a cold build, no cache can be utilized. Also, RelWithDebInfo may take longer since it's an -O2 build. It shouldn't take this long once it's merged into main and sccache starts taking effect.

strategy:
fail-fast: false
matrix:
cmake_build_type:
- Debug
- RelWithDebInfo
env:
SCCACHE_DIR: ${{ github.workspace }}/.sccache
SCCACHE_CACHE_SIZE: "2G"
Expand All @@ -60,17 +64,17 @@ jobs:
uses: actions/cache/restore@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
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 @@ -79,7 +83,7 @@ jobs:
uses: actions/cache/save@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
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
16 changes: 11 additions & 5 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,12 @@ is_windows() {
[[ "${OSTYPE}" == "msys" || "${OSTYPE}" == "win32" || "${OSTYPE}" == "cygwin" ]]
}

if is_windows; then
build_type=${7:-Release}
else
build_type=${7:-Debug}
fi

CMAKE_ARGS=(
"-G Ninja"
"-DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX:-${ICEBERG_HOME}}"
Expand Down Expand Up @@ -65,13 +71,13 @@ fi

if is_windows; then
CMAKE_ARGS+=("-DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake")
CMAKE_ARGS+=("-DCMAKE_BUILD_TYPE=Release")
CMAKE_ARGS+=("-DCMAKE_BUILD_TYPE=${build_type}")
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_ARGS+=("-DCMAKE_BUILD_TYPE=${build_type}")
fi

if [[ "${build_enable_sccache}" == "ON" ]]; then
Expand All @@ -86,9 +92,9 @@ fi

cmake "${CMAKE_ARGS[@]}" ${source_dir}
if is_windows; then
cmake --build . --config Release --target install
cmake --build . --config "${build_type}" --target install
if [[ "${run_tests}" == "ON" ]]; then
ctest --output-on-failure -C Release
ctest --output-on-failure -C "${build_type}"
fi
else
cmake --build . --target install
Expand Down
6 changes: 3 additions & 3 deletions src/iceberg/json_serde.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1377,9 +1377,9 @@ Result<std::unique_ptr<TableMetadata>> TableMetadataFromJson(const nlohmann::jso
TimePointMs{std::chrono::milliseconds(last_updated_ms)};

if (json.contains(kRefs)) {
ICEBERG_ASSIGN_OR_RAISE(
table_metadata->refs,
FromJsonMap<std::shared_ptr<SnapshotRef>>(json, kRefs, SnapshotRefFromJson));
ICEBERG_ASSIGN_OR_RAISE(auto refs, FromJsonMap<std::shared_ptr<SnapshotRef>>(
json, kRefs, SnapshotRefFromJson));
table_metadata->refs = std::move(refs);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems like a more readable version of previous version, however it seems disconnected from the change discussed in this PR?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, this is related to the new RelWithDebInfo coverage: that build exposed the -Werror=free-nonheap-object failure, so this change avoids assigning directly through ICEBERG_ASSIGN_OR_RAISE and fixes the issue surfaced by the new CI job. I'll update the PR title to make that relationship clearer.

} else if (table_metadata->current_snapshot_id != kInvalidSnapshotId) {
table_metadata->refs["main"] = std::make_unique<SnapshotRef>(SnapshotRef{
.snapshot_id = table_metadata->current_snapshot_id,
Expand Down
Loading