userver
userver copied to clipboard
build fail on archlinux for 'backtrace.h' not found but actually it's there.
It complains
[cmake]
[cmake] CMake Error at build/_deps/userver-src/third_party/boost_stacktrace/CMakeLists.txt:43 (message):
[cmake] Failed to find <backtrace.h>. Use -DUSERVER_FEATURE_STACKTRACE=0 or
[cmake] install the required packages (for Ubuntu: build-essential or
[cmake] libgcc-*-dev).
[cmake]
[cmake]
[cmake] -- Configuring incomplete, errors occurred!
[proc] The command: /usr/bin/cmake --no-warn-unused-c
1. Gcc name triplet not match on my laptop
. My system has default gcc path like this: /usr/lib/gcc/x86_64-pc-linux-gnu/13.2.1/
userver-src/third_party/boost_stacktrace/CMakeLists.txt line 35:
file(GLOB BacktraceIncludeFiles
"/usr/lib/gcc/x86_64-linux-gnu/*/include/backtrace.h"
)
2. On my laptop the backtrace.h is under /usr/include not under the gcc/xxx/yyyy/include folder, therefore the cmake script fails to find it the way shown in the above cmake lines.
Turns out my system's /usr/include/backtrace.h is owned by AUR package libbacktrace-git r77.g9ae4f4a-1.
Looks like that knowledge is already reflected in docs https://userver.tech/d3/da9/md_en_2userver_2tutorial_2build.html#autotoc_md476 and the package libbacktrace-git is in the deps list https://github.com/userver-framework/userver/blob/develop/scripts/docs/en/deps/arch.md
Thanks for your reply. I've updated the description. I made a small change on the find GLOB path, but for the second problem, only /usr/include/backtrace.h no gcc specific backtrace.h, I don't have a clue which I should use, are they the same thing just in different location.
We should actually use just Boost.Stacktrace instead of using our copy in third_party/boost_stacktrace.
Fixed in https://github.com/userver-framework/userver/commit/68574f5b83f560ab802bef79c6ae5795493efc1d