1fanwang opened a new pull request, #50997: URL: https://github.com/apache/arrow/pull/50997
### Rationale for this change The R macOS CRAN nightly stopped building Arrow C++ after #50785. It uses the macOS 11.3 SDK to match CRAN's builder, and fails on one file with "no template named 'identity' in namespace 'std'" at lines 230, 307 and 323. That SDK's libc++ predates the standard identity functor, which arrived in libc++ 12 with the macOS 12 SDK, so the name is absent whatever standard is selected. The cran-m1 job uses a current SDK and passes, which is why only this builder is red. Before this change the R package cannot be built on CRAN's macOS builder. After it, the file compiles there. Closes #50987. ### What changes are included in this PR? That file is the only one in the C++ tree naming the missing symbol, at the three sites above. It now uses a small equivalent functor in the same translation unit, so the compile-time fast path that skips per-bit work still matches and the bitmap copy keeps its memcpy shortcut. The bitwise-not functor is older and untouched. No behavior or API change. ### Are these changes tested? Reproduced on a real macOS 11.3 SDK, whose internal identity helper sits at the same header line cited in the CI log, confirming the same libc++. From a checkout of this branch: ```console $ curl -fsSL https://github.com/phracker/MacOSX-SDKs/releases/download/11.3/MacOSX11.3.sdk.tar.xz | tar -xJ -C /tmp $ SDK=/tmp/MacOSX11.3.sdk $ F=cpp/src/arrow/util/bitmap_ops.cc $ clang++ -std=gnu++20 -isysroot "$SDK" -I cpp/src -fsyntax-only "$F" && echo ok ok $ git checkout upstream/main -- "$F" $ clang++ -std=gnu++20 -isysroot "$SDK" -I cpp/src -fsyntax-only "$F" 230:57: error: no template named 'identity' in namespace 'std' 307:23: error: no template named 'identity' in namespace 'std' 323:30: error: no template named 'identity' in namespace 'std' 6 errors generated. ``` Behavior is unchanged. The bit utility test target builds and its bitmap copy, invert and reverse cases pass, covering both branches of the mapping helper: the byte-aligned memcpy path and the bit-offset path that calls the functor. ``` [ PASSED ] 4 tests. ``` The local run compiles the failing translation unit, not the full R build, which the CRAN job here covers. ### Are there any user-facing changes? No. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
