apache / apache/iceberg-cpp

Public headers require C++23, forcing the same on every consumer

Ouverte
#928 4 commentaires 1 réaction 0 personnes assignées Voir sur GitHub
Langage dominant
C++
Étoiles
221
Forks
124
Merge moyen
1 j 16 h
PR mergées (30 j)
21

Description

`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.

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Piste de recherche

Commencez par CMakeLists.txt:35 et l’en-tête public src/iceberg/result.h, puis suivez les points d’entrée de Catalog listés qui exposent Result. Comparez les fonctionnalités requises de la bibliothèque C++23 avec les toolchains plus anciennes mentionnées dans l’issue. Le travail est terminé lorsque les consommateurs peuvent inclure et utiliser l’API publique sans adopter C++23, tandis que les propres sources de la bibliothèque peuvent continuer à être compilées en C++23 et que la forme de l’API reste inchangée.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
cmake, cpp
Domaine
api, build-system
Type d'issue
Fonctionnalité
Difficulté
5/5
Temps estimé
Plus d'une semaine
Activité
Active
Clarté
Plutôt claire
Accessibilité débutants
42/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.