GH-55429: [C++] std::invocable in codegen_internal.h fails to compile with CRAN's macOS 11.3 SDK #55457
@github-actions crossbow submit test-r-macos-as-cran
:warning: GitHub issue #55429 has been automatically assigned in GitHub to PR creator.
<!-- ccr-overview-v2 -->
🟢 Approval recommended
The review reports no active issues with the macOS SDK compatibility changes.
No open issues 🎉
<details>
<summary><strong>What changed in this PR</strong></summary>
This PR addresses C++ build compatibility with CRAN’s macOS 11.3 SDK by replacing unavailable standard-library features with older equivalents.
Changes:
std::invocable constraints with std::is_invocable_v in compute kernel generation.std::in_range checks with an integer-capacity trait and add compile-time assertions for representative type pairs.| File | Description |
| ---- | ----------- |
| cpp/src/parquet/column_reader.cc | Use numeric limits and signedness to check integer capacity without std::in_range. |
| cpp/src/arrow/compute/kernels/codegen_internal.h | Use std::is_invocable_v and remove the <concepts> include. |
</details>
<sub>Review effort: Balanced</sub>
Revision: cc05f472c447523ee028eb85299737cdfc1f630f
Submitted crossbow builds: ursacomputing/crossbow @ actions-fd168d079e
|Task|Status|
|----|------|
|test-r-macos-as-cran||
The converse should hold true as well?
static_assert(!can_hold_v<int32_t, uint32_t>);
static_assert(!can_hold_v<uint32_t, int32_t>);
Approved these changes.
CI failures looked unrelated but it's all running again since I accept the changes suggested
<!-- ccr-overview-v2 -->
🟢 Approval recommended
No active review issues block the C++ compatibility changes targeting CRAN’s macOS 11.3 SDK.
No open issues 🎉
<sub>Review effort: Balanced</sub>
pitrou
thisisnic
Rationale for this change
macOS on CRAN is old and doesn't have all the C++20 stuff in it - evidenced by failing CI
What changes are included in this PR?
Refactor code which requires newer stuff that the CRAN stuff doesn't have
Are these changes tested?
Will run CI
Are there any user-facing changes?
Nah
Was AI used for this PR?
Yeah, all generated but I checked it with an adversarial review and will run CI to make sure it actually works
PR code and description written by:
Reviewed before submission by: