facebook / CacheLib

Pluggable in-process caching engine to build and scale high performance services

Home Page:https://www.cachelib.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Build (install) error. Could not find include file thrift/annotation/cpp.thrift

dagmcr opened this issue · comments

commented

Describe the bug
Cachelib build (install benchmark) error when using the wrapper command: ./contrib/build.sh -d -j -v

To Reproduce

  1. Use debian 10 (through a container in my case: debian:10).
docker run --rm -it --name cachelib debian:10
  1. checkout the main branch (3d475f673a5e1bd5db776c8cb7f2666c9694f7dd) or the latest tag v2023.04.17.00.
  2. Build cachelib using the contrib/build.sh script.
./contrib/build.sh -d -j -v

Expected behavior
Build succeeds.

Logs

...
cd /cachelib/build-fbthrift/thrift/lib/cpp2 && /usr/bin/cmake -E cmake_symlink_library ../../../lib/libthriftcpp2.so.1.0.0 ../../../lib/libthriftcpp2.so.1.0.0 ../../../lib/libthriftcpp2.so
make[2]: Leaving directory '/cachelib/build-fbthrift'
[100%] Built target thriftcpp2
make[1]: Leaving directory '/cachelib/build-fbthrift'
/usr/bin/cmake -E cmake_progress_start /cachelib/build-fbthrift/CMakeFiles 0
make -f CMakeFiles/Makefile2 preinstall
make[1]: Entering directory '/cachelib/build-fbthrift'
make[1]: Nothing to be done for 'preinstall'.
make[1]: Leaving directory '/cachelib/build-fbthrift'
Install the project...
/usr/bin/cmake -P cmake_install.cmake
-- Install configuration: "Debug"
-- Up-to-date: /cachelib/opt/cachelib/include/thrift/ThriftLibrary.cmake
-- Up-to-date: /cachelib/opt/cachelib/lib/cmake/fbthrift/FBThriftConfig.cmake
-- Up-to-date: /cachelib/opt/cachelib/lib/cmake/fbthrift/FBThriftTargets.cmake
-- Installing: /cachelib/opt/cachelib/lib/cmake/fbthrift/FBThriftTargets-debug.cmake
-- Up-to-date: /cachelib/opt/cachelib/include/thrift/annotation
-- Up-to-date: /cachelib/opt/cachelib/include/thrift/annotation/autocargo
...
-- Set runtime path of "/cachelib/opt/cachelib/lib/libthriftprotocol.so.1.0.0" to "/cachelib/opt/cachelib/lib"
-- Up-to-date: /cachelib/opt/cachelib/lib/libthriftprotocol.so
-- Installing: /cachelib/opt/cachelib/lib/libthriftcpp2.so.1.0.0
-- Set runtime path of "/cachelib/opt/cachelib/lib/libthriftcpp2.so.1.0.0" to "/cachelib/opt/cachelib/lib"
-- Up-to-date: /cachelib/opt/cachelib/lib/libthriftcpp2.so
'fbthrift' is now installed
-- Update CXXFLAGS:
-- Boost version: 1.67.0
-- Found the following Boost libraries:
--   system
--   filesystem
--   regex
--   context
--   program_options
--   thread
--   chrono
--   date_time
--   atomic
-- Found folly: /cachelib/opt/cachelib
-- Found fizz: /cachelib/opt/cachelib
-- Found wangle: /cachelib/opt/cachelib
-- Found Zstd: /usr/lib/x86_64-linux-gnu/libz.so
-- ZLIB: /usr/include
-- Found Zstd: /cachelib/opt/cachelib/lib/libzstd.so
-- ZSTD: /cachelib/opt/cachelib/include
-- Found FBThrift: /cachelib/opt/cachelib
-- *** OUTDIR: /cachelib/build-cachelib/common/
-- before: constants.cpp;constants.h;data.cpp;data
...
make[2]: Leaving directory '/cachelib/build-cachelib'
[  2%] Built target SERIALIZE_thrift_target
[  2%] Built target SERIALIZATION_thrift_target
[  3%] Built target MEMORY_SERIALIZE_thrift_target
[  3%] Generating ../cachelib/benchmarks/gen-cpp2/DataTypeBench_constants.cpp, ../cachelib/benchmarks/gen-cpp2/DataTypeBench_constants.h, ../cachelib/benchmarks/gen-cpp2/DataTypeBench_data.cpp, ../cachelib/benchmarks/gen-cpp2/DataTypeBench_data.h, ../cachelib/benchmarks/gen-cpp2/DataTypeBench_metadata.cpp, ../cachelib/benchmarks/gen-cpp2/DataTypeBench_metadata.h
, ../cachelib/benchmarks/gen-cpp2/DataTypeBench_types.cpp, ../cachelib/benchmarks/gen-cpp2/DataTypeBench_types_custom_protocol.h, ../cachelib/benchmarks/gen-cpp2/DataTypeBench_types.h, ../cachelib/benchmarks/gen-cpp2/DataTypeBench_types.tcc, ../cachelib/benchmarks/gen-cpp2/DataTypeBench_layouts.h, ../cachelib/benchmarks/gen-cpp2/DataTypeBench_layouts.cpp
cd /cachelib/cachelib/benchmarks && /cachelib/opt/cachelib/bin/thrift1 -o /cachelib/build-cachelib/cachelib/benchmarks/ --gen mstch_cpp2:frozen2 -I /cachelib/cachelib/.. DataTypeBench.thrift
[  4%] Built target DATASTRUCT_TESTS_thrift_target
[  4%] Built target BLOOM_thrift_target
[  5%] Built target SHM_thrift_target
[  5%] Built target DATASTRUCT_SERIALIZE_thrift_target
[ERROR:DataTypeBench.thrift:19] Could not find include file thrift/annotation/cpp.thrift
make[2]: *** [benchmarks/CMakeFiles/DATATYPEBENCH_thrift_target.dir/build.make:72: cachelib/benchmarks/gen-cpp2/DataTypeBench_constants.cpp] Error 1
make[2]: Leaving directory '/cachelib/build-cachelib'
make[1]: *** [CMakeFiles/Makefile2:660: benchmarks/CMakeFiles/DATATYPEBENCH_thrift_target.dir/all] Error 2
make[1]: Leaving directory '/cachelib/build-cachelib'
make: *** [Makefile:130: all] Error 2
build-package.sh: error: make failed
build.sh: error: failed to build cachelib

