Public headers require C++23, forcing the same on every consumer
- 主要语言
- C++
- 星标
- 221
- 派生
- 124
- 平均合并
- 1 天 17 小时
- 30 天内合并 PR
- 21
描述
`CMakeLists.txt:35` sets `CMAKE_CXX_STANDARD 23`, which is a fine choice for the
library's own sources. The requirement is not confined to them, though.
`src/iceberg/result.h` includes `` and ``, and defines:
```cpp
template ::type>
using Result = std::expected;
using Status = Result;
```
`Result` is the return type of most public entry points —
`Catalog::ListNamespaces`, `ListTables`, `LoadTable`, `CreateTable`,
`StageCreateTable` and so on. Every consumer translation unit that calls them
must therefore compile as C++23 as well. `std::expected` needs libstdc++ 12 or
libc++ 16 and `` needs libstdc++ 13, so a consumer on an older but still
widely deployed toolchain cannot include the headers at all.
This matters for the engines the library is meant to be embedded in: Velox
builds as C++20, Arrow as C++17, DuckDB as C++11. Integrating leaves two
options — move the whole engine to C++23, or add an isolation layer whose only
purpose is keeping iceberg-cpp headers out of the rest of the build. We are
looking at iceberg-cpp for an Iceberg connector in
[Axiom](https://github.com/facebookincubator/axiom), which builds on Velox at
C++20, and would rather do neither.
Would you consider making the public error type portable while keeping the API
shape unchanged?
```cpp
#if defined(__cpp_lib_expected)
template ::type>
using Result = std::expected;
#else
// vendored fallback with the same interface
#endif
```
`arrow::Result`, `absl::StatusOr` and `tl::expected` all exist for this reason.
The library's own sources could keep building as C++23; only the public headers
would need to hold a lower baseline.
Happy to send a patch if the direction is agreeable.
cc @PingLiuPing, who is proposing the Iceberg connector for Axiom.
贡献指南
这个仓库没有索引到贡献指南
调研方向
从 CMakeLists.txt:35 和公共头文件 src/iceberg/result.h 开始,然后跟踪列出的、暴露 Result 的 Catalog 入口点。将所需的 C++23 库功能与 issue 中提到的旧版 toolchain 进行比较。完成的标准是:使用者无需采用 C++23 即可 include 并使用公共 API,同时库自身的源代码仍可继续按 C++23 构建,并且 API 形态保持不变。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- cmake, cpp
- 领域
- api, build-system
- Issue 类型
- 功能
- 难度
- 5/5
- 预计耗时
- 一周以上
- 活跃度
- 活跃
- 描述清晰度
- 基本清楚
- 新手友好度
- 42/100