Repository navigation
Closed
Description
When using the CMake configuration, dependencies that need to be built may throw warnings. With the current CMake configuration, these warnings cause the build to fail:
[ 62%] Building CXX object src/iceberg/CMakeFiles/iceberg_static.dir/manifest_entry.cc.o
/home/will/clones/iceberg-cpp/build/_deps/vendoredarrow-src/cpp/src/arrow/array/array_nested.cc: In member function ‘const std::shared_ptr<arrow::Array>& arrow::StructArray::field(int) const’:
/home/will/clones/iceberg-cpp/build/_deps/vendoredarrow-src/cpp/src/arrow/array/array_nested.cc:1080:51: error: ‘std::shared_ptr<_Tp> std::atomic_load(const shared_ptr<_Tp>*) [with _Tp = arrow::Array]’ is deprecated: use 'std::atomic<std::shared_ptr<T>>' instead [-Werror=deprecated-declarations]
1080 | std::shared_ptr<Array> result = std::atomic_load(&boxed_fields_[i]);
| ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/memory:81,
from /home/will/clones/iceberg-cpp/build/_deps/vendoredarrow-src/cpp/src/arrow/array/array_nested.h:24,
from /home/will/clones/iceberg-cpp/build/_deps/vendoredarrow-src/cpp/src/arrow/array/array_nested.cc:18:
/usr/include/c++/14/bits/shared_ptr_atomic.h:142:5: note: declared here
142 | atomic_load(const shared_ptr<_Tp>* __p)
| ^~~~~~~~~~~
/home/will/clones/iceberg-cpp/build/_deps/vendoredarrow-src/cpp/src/arrow/array/array_nested.cc:1089:22: error: ‘void std::atomic_store(shared_ptr<_Tp>*, shared_ptr<_Tp>) [with _Tp = arrow::Array]’ is deprecated: use 'std::atomic<std::shared_ptr<T>>' instead [-Werror=deprecated-declarations]
1089 | std::atomic_store(&boxed_fields_[i], std::move(result));
| ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/shared_ptr_atomic.h:183:5: note: declared here
183 | atomic_store(shared_ptr<_Tp>* __p, shared_ptr<_Tp> __r)
| ^~~~~~~~~~~~
/home/will/clones/iceberg-cpp/build/_deps/vendoredarrow-src/cpp/src/arrow/array/array_nested.cc: In member function ‘std::shared_ptr<arrow::Array> arrow::UnionArray::field(int) const’:
/home/will/clones/iceberg-cpp/build/_deps/vendoredarrow-src/cpp/src/arrow/array/array_nested.cc:1360:51: error: ‘std::shared_ptr<_Tp> std::atomic_load(const shared_ptr<_Tp>*) [with _Tp = arrow::Array]’ is deprecated: use 'std::atomic<std::shared_ptr<T>>' instead [-Werror=deprecated-declarations]
1360 | std::shared_ptr<Array> result = std::atomic_load(&boxed_fields_[i]);
| ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/shared_ptr_atomic.h:142:5: note: declared here
142 | atomic_load(const shared_ptr<_Tp>* __p)
| ^~~~~~~~~~~
/home/will/clones/iceberg-cpp/build/_deps/vendoredarrow-src/cpp/src/arrow/array/array_nested.cc:1372:22: error: ‘void std::atomic_store(shared_ptr<_Tp>*, shared_ptr<_Tp>) [with _Tp = arrow::Array]’ is deprecated: use 'std::atomic<std::shared_ptr<T>>' instead [-Werror=deprecated-declarations]
1372 | std::atomic_store(&boxed_fields_[i], result);
| ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/shared_ptr_atomic.h:183:5: note: declared here
183 | atomic_store(shared_ptr<_Tp>* __p, shared_ptr<_Tp> __r)
| ^~~~~~~~~~~~
Metadata
Metadata
Assignees
Labels
No labels
Activity
zhjwpku commentedon Sep 28, 2025
Hi @WillAyd Could you provide more details on how to reproduce this error? We've had CMAKE_COMPILE_WARNING_AS_ERROR enabled for about three months, not seeing CI errors on array_nested.cc[1]. But what you reported seems reasonable, I'd like to reproduce the issue locally to investigate further.
[1] https://github.com/apache/iceberg-cpp/actions/runs/18053108795/job/51378485398?pr=242#step:4:1139
zhjwpku commentedon Sep 28, 2025
It seems we have CMAKE_COMPILE_WARNING_AS_ERROR disabled for subprojects.
https://github.com/apache/iceberg-cpp/blob/main/cmake_modules/IcebergThirdpartyToolchain.cmake#L51
wgtmac commentedon Sep 28, 2025
CMAKE_COMPILE_WARNING_AS_ERRORdoes not always work. I have seen the same issue in apache/orc#2416 that buildingProtobufusingFetchContentfailed due to warnings are regarded as errors.yadavay-amzn commentedon Jul 6, 2026
I would like to take this. Plan: scope the warnings-as-error settings (CMAKE_COMPILE_WARNING_AS_ERROR / -Werror) to this project's own targets so they do not propagate into FetchContent-built dependencies. Will disclose AI-assisted authoring in the PR per the Iceberg AI-contribution guidelines.
Apply cmake-format (fix pre-commit CI) (apache#246)
Scope warnings-as-error to project targets, not FetchContent subproje…
build: scope warnings-as-error to project targets, not FetchContent s…