Desktop:

root@97cb6ebf98ed:/cachelib# lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description:    Debian GNU/Linux 10 (buster)
Release:        10
Codename:       buster
commented

Manually executing cd cachelib/benchmarks && /cachelib/opt/cachelib/bin/thrift1 -o /cachelib/build-cachelib/cachelib/benchmarks/ --gen mstch_cpp2:frozen2 -I /cachelib/cachelib/.. -I /cachelib/cachelib/external/fbthrift DataTypeBench.thrift workarounds the issue.

root@97cb6ebf98ed:/cachelib# cd cachelib/benchmarks && /cachelib/opt/cachelib/bin/thrift1 -o /cachelib/build-cachelib/cachelib/benchmarks/ --gen mstch_cpp2:frozen2 -I /cachelib/cachelib/.. -I /cachelib/cachelib/external/fbthrift DataTypeBench.thrift
[WARNING:DataTypeBench.thrift:22] Required field is deprecated: `m`.
[WARNING:DataTypeBench.thrift:26] Required field is deprecated: `m`.
root@97cb6ebf98ed:/cachelib# ./contrib/build.sh -d -j -v
...
[100%] Built target cachebench
make[1]: Leaving directory '/cachelib/build-cachelib'
/usr/bin/cmake -E cmake_progress_start /cachelib/build-cachelib/CMakeFiles 0
make -f CMakeFiles/Makefile2 preinstall
make[1]: Entering directory '/cachelib/build-cachelib'
make[1]: Nothing to be done for 'preinstall'.
make[1]: Leaving directory '/cachelib/build-cachelib'
Install the project...
/usr/bin/cmake -P cmake_install.cmake
-- Install configuration: "Debug"
-- Installing: /cachelib/opt/cachelib/include/cachelib/allocator
-- Installing: /cachelib/opt/cachelib/include/cachelib/allocator/memory
...
-- Installing: /cachelib/opt/cachelib/test_configs/consistency/navy-with-deletes-with-truncated-alloc-size.json
-- Installing: /cachelib/opt/cachelib/test_configs/consistency/navy-with-deletes-stack-alloc-inmem-buf.json
-- Installing: /cachelib/opt/cachelib/test_configs/simple_test_with_persistence.json
-- Installing: /cachelib/opt/cachelib/lib/cmake/cachelib/cachelib-targets.cmake
-- Installing: /cachelib/opt/cachelib/lib/cmake/cachelib/cachelib-targets-debug.cmake
-- Installing: /cachelib/opt/cachelib/lib/libcachelib_common.a
-- Installing: /cachelib/opt/cachelib/lib/libcachelib_shm.a
-- Installing: /cachelib/opt/cachelib/lib/libcachelib_navy.a
-- Installing: /cachelib/opt/cachelib/lib/libcachelib_allocator.a
-- Installing: /cachelib/opt/cachelib/lib/libcachelib_datatype.a
-- Installing: /cachelib/opt/cachelib/bin/cachebench
'cachelib' is now installed

Hi @dagmcr

Thanks for reporting the bug and the workaround. This is caused by eee2913 (fbcode/cachelib/) and we are working on the fix.

I will let you know once this is fixed.

The offending change had been reverted, so let me close this.