Skip to content

[C++][R] macOS 11.3 SDK fails to compile std::span iterator range in vector_sort #50636

Closed

Description

@rok

Describe the bug, including details regarding any error messages, version, and platform.

The test-r-macos-as-cran crossbow job fails when compiling vector_sort.cc against the macOS 11.3 SDK:

error: cannot convert initializer list argument to 'std::span<uint64_t>'

This was introduced in #50248

auto range_start = indices.begin();
auto range_cur = range_start;
auto last_value = GetView::LogicalValue(array.GetView(*range_cur - offset));
while (++range_cur != indices.end()) {
auto v = GetView::LogicalValue(array.GetView(*range_cur - offset));
if (v != last_value) {
visit({range_start, range_cur});
range_start = range_cur;
last_value = v;
}
}
if (range_start != range_cur) {
visit({range_start, range_cur});
}
}

The macOS 11.3 libc++ implementation uses __wrap_iter for span iterators but only accepts raw pointers in this constructor. Using indices.data() for the internal range iteration, or constructing the range with subspan(), would likely retain the span interface and fix the issue.

 diff --git a/cpp/src/arrow/compute/kernels/vector_sort.cc b/cpp/src/arrow/compute/kernels/vector_sort.cc
-  auto range_start = indices.begin();
+  auto range_start = indices.data();
   auto range_cur = range_start;
+  const auto range_end = range_start + indices.size();
   auto last_value = GetView::LogicalValue(array.GetView(*range_cur - offset));
-  while (++range_cur != indices.end()) {
+  while (++range_cur != range_end) {

Crossbow failure:
https://github.com/ursacomputing/crossbow/actions/runs/30154135424/job/89669316217#step:9:2303

Component(s)

C++, R

Activity

  1. KHARSHAVARDHAN-eng commented on Jul 27, 2026

    @KHARSHAVARDHAN-eng

    I'd like to work on this issue.

  2. added this to the 26.0.0 milestone on Jul 30, 2026
  3. kou commented on Jul 30, 2026

    @kou
    Member

    Issue resolved by pull request 50705
    #50705

  4. added a commit that references this issue on Jul 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions