This is an automated email from the ASF dual-hosted git repository.

thisisnic pushed a commit to branch maint-23.0.1-r
in repository https://gitbox.apache.org/repos/asf/arrow.git

commit d1cea282adb1eb57fc35d59c5f56b039ed99d3d0
Author: Jonathan Keane <[email protected]>
AuthorDate: Mon Feb 16 03:26:20 2026 -0600

    GH-49176: [C++] CRAN build fail on missing std::floating_point concept 
(#49221)
    
    ### Rationale for this change
    
    Passing builds on CRAN
    
    ### What changes are included in this PR?
    
    A workaround for C++20 compatibility issues
    
    ### Are these changes tested?
    
    Yes, we can ship these tests in this PR or we can keep them in #49216 
either is fine by me.
    
    ### Are there any user-facing changes?
    
    No
    * GitHub Issue: #49176
    
    Authored-by: Jonathan Keane <[email protected]>
    Signed-off-by: Nic Crane <[email protected]>
---
 cpp/src/arrow/compute/kernels/hash_aggregate.cc |  8 ++++++
 dev/tasks/r/github.macos.cran.yml               | 36 ++++++++++++++++++++++---
 2 files changed, 41 insertions(+), 3 deletions(-)

diff --git a/cpp/src/arrow/compute/kernels/hash_aggregate.cc 
b/cpp/src/arrow/compute/kernels/hash_aggregate.cc
index 2ab5e574e2..d28639c34a 100644
--- a/cpp/src/arrow/compute/kernels/hash_aggregate.cc
+++ b/cpp/src/arrow/compute/kernels/hash_aggregate.cc
@@ -277,8 +277,16 @@ template <typename T>
 concept CBooleanConcept = std::same_as<T, bool>;
 
 // XXX: Ideally we want to have std::floating_point<Float16> = true.
+// Some older standard library implementations (e.g., macOS 11.x libc++) have 
partial
+// C++20 concepts support with std::same_as but lack std::floating_point.
+#if defined(__cpp_lib_concepts) && __cpp_lib_concepts >= 202002L
 template <typename T>
 concept CFloatingPointConcept = std::floating_point<T> || std::same_as<T, 
util::Float16>;
+#else
+template <typename T>
+concept CFloatingPointConcept =
+    std::is_floating_point_v<T> || std::same_as<T, util::Float16>;
+#endif
 
 template <typename T>
 concept CDecimalConcept = std::same_as<T, Decimal32> || std::same_as<T, 
Decimal64> ||
diff --git a/dev/tasks/r/github.macos.cran.yml 
b/dev/tasks/r/github.macos.cran.yml
index dda8ac7fd7..930f7c5587 100644
--- a/dev/tasks/r/github.macos.cran.yml
+++ b/dev/tasks/r/github.macos.cran.yml
@@ -21,10 +21,12 @@
 
 jobs:
   macos-cran:
-    name: "macOS similar to CRAN"
+    name: "macOS {{ '${{ matrix.config }}' }}"
     runs-on: macOS-latest
     strategy:
       fail-fast: false
+      matrix:
+        config: ["cran-m1", "cran-release"]
 
     steps:
       {{ macros.github_checkout_arrow()|indent }}
@@ -58,7 +60,35 @@ jobs:
           extra-packages: |
             any::rcmdcheck
             any::sys
-      - name: Install
+      - name: Install MacOSX 11.3 SDK
+        if: matrix.config == 'cran-release'
+        env:
+          SDK_TOKEN: {{ '${{ secrets.JONKEANE_MACOS_11_SDK_DOWNLOAD_TOKEN }}' 
}}
+        run: |
+          # Download, Confirm integrity, expand. This will fail if the hash 
does not match.
+          curl -fsSL -H "Authorization: Bearer $SDK_TOKEN" \
+            -H "Accept: application/vnd.github+json" \
+            
https://api.github.com/repos/jonkeane/crossbow_11_sdk/tarball/v0.0.1 \
+            -o /tmp/MacOSX11.3.sdk.tar.gz
+          echo 
"493570e56d6c6af26128e9096de738822589cc3cdb1b29aa5854f3f4c99756ac  
/tmp/MacOSX11.3.sdk.tar.gz" | shasum -a 256 -c -
+          sudo tar -xzf /tmp/MacOSX11.3.sdk.tar.gz -C 
/Library/Developer/CommandLineTools/SDKs/
+          # Move SDK from extracted folder (GitHub archives as 
{owner}-{repo}-{sha}/)
+          sudo mv 
/Library/Developer/CommandLineTools/SDKs/jonkeane-crossbow_11_sdk-*/MacOSX11.3.sdk
 \
+            /Library/Developer/CommandLineTools/SDKs/MacOSX11.3.sdk
+          sudo rm -rf 
/Library/Developer/CommandLineTools/SDKs/jonkeane-crossbow_11_sdk-*
+          ls -la /Library/Developer/CommandLineTools/SDKs/
+      - name: Install (cran-release)
+        if: matrix.config == 'cran-release'
+        env:
+          _R_CHECK_CRAN_INCOMING_: false
+          SDKROOT: '/Library/Developer/CommandLineTools/SDKs/MacOSX11.3.sdk'
+          NOT_CRAN: false
+        run: |
+          sccache --start-server || echo 'sccache not found'
+          cd arrow/r
+          R CMD INSTALL . --install-tests
+      - name: Install (cran-m1)
+        if: matrix.config == 'cran-m1'
         env:
           _R_CHECK_CRAN_INCOMING_: false
           CXX: "clang++ -mmacos-version-min=14.6"
@@ -77,6 +107,6 @@ jobs:
       - name: Save the test output
         uses: actions/upload-artifact@v4
         with:
-          name: test-output
+          name: test-output-{{ '${{ matrix.config }}' }}
           path: arrow-tests/testthat.Rout*
         if: always()

Reply via email to