Skip to content

[C++]: Work around bit_width not being available on MacOS's partially compatible C++20 build #49371

@jonkeane

Description

@jonkeane

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

#49298 introduced the failure on our CRAN-like Crossbow job: https://github.com/ursacomputing/crossbow/actions/runs/22267571643/job/64416504261#step:9:982

[  4%] Building C object _deps/lz4-build/CMakeFiles/lz4_static.dir/__/lz4-src/lib/lz4frame.c.o
In file included from /Users/runner/work/crossbow/crossbow/arrow/cpp/src/arrow/array/array_base.cc:18:
In file included from /Users/runner/work/crossbow/crossbow/arrow/cpp/src/arrow/array/array_base.h:26:
In file included from /Users/runner/work/crossbow/crossbow/arrow/cpp/src/arrow/array/data.h:32:
/Users/runner/work/crossbow/crossbow/arrow/cpp/src/arrow/util/bit_util.h:141:15: error: no member named 'bit_width' in namespace 'std'
  141 |   return std::bit_width(x - 1);
      |          ~~~~~^
[  4%] Building C object _deps/lz4-build/CMakeFiles/lz4_static.dir/__/lz4-src/lib/lz4hc.c.o
1 error generated.
make[2]: *** [src/arrow/CMakeFiles/arrow_array.dir/array/array_base.cc.o] Error 1
make[1]: *** [src/arrow/CMakeFiles/arrow_array.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[  4%] Building C object _deps/lz4-build/CMakeFiles/lz4_static.dir/__/lz4-src/lib/xxhash.c.o
[  4%] Linking C static library liblz4.a
[  4%] Built target lz4_static
make: *** [all] Error 2
**** Complete build log may still be present at 

We'll need to walk this back or work around it until CRAN fully supports C++20. cc @Anakin100100 @pitrou

Component(s)

C++

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions