folly icon indicating copy to clipboard operation
folly copied to clipboard

IoUringZeroCopyBufferPool.cpp build issues

Open kiefernforst opened this issue 5 months ago • 3 comments

I'm trying to build git master 5aeae0d3e1c4b93b301e37c484328e9b0e55906b with

  cmake -S . -B build \
    -DCMAKE_BUILD_TYPE=None \
    -DCMAKE_PREFIX_PATH=/usr \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DBUILD_TESTS=OFF \
    -DBUILD_SHARED_LIBS=ON \
    -DCMAKE_CXX_STANDARD=20 \
    -DCMAKE_CXX_STANDARD_REQUIRED=ON \
    -DBoost_NO_BOOST_CMAKE=ON \
    -Wno-dev
  cmake --build build

which leads to

./folly/folly/io/async/IoUringZeroCopyBufferPool.cpp:65:29: error: field 'zc_export' has incomplete type 'zcrx_ctrl_export'
   65 |     struct zcrx_ctrl_export zc_export;
      |                             ^~~~~~~~~
./folly/folly/io/async/IoUringZeroCopyBufferPool.cpp:65:12: note: forward declaration of 'struct zcrx_ctrl_export'
   65 |     struct zcrx_ctrl_export zc_export;
      |            ^~~~~~~~~~~~~~~~
./folly/folly/io/async/IoUringZeroCopyBufferPool.cpp:66:31: error: field 'zc_flush' has incomplete type 'zcrx_ctrl_flush_rq'
   66 |     struct zcrx_ctrl_flush_rq zc_flush;
      |                               ^~~~~~~~
./folly/folly/io/async/IoUringZeroCopyBufferPool.cpp:66:12: note: forward declaration of 'struct zcrx_ctrl_flush_rq'
   66 |     struct zcrx_ctrl_flush_rq zc_flush;
      |            ^~~~~~~~~~~~~~~~~~
./folly/folly/io/async/IoUringZeroCopyBufferPool.cpp: In member function 'void folly::IoUringZeroCopyBufferPoolImpl::checkZcRxFeatures()':
./folly/folly/io/async/IoUringZeroCopyBufferPool.cpp:226:30: error: variable 'folly::IoUringZeroCopyBufferPoolImpl::checkZcRxFeatures()::io_uring_query_zcrx zcrxQuery' has initializer but incomplete type
  226 |   struct io_uring_query_zcrx zcrxQuery{};
      |                              ^~~~~~~~~
./folly/folly/io/async/IoUringZeroCopyBufferPool.cpp:228:18: error: 'IO_URING_QUERY_ZCRX' was not declared in this scope; did you mean 'IO_URING_QUERY_OPCODES'?
  228 |   hdr.query_op = IO_URING_QUERY_ZCRX;
      |                  ^~~~~~~~~~~~~~~~~~~
      |                  IO_URING_QUERY_OPCODES
./folly/folly/io/async/IoUringZeroCopyBufferPool.cpp:238:62: error: 'ZCRX_REG_IMPORT' was not declared in this scope
  238 |   supportedFeatures_.importRing = zcrxQuery.register_flags & ZCRX_REG_IMPORT;
      |                                                              ^~~~~~~~~~~~~~~
./folly/folly/io/async/IoUringZeroCopyBufferPool.cpp:239:63: error: 'ZCRX_CTRL_EXPORT' was not declared in this scope
  239 |   supportedFeatures_.exportRing = zcrxQuery.nr_ctrl_opcodes > ZCRX_CTRL_EXPORT;
      |                                                               ^~~~~~~~~~~~~~~~
./folly/folly/io/async/IoUringZeroCopyBufferPool.cpp:240:60: error: 'ZCRX_CTRL_FLUSH_RQ' was not declared in this scope
  240 |   supportedFeatures_.flushRq = zcrxQuery.nr_ctrl_opcodes > ZCRX_CTRL_FLUSH_RQ;
      |                                                            ^~~~~~~~~~~~~~~~~~
./folly/folly/io/async/IoUringZeroCopyBufferPool.cpp:241:54: error: 'ZCRX_FEATURE_RX_PAGE_SIZE' was not declared in this scope
  241 |   supportedFeatures_.pageSize = zcrxQuery.features & ZCRX_FEATURE_RX_PAGE_SIZE;
      |                                                      ^~~~~~~~~~~~~~~~~~~~~~~~~
./folly/folly/io/async/IoUringZeroCopyBufferPool.cpp: In member function 'void folly::IoUringZeroCopyBufferPoolImpl::initialRegister(const folly::IoUringZeroCopyBufferPool::Params&, uint32_t)':
./folly/folly/io/async/IoUringZeroCopyBufferPool.cpp:448:12: error: 'struct io_uring_zcrx_ifq_reg' has no member named 'rx_buf_len'
  448 |     ifqReg.rx_buf_len = bufferSize_;
      |            ^~~~~~~~~~
./folly/folly/io/async/IoUringZeroCopyBufferPool.cpp:455:19: error: 'struct io_uring_zcrx_ifq_reg' has no member named 'rx_buf_len'
  455 |         << ifqReg.rx_buf_len << ", falling back to default page size";
      |                   ^~~~~~~~~~
./folly/folly/io/async/IoUringZeroCopyBufferPool.cpp:462:12: error: 'struct io_uring_zcrx_ifq_reg' has no member named 'rx_buf_len'
  462 |     ifqReg.rx_buf_len = 0;
      |            ^~~~~~~~~~
./folly/folly/io/async/IoUringZeroCopyBufferPool.cpp: In member function 'void folly::IoUringZeroCopyBufferPoolImpl::flushRefillQueue()':
./folly/folly/io/async/IoUringZeroCopyBufferPool.cpp:545:20: error: variable 'folly::IoUringZeroCopyBufferPoolImpl::flushRefillQueue()::zcrx_ctrl ctrl' has initializer but incomplete type
  545 |   struct zcrx_ctrl ctrl{};
      |                    ^~~~
./folly/folly/io/async/IoUringZeroCopyBufferPool.cpp:547:13: error: 'ZCRX_CTRL_FLUSH_RQ' was not declared in this scope
  547 |   ctrl.op = ZCRX_CTRL_FLUSH_RQ;
      |             ^~~~~~~~~~~~~~~~~~
./folly/folly/io/async/IoUringZeroCopyBufferPool.cpp:548:37: error: 'IORING_REGISTER_ZCRX_CTRL' was not declared in this scope; did you mean 'IORING_REGISTER_ZCRX_IFQ'?
  548 |   io_uring_register(ring_->ring_fd, IORING_REGISTER_ZCRX_CTRL, &ctrl, 0);
      |                                     ^~~~~~~~~~~~~~~~~~~~~~~~~
      |                                     IORING_REGISTER_ZCRX_IFQ
./folly/folly/io/async/IoUringZeroCopyBufferPool.cpp: In constructor 'folly::IoUringZeroCopyBufferPool::IoUringZeroCopyBufferPool(ExportHandle, io_uring*)':
./folly/folly/io/async/IoUringZeroCopyBufferPool.cpp:590:18: error: 'ZCRX_REG_IMPORT' was not declared in this scope
  590 |   ifqReg.flags = ZCRX_REG_IMPORT;
      |                  ^~~~~~~~~~~~~~~
./folly/folly/io/async/IoUringZeroCopyBufferPool.cpp: In member function 'folly::IoUringZeroCopyBufferPool::ExportHandle folly::IoUringZeroCopyBufferPool::exportHandle() const':
./folly/folly/io/async/IoUringZeroCopyBufferPool.cpp:624:20: error: variable 'folly::IoUringZeroCopyBufferPool::exportHandle() const::zcrx_ctrl ctrl' has initializer but incomplete type
  624 |   struct zcrx_ctrl ctrl{};
      |                    ^~~~
./folly/folly/io/async/IoUringZeroCopyBufferPool.cpp:626:13: error: 'ZCRX_CTRL_EXPORT' was not declared in this scope
  626 |   ctrl.op = ZCRX_CTRL_EXPORT;
      |             ^~~~~~~~~~~~~~~~
./folly/folly/io/async/IoUringZeroCopyBufferPool.cpp:628:41: error: 'IORING_REGISTER_ZCRX_CTRL' was not declared in this scope; did you mean 'IORING_REGISTER_ZCRX_IFQ'?
  628 |       io_uring_register(ring_->ring_fd, IORING_REGISTER_ZCRX_CTRL, &ctrl, 0);
      |                                         ^~~~~~~~~~~~~~~~~~~~~~~~~
      |                                         IORING_REGISTER_ZCRX_IFQ
./folly/folly/io/async/IoUringZeroCopyBufferPool.cpp: In member function 'void folly::IoUringZeroCopyBufferPool::processNotificationCqe(const io_uring_cqe*)':
./folly/folly/io/async/IoUringZeroCopyBufferPool.cpp:681:41: error: 'IORING_REGISTER_ZCRX_CTRL' was not declared in this scope; did you mean 'IORING_REGISTER_ZCRX_IFQ'?
  681 |       io_uring_register(ring_->ring_fd, IORING_REGISTER_ZCRX_CTRL, &ctrl, 0);
      |                                         ^~~~~~~~~~~~~~~~~~~~~~~~~
      |                                         IORING_REGISTER_ZCRX_IFQ
make[2]: *** [folly/io/async/CMakeFiles/folly_io_async_io_uring_zero_copy_buffer_pool_obj.dir/build.make:79: folly/io/async/CMakeFiles/folly_io_async_io_uring_zero_copy_buffer_pool_obj.dir/IoUringZeroCopyBufferPool.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:9364: folly/io/async/CMakeFiles/folly_io_async_io_uring_zero_copy_buffer_pool_obj.dir/all] Error 2

folly seems to do wrong to my liburing 2.14. I could not completely override it:

[ 95%] Built target folly_testing_test_util_obj make[2]: *** No rule to make target '/usr/lib/liburing.so', needed by 'libfolly.so.2026.06.15'. Stop.

Less important because already fixed is a jemalloc build issue:

-/folly/memory/JemallocHugePageAllocator.cpp:65:8: error: redefinition of 'struct extent_hooks_s'
   65 | struct extent_hooks_s {
      |        ^~~~~~~~~~~~~~
In file included from -/folly/portability/Malloc.h:36,
                 from -/folly/Memory.h:41,
                 from -/folly/memory/Malloc.h:28,
                 from -/folly/memory/JemallocHugePageAllocator.cpp:22:
/usr/include/jemalloc/jemalloc.h:422:8: note: previous definition of 'struct extent_hooks_s'
  422 | struct extent_hooks_s {
      |        ^~~~~~~~~~~~~~
make[2]: *** [folly/memory/CMakeFiles/folly_memory_jemalloc_huge_page_allocator_obj.dir/build.make:79: folly/memory/CMakeFiles/folly_memory_jemalloc_huge_page_allocator_obj.dir/JemallocHugePageAllocator.cpp.o] Error 1

which is similar to https://github.com/facebook/folly/issues/943 !

kiefernforst avatar Jun 15 '26 23:06 kiefernforst

Additionally: GLOG 0.7 errors without https://github.com/facebook/folly/pull/2320

kiefernforst avatar Jun 16 '26 00:06 kiefernforst

When diverting to older versions of folly I'm getting

[ 98%] Linking CXX executable logging_example
/usr/bin/ld: ../../../libfolly.so.2025.11.24: undefined reference to `blake3_hasher_init_keyed'
/usr/bin/ld: ../../../libfolly.so.2025.11.24: undefined reference to `blake3_hasher_init_derive_key'
/usr/bin/ld: ../../../libfolly.so.2025.11.24: undefined reference to `blake3_hasher_update'
/usr/bin/ld: ../../../libfolly.so.2025.11.24: undefined reference to `blake3_hasher_finalize'
collect2: error: ld returned 1 exit status

against libblake3 1.8.3

kiefernforst avatar Jun 16 '26 06:06 kiefernforst

liburing 2.15 is now available.

chenx97 avatar Jun 30 '26 05:06 chenx